clan::XMLResourceDocument Class Reference

XML Resource Document. More...

#include <xml_resource_document.h>

Public Member Functions

 XMLResourceDocument ()
 Construct a XMLResourceDocument. More...
 
 XMLResourceDocument (const std::string &filename)
 Constructs a XMLResourceDocument. More...
 
 XMLResourceDocument (const std::string &filename, FileSystem fs)
 Constructs a XMLResourceDocument. More...
 
 XMLResourceDocument (IODevice file, const std::string &base_path, FileSystem fs)
 Constructs a XMLResourceDocument. More...
 
 XMLResourceDocument (const XMLResourceDocument &other)
 Constructs a XMLResourceDocument. More...
 
 ~XMLResourceDocument ()
 
void add_resources (const XMLResourceDocument &additional_resources)
 Add resources from an other resource document. More...
 
XMLResourceNode create_resource (const std::string &resource_id, const std::string &type)
 Construct a new resource object. More...
 
void destroy_resource (const std::string &resource_id)
 Destroy resource object. More...
 
bool get_boolean_resource (const std::string &resource_id, bool default_value) const
 Returns the value of a boolean resource. (using the value attribute) More...
 
int get_integer_resource (const std::string &resource_id, int default_value) const
 Returns the value of an integer resource. (using the value attribute) More...
 
XMLResourceNode get_resource (const std::string &resource_id) const
 Returns Resource representing the given resource. More...
 
std::vector< std::stringget_resource_names () const
 Returns a list of all resources available. More...
 
std::vector< std::stringget_resource_names (const std::string &section) const
 
std::vector< std::stringget_resource_names_of_type (const std::string &type) const
 Returns a list of all resources available matching a given type. More...
 
std::vector< std::stringget_resource_names_of_type (const std::string &type, const std::string &section) const
 
std::vector< std::stringget_section_names () const
 Returns all the resource sections available. More...
 
std::string get_string_resource (const std::string &resource_id, const std::string &default_value) const
 Returns the value of an string resource. (using the value attribute) More...
 
void load (const std::string &filename)
 Load resource XML tree from file. More...
 
void load (const std::string &filename, const FileSystem &file_system)
 Load. More...
 
void load (IODevice file, const std::string &base_path=std::string(), const FileSystem &file_system=FileSystem())
 Load. More...
 
XMLResourceDocumentoperator= (const XMLResourceDocument &copy)
 
bool operator== (const XMLResourceDocument &that) const
 
void remove_resources (const XMLResourceDocument &additional_resources)
 Remove resources from an other resource document. More...
 
bool resource_exists (const std::string &resource_id) const
 Returns true if a resource exists. More...
 
void save (const std::string &filename)
 Save resource XML tree to file. More...
 
void save (const std::string &filename, const FileSystem &file_system)
 Save. More...
 
void save (IODevice file)
 Save. More...
 

Friends

class XMLResourceDocument_Impl
 
class XMLResourceNode
 

Detailed Description

XML Resource Document.

Constructor & Destructor Documentation

clan::XMLResourceDocument::XMLResourceDocument ( )

Construct a XMLResourceDocument.

clan::XMLResourceDocument::XMLResourceDocument ( const std::string filename)

Constructs a XMLResourceDocument.

Parameters
filename= String
clan::XMLResourceDocument::XMLResourceDocument ( const std::string filename,
FileSystem  fs 
)

Constructs a XMLResourceDocument.

Parameters
filename= String
directory= Virtual Directory
clan::XMLResourceDocument::XMLResourceDocument ( IODevice  file,
const std::string base_path,
FileSystem  fs 
)

Constructs a XMLResourceDocument.

Parameters
file= IODevice
directory= Virtual Directory
clan::XMLResourceDocument::XMLResourceDocument ( const XMLResourceDocument other)

Constructs a XMLResourceDocument.

Parameters
other= XMLResourceDocument
clan::XMLResourceDocument::~XMLResourceDocument ( )

Member Function Documentation

void clan::XMLResourceDocument::add_resources ( const XMLResourceDocument additional_resources)

Add resources from an other resource document.

This function only makes the resource document search other documents, it does not copy the resources into this document.

XMLResourceNode clan::XMLResourceDocument::create_resource ( const std::string resource_id,
const std::string type 
)

Construct a new resource object.

void clan::XMLResourceDocument::destroy_resource ( const std::string resource_id)

Destroy resource object.

bool clan::XMLResourceDocument::get_boolean_resource ( const std::string resource_id,
bool  default_value 
) const

Returns the value of a boolean resource. (using the value attribute)

int clan::XMLResourceDocument::get_integer_resource ( const std::string resource_id,
int  default_value 
) const

Returns the value of an integer resource. (using the value attribute)

XMLResourceNode clan::XMLResourceDocument::get_resource ( const std::string resource_id) const

Returns Resource representing the given resource.

std::vector<std::string> clan::XMLResourceDocument::get_resource_names ( ) const

Returns a list of all resources available.

The returned resources are in the form "section/subsection/.../resourcename".

std::vector<std::string> clan::XMLResourceDocument::get_resource_names ( const std::string section) const
std::vector<std::string> clan::XMLResourceDocument::get_resource_names_of_type ( const std::string type) const

Returns a list of all resources available matching a given type.

The returned resources are in the form "section/subsection/.../resourcename".

std::vector<std::string> clan::XMLResourceDocument::get_resource_names_of_type ( const std::string type,
const std::string section 
) const
std::vector<std::string> clan::XMLResourceDocument::get_section_names ( ) const

Returns all the resource sections available.

std::string clan::XMLResourceDocument::get_string_resource ( const std::string resource_id,
const std::string default_value 
) const

Returns the value of an string resource. (using the value attribute)

void clan::XMLResourceDocument::load ( const std::string filename)

Load resource XML tree from file.

void clan::XMLResourceDocument::load ( const std::string filename,
const FileSystem file_system 
)

Load.

Parameters
filename= the filename to save
directory= Virtual Directory
void clan::XMLResourceDocument::load ( IODevice  file,
const std::string base_path = std::string(),
const FileSystem file_system = FileSystem() 
)

Load.

Parameters
file= the file to load
directory= Virtual Directory
XMLResourceDocument& clan::XMLResourceDocument::operator= ( const XMLResourceDocument copy)
bool clan::XMLResourceDocument::operator== ( const XMLResourceDocument that) const
void clan::XMLResourceDocument::remove_resources ( const XMLResourceDocument additional_resources)

Remove resources from an other resource document.

bool clan::XMLResourceDocument::resource_exists ( const std::string resource_id) const

Returns true if a resource exists.

void clan::XMLResourceDocument::save ( const std::string filename)

Save resource XML tree to file.

void clan::XMLResourceDocument::save ( const std::string filename,
const FileSystem file_system 
)

Save.

Parameters
filename= the filename to save
directory= Virtual Directory
void clan::XMLResourceDocument::save ( IODevice  file)

Save.

Parameters
file= IODevice

Friends And Related Function Documentation

friend class XMLResourceDocument_Impl
friend
friend class XMLResourceNode
friend

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