2 |
|
#define XMLPATCH_H |
3 |
|
|
4 |
|
#include "xmltools.h" |
5 |
+ |
#include "xmlcustomcode.h" |
6 |
|
#include "optionsparser.h" |
6 |
– |
#include <omp.h> // OpenMP support |
7 |
– |
#include <ctime> // script execution time calculation |
8 |
– |
|
9 |
– |
#define SLOW_SCRIPT_TIME 0.1 // if a user script takes more than 0.1 seconds to execute give a warning. |
7 |
|
|
8 |
|
class XmlPatch |
9 |
|
{ |
11 |
|
XmlPatch(QString patchFilesWildcard, QString forceTargetFilesWildcard, bool noBackups, bool noVerbose); |
12 |
|
void readAndProcessPatchFile(); |
13 |
|
private: |
14 |
< |
QStringList patchFilesToProcess; |
14 |
> |
QVector<QString> patchFilesToProcess; |
15 |
|
QString forceTargetFilesWildcard; |
16 |
|
pugi::xml_document document; |
17 |
|
pugi::xml_node rootNode; |
18 |
|
bool backupsEnabled, verboseEnabled; |
19 |
+ |
XmlCustomCode customCodeOperation; |
20 |
|
QString getPatchParameterValue(const QString& line, QString parameter); |
21 |
|
void insertNodesOperation(const QString &xmlString, XmlFilter &filters, const QString &xPathExpression, const QString &filesWildcard=""); |
22 |
|
void removeNodesOperation(XmlFilter &filters, const QString &xPathExpression, const QString &filesWildcard=""); |
24 |
|
void executeCustomCommandOperation(const QString &jsString, const QString &filesWildcard=""); |
25 |
|
void checkPatchVersion(const QString &file, QTextStream &fileStream); |
26 |
|
void checkAndProcessValidCommands(QTextStream &fileStream); |
29 |
– |
void displayJsException(QScriptEngine &engine, QScriptValue &engineResult); |
27 |
|
}; |
28 |
|
|
29 |
|
#endif // XMLPATCH_H |