ini

The contents of this module can be included with the header hpx/modules/ini.hpp. These headers may be used by user-code but are not guaranteed stable (neither header location nor contents). You are using these at your own risk. If you wish to use non-public functionality from a module we strongly suggest only including the module header hpx/modules/ini.hpp, not the particular header in which the functionality you would like to use is defined. See Public API for a list of names that are part of the public HPX API.

Defines

HPX_SECTION_VERSION
namespace hpx
namespace util
class section

Public Types

typedef util::function_nonser<void(std::string const&, std::string const&)> entry_changed_func
typedef std::pair<std::string, entry_changed_func> entry_type
typedef std::map<std::string, entry_type> entry_map
typedef std::map<std::string, section> section_map

Public Functions

section()
section(std::string const &filename, section *root = nullptr)
section(section const &in)
~section()
section &operator=(section const &rhs)
void parse(std::string const &sourcename, std::vector<std::string> const &lines, bool verify_existing = true, bool weed_out_comments = true, bool replace_existing = true)
void parse(std::string const &sourcename, std::string const &line, bool verify_existing = true, bool weed_out_comments = true, bool replace_existing = true)
void read(std::string const &filename)
void merge(std::string const &second)
void merge(section &second)
void dump(int ind = 0) const
void dump(int ind, std::ostream &strm) const
void add_section(std::string const &sec_name, section &sec, section *root = nullptr)
section *add_section_if_new(std::string const &sec_name)
bool has_section(std::string const &sec_name) const
section *get_section(std::string const &sec_name)
section const *get_section(std::string const &sec_name) const
section_map &get_sections()
section_map const &get_sections() const
void add_entry(std::string const &key, entry_type const &val)
void add_entry(std::string const &key, std::string const &val)
bool has_entry(std::string const &key) const
std::string get_entry(std::string const &key) const
std::string get_entry(std::string const &key, std::string const &dflt) const
template<typename T>
std::string get_entry(std::string const &key, T dflt) const
void add_notification_callback(std::string const &key, entry_changed_func const &callback)
entry_map const &get_entries() const
std::string expand(std::string const &str) const
void expand(std::string &str, std::string::size_type len) const
void set_root(section *r, bool recursive = false)
section *get_root() const
std::string get_name() const
std::string get_parent_name() const
std::string get_full_name() const
void set_name(std::string const &name)

Protected Functions

void line_msg(std::string msg, std::string const &file, int lnum = 0, std::string const &line = "")
section &clone_from(section const &rhs, section *root = nullptr)

Private Types

using mutex_type = util::spinlock

Private Functions

section *this_()
template<typename Archive>
void save(Archive &ar, const unsigned int version) const
template<typename Archive>
void load(Archive &ar, const unsigned int version)
void add_section(std::unique_lock<mutex_type> &l, std::string const &sec_name, section &sec, section *root = nullptr)
bool has_section(std::unique_lock<mutex_type> &l, std::string const &sec_name) const
section *get_section(std::unique_lock<mutex_type> &l, std::string const &sec_name)
section const *get_section(std::unique_lock<mutex_type> &l, std::string const &sec_name) const
section *add_section_if_new(std::unique_lock<mutex_type> &l, std::string const &sec_name)
void add_entry(std::unique_lock<mutex_type> &l, std::string const &fullkey, std::string const &key, std::string val)
void add_entry(std::unique_lock<mutex_type> &l, std::string const &fullkey, std::string const &key, entry_type const &val)
bool has_entry(std::unique_lock<mutex_type> &l, std::string const &key) const
std::string get_entry(std::unique_lock<mutex_type> &l, std::string const &key) const
std::string get_entry(std::unique_lock<mutex_type> &l, std::string const &key, std::string const &dflt) const
void add_notification_callback(std::unique_lock<mutex_type> &l, std::string const &key, entry_changed_func const &callback)
std::string expand(std::unique_lock<mutex_type> &l, std::string in) const
void expand(std::unique_lock<mutex_type> &l, std::string&, std::string::size_type) const
void expand_bracket(std::unique_lock<mutex_type> &l, std::string&, std::string::size_type) const
void expand_brace(std::unique_lock<mutex_type> &l, std::string&, std::string::size_type) const
std::string expand_only(std::unique_lock<mutex_type> &l, std::string in, std::string const &expand_this) const
void expand_only(std::unique_lock<mutex_type> &l, std::string&, std::string::size_type, std::string const &expand_this) const
void expand_bracket_only(std::unique_lock<mutex_type> &l, std::string&, std::string::size_type, std::string const &expand_this) const
void expand_brace_only(std::unique_lock<mutex_type> &l, std::string&, std::string::size_type, std::string const &expand_this) const

Private Members

section *root_
entry_map entries_
section_map sections_
std::string name_
std::string parent_name_
mutex_type mtx_

Friends

friend hpx::util::hpx::serialization::access