8#ifndef HPP_ALIB_CONFIG_VARIABLE
9#define HPP_ALIB_CONFIG_VARIABLE 1
11#if !defined (HPP_ALIB_CONFIG_PRIORITIES)
15#if !defined (HPP_ALIB_STRINGS_STRING)
19#if !defined (HPP_ALIB_C)
23#if !defined (HPP_ALIB_MONOMEM_SELF_CONTAINED)
26#if !defined (HPP_ALIB_MONOMEM_STDCONTAINERMA)
30#if !defined (_GLIBCXX_VECTOR) && !defined(_VECTOR_)
34namespace alib {
namespace config {
119 std::vector<String, StdContMA<String>>
values;
131 :
values( (*fields)->allocator )
216 #if ALIB_DEBUG_MONOMEM
238 #if ALIB_DEBUG_MONOMEM
241 Declare( declaration, replacements );
254 #if ALIB_DEBUG_MONOMEM
271 const String& comments =
nullptr )
274 #if ALIB_DEBUG_MONOMEM
277 Declare( category, name, delim, comments );
280 #if defined(ALIB_DOX)
291 template<
typename TEnum,
typename TEnableIf=
void>
295 template<
typename TEnum,
typename TEnableIf=
300 #if ALIB_DEBUG_MONOMEM
326 template<
typename TEnum,
typename TEnableIf=
void>
329 template<
typename TEnum,
typename TEnableIf=
331 Variable( TEnum declaration,
const Box& replacements )
334 #if ALIB_DEBUG_MONOMEM
337 Declare( declaration, replacements );
358 #if defined(ALIB_DOX)
369 template<
typename TEnum>
372 template<
typename TEnum>
377 return Declare( decl,
nullptr );
411 const String& comments =
nullptr );
460 return Self().Config;
470 return Self().Config;
479 Self().Config= config;
489 return Self().Category;
529 return Self().FmtHints;
540 Self().FmtHints= hints;
551 return Self().FormatAttrAlignment;
560 return Self().Comments;
599 return Self().DefaultValue;
619 return Self().Priority;
630 Self().Priority= priority;
723 auto& vector=
Self().values;
728 vector.erase( vector.begin() + startIdx, vector.end() );
748 void Add(int32_t value) {
Add(
static_cast<int64_t
>(value) ); }
783 NString128(
"Variable field index '") << idx <<
"' is out of range." )
784 return Self().values[
static_cast<size_t>(idx)];
void SetFmtHints(FormatHints hints)
ALIB_API bool IsTrue(int idx=0)
const String & DefaultValue() const
void ReplaceDefaultValue(const String &newValue)
void ReplaceFormatAttrAlignment(const String &newValue)
const String & FormatAttrAlignment() const
void ReplaceComments(const String &newValue)
ALIB_API bool GetAttribute(const String &attrName, Substring &result, character attrDelim=A_CHAR('='))
FormatHints FmtHints() const
ALIB_API const String & Fullname()
const Configuration * Config() const
void SetPriority(Priorities priority)
ALIB_API void Add(const String &value)
Variable(TEnum declaration)
ALIB_API void ReplaceValue(int idx, const String &replacement)
Variable(Variable &&src) noexcept
Variable(const Variable &variable)
Variable(TEnum declaration, const Box &replacements)
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
void ReplaceName(const String &newValue)
void SetDelim(character delim)
const String & Category() const
const String & GetString(int idx=0)
Variable(const VariableDecl &declaration, const Box &replacements)
Variable & ClearValues(int startIdx=0)
Priorities Priority() const
Variable & Declare(TEnum declaration)
ALIB_API Variable & Reset(lang::CurrentData nameAndCategory=lang::CurrentData::Clear)
void ReplaceCategory(const String &newValue)
ALIB_API integer GetInteger(int idx=0)
Variable(const String &category, const String &name, character delim='\0', const String &comments=nullptr)
void SetConfig(Configuration *config)
strings::TString< TChar > EmplaceString(const strings::TString< TChar > &src)
MonoAllocator & Allocator()
detail::VariableFields & Self()
#define ATMP_VOID_IF(Cond)
#define ALIB_ASSERT_ERROR(cond,...)
#define ATMP_T_IF(T, Cond)
@ Clear
Chooses to clear existing data.
NLocalString< 128 > NString128
Type alias name for TLocalString<nchar,128> .
characters::complementChar complementChar
Type alias in namespace alib.
config::Configuration Configuration
Type alias in namespace alib.
characters::character character
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
String FormatAttrAlignment
VariableFields(monomem::SelfContained< VariableFields >::Fields **fields)
std::vector< String, StdContMA< String > > values