CLAW Library (a C++ Library Absolutely Wonderful) 1.5.5
Public Types | Public Member Functions | Public Attributes

claw::configuration_file::syntax_description Struct Reference

This class tells us how to parse the input file. More...

#include <configuration_file.hpp>

List of all members.

Public Types

typedef std::pair< char, char > paired_symbol
 Two symbols making a pair (like () or []).

Public Member Functions

 syntax_description ()
 Default constructor.
std::string make_comment (const std::string &value) const
 Create a comment from a string.
std::string make_assignment (const std::string &key, const std::string &value) const
 Make an assignment of a value to a key.
std::string make_section_name (const std::string &name) const
 Create a section name from a string.

Public Attributes

char comment
 Symbol used to comment the rest of the line.
char assignment
 Symbol used to assign a value to a field.
paired_symbol section_name
 Pair of symbols around a section name.

Detailed Description

This class tells us how to parse the input file.

Definition at line 46 of file configuration_file.hpp.


Member Typedef Documentation

Two symbols making a pair (like () or []).

Definition at line 50 of file configuration_file.hpp.


Constructor & Destructor Documentation

claw::configuration_file::syntax_description::syntax_description ( )

Default constructor.

Definition at line 38 of file configuration_file.cpp.

  : comment('#'), assignment('='), section_name('[', ']')
{

} // configuration_file::syntax_description::syntax_description()

Member Function Documentation

std::string claw::configuration_file::syntax_description::make_assignment ( const std::string &  key,
const std::string &  value 
) const

Make an assignment of a value to a key.

Parameters:
keyThe key.
valueThe value given to the key.

Definition at line 62 of file configuration_file.cpp.

Referenced by claw::configuration_file::save_section_content().

{
  return key + ' ' + assignment + ' ' + value;
} // configuration_file::syntax_description::make_assignment()
std::string claw::configuration_file::syntax_description::make_comment ( const std::string &  value) const

Create a comment from a string.

Parameters:
valueThe string to comment.

Definition at line 50 of file configuration_file.cpp.

{
  return comment + (' ' + value);
} // configuration_file::syntax_description::make_comment()
std::string claw::configuration_file::syntax_description::make_section_name ( const std::string &  name) const

Create a section name from a string.

Parameters:
nameThe name of the section.

Definition at line 73 of file configuration_file.cpp.

Referenced by claw::configuration_file::save().

{
  return section_name.first + name + section_name.second;
} // configuration_file::syntax_description::make_section_name()

Member Data Documentation

Symbol used to assign a value to a field.

Definition at line 65 of file configuration_file.hpp.

Referenced by claw::configuration_file::process_line().

Symbol used to comment the rest of the line.

Definition at line 62 of file configuration_file.hpp.

Referenced by claw::configuration_file::escape_char(), and claw::configuration_file::escape_line().

Pair of symbols around a section name.

Definition at line 68 of file configuration_file.hpp.

Referenced by claw::configuration_file::process_line().


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