LocalGuidance
A library that generates velocity references to follow a path.
tinyxml_tools::DocumentHandle Class Referenceabstract

#include <DocumentHandle.hpp>

Inheritance diagram for tinyxml_tools::DocumentHandle:
Inheritance graph

Public Member Functions

 DocumentHandle ()
 Default ctor. More...
 
virtual ~DocumentHandle ()=default
 Default dtor. More...
 
virtual bool create (const std::string &path, DocumentMode mode)=0
 Opens or creates a file at 'path' in depending on 'mode'. More...
 
virtual bool merge (const std::string &path, MergeMode mode)=0
 Merges file at 'path' with the handled document. More...
 
virtual bool saveAs (const std::string &path, bool force)=0
 Saves the current configuration to 'path'. More...
 
bool save ()
 Saves the current configuration to the file specified in create() More...
 

Protected Member Functions

bool writeable ()
 Check whether document can be saved (overwritten) More...
 
bool readable ()
 Check whether document shall be read on creation. More...
 

Protected Attributes

std::string filepath_
 Path of the handled file. More...
 
DocumentMode mode_
 Document mode ( allows protecting files against reads/writes ) More...
 

Constructor & Destructor Documentation

tinyxml_tools::DocumentHandle::DocumentHandle ( )
inline

Default ctor.

virtual tinyxml_tools::DocumentHandle::~DocumentHandle ( )
virtualdefault

Default dtor.

Member Function Documentation

virtual bool tinyxml_tools::DocumentHandle::create ( const std::string &  path,
DocumentMode  mode 
)
pure virtual

Opens or creates a file at 'path' in depending on 'mode'.

Parameters
pathPath of the config file to open/store
modeAccess mode for the document
Returns
true, iff successful

Implemented in tinyxml_tools::DocumentHandleXML.

virtual bool tinyxml_tools::DocumentHandle::merge ( const std::string &  path,
MergeMode  mode 
)
pure virtual

Merges file at 'path' with the handled document.

Parameters
pathPath of the config file to append
modeMode of the merge, see Enum description on top of this file
Returns
true, iff successful

Implemented in tinyxml_tools::DocumentHandleXML.

bool tinyxml_tools::DocumentHandle::readable ( )
inlineprotected

Check whether document shall be read on creation.

bool tinyxml_tools::DocumentHandle::save ( )
inline

Saves the current configuration to the file specified in create()

Returns
true, iff successful
virtual bool tinyxml_tools::DocumentHandle::saveAs ( const std::string &  path,
bool  force 
)
pure virtual

Saves the current configuration to 'path'.

Parameters
pathpath of the output file
forceforce saving if file already exists
Returns
true, iff successful

Implemented in tinyxml_tools::DocumentHandleXML.

bool tinyxml_tools::DocumentHandle::writeable ( )
inlineprotected

Check whether document can be saved (overwritten)

Member Data Documentation

std::string tinyxml_tools::DocumentHandle::filepath_
protected

Path of the handled file.

DocumentMode tinyxml_tools::DocumentHandle::mode_
protected

Document mode ( allows protecting files against reads/writes )


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