10#if !defined (HPP_ALIB_CONFIG_VARIABLE)
14#if !defined (HPP_ALIB_CONFIG_CONFIGURATION)
18#if !defined (HPP_ALIB_ENUMS_RECORDPARSER)
23namespace alib {
namespace config {
33 oldCategory << self.Category;
36 SelfContained::Reset( &
fields );
37 self.Config =
nullptr;
38 self.Priority = Priorities::NONE;
40 self.FmtHints = FormatHints::None;
68 self.Category= allocator.EmplaceString( variable.
Category() );
69 self.Name = allocator.EmplaceString( variable.
Name () );
70 self.Comments= allocator.EmplaceString( variable.
Comments() );
71 self.Delim = variable.
Delim () ;
83 self.Delim= declaration.
Delim;
88 String128 bufCategory;
ALIB_DBG( bufCategory .DbgDisableBufferReplacementWarning() );
90 String1K bufComments;
ALIB_DBG( bufComments .DbgDisableBufferReplacementWarning() );
100 if( !replacements.
IsType<
void>() )
105 const Box* replacementPtr;
110 replacementPtr = boxes->data();
111 qtyReplacements= boxes->
Size();
120 replacementPtr = &replacements;
124 for (
integer replCnt= 0; replCnt< qtyReplacements ; ++replCnt )
125 if ( !replacementPtr->IsType<
void>() )
127 String64 search(
"%"); search.
_( replCnt + 1 );
128 replace.
Reset( *( replacementPtr + replCnt) );
139 self.Category = allocator.EmplaceString( bufCategory );
140 self.Name = allocator.EmplaceString( bufName );
141 self.Comments = allocator.EmplaceString( bufComments );
144 self.DefaultValue = allocator.EmplaceString( bufDefaultValue );
159 self.Category = allocator.EmplaceString( category );
160 self.Name = allocator.EmplaceString( name );
161 self.Comments = allocator.EmplaceString( comments );
180 self.Category = allocator.EmplaceString( charWidthConverter.
Reset(category) );
181 self.Name = allocator.EmplaceString( charWidthConverter.
Reset(name ) );
182 self.Comments = allocator.EmplaceString( charWidthConverter.
Reset(comments) );
183 self.Delim =
static_cast<character>( delim );
191 if( idx < 0 || idx >=
Size() )
204 if( idx < 0 || idx >=
Size() )
213 self.values.erase( self.values.begin() + idx );
216 self.values.reserve(
static_cast<size_t>(
Size() + replSize - 1 ) );
217 self.values[
static_cast<size_t>(idx)]= allocator.EmplaceString( replVariable.
GetString() );
218 for(
int i= 1 ; i < replSize; ++i )
219 self.values.insert( self.values.begin() + idx + i, allocator.EmplaceString( replVariable.
GetString(i) ) );
225 Self().values.push_back(
Allocator().EmplaceString( value ) );
232 Self().values.push_back(
Allocator().EmplaceString( converter ) );
238 Self().values.push_back(
Allocator().EmplaceString( converter ) );
252 for (
int i= 0; i<
Size(); ++i )
270 if( self.Fullname.IsEmpty() )
273 if( self.Category.IsNotEmpty() )
274 bufFullname << self.Category <<
'_';
275 bufFullname << self.Name;
277 self.Fullname= allocator.EmplaceString( bufFullname );
280 return self.Fullname;
284DOX_MARKER([DOX_ALIB_ENUMS_RECORD_PARSER])
289 ERSerializable::MinimumRecognitionLength= 0;
294DOX_MARKER([DOX_ALIB_ENUMS_RECORD_PARSER])
TElementType * UnboxArray() const
integer UnboxLength() const
const TUnboxable Unbox() const
ALIB_API bool IsTrue(int idx=0)
ALIB_API bool GetAttribute(const String &attrName, Substring &result, character attrDelim=A_CHAR('='))
ALIB_API const String & Fullname()
ALIB_API void Add(const String &value)
ALIB_API void ReplaceValue(int idx, const String &replacement)
ALIB_API Variable & Declare(const VariableDecl &declaration, const Box &replacements)
ALIB_API double GetFloat(int idx=0)
const String & Comments() const
const String & Name() const
const String & Category() const
const String & GetString(int idx=0)
ALIB_API Variable & Reset(lang::CurrentData nameAndCategory=lang::CurrentData::Clear)
ALIB_API integer GetInteger(int idx=0)
strings::TString< TChar > EmplaceString(const strings::TString< TChar > &src)
MonoAllocator & Allocator()
detail::VariableFields & Self()
TAString & _(const TString< TChar > &src, integer regionStart, integer regionLength=MAX_LEN)
void DbgDisableBufferReplacementWarning()
ALIB_API integer SearchAndReplace(TChar needle, TChar replacement, integer startIdx=0)
constexpr bool IsNotEmpty() const
constexpr bool IsNotNull() const
ALIB_API double ParseFloat(integer startIdx=0, TNumberFormat< TChar > *numberFormat=nullptr, integer *newIdx=nullptr) const
TSubstring & Trim(const TCString< TChar > &whiteSpaces=TT_StringConstants< TChar >::DefaultWhitespaces())
bool ConsumeString(const TString< TChar > &consumable)
#define ALIB_WARNING(...)
#define ALIB_WARNINGS_RESTORE
#define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE
#define ALIB_ASSERT_WARNING(cond,...)
@ Trim
Trim whitespaces away.
@ Keep
Chooses not no clear existing data.
characters::complementChar complementChar
Type alias in namespace alib.
constexpr CString EmptyString()
constexpr String NullString()
characters::character character
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
String FormatAttrAlignment
static ALIB_API void Get(String &result, bool isLastField=false)