ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
config.cpp
1// #################################################################################################
2// ALib C++ Library
3//
4// Copyright 2013-2024 A-Worx GmbH, Germany
5// Published under 'Boost Software License' (a free software license, see LICENSE.txt)
6// #################################################################################################
8
9#if !defined(ALIB_DOX)
10# if !defined (HPP_ALIB_CONFIG_CONFIG)
11# include "alib/config/config.hpp"
12# endif
13# if !defined (HPP_ALIB_LANG_BASECAMP)
15# endif
16# if !defined(HPP_ALIB_CAMP_ERRORS)
18# endif
19# if !defined (HPP_ALIB_LANG_RESOURCES_RESOURCES)
21# endif
22# if !defined (HPP_ALIB_ENUMS_RECORDBOOTSTRAP)
24# endif
25# if !defined(HPP_ALIB_ENUMS_SERIALIZATION)
27# endif
28#endif // !defined(ALIB_DOX)
29
30
31
34
35using namespace alib;
36using namespace alib::config;
37
38namespace alib {
39
41
42namespace config {
43
45: Camp( "CFG" )
46{
47 ALIB_ASSERT_ERROR( this == &CONFIG, "CONFIG",
48 "Instances of class Config must not be created. Use singleton alib::CONFIG" )
49}
50
51
53{
55 {
56 ALIB_BOXING_BOOTSTRAP_VTABLE_DBG_REGISTER( vt_config_priorities )
57 ALIB_BOXING_BOOTSTRAP_VTABLE_DBG_REGISTER( vt_config_exceptions )
60
61
62#if !ALIB_RESOURCES_OMIT_DEFAULTS
64
65 "E<", A_CHAR("config::"),
66 "E" , A_CHAR("0" "," "OK" "," "" ","
67 "1" "," "ErrorOpeningFile" "," "EOF" ","
68 "2" "," "ErrorWritingFile" "," "EWF" ),
69
70 "EOF", A_CHAR("Can't open {}file {!Q'} for reading.") ,
71 "EWF", A_CHAR("Can't open {}file {!Q'} for writing.") ,
72
73
74 "Priorities",
75 A_CHAR( "0" "," "NONE" ",1,"
76 "500" "," "AutoDetected" ",1,"
77 "10000" "," "DefaultValues" ",1,"
78 "20000" "," "Standard" ",1,"
79 "30000" "," "Environment" ",1,"
80 "40000" "," "CLI" ",1,"
81 "max" "," "ProtectedValues" ",1" ),
82
83
84 // names of the configuration plug-ins added to configuration in default construction.
85 "CfgPlgDef" , A_CHAR("Internal Default Variables") ,
86 "CfgPlgPro" , A_CHAR("Protected Variables") ,
87 "CfgPlgEnv" , A_CHAR("Environment Variables") ,
88 "CfgPlgCLI" , A_CHAR("Command Line Arguments") ,
89
90 // end of BootstrapBulk()
91 nullptr );
92#endif // !ALIB_RESOURCES_OMIT_DEFAULTS
93
94
95 // load plugin slots resources already now, so that plug-ins may be added to resource
96 EnumRecords<Priorities>::Bootstrap( *this, "Priorities" );
97 }
98
99 else if( phase == BootstrapPhases::PrepareConfig )
100 {
102 }
103
104
105}
106
107
108
109// #################################################################################################
110// Implementation of parsing methods of built-in record types.
111// #################################################################################################
113{
114 enums::EnumRecordParser::Get( ERSerializable::EnumElementName );
116}
117}} // namespace [alib::config]
virtual void bootstrap(BootstrapPhases phase) override
Definition config.cpp:52
NCString ResourceCategory
Definition camp.hpp:142
lang::resources::ResourcePool * resourcePool
Definition camp.hpp:98
virtual void BootstrapBulk(const nchar *category,...)=0
#define ALIB_BOXING_VTABLE_DEFINE(TMapped, Identifier)
Definition vtable.inl:490
#define A_CHAR(STR)
#define ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE(TAppendable)
#define ALIB_BOXING_BOOTSTRAP_VTABLE_DBG_REGISTER(Identifier)
Definition vtable.inl:506
#define ALIB_ASSERT_ERROR(cond,...)
Definition alib.hpp:984
Definition alib.cpp:57
BootstrapPhases
Definition camp.hpp:26
@ PrepareConfig
Initializes up to the creation of a field config .
config::Config CONFIG
Definition config.cpp:40
ALIB_API void Parse()
Definition config.cpp:112
static ALIB_API void Get(String &result, bool isLastField=false)
static void Bootstrap(TEnum element, TArgs &&... args) noexcept