ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
No Matches
T_Append< TEnum, TChar > Struct Template Reference


template<typename TEnum, typename TChar>
struct alib::strings::APPENDABLES::T_Append< TEnum, TChar >

Templated specialization of functor T_Append makes elements of C++ enumeration type TEnum appendable to AString instances, if:

  • Type TEnum is equipped with ALib Enum Records of type ERSerializable (or a derived type ), and if:
  • No specialization of TMP struct T_EnumIsBitwise exists for TEnum . (For those, a different implementation of this functor is given.)
The conditions are evaluated by the compiler using std::enable_if on optional template parameter TEnableIf of unspecialized T_Append .

Member operator() writes the name of the given enumeration value to target . As with all specializations of functor T_Append, the use of it is done implicitly with various interface method of class AString .

If furthermore TMP struct T_Resourced is specialized for type TEnum and an externalizd resouce string exists according to the specification described with methods ResourcedType::TypeNamePrefix and ResourcedType::TypeNamePostfix then these resourced strings are written prior and after the enumeration element's name.

See also
Template Parameters
TEnumThe enumeration type of the element that is to be appended to an AString.
TCharThe character type of the target AString.

Definition at line 327 of file serialization.hpp.

#include <serialization.hpp>

Public Method Index:

void operator() (TAString< TChar > &target, TEnum element)

Method Details:

◆ operator()()

template<typename TEnum , typename TChar >
void operator() ( TAString< TChar > & target,
TEnum element )

Writes the name of the given enumeration element it to target .

If available for TEnum , the resourced name prefix and postfix are written before and after the element's name.

If no record exists for element , its underlying integral value is written. In debug builds, the method asserts that at least one record is defined for TEnum .

targetThe AString that element is to be appended to.
elementThe enumeration element to append to target .

Definition at line 350 of file serialization.hpp.

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