rippled
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
ripple::BasicConfig Class Reference

Holds unparsed configuration information. More...

Inheritance diagram for ripple::BasicConfig:
Inheritance graph
[legend]
Collaboration diagram for ripple::BasicConfig:
Collaboration graph
[legend]

Public Member Functions

bool exists (std::string const &name) const
 Returns true if a section with the given name exists. More...
 
void overwrite (std::string const &section, std::string const &key, std::string const &value)
 Overwrite a key/value pair with a command line argument If the section does not exist it is created. More...
 
void deprecatedClearSection (std::string const &section)
 Remove all the key/value pairs from the section. More...
 
void legacy (std::string const &section, std::string value)
 Set a value that is not a key/value pair. More...
 
std::string legacy (std::string const &sectionName) const
 Get the legacy value of a section. More...
 
bool had_trailing_comments () const
 

Protected Member Functions

void build (IniFileSections const &ifs)
 

Private Attributes

std::map< std::string, Section, boost::beast::iless > map_
 

Friends

std::ostreamoperator<< (std::ostream &ss, BasicConfig const &c)
 

Detailed Description

Holds unparsed configuration information.

The raw data sections are processed with intermediate parsers specific to each module instead of being all parsed in a central location.

Definition at line 215 of file BasicConfig.h.

Member Function Documentation

◆ exists()

bool ripple::BasicConfig::exists ( std::string const &  name) const

Returns true if a section with the given name exists.

Definition at line 121 of file BasicConfig.cpp.

◆ section() [1/2]

Section & ripple::BasicConfig::section ( std::string const &  name)

Returns the section with the given name.

If the section does not exist, an empty section is returned.

Definition at line 127 of file BasicConfig.cpp.

◆ section() [2/2]

Section const & ripple::BasicConfig::section ( std::string const &  name) const

Definition at line 133 of file BasicConfig.cpp.

◆ operator[]() [1/2]

Section const& ripple::BasicConfig::operator[] ( std::string const &  name) const

Definition at line 236 of file BasicConfig.h.

◆ operator[]() [2/2]

Section& ripple::BasicConfig::operator[] ( std::string const &  name)

Definition at line 242 of file BasicConfig.h.

◆ overwrite()

void ripple::BasicConfig::overwrite ( std::string const &  section,
std::string const &  key,
std::string const &  value 
)

Overwrite a key/value pair with a command line argument If the section does not exist it is created.

The previous value, if any, is overwritten.

Definition at line 143 of file BasicConfig.cpp.

◆ deprecatedClearSection()

void ripple::BasicConfig::deprecatedClearSection ( std::string const &  section)

Remove all the key/value pairs from the section.

Definition at line 156 of file BasicConfig.cpp.

◆ legacy() [1/2]

void ripple::BasicConfig::legacy ( std::string const &  section,
std::string  value 
)

Set a value that is not a key/value pair.

The value is stored as the section's first value and may be retrieved through section::legacy.

Parameters
sectionName of the section to modify.
valueContents of the legacy value.

Definition at line 164 of file BasicConfig.cpp.

◆ legacy() [2/2]

std::string ripple::BasicConfig::legacy ( std::string const &  sectionName) const

Get the legacy value of a section.

A section with a single-line value may be retrieved as a legacy value.

Parameters
sectionNameRetrieve the contents of this section's legacy value.
Returns
Contents of the legacy value.

Definition at line 170 of file BasicConfig.cpp.

◆ had_trailing_comments()

bool ripple::BasicConfig::had_trailing_comments ( ) const

Definition at line 292 of file BasicConfig.h.

◆ build()

void ripple::BasicConfig::build ( IniFileSections const &  ifs)
protected

Definition at line 176 of file BasicConfig.cpp.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream ss,
BasicConfig const &  c 
)
friend

Definition at line 189 of file BasicConfig.cpp.

Member Data Documentation

◆ map_

std::map<std::string, Section, boost::beast::iless> ripple::BasicConfig::map_
private

Definition at line 218 of file BasicConfig.h.