8#if !defined(ALIB_C20_MODULES) || ((ALIB_C20_MODULES != 0) && (ALIB_C20_MODULES != 1))
9# error "Symbol ALIB_C20_MODULES has to be given to the compiler as either 0 or 1"
73 placeholder.NF.Flags -= NumberFormatFlags::ForceDecimalPoint;
77 placeholder.NF.Flags += NumberFormatFlags::OmitTrailingFractionalZeros;
88 while( (idx=
parser.IndexOf(
'{', idx )) >= 0
89 &&
parser.CharAt( idx + 1 ) ==
'{' )
101 if( isdigit(
parser.CharAtStart() ) )
104 parser.ConsumeDecDigits( argNo );
109 if(
parser.CharAtStart() ==
'!' )
114 if( endConversion < 0 )
122 if(
parser.CharAtStart() ==
':' )
156 if(
parser.CharAtStart() !=
'}' )
178 do switch ( formatSpec.
CharAt( cNo++ ) )
200 while( cNo < 2 && charsToConsume != 1 );
205 while( (actChar= formatSpec.
CharAtStart()) !=
'\0' )
208 if( isdigit( actChar ) )
214 if ( actChar ==
'0' )
228 else if( actChar ==
'.' )
232 - formatSpec.
Length() -1 );
239 - formatSpec.
Length() - 1 );
245 else if (
String(
A_CHAR(
"sdcboxXeEfFngGhHB%" )).IndexOf( actChar ) >= 0 )
253 - formatSpec.
Length() - 1 );
258 - formatSpec.
Length() - 1 );
285 placeholder.NF.Flags+= NumberFormatFlags::ForceScientific;
break;
289 case 'F':
placeholder.NF.Flags-= NumberFormatFlags::OmitTrailingFractionalZeros;
300 default:
ALIB_ERROR(
"FORMAT",
"Unhandled character in choices string above" )
308 else switch( actChar )
317 placeholder.NF.Flags+= NumberFormatFlags::ForceDecimalPoint;
318 placeholder.NF.Flags-= NumberFormatFlags::OmitTrailingFractionalZeros;
322 case ',':
placeholder.NF.Flags+= NumberFormatFlags::WriteGroupChars;
332 - formatSpec.
Length() - 1,
350 auto* src =
parser.Buffer();
352 parser.ConsumeChars( length );
364 else if( ( c1 ==
'{' && c2 ==
'{')
365 || ( c1 ==
'}' && c2 ==
'}')
371 case 'r': c1=
'\r' ;
break;
377 case 't': c1=
'\t' ;
break;
378 case 'a': c1=
'\a' ;
break;
379 case 'b': c1=
'\b' ;
break;
380 case 'v': c1=
'\v' ;
break;
381 case 'f': c1=
'\f' ;
break;
382 case '"': c1=
'"' ;
break;
383 default: c1=
'?' ;
break;
409 bool isPreProcess= startIdx < 0;
410 bool isPostProcess= startIdx>= 0 && target ==
nullptr;
440 targetString->InsertAt<
NC>( open, startIdx ) .Append<NC>( close );
507 else if ( isPostProcess )
535 if( target !=
nullptr )
void InsertDerived(TArgs &&... args)
ALIB_DLL integer SearchAndReplace(TChar needle, TChar replacement, integer startIdx=0, integer endIdx=strings::MAX_LEN)
constexpr integer Length() const
constexpr bool IsEmpty() const
TChar CharAtStart() const
TChar CharAt(integer idx) const
constexpr bool IsNotEmpty() const
constexpr bool IsNull() const
TString< TChar > ConsumeField(TChar startChar, TChar endChar)
integer ConsumePartOf(const TString< TChar > &consumable, int minChars=1)
bool ConsumeDecDigits(std::integral auto &result)
integer ConsumeChars(integer regionLength, TSubstring *target=nullptr)
@ Field
denotes a field width entry.
@ Tabstop
denotes a tab stop entry.
#define ALIB_CALLER_NULLED
#define ALIB_ERROR(domain,...)
@ Center
Chooses centered alignment.
@ Right
Chooses right alignment.
@ Left
Chooses left alignment.
Switch
Denotes if sth. is switched on or off.
@ On
Switch it on, switched on, etc.
@ Off
Switch it off, switched off, etc.
@ Include
Chooses inclusion.
strings::TAString< character, lang::HeapAllocator > AString
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
LocalString< 8 > String8
Type alias name for TLocalString<character,8>.
exceptions::Exception Exception
Type alias in namespace alib.
containers::SharedPtr< format::Formatter > SPFormatter
characters::character character
Type alias in namespace alib.
strings::TSubstring< character > Substring
Type alias in namespace alib.