-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXMLRead.h
executable file
·36 lines (31 loc) · 1.07 KB
/
XMLRead.h
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
/*
* Copyright Notice : Copyright 2015, Josiah Bruner, All Rights Reserved.
*/
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cctype>
struct attribute {
std::string name;
std::string contents;
};
class XMLRead {
public:
XMLRead();
~XMLRead();
void Load(std::string xmlData);
std::string GetFieldContents(std::string fieldName);
std::string GetRawXML();
void MoveAttributesIntoChildren(std::string fieldName);
private:
std::string _xmlData;
std::string _MakeTag(std::string name, bool open);
std::string _GetStringBetween(std::string data, std::string startDelim, std::string endDelim);
bool _VerifyXML(std::string data);
bool _HasAttributes(std::string fieldName);
std::vector<attribute> _GetAttributes(std::string fieldName);
bool _CreateChild(std::string name, std::string content, std::string parentTagName);
void _DeleteAttributes(std::string fieldName);
};