mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-14 07:21:51 +00:00
UiXmlReader added (WIP)
This commit is contained in:
parent
e9efdb0e7b
commit
86412a28ec
6 changed files with 269 additions and 13 deletions
31
src/frontend/gui/gui_xml.h
Normal file
31
src/frontend/gui/gui_xml.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#ifndef FRONTEND_GUI_GUI_XML_H_
|
||||
#define FRONTEND_GUI_GUI_XML_H_
|
||||
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "GUI.h"
|
||||
#include "../../coders/xml.h"
|
||||
|
||||
namespace gui {
|
||||
class UiXmlReader;
|
||||
|
||||
using uinode_reader = std::function<std::shared_ptr<UINode>(UiXmlReader&, xml::xmlelement)>;
|
||||
|
||||
class UiXmlReader {
|
||||
std::unordered_map<std::string, uinode_reader> readers;
|
||||
public:
|
||||
UiXmlReader();
|
||||
|
||||
void add(const std::string& tag, uinode_reader reader);
|
||||
|
||||
std::shared_ptr<UINode> readUINode(xml::xmlelement element);
|
||||
|
||||
std::shared_ptr<UINode> readXML(
|
||||
const std::string& filename,
|
||||
const std::string& source
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
#endif // FRONTEND_GUI_GUI_XML_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue