Changeset 953 for XmlTools2/trunk
- Timestamp:
- Feb 10, 2014, 3:28:14 PM (11 years ago)
- Location:
- XmlTools2/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
XmlTools2/trunk/XmlTools.pro
r944 r953 6 6 #QT += qml #for use new google v8 qtscript engine 7 7 QT += script #for use old qtscript engine 8 #QMAKE_CXXFLAGS+= -fopenmp 9 #QMAKE_LFLAGS += -fopenmp #OpenMP (multithreading) support 8 QMAKE_CXXFLAGS+= -fopenmp 9 QMAKE_LFLAGS += -fopenmp #OpenMP (multithreading) support 10 10 11 11 12 macx { -
XmlTools2/trunk/optionsparser.h
r944 r953 1 1 #ifndef OPTIONSPARSER_H 2 2 #define OPTIONSPARSER_H 3 4 //#include <omp.h> // OpenMP support5 3 6 4 #include "xmlpatch.h" -
XmlTools2/trunk/xmlpatch.cpp
r947 r953 199 199 200 200 std::cout << "@COMMAND patch operation output:\n" 201 << "########################################################################"202 << std::endl;201 << "########################################################################" 202 << std::endl; 203 203 204 204 OptionsParser myParser(Util::QStringToArgsArray(commandString)); … … 206 206 207 207 std::cout 208 << "########################################################################"209 << std::endl;208 << "########################################################################" 209 << std::endl; 210 210 211 211 UtilXmlTools::displaySuccessMessage(1,"@COMMAND"); … … 221 221 void XmlPatch::executeCustomCommandOperation(const QString &jsString, const QString &filesWildcard){ 222 222 223 QStringList filesToProcess; 224 #ifdef _USE_OLD_JS_ENGINE 225 QScriptEngine engine; 226 QScriptValue engineResult; // variable to check for js_errors 227 #else 228 QJSEngine engine; 229 QJSValue engineResult; // variable to check for js_errors 230 #endif 231 232 QString rexmlString, jsxmlString, currXmlFileString; 233 223 QString rexmlString, jsxmlString; 224 QStringList filesToProcess=UtilXmlTools::getAllXmlFilesByWildcard(filesWildcard); 225 226 if(filesToProcess.isEmpty()){ 227 UtilXmlTools::displayErrorMessage("@CUSTOM_CODE","No XML files were found for the wildcard: "+filesWildcard); 228 } 234 229 235 230 QFile rexmlfile(":/resources/libs/rexml.js"); 236 231 QFile jsxmlfile(":/resources/libs/jsxml.js"); 237 232 238 // Add echo function so user can debug the code239 QScriptValue echoFunction = engine.newFunction(echo);240 engine.globalObject().setProperty("echo", echoFunction);241 242 filesToProcess=UtilXmlTools::getAllXmlFilesByWildcard(filesWildcard);243 244 if(filesToProcess.isEmpty()){245 UtilXmlTools::displayErrorMessage("@CUSTOM_CODE","No XML files were found for the wildcard: "+filesWildcard);246 }247 248 233 rexmlfile.open(QFile::ReadOnly | QFile::Text); 249 234 jsxmlfile.open(QFile::ReadOnly | QFile::Text); … … 252 237 jsxmlString=QTextStream(&jsxmlfile).readAll(); 253 238 254 engine.evaluate(rexmlString); // load js libraries255 engine.evaluate(jsxmlString);256 257 239 // Process all XmlFiles 240 #pragma omp parallel for 258 241 for(int i=0; i<filesToProcess.size(); i++){ 242 243 QString currXmlFileString; 244 245 #ifdef _USE_OLD_JS_ENGINE 246 QScriptEngine engine; 247 QScriptValue engineResult; // variable to check for js_errors 248 #else 249 QJSEngine engine; 250 QJSValue engineResult; // variable to check for js_errors 251 #endif 252 253 // Add echo function so user can debug the code 254 QScriptValue echoFunction = engine.newFunction(echo); 255 engine.globalObject().setProperty("echo", echoFunction); 256 257 engine.evaluate(rexmlString); // load js libraries 258 engine.evaluate(jsxmlString); 259 259 260 260 if(this->backupsEnabled){ -
XmlTools2/trunk/xmlpatch.h
r926 r953 4 4 #include "xmltools.h" 5 5 #include "optionsparser.h" 6 #include <omp.h> // OpenMP support 6 7 7 8 class XmlPatch
Note:
See TracChangeset
for help on using the changeset viewer.