#include <persist_context.hpp>
Public Member Functions | |
persist_file_context (const std::string &name_space) | |
bool | clear_var (const std::string &, bool immediate=false) |
config | get_var (const std::string &) const |
bool | set_var (const std::string &, const config &, bool immediate=false) |
bool | start_transaction () |
bool | end_transaction () |
bool | cancel_transaction () |
Public Member Functions inherited from persist_context | |
virtual | ~persist_context () |
std::string | get_node () const |
void | set_node (const std::string &) |
bool | valid () const |
bool | dirty () const |
operator bool () const | |
Private Member Functions | |
void | load () |
void | init () |
bool | save_context () |
Additional Inherited Members | |
Protected Member Functions inherited from persist_context | |
persist_context () | |
persist_context (const std::string &name_space) | |
config * | get_node (config &cfg, name_space &ns, bool force=false) |
const config * | get_node (const config &cfg, const name_space &ns) const |
Protected Attributes inherited from persist_context | |
config | cfg_ |
name_space | namespace_ |
bool | valid_ |
bool | in_transaction_ |
Definition at line 164 of file persist_context.hpp.
persist_file_context::persist_file_context | ( | const std::string & | name_space | ) |
Definition at line 49 of file persist_context.cpp.
References load().
|
inlinevirtual |
Implements persist_context.
Definition at line 189 of file persist_context.hpp.
References persist_context::in_transaction_, and load().
|
virtual |
Implements persist_context.
Definition at line 55 of file persist_context.cpp.
References config::add_child(), persist_context::cfg_, config::child_or_add(), config::clear_children(), config::empty(), image::exists(), utils::find(), persist_context::get_node(), config::has_attribute(), config::has_child(), persist_context::in_transaction_, utf8::index(), persist_context::name_space::lineage_, load(), config::mandatory_child(), persist_context::namespace_, persist_context::name_space::node_, prev, persist_context::name_space::prev(), config::remove_attribute(), config::remove_child(), and save_context().
Referenced by set_var().
|
inlinevirtual |
Implements persist_context.
Definition at line 182 of file persist_context.hpp.
References persist_context::in_transaction_, and save_context().
|
virtual |
Implements persist_context.
Definition at line 160 of file persist_context.cpp.
References config::add_child(), persist_context::cfg_, config::child_count(), persist_context::get_node(), config::has_child(), i, config::mandatory_child(), persist_context::namespace_, and pack_scalar().
|
private |
|
private |
Definition at line 34 of file persist_context.cpp.
References persist_context::cfg_, lg::err(), filesystem::file_exists(), get_persist_cfg_name(), filesystem::is_directory(), filesystem::istream_file(), LOG_PERSIST, persist_context::namespace_, read(), and persist_context::name_space::root_.
Referenced by cancel_transaction(), clear_var(), persist_file_context(), and set_var().
|
private |
Definition at line 178 of file persist_context.cpp.
References persist_context::cfg_, filesystem::delete_file(), config::empty(), lg::err(), get_persist_cfg_name(), LOG_PERSIST, persist_context::namespace_, filesystem::ostream_file(), persist_context::name_space::root_, and config_writer::write().
Referenced by clear_var(), end_transaction(), and set_var().
|
virtual |
Implements persist_context.
Definition at line 202 of file persist_context.cpp.
References config::add_child(), config::append(), persist_context::cfg_, config::child_or_add(), config::clear_children(), clear_var(), persist_context::get_node(), config::has_attribute(), persist_context::in_transaction_, load(), persist_context::namespace_, config::remove_attribute(), and save_context().
|
inlinevirtual |
Implements persist_context.
Definition at line 176 of file persist_context.hpp.
References persist_context::in_transaction_.