-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
28 lines (22 loc) · 922 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include "../srlzio/srlzio.hpp"
#include "models.hpp"
/* --------------------------------------------------------------------------------------- */
int main() {
using namespace tinyxml2;
XMLDocument doc;
doc.LoadFile("data/recipe.xml");
XMLElement * root = doc.FirstChildElement("DataFile");
XMLElement * models_node = root->FirstChildElement("Models");
Models models;
parse(models_node, models);
for (ModelBuffer const& model_buffer : models.children.get<0>().items) {
std::cout << "ModelBuffer: [ID=" << model_buffer.attributes.get<0>() << "]\n";
for (Model const& model : model_buffer.children.get<0>().items) {
std::cout << "\tModel [ID=" << model.attributes.get<0>() << "] ## "
<< model.children.names[0] << " -> " << model.children.get<0>().value << "\n";
}
std::cout << '\n';
}
return 0;
}