32 #include "../Resources/xml_resource_node.h"
33 #include "../IOData/file_system.h"
43 class XMLResourceNode;
45 class XMLResourceDocument_Impl;
101 const std::string &type,
102 const std::string §ion)
const;
106 const std::string &resource_id)
const;
110 const std::string &resource_id,
111 bool default_value)
const;
115 const std::string &resource_id,
116 int default_value)
const;
120 const std::string &resource_id,
121 const std::string &default_value)
const;
146 void save(
const std::string &filename);
160 void load(
const std::string &filename);
184 std::shared_ptr<XMLResourceDocument_Impl> impl;
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)
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.
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.
int get_integer_resource(const std::string &resource_id, int default_value) const
Returns the value of an integer resource. (using the value attribute)
Resource node for a XMLResourceDocument.
Definition: xml_resource_node.h:47
XMLResourceDocument()
Construct a XMLResourceDocument.
XMLResourceNode create_resource(const std::string &resource_id, const std::string &type)
Construct a new resource object.
std::vector< std::string > get_resource_names() const
Returns a list of all resources available.
bool operator==(const XMLResourceDocument &that) const
I/O Device interface.
Definition: iodevice.h:51
std::vector< std::string > get_resource_names(const std::string §ion) const
XMLResourceDocument(const XMLResourceDocument &other)
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)
void load(const std::string &filename)
Load resource XML tree from file.
XMLResourceNode get_resource(const std::string &resource_id) const
Returns Resource representing the given resource.
XMLResourceDocument & operator=(const XMLResourceDocument ©)
XMLResourceDocument(IODevice file, const std::string &base_path, FileSystem fs)
Constructs a XMLResourceDocument.
void add_resources(const XMLResourceDocument &additional_resources)
Add resources from an other resource document.
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.
friend class XMLResourceDocument_Impl
Definition: xml_resource_document.h:187
void save(IODevice file)
Save.
void save(const std::string &filename)
Save resource XML tree to file.
std::vector< std::string > get_resource_names_of_type(const std::string &type, const std::string §ion) const
XMLResourceDocument(const std::string &filename, FileSystem fs)
Constructs a XMLResourceDocument.
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.
Virtual File System (VFS).
Definition: file_system.h:48
XML Resource Document.
Definition: xml_resource_document.h:49
void remove_resources(const XMLResourceDocument &additional_resources)
Remove resources from an other resource document.
XMLResourceDocument(const std::string &filename)
Constructs a XMLResourceDocument.