senf::console::CharAsString< CharT > Struct Template Reference

Parse character value as single-char string. More...

#include <senf/Utils/Console/Utility.hh>

Public Member Functions

 CharAsString ()
 
 CharAsString (CharT value_)
 
 operator CharT () const
 

Public Attributes

CharT value
 

Detailed Description

template<class CharT>
struct senf::console::CharAsString< CharT >

Parse character value as single-char string.

This helper types is a wrapper around CharT which must be a character type. A value of this type will be represented as a single character string, not as numeric value (the default interpretation of char arguments in the console library).

This wrapper is used via type conversion using boost::function to convert the argument/return type CharT to CharAsString<CharT>:

char foo(char v) { return v; }
"foo", fty::Command< CharAsString<char> (CharAsString<char>) >(&foo));
    \tparam CharT character type, one of \c char, \c signed \c char or \c unsigned \c char

Definition at line 55 of file Utility.hh.

Constructor & Destructor Documentation

◆ CharAsString() [1/2]

template<class CharT>
senf::console::CharAsString< CharT >::CharAsString ( )

◆ CharAsString() [2/2]

template<class CharT>
senf::console::CharAsString< CharT >::CharAsString ( CharT  value_)

Member Function Documentation

◆ operator CharT()

template<class CharT>
senf::console::CharAsString< CharT >::operator CharT ( ) const

Member Data Documentation

◆ value

template<class CharT>
CharT senf::console::CharAsString< CharT >::value

Definition at line 60 of file Utility.hh.


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