The Battle for Wesnoth  1.19.5+dev
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
persist_context Class Referenceabstract

#include <persist_context.hpp>

Inheritance diagram for persist_context:

Classes

struct  name_space
 

Public Member Functions

virtual ~persist_context ()
 
virtual bool clear_var (const std::string &, bool immediate=false)=0
 
virtual config get_var (const std::string &) const =0
 
virtual bool set_var (const std::string &, const config &, bool immediate=false)=0
 
virtual bool start_transaction ()=0
 
virtual bool end_transaction ()=0
 
virtual bool cancel_transaction ()=0
 
std::string get_node () const
 
void set_node (const std::string &)
 
bool valid () const
 
bool dirty () const
 
 operator bool () const
 

Protected Member Functions

 persist_context ()
 
 persist_context (const std::string &name_space)
 
configget_node (config &cfg, name_space &ns, bool force=false)
 
const configget_node (const config &cfg, const name_space &ns) const
 

Protected Attributes

config cfg_
 
name_space namespace_
 
bool valid_
 
bool in_transaction_
 

Detailed Description

Definition at line 25 of file persist_context.hpp.

Constructor & Destructor Documentation

◆ ~persist_context()

virtual persist_context::~persist_context ( )
inlinevirtual

Definition at line 28 of file persist_context.hpp.

◆ persist_context() [1/2]

persist_context::persist_context ( )
inlineprotected

Definition at line 108 of file persist_context.hpp.

◆ persist_context() [2/2]

persist_context::persist_context ( const std::string &  name_space)
inlineprotected

Definition at line 115 of file persist_context.hpp.

Member Function Documentation

◆ cancel_transaction()

virtual bool persist_context::cancel_transaction ( )
pure virtual

Implemented in persist_file_context.

◆ clear_var()

virtual bool persist_context::clear_var ( const std::string &  ,
bool  immediate = false 
)
pure virtual

Implemented in persist_file_context.

Referenced by clear_global_variable().

◆ dirty()

bool persist_context::dirty ( ) const
inline

Definition at line 158 of file persist_context.hpp.

◆ end_transaction()

virtual bool persist_context::end_transaction ( )
pure virtual

Implemented in persist_file_context.

◆ get_node() [1/3]

std::string persist_context::get_node ( ) const

◆ get_node() [2/3]

config* persist_context::get_node ( config cfg,
name_space ns,
bool  force = false 
)
inlineprotected

◆ get_node() [3/3]

const config* persist_context::get_node ( const config cfg,
const name_space ns 
) const
inlineprotected

◆ get_var()

virtual config persist_context::get_var ( const std::string &  ) const
pure virtual

Implemented in persist_file_context.

Referenced by persist_choice::query_user().

◆ operator bool()

persist_context::operator bool ( ) const
inline

Definition at line 161 of file persist_context.hpp.

References valid_.

◆ set_node()

void persist_context::set_node ( const std::string &  name)

Definition at line 244 of file persist_context.cpp.

References namespace_, and persist_context::name_space::root_.

◆ set_var()

virtual bool persist_context::set_var ( const std::string &  ,
const config ,
bool  immediate = false 
)
pure virtual

Implemented in persist_file_context.

Referenced by set_global_variable().

◆ start_transaction()

virtual bool persist_context::start_transaction ( )
pure virtual

Implemented in persist_file_context.

◆ valid()

bool persist_context::valid ( ) const
inline

Member Data Documentation

◆ cfg_

config persist_context::cfg_
protected

◆ in_transaction_

bool persist_context::in_transaction_
protected

◆ namespace_

name_space persist_context::namespace_
protected

◆ valid_

bool persist_context::valid_
protected

Definition at line 105 of file persist_context.hpp.

Referenced by operator bool(), and valid().


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