Drizzled Public API Documentation

drizzled::program_options::detail::common_config_file_iterator Class Reference

#include <config_file.h>

Inheritance diagram for drizzled::program_options::detail::common_config_file_iterator:
drizzled::program_options::detail::basic_config_file_iterator< charT >

List of all members.

Public Member Functions

 common_config_file_iterator (const std::set< std::string > &in_allowed_options, bool allow_unregistered)
void get ()

Protected Member Functions

virtual bool getline (std::string &)

Private Member Functions

void add_option (const char *name)
bool allowed_option (const std::string &s) const

Private Attributes

std::set< std::string > allowed_options
std::set< std::string > allowed_prefixes
std::string m_prefix
bool m_allow_unregistered

Detailed Description

Standalone parser for config files in ini-line format. The parser is a model of single-pass lvalue iterator, and default constructor creates past-the-end-iterator. The typical usage is: config_file_iterator i(is, ... set of options ...), e; for(; i !=e; ++i) { i; }

Syntax conventions:

  • config file can not contain positional options
  • '#' is comment character: it is ignored together with the rest of the line.
  • variable assignments are in the form name '=' value. spaces around '=' are trimmed.
  • Section names are given in brackets.

The actual option name is constructed by combining current section name and specified option name, with dot between. If section_name already contains dot at the end, new dot is not inserted. For example:

 [gui.accessibility]
 visual_bell=yes
 

will result in option "gui.accessibility.visual_bell" with value "yes" been returned.

Definition at line 215 of file config_file.h.


Member Function Documentation

void drizzled::program_options::detail::common_config_file_iterator::add_option ( const char *  name) [inline, private]

Adds another allowed option. If the 'name' ends with '*', then all options with the same prefix are allowed. For example, if 'name' is 'foo*', then 'foo1' and 'foo_bar' are allowed.

Definition at line 316 of file config_file.h.


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