31#include "../Resources/xml_resource_node.h"
32#include "../../Core/IOData/file_system.h"
42 class XMLResourceNode;
44 class XMLResourceDocument_Impl;
94 const std::string &type,
95 const std::string §ion)
const;
99 const std::string &resource_id)
const;
103 const std::string &resource_id,
104 bool default_value)
const;
108 const std::string &resource_id,
109 int default_value)
const;
113 const std::string &resource_id,
114 const std::string &default_value)
const;
135 void save(
const std::string &filename);
149 void load(
const std::string &filename);
169 std::shared_ptr<XMLResourceDocument_Impl> impl;
Virtual File System (VFS).
Definition: file_system.h:47
I/O Device interface.
Definition: iodevice.h:50
XML Resource Document.
Definition: xml_resource_document.h:48
void load(const std::string &filename)
Load resource XML tree from file.
XMLResourceDocument()
Construct a XMLResourceDocument.
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::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(IODevice file, const std::string &base_path=std::string(), const FileSystem &file_system=FileSystem())
Load.
void save(const std::string &filename, const FileSystem &file_system)
Save.
XMLResourceDocument(const std::string &filename, FileSystem fs)
Constructs a XMLResourceDocument.
bool get_boolean_resource(const std::string &resource_id, bool default_value) const
Returns the value of a boolean resource. (using the value attribute)
std::vector< std::string > get_resource_names_of_type(const std::string &type, const std::string §ion) const
void add_resources(const XMLResourceDocument &additional_resources)
Add resources from an other resource document.
XMLResourceDocument(IODevice file, const std::string &base_path, FileSystem fs)
Constructs a XMLResourceDocument.
void remove_resources(const XMLResourceDocument &additional_resources)
Remove resources from an other resource document.
std::vector< std::string > get_resource_names(const std::string §ion) const
friend class XMLResourceDocument_Impl
Definition: xml_resource_document.h:172
XMLResourceNode create_resource(const std::string &resource_id, const std::string &type)
Construct a new resource object.
XMLResourceNode get_resource(const std::string &resource_id) const
Returns Resource representing the given resource.
void save(IODevice file)
Save.
void load(const std::string &filename, const FileSystem &file_system)
Load.
std::vector< std::string > get_section_names() const
Returns all the resource sections available.
std::vector< std::string > get_resource_names() const
Returns a list of all resources available.
XMLResourceDocument & operator=(const XMLResourceDocument ©)
bool operator==(const XMLResourceDocument &that) const
XMLResourceDocument(const XMLResourceDocument &other)
Constructs a XMLResourceDocument.
void destroy_resource(const std::string &resource_id)
Destroy resource object.
bool resource_exists(const std::string &resource_id) const
Returns true if a resource exists.
int get_integer_resource(const std::string &resource_id, int default_value) const
Returns the value of an integer resource. (using the value attribute)
void save(const std::string &filename)
Save resource XML tree to file.
XMLResourceDocument(const std::string &filename)
Constructs a XMLResourceDocument.
Resource node for a XMLResourceDocument.
Definition: xml_resource_node.h:46