10#if !defined (HPP_ALIB_STRINGS_UTIL_AUTOSIZES)
14#if !defined (HPP_ALIB_STRINGS_LOCALSTRING)
18#if !defined (HPP_ALIB_STRINGS_CSTRING)
22#if !defined (HPP_ALIB_STRINGS_SUBSTRING)
27namespace alib {
namespace strings {
namespace util {
33 data.emplace_back( type, -1, -1 );
39 if ( session < requestedSize )
46 if ( actual < requestedSize )
48 actual=
data[
ActualIndex ].actual= (requestedSize + ( actual < 0 ? 0 : growthPadding ));
51 return static_cast<int>(actual);
57 for(
auto& entry :
data )
60 .
_( entry.actual ).
_(
',' )
61 .
_( entry.session ) .
_(
')' );
74 # define PARSERROR ALIB_WARNING( \
75 NString512("Error reading tab stops string \"") << NString512(sourceString) \
76 << "\":\n at position " << (sourceString.Length() - parser.Length()) )
127 data.emplace_back( type, actual, sessionValue );
138 for(
auto& entry :
data )
140 integer actDiff= entry.session - entry.actual;
148 if( entry.actual > lastTabStop )
150 lastTabStop= entry.actual;
151 entry.actual= entry.session + tabDiff;
155 lastTabStop= entry.actual;
157 entry.actual= entry.session + tabDiff;
162 entry.actual = entry.session;
TAString & DeleteEnd(integer regionLength)
TAString & _(const TString< TChar > &src, integer regionStart, integer regionLength=MAX_LEN)
constexpr bool IsNotEmpty() const
constexpr integer Length() const
ALIB_WARNINGS_RESTORE integer LastIndexOf(TChar needle, integer startIndex=MAX_LEN) const
bool EndsWith(const TString &needle) const
TSubstring & Trim(const TCString< TChar > &whiteSpaces=TT_StringConstants< TChar >::DefaultWhitespaces())
bool ConsumeInt(TIntegral &result, TNumberFormat< TChar > *numberFormat=nullptr)
TSubstring & TrimStart(const TCString< TChar > &whiteSpaces=TT_StringConstants< TChar >::DefaultWhitespaces())
std::vector< Entry > data
ALIB_API void Import(const String &source, lang::CurrentData session=lang::CurrentData::Clear)
@ 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)
ALIB_API void Consolidate()
@ Trim
Trim whitespaces away.
@ Clear
Chooses to clear existing data.
lang::integer integer
Type alias in namespace alib.