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