XML Resource Document. More...
#include <xml_resource_document.h>
Public Member Functions | |
XMLResourceDocument () | |
Construct a XMLResourceDocument. | |
XMLResourceDocument (const std::string &filename) | |
Constructs a XMLResourceDocument. | |
XMLResourceDocument (const std::string &filename, FileSystem fs) | |
Constructs a XMLResourceDocument. | |
XMLResourceDocument (const XMLResourceDocument &other) | |
Constructs a XMLResourceDocument. | |
XMLResourceDocument (IODevice file, const std::string &base_path, FileSystem fs) | |
Constructs a XMLResourceDocument. | |
~XMLResourceDocument () | |
void | add_resources (const XMLResourceDocument &additional_resources) |
Add resources from an other resource document. | |
XMLResourceNode | create_resource (const std::string &resource_id, const std::string &type) |
Construct a new resource object. | |
void | destroy_resource (const std::string &resource_id) |
Destroy resource object. | |
bool | get_boolean_resource (const std::string &resource_id, bool default_value) const |
Returns the value of a boolean resource. (using the value attribute) | |
int | get_integer_resource (const std::string &resource_id, int default_value) const |
Returns the value of an integer resource. (using the value attribute) | |
XMLResourceNode | get_resource (const std::string &resource_id) const |
Returns Resource representing the given resource. | |
std::vector< std::string > | get_resource_names () const |
Returns a list of all resources available. | |
std::vector< std::string > | get_resource_names (const std::string §ion) const |
std::vector< std::string > | get_resource_names_of_type (const std::string &type) const |
Returns a list of all resources available matching a given type. | |
std::vector< std::string > | get_resource_names_of_type (const std::string &type, const std::string §ion) const |
std::vector< std::string > | get_section_names () const |
Returns all the resource sections available. | |
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) | |
void | load (const std::string &filename) |
Load resource XML tree from file. | |
void | load (const std::string &filename, const FileSystem &file_system) |
Load. | |
void | load (IODevice file, const std::string &base_path=std::string(), const FileSystem &file_system=FileSystem()) |
Load. | |
XMLResourceDocument & | operator= (const XMLResourceDocument ©) |
bool | operator== (const XMLResourceDocument &that) const |
void | remove_resources (const XMLResourceDocument &additional_resources) |
Remove resources from an other resource document. | |
bool | resource_exists (const std::string &resource_id) const |
Returns true if a resource exists. | |
void | save (const std::string &filename) |
Save resource XML tree to file. | |
void | save (const std::string &filename, const FileSystem &file_system) |
Save. | |
void | save (IODevice file) |
Save. | |
Friends | |
class | XMLResourceDocument_Impl |
class | XMLResourceNode |
XML Resource Document.
clan::XMLResourceDocument::XMLResourceDocument | ( | ) |
Construct a XMLResourceDocument.
Referenced by XMLResourceDocument(), add_resources(), operator=(), operator==(), and remove_resources().
clan::XMLResourceDocument::XMLResourceDocument | ( | const std::string & | filename | ) |
Constructs a XMLResourceDocument.
filename | = String |
clan::XMLResourceDocument::XMLResourceDocument | ( | const std::string & | filename, |
FileSystem | fs ) |
Constructs a XMLResourceDocument.
filename | = String |
directory | = Virtual Directory |
clan::XMLResourceDocument::XMLResourceDocument | ( | IODevice | file, |
const std::string & | base_path, | ||
FileSystem | fs ) |
Constructs a XMLResourceDocument.
clan::XMLResourceDocument::XMLResourceDocument | ( | const XMLResourceDocument & | other | ) |
Constructs a XMLResourceDocument.
other | = XMLResourceDocument |
References XMLResourceDocument().
clan::XMLResourceDocument::~XMLResourceDocument | ( | ) |
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.
References XMLResourceDocument().
XMLResourceNode clan::XMLResourceDocument::create_resource | ( | const std::string & | resource_id, |
const std::string & | type ) |
Construct a new resource object.
References XMLResourceNode.
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.
References XMLResourceNode.
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.
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.
file | = the file to load |
directory | = Virtual Directory |
XMLResourceDocument & clan::XMLResourceDocument::operator= | ( | const XMLResourceDocument & | copy | ) |
References XMLResourceDocument().
bool clan::XMLResourceDocument::operator== | ( | const XMLResourceDocument & | that | ) | const |
References XMLResourceDocument().
void clan::XMLResourceDocument::remove_resources | ( | const XMLResourceDocument & | additional_resources | ) |
Remove resources from an other resource document.
References XMLResourceDocument().
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.
filename | = the filename to save |
directory | = Virtual Directory |
|
friend |
References XMLResourceDocument_Impl.
Referenced by XMLResourceDocument_Impl.
|
friend |
References XMLResourceNode.
Referenced by create_resource(), get_resource(), and XMLResourceNode.