ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/s10k/XmlTools/xmltools.h
Revision: 1073
Committed: Thu Oct 5 17:48:32 2017 UTC (8 years ago) by s10k
Content type: text/x-chdr
File size: 1219 byte(s)
Log Message:
added XML Tools latest version (2.0d) and s10k's common libs

File Contents

# Content
1 #ifndef XMLTOOLS_H
2 #define XMLTOOLS_H
3
4
5 #include <string>
6 #include <stdio.h>
7
8 #include "utilxmltools.h"
9 #include "utilglobalvars.h"
10 #include "multidimvar.h"
11
12 // Template got from here:
13 // http://www.lubby.org/ebooks/qtconsoleapp2/qtconsoleapp2.html
14
15 // The xml library used was pugixml:
16 // https://code.google.com/p/pugixml/
17
18 class XmlTools
19 {
20 public:
21 XmlTools(QString filesWildcard, XmlFilter filter, bool noBackups, bool noVerbose);
22 XmlTools(QString filesWildcard, QString xPathExpression, bool noBackups, bool noVerbose);
23 void addValues(QString newValues);
24 void removeValues(QString valuesToRemove);
25 void replaceValue(QString oldValue, QString newValue);
26 void replaceAll(QString value, QString valuePositions = "");
27 void updateElements(QString diffBetweenOldAndNewValue);
28 void invertElements();
29 private:
30 QString replaceSpecificPositions(const QString &newValue, const QString &currValues, const QString &positionsToReplace);
31 pugi::xml_document document;
32 pugi::xml_node rootNode;
33 QVector<QString> filesToProcess;
34 QString xPathExpression;
35 XmlFilter filters;
36 bool backupsEnabled, verboseEnabled;
37 };
38
39 #endif // XMLTOOLS_H