Pol  Revision:f37d500
cfgsect.h
Go to the documentation of this file.
1 
7 #ifndef CLIB_CFGSECT_H
8 #define CLIB_CFGSECT_H
9 
10 #include <string>
11 
12 namespace Pol
13 {
14 namespace Clib
15 {
16 class ConfigFile;
17 class ConfigElem;
18 
19 const unsigned CST_NORMAL = 0;
20 const unsigned CST_MANDATORY = 1;
21 const unsigned CST_UNIQUE = 2;
22 
24 {
25 public:
26  ConfigSection( ConfigFile& cf, const std::string& sectname,
27  unsigned flags = CST_MANDATORY | CST_UNIQUE );
28  ~ConfigSection() noexcept(false);
29  ConfigSection& operator=( const ConfigSection& ) { return *this; }
30  bool matches( const ConfigElem& elem );
31 
32 private:
34  std::string _sectname;
35  bool _found;
36  unsigned _flags;
37 };
38 }
39 }
40 #endif
bool matches(const ConfigElem &elem)
Definition: cfgsect.cpp:32
ConfigFile & _cf
Definition: cfgsect.h:33
~ConfigSection() noexcept(false)
Definition: cfgsect.cpp:22
ConfigSection & operator=(const ConfigSection &)
Definition: cfgsect.h:29
const unsigned CST_NORMAL
Definition: cfgsect.h:19
const unsigned CST_UNIQUE
Definition: cfgsect.h:21
std::string _sectname
Definition: cfgsect.h:34
const unsigned CST_MANDATORY
Definition: cfgsect.h:20
ConfigSection(ConfigFile &cf, const std::string &sectname, unsigned flags=CST_MANDATORY|CST_UNIQUE)
Definition: cfgsect.cpp:16
Definition: berror.cpp:12