source: XmlTools2/trunk/xmltools.h@ 958

Last change on this file since 958 was 956, checked in by s10k, 11 years ago

XmlTools
removed QJSEngine defines

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