2018-11-12 00:57:16 +01:00
|
|
|
#ifndef __BML_H
|
|
|
|
#define __BML_H
|
|
|
|
#include <vector>
|
2019-05-16 02:55:44 +02:00
|
|
|
#include <string>
|
2019-06-04 03:15:16 +02:00
|
|
|
#include <fstream>
|
2018-11-12 00:57:16 +01:00
|
|
|
|
2019-05-16 02:55:44 +02:00
|
|
|
struct bml_node
|
2018-11-12 00:57:16 +01:00
|
|
|
{
|
2019-06-04 03:15:16 +02:00
|
|
|
enum node_type {
|
|
|
|
CHILD,
|
|
|
|
ATTRIBUTE
|
|
|
|
};
|
|
|
|
|
2019-05-16 02:55:44 +02:00
|
|
|
bml_node();
|
2019-06-04 03:15:16 +02:00
|
|
|
bool parse_file(std::string filename);
|
|
|
|
void parse(std::ifstream &fd);
|
2019-05-16 02:55:44 +02:00
|
|
|
bml_node *find_subnode(std::string name);
|
|
|
|
void print();
|
|
|
|
|
|
|
|
std::string name;
|
|
|
|
std::string data;
|
2018-11-12 00:57:16 +01:00
|
|
|
int depth;
|
2019-05-16 02:55:44 +02:00
|
|
|
std::vector<bml_node> child;
|
2019-06-04 03:15:16 +02:00
|
|
|
node_type type;
|
2019-05-16 02:55:44 +02:00
|
|
|
};
|
2018-11-12 00:57:16 +01:00
|
|
|
|
|
|
|
#endif
|