51template<
typename TEnum,
55requires alib::enumrecords::IsSerializable<TEnum>
58 "No Enum Records for type <{}> found.", &
typeid(TEnum) )
64 if ( input.template ConsumePartOf<TSensitivity>( recordIt->EnumElementName,
65 recordIt->MinimumRecognitionLength ) > 0 )
67 result= recordIt.Enum();
111template<
typename TEnum,
115 TChar delimiter =
',',
116 bool keepLastDelim =
true >
118 && alib::enumops::IsBitwise <TEnum> )
123 if constexpr ( keepLastDelim )
124 restoreBeforeDelim= input;
130 if constexpr ( keepLastDelim )
131 input= restoreBeforeDelim;
138 if constexpr ( keepLastDelim )
139 restoreBeforeDelim= input;
141 if( !input.template ConsumeChar<TSensitivity, TTrimBeforeConsume>( delimiter ) )
178template<
typename TEnum,
217#if !ALIB_RESOURCES || DOXYGEN
260template<
typename TEnum,
typename TChar,
typename TAllocator>
261requires ( enumrecords::IsSerializable<TEnum> && !enumops::IsBitwise<TEnum> )
280 "No Enum Records for type <{}> found.", &
typeid(TEnum) )
283 if( record !=
nullptr )
284 target << record->EnumElementName;
286 target << UnderlyingIntegral( element );
358template<
typename TBitwiseEnum,
typename TChar,
typename TAllocator>
360 && alib::enumops::IsBitwise <TBitwiseEnum> )
382 "ENUMS",
"No Enum Records for type <{}> found.", &
typeid(TBitwiseEnum) )
385 TBitwiseEnum covered= TBitwiseEnum(0);
394 if( recordIt.Integral() == 0 )
396 if( elements == TBitwiseEnum(0) )
398 target << recordIt->EnumElementName;
402 else if( HasBits( elements, recordIt.Enum() )
403 && !HasBits( covered , recordIt.Enum() ) )
405 covered|= recordIt.Enum();
406 target << recordIt->EnumElementName <<
',';
409 len= target.
Length() - len;
416 "Not all bits have been covered while writing bitset '{}' of enumeration type <{}>."
#define ALIB_ASSERT_ERROR(cond, domain,...)
TAString & DeleteEnd(integer regionLength)
constexpr integer Length() const
TSubstring & TrimStart(const TCString< TChar > &whiteSpaces=CStringConstantsTraits< TChar >::DefaultWhitespaces())
bool ParseEnumOrTypeBool(strings::TSubstring< TChar > &input, TEnum &result, TEnum falseValue, TEnum trueValue)
bool ParseBitwise(strings::TSubstring< TChar > &input, TEnum &result)
bool Parse(strings::TSubstring< TChar > &input, TEnum &result)
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.
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".
NLocalString< 128 > NString128
Type alias name for #"TLocalString;TLocalString<nchar,128>".
static constexpr ForwardIterator end()
void operator()(TAString< TChar, TAllocator > &target, TBitwiseEnum elements)
void operator()(TAString< TChar, TAllocator > &target, TEnum element)