source: XmlTools2/trunk/xmltools.h@ 969

Last change on this file since 969 was 964, checked in by s10k, 11 years ago

XmlTools
More speedup, about 3 times faster now than the current AEI build

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