arg_router  1.4.0
C++ command line argument parsing and routing
arg_router::policy::short_name_t< S > Class Template Reference

#include <arg_router/policy/short_name.hpp>

Public Types

using string_type = S
 

Public Member Functions

constexpr short_name_t ([[maybe_unused]] S str={}) noexcept
 

Static Public Member Functions

constexpr static std::string_view short_name () noexcept
 

Detailed Description

template<typename S>
class arg_router::policy::short_name_t< S >

Represents the short name of a node.

Although this type only accepts a single UTF-8 character, the parser expects it (or the short name group it is a part of) to be preceded by the short prefix.

If using C++17 then use the template variable helper with the S_ macro or char; for C++20 and higher, use the char variable helper or the constructor directly with a compile-time string literal:

constexpr auto a = ar::policy::short_name<'h'>;
constexpr auto b = ar::policy::short_name_utf8<S_("h")>;
constexpr auto c = ar::policy::short_name_t{"h"_S};
#define S_(tok)
Template Parameters
SCompile-time string

Definition at line 28 of file short_name.hpp.

Member Typedef Documentation

◆ string_type

template<typename S >
using arg_router::policy::short_name_t< S >::string_type = S

String type.

Definition at line 32 of file short_name.hpp.

Constructor & Destructor Documentation

◆ short_name_t()

template<typename S >
constexpr arg_router::policy::short_name_t< S >::short_name_t ( [[maybe_unused] ] S  str = {})
inlineexplicitconstexprnoexcept

Constructor.

Parameters
strString instance

Definition at line 38 of file short_name.hpp.

Member Function Documentation

◆ short_name()

template<typename S >
constexpr static std::string_view arg_router::policy::short_name_t< S >::short_name ( )
inlinestaticconstexprnoexcept

Returns the name.

Returns
Short name

Definition at line 44 of file short_name.hpp.


The documentation for this class was generated from the following file: