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"
32 data.emplace_back( type, -1, -1 );
49 if ( session < requestedSize )
51 session= requestedSize;
57 if ( actual < requestedSize )
59 actual= (requestedSize + ( actual < 0 ? 0 : growthPadding ));
71 auto it=
data.begin();
72 while( it!=
data.end() )
77 target <<
',' << (*it).session;
102 # define PARSERROR ALIB_WARNING( "STRINGS", \
103 "Error reading tab stops string \"{}\":\n at position ", \
104 src, src.Length() - parser.Length() )
116 parser= tknzr.
Next();
120 else { PARSERROR
break; }
127 sessionValue= actual;
131 data.emplace_back( type, actual, sessionValue );
142 for(
auto& entry :
data )
144 integer actDiff= entry.session - entry.actual;
152 if( entry.actual > lastTabStop )
154 lastTabStop= entry.actual;
155 entry.actual= entry.session + tabDiff;
159 lastTabStop= entry.actual;
161 entry.actual= entry.session + tabDiff;
166 entry.actual = entry.session;
TAString & DeleteEnd(integer regionLength)
TAString & _(const TAppendable &src)
constexpr integer Length() const
constexpr bool IsEmpty() const
bool EndsWith(const TString &needle) const
integer LastIndexOf(TChar needle, integer startIndex=MAX_LEN) const
bool ConsumeInt(std::integral auto &result, TNumberFormat< TChar > *numberFormat=nullptr)
TSubstring & Trim(const TCString< TChar > &whiteSpaces=CStringConstantsTraits< TChar >::DefaultWhitespaces())
ALIB_DLL integer Actual(Types type, integer requestedSize, integer growthPadding)
ALIB_DLL void Export(AString &target)
bool dirty
Determines whether any value was changed sincel last Reset.
ALIB_DLL void Consolidate()
ALIB_DLL void Import(const String &source, lang::CurrentData session=lang::CurrentData::Clear)
std::vector< Entry > data
The current and measured sizes.
Types
The entry type, tab stop or field width.
@ Field
denotes a field width entry.
@ Tabstop
denotes a tab stop entry.
ALIB_DLL TSubstring< TChar > & Next(lang::Whitespaces trimming=lang::Whitespaces::Trim, TChar newDelim='\0')
@ Clear
Chooses to clear existing data.
@ Trim
Trim whitespaces away.
strings::TAString< character, lang::HeapAllocator > AString
Type alias in namespace alib.
strings::util::TTokenizer< character > Tokenizer
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
strings::TString< character > String
Type alias in namespace alib.
strings::TSubstring< character > Substring
Type alias in namespace alib.