Repository navigation
Expand file tree
/
Copy pathmain.cpp
More file actions
119 lines (99 loc) · 2.02 KB
/
Copy pathmain.cpp
File metadata and controls
119 lines (99 loc) · 2.02 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#include "FileReader.h"
void main()
{
file_Reader file("aue_training_ground_map.tmx");
//file.GetData_ReadFile("data");
}
/*
personal notes in case if something doesn't work
while (pos != buf_length)
{
if (Buffer[pos] == '<')
{
std::string Nodetag{}; Node *node = new Node;
pos++;
if (Buffer[pos] != '/')
{
//getting a tag of the node
if (Nodetag.empty())
{
std::string tag{};
if (Buffer[pos] == '?') pos++;
while (Buffer[pos] != ' ')
{
tag += Buffer[pos];
pos++;
}
Nodetag = tag;
}
//reading node for atributes
while (Buffer[pos] != '>')
{
if (Buffer[pos] == ' ')
{
if (!atr_name.empty()) atr_name.clear();
pos++;
while (Buffer[pos] != '=')
{
atr_name += Buffer[pos];
pos++;
}
}
if (Buffer[pos] == '"')
{
if (!atr_value.empty()) atr_value.clear();
pos++;
while (Buffer[pos] != '"')
{
atr_value += Buffer[pos]; pos++;
}
node->setNewAtribute(atr_name, atr_value);
}
pos++;
}
}
if (Nodetag == "data" && Buffer[pos] == '>')
{
pos++;
std::string map;
while (Buffer[pos] != '<')
{
map += Buffer[pos];
pos++;
}
node->Inner_Text = map;
}
Node_List[Nodetag] = node; node = nullptr; delete node;
}
pos++;
}
*/
/*
personal notes in case if something doesn't work
Node* node = new Node;
if(Buffer[pos+1]!='/')
{
while (Buffer[pos] != '/')
{
Line += Buffer[pos];
pos++;
if (Buffer[pos] == '>')
{
Line += Buffer[pos];
node->Inner_Text.push_back(Line);
Line.clear();
pos++;
}
}
if (Buffer[pos] == '/')
{
Line += '/';
while (Buffer[pos] != '>')
{
pos++;
Line += Buffer[pos];
}
node->Inner_Text.push_back(Line);
}
nodes.push_back(node); node = nullptr; delete node;
}*/