-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathParser.h
More file actions
49 lines (31 loc) · 773 Bytes
/
Parser.h
File metadata and controls
49 lines (31 loc) · 773 Bytes
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
// Created by Alone on 2022-8-8.
//
#ifndef MYUTIL_PARSER_H
#define MYUTIL_PARSER_H
static const int detail_len = 60;
#include "Element.h"
namespace xml
{
class Parser
{
public:
void LoadFile(const string &filename);
void LoadString(string_view content);
Element Parse();
static Element FromFile(const string &filename);
static Element FromString(string_view content);
private:
char _get_next_token();
void _trim_right();
bool _parse_version();
bool _parse_comment();
Element _parse_element();
string _parse_attr_key();
string _parse_attr_value();
private:
string m_str;
size_t m_idx{};
};
}
#endif //MYUTIL_PARSER_H