30 #ifndef __CLAW_CONFIGURATION_FILE_HPP__
31 #define __CLAW_CONFIGURATION_FILE_HPP__
59 std::string
make_comment(
const std::string& value )
const;
61 (
const std::string& key,
const std::string& value )
const;
78 typedef std::multimap<std::string, std::string> section_content;
81 typedef std::map<std::string, section_content> file_content;
84 typedef section_content* section_content_ptr;
89 <
const file_content::key_type,
90 file_content::const_iterator,
96 <
const section_content::key_type,
97 section_content::const_iterator,
108 typedef section_content::const_iterator wrapped_iterator_type;
111 typedef std::string value_type;
112 typedef const value_type& reference;
113 typedef const value_type* pointer;
114 typedef wrapped_iterator_type::difference_type difference_type;
116 typedef wrapped_iterator_type::iterator_category iterator_category;
124 return m_iterator == that.m_iterator;
129 return m_iterator != that.m_iterator;
158 reference operator*()
const
160 return m_iterator->second;
163 pointer operator->()
const
165 return &m_iterator->second;
170 wrapped_iterator_type m_iterator;
185 operator()(
const std::string& section,
const std::string& field )
const;
187 const std::string&
operator()(
const std::string& field )
const;
190 (
const std::string& section,
const std::string& field )
const;
191 bool has_field(
const std::string& field )
const;
194 (
const std::string& section,
const std::string& field,
195 const std::string& val );
196 void set_value(
const std::string& field,
const std::string& val );
199 (
const std::string& section,
const std::string& field,
200 const std::string& val );
201 void add_value(
const std::string& field,
const std::string& val );
206 field_begin(
const std::string& section,
const std::string& field )
const;
208 field_end(
const std::string& section,
const std::string& field )
const;
224 std::string& line )
const;
227 section_content_ptr& section );
230 std::string& line )
const;
235 void save_section_content
236 (
const section_content& c, std::ostream& os,
241 section_content m_noname_section;
244 file_content m_sections;
247 static const std::string s_unknow_field_value;
252 #endif // __CLAW_CONFIGURATION_FILE_HPP__