51template<
typename TEnum,
55requires alib::enumrecords::IsSerializable<TEnum>
59 "No Enum Records for type <{}> found.", &
typeid(TEnum) )
65 if ( input.template ConsumePartOf<TSensitivity>( recordIt->EnumElementName,
66 recordIt->MinimumRecognitionLength ) > 0 )
68 result= recordIt.Enum();
112template<
typename TEnum,
116 TChar delimiter =
',',
117 bool keepLastDelim =
true >
119 && alib::enumops::IsBitwise <TEnum> )
125 if constexpr ( keepLastDelim )
126 restoreBeforeDelim= input;
134 if constexpr ( keepLastDelim )
135 input= restoreBeforeDelim;
142 if constexpr ( keepLastDelim )
143 restoreBeforeDelim= input;
145 if( !input.template ConsumeChar<TSensitivity, TTrimBeforeConsume>( delimiter ) )
183template<
typename TEnum,
224#if !ALIB_RESOURCES || DOXYGEN
267template<
typename TEnum,
typename TChar,
typename TAllocator>
268requires ( enumrecords::IsSerializable<TEnum> && !enumops::IsBitwise<TEnum> )
289 "No Enum Records for type <{}> found.", &
typeid(TEnum) )
292 if( record !=
nullptr )
293 target << record->EnumElementName;
295 target << UnderlyingIntegral( element );
368template<
typename TBitwiseEnum,
typename TChar,
typename TAllocator>
370 && alib::enumops::IsBitwise <TBitwiseEnum> )
392 "ENUMS",
"No Enum Records for type <{}> found.", &
typeid(TBitwiseEnum) )
395 TBitwiseEnum covered= TBitwiseEnum(0);
404 if( recordIt.Integral() == 0 )
406 if( elements == TBitwiseEnum(0) )
408 target << recordIt->EnumElementName;
412 else if( HasBits( elements, recordIt.Enum() )
413 && !HasBits( covered , recordIt.Enum() ) )
415 covered|= recordIt.Enum();
416 target << recordIt->EnumElementName <<
',';
419 len= target.
Length() - len;
426 "Not all bits have been covered while writing bitset '{}' of enumeration type <{}>."
TAString & DeleteEnd(integer regionLength)
constexpr integer Length() const
TSubstring & TrimStart(const TCString< TChar > &whiteSpaces=CStringConstantsTraits< TChar >::DefaultWhitespaces())
#define ALIB_ASSERT_ERROR(cond, domain,...)
bool Parse(strings::TSubstring< TChar > &input, TEnum &result)
bool ParseBitwise(strings::TSubstring< TChar > &input, TEnum &result)
bool ParseEnumOrTypeBool(strings::TSubstring< TChar > &input, TEnum &result, TEnum falseValue, TEnum trueValue)
const RecordsTraits< TEnum >::Type * TryRecord(TEnum element)
Case
Denotes upper and lower case character treatment.
Whitespaces
Denotes whether a string is trimmed or not.
@ Trim
Trim whitespaces away.
NLocalString< 128 > NString128
Type alias name for TLocalString<nchar,128>.
lang::integer integer
Type alias in namespace alib.
enumrecords::EnumRecords< TEnum > EnumRecords
Type alias in namespace alib.
strings::TBin< nchar > NBin
Type alias in namespace alib.
static constexpr ForwardIterator end()
void operator()(TAString< TChar, TAllocator > &target, TBitwiseEnum elements)
void operator()(TAString< TChar, TAllocator > &target, TEnum element)