17namespace alib {
namespace strings {
namespace util {
24 data.emplace_back( type, -1, -1 );
41 if ( session < requestedSize )
43 session= requestedSize;
49 if ( actual < requestedSize )
51 actual= (requestedSize + ( actual < 0 ? 0 : growthPadding ));
64 while( it!=
data.end() )
69 target <<
',' << (*it).session;
94 # define PARSERROR ALIB_WARNING( \
95 NString512("Error reading tab stops string \"") << NString512(src) \
96 << "\":\n at position " << (src.Length() - parser.Length()) )
108 parser= tknzr.
Next();
112 else { PARSERROR
break; }
119 sessionValue= actual;
123 data.emplace_back( type, actual, sessionValue );
134 for(
auto& entry :
data )
136 integer actDiff= entry.session - entry.actual;
144 if( entry.actual > lastTabStop )
146 lastTabStop= entry.actual;
147 entry.actual= entry.session + tabDiff;
151 lastTabStop= entry.actual;
153 entry.actual= entry.session + tabDiff;
158 entry.actual = entry.session;
TAString & DeleteEnd(integer regionLength)
TAString & _(const TString< TChar > &src, integer regionStart, integer regionLength=MAX_LEN)
constexpr bool IsEmpty() const
constexpr integer Length() const
ALIB_WARNINGS_RESTORE integer LastIndexOf(TChar needle, integer startIndex=MAX_LEN) const
bool EndsWith(const TString &needle) const
bool ConsumeInt(TIntegral &result, TNumberFormat< TChar > *numberFormat=nullptr)
TSubstring & Trim(const TCString< TChar > &whiteSpaces=TT_CStringConstants< TChar >::DefaultWhitespaces())
std::vector< Entry > data
The current and measured sizes.
ALIB_API void Import(const String &source, lang::CurrentData session=lang::CurrentData::Clear)
Types
The entry type, tab stop or field width.
@ Field
denotes a field width entry.
@ Tabstop
denotes a tab stop entry.
ALIB_API integer Actual(Types type, integer requestedSize, integer growthPadding)
ALIB_API void Export(AString &target)
bool dirty
Determines whether any value was changed sincel last Reset.
ALIB_API void Consolidate()
ALIB_API TSubstring< TChar > & Next(lang::Whitespaces trimming=lang::Whitespaces::Trim, TChar newDelim='\0')
@ Trim
Trim whitespaces away.
@ Clear
Chooses to clear existing data.
lang::integer integer
Type alias in namespace alib.