libcamgm
CAConfig.hpp
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | |
3 | _ _ _ _ __ _ |
4 | | | | | | \_/ | / \ | | |
5 | | | | | | |_| | / /\ \ | | |
6 | | |__ | | | | | | / ____ \ | |__ |
7 | |____||_| |_| |_|/ / \ \|____| |
8 | |
9 | ca-mgm library |
10 | |
11 | (C) SUSE Linux Products GmbH |
12 \----------------------------------------------------------------------/
13 
14  File: CAConfig.hpp
15 
16  Author: <Michael Calmer> <mc@suse.de>
17  Maintainer: <Michael Calmer> <mc@suse.de>
18 
19  Purpose:
20 
21 /-*/
22 
27 #ifndef CA_MGM_CA_CONFIG_HPP
28 #define CA_MGM_CA_CONFIG_HPP
29 
30 #include <ca-mgm/config.h>
31 #include <ca-mgm/CommonData.hpp>
32 #include <ca-mgm/PtrTypes.hpp>
33 
34 
35 namespace CA_MGM_NAMESPACE
36 {
37 
38  class CAConfigImpl;
39 
43  class CAConfig
44  {
45  public:
46 
50  CAConfig(const std::string &file);
51  ~CAConfig();
52 
56  void
57  setValue(const std::string &section, const std::string &key, const std::string &value);
58 
62  void
63  deleteValue(const std::string &section, const std::string &key);
64 
65  void
66  deleteSection(const std::string &section);
67 
71  std::string
72  getValue(const std::string &section, const std::string &key) const;
73 
77  bool
78  exists(const std::string &section, const std::string &key) const;
79 
83  std::list<std::string>
84  getKeylist(const std::string &section) const;
85 
90  void
91  copySection(const std::string &srcSection, const std::string &destSection);
92 
98  CAConfig*
99  clone(const std::string &file);
100 
104  std::string
105  filename() const;
106 
107  void dump();
108 
109 
110  private:
112 
113  CAConfig();
114  CAConfig(const CAConfig&);
115  CAConfig& operator=(const CAConfig&);
116 
117  class CASection;
118  void dumpTree(CASection *section, int level = 0);
119 
124  void validateAndFix();
125  };
126 
127 }
128 
129 #endif //CA_MGM_CA_CONFIG_HPP
Definition: CAConfig.hpp:43
ca_mgm::RWCOW_pointer< CAConfigImpl > m_impl
Definition: CAConfig.hpp:111