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> )
282 "No Enum Records for type <{}> found.", &
typeid(TEnum) )
285 if( record !=
nullptr )
286 target << record->EnumElementName;
288 target << UnderlyingIntegral( element );
361template<
typename TBitwiseEnum,
typename TChar,
typename TAllocator>
363 && alib::enumops::IsBitwise <TBitwiseEnum> )
385 "ENUMS",
"No Enum Records for type <{}> found.", &
typeid(TBitwiseEnum) )
388 TBitwiseEnum covered= TBitwiseEnum(0);
397 if( recordIt.Integral() == 0 )
399 if( elements == TBitwiseEnum(0) )
401 target << recordIt->EnumElementName;
405 else if( HasBits( elements, recordIt.Enum() )
406 && !HasBits( covered , recordIt.Enum() ) )
408 covered|= recordIt.Enum();
409 target << recordIt->EnumElementName <<
',';
412 len= target.
Length() - len;
419 "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)