Logo Search packages:      
Sourcecode: schroot version File versions  Download package

sbuild::keyfile Class Reference

#include <sbuild-keyfile.h>

List of all members.


Detailed Description

Configuration file parser. This class loads an INI-style configuration file from a file or stream. The format is documented in schroot.conf(5). It is based upon the Glib GKeyFile class, which it is intended to replace.

Definition at line 48 of file sbuild-keyfile.h.


Public Types

typedef runtime_error_custom
< keyfile
error
 Exception type.
enum  priority {
  PRIORITY_OPTIONAL, PRIORITY_REQUIRED, PRIORITY_DISALLOWED, PRIORITY_DEPRECATED,
  PRIORITY_OBSOLETE
}
 Configuration parameter priority. More...

Public Member Functions

std::string get_comment (std::string const &group, std::string const &key) const
std::string get_comment (std::string const &group) const
string_list get_groups () const
string_list get_keys (std::string const &group) const
template<typename T, template< typename T > class C>
bool get_list_value (std::string const &group, std::string const &key, priority priority, C< T > &value) const
template<typename T, template< typename T > class C>
bool get_list_value (std::string const &group, std::string const &key, C< T > &value) const
bool get_locale_string (std::string const &group, std::string const &key, std::string const &locale, priority priority, std::string &value) const
bool get_locale_string (std::string const &group, std::string const &key, std::string const &locale, std::string &value) const
bool get_locale_string (std::string const &group, std::string const &key, priority priority, std::string &value) const
bool get_locale_string (std::string const &group, std::string const &key, std::string &value) const
template<typename T>
bool get_value (std::string const &group, std::string const &key, priority priority, T &value) const
template<typename T>
bool get_value (std::string const &group, std::string const &key, T &value) const
bool has_group (std::string const &group) const
bool has_key (std::string const &group, std::string const &key) const
 keyfile (std::istream &stream)
 keyfile (std::string const &file)
 keyfile ()
 The constructor.
keyfileoperator+= (keyfile const &rhs)
void remove_group (std::string const &group)
void remove_key (std::string const &group, std::string const &key)
void set_group (std::string const &group, std::string const &comment)
template<typename T, template< typename T > class C>
void set_list_value (std::string const &group, std::string const &key, C< T > const &value, std::string const &comment)
template<typename T, template< typename T > class C>
void set_list_value (std::string const &group, std::string const &key, C< T > const &value)
template<typename T>
void set_value (std::string const &group, std::string const &key, T const &value, std::string const &comment)
template<typename T>
void set_value (std::string const &group, std::string const &key, T const &value)
virtual ~keyfile ()
 The destructor.

Private Types

typedef std::map< std::string,
group_type
group_map_type
 Map between group name and group-items-comment tuple.
typedef std::tr1::tuple
< std::string, item_map_type,
std::string > 
group_type
 Group-items-comment tuple.
typedef std::map< std::string,
item_type
item_map_type
 Map between key name and key-value-comment tuple.
typedef std::tr1::tuple
< std::string, std::string,
std::string > 
item_type
 Key-value-comment tuple.

Private Member Functions

void check_priority (std::string const &group, std::string const &key, priority priority, bool valid) const
group_typefind_group (std::string const &group)
const group_typefind_group (std::string const &group) const
item_typefind_item (std::string const &group, std::string const &key)
const item_typefind_item (std::string const &group, std::string const &key) const

Static Private Member Functions

static void print_comment (std::string const &comment, std::ostream &stream)

Private Attributes

group_map_type groups
 The top-level groups.
char separator
 The separator used as a list item delimiter.

Friends

keyfile operator+ (keyfile const &lhs, keyfile const &rhs)
template<class charT, class traits>
std::basic_ostream< charT,
traits > & 
operator<< (std::basic_ostream< charT, traits > &stream, keyfile const &kf)
template<class charT, class traits>
std::basic_istream< charT,
traits > & 
operator>> (std::basic_istream< charT, traits > &stream, keyfile &kf)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index