10# if !defined (HPP_ALIB_LANG_FORMAT_FORMATTER_PYTHONSTYLE)
13# if !defined (HPP_ALIB_STRINGS_FORMAT)
16# if !defined(HPP_ALIB_LANG_FORMAT_EXCEPTIONS)
26 #pragma clang diagnostic push
27 #pragma clang diagnostic ignored "-Wreserved-id-macro"
32 #pragma clang diagnostic pop
122 states state= POSITION;
123 #define NEXTSTATE(s) { state= s; continue; }
139 NEXTSTATE(CONVERSION)
148 if( endConversion < 0 )
164 NEXTSTATE(FORMAT_SPEC)
174 while( eoFormatSpec > 0
177 if ( eoFormatSpec < 0 )
217 do switch ( formatSpec.
CharAt( cNo++ ) )
239 while( cNo < 2 && charsToConsume != 1 );
244 while( (actChar= formatSpec.
CharAtStart()) !=
'\0' )
247 if( isdigit( actChar ) )
253 if ( actChar ==
'0' )
267 else if( actChar ==
'.' )
271 - formatSpec.
Length() -1 );
278 - formatSpec.
Length() - 1 );
284 else if (
String(
A_CHAR(
"sdcboxXeEfFngGhHB%" )).IndexOf( actChar ) >= 0 )
292 - formatSpec.
Length() - 1 );
297 - formatSpec.
Length() - 1 );
339 default:
ALIB_ERROR(
"FMT",
"Unhandled character in choices string above" )
347 else switch( actChar )
371 - formatSpec.
Length() - 1 );
399 if( ( c1 ==
'{' && c2 ==
'{')
400 || ( c1 ==
'}' && c2 ==
'}')
406 case 'r': c1=
'\r' ;
break;
412 case 't': c1=
'\t' ;
break;
413 case 'a': c1=
'\a' ;
break;
414 case 'b': c1=
'\b' ;
break;
415 case 'v': c1=
'\v' ;
break;
416 case 'f': c1=
'\f' ;
break;
417 case '"': c1=
'"' ;
break;
418 default: c1=
'?' ;
break;
440 bool isPreProcess= startIdx < 0;
441 bool isPostProcess= startIdx>= 0 && target ==
nullptr;
538 else if ( isPostProcess )
566 if( target !=
nullptr )
TAString & ToLower(integer regionStart=0, integer regionLength=MAX_LEN)
TAString & ToUpper(integer regionStart=0, integer regionLength=MAX_LEN)
TAString & InsertChars(TChar c, integer qty)
TAString & _(const TString< TChar > &src, integer regionStart, integer regionLength=MAX_LEN)
void EnsureRemainingCapacity(integer spaceNeeded)
void SetLength(integer newLength)
ALIB_API integer SearchAndReplace(TChar needle, TChar replacement, integer startIdx=0)
TAString & InsertAt(const TString< TChar > &src, integer pos)
constexpr bool IsNull() const
integer IndexOf(TChar needle, integer startIdx=0) const
constexpr bool IsEmpty() const
TChar CharAt(integer idx) const
constexpr bool IsNotEmpty() const
constexpr integer Length() const
TChar CharAtStart() const
integer IndexOfAny(const TString &needles, integer startIdx=0) const
constexpr const TChar * Buffer() const
TString< TChar > ConsumeField(TChar startChar, TChar endChar)
integer ConsumePartOf(const TString< TChar > &consumable, int minChars=1)
integer ConsumeChars(integer regionLength, TSubstring *target=nullptr)
bool ConsumeDecDigits(TIntegral &result)
@ Field
denotes a field width entry.
@ Tabstop
denotes a tab stop entry.
ALIB_API integer Actual(Types type, integer requestedSize, integer growthPadding)
integer Next(Types type, integer requestedSize, integer growthPadding)
#define ALIB_CALLER_NULLED
#define ALIB_WARNINGS_RESTORE
#define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE
@ Include
Chooses inclusion.
platform_specific integer
@ On
Switch it on, switched on, etc.
@ Off
Switch it off, switched off, etc.
@ Center
Chooses centered alignment.
@ Right
Chooses right alignment.
@ Left
Chooses left alignment.
lang::Exception Exception
Type alias in namespace alib.
characters::character character
Type alias in namespace alib.