diff options
author | Stefan Radomski <github@mintwerk.de> | 2017-01-30 14:30:55 (GMT) |
---|---|---|
committer | Stefan Radomski <github@mintwerk.de> | 2017-01-30 14:30:55 (GMT) |
commit | 7659ef059fa31c780f7c4e0fb028b9fb5b400030 (patch) | |
tree | 3a1705ae2e459e5a92cb1988ed160b5bde0d4e03 /src/uscxml/plugins | |
parent | aaec51ce3330a96f7a4f0f2ab0ca75f055223c67 (diff) | |
download | uscxml-7659ef059fa31c780f7c4e0fb028b9fb5b400030.zip uscxml-7659ef059fa31c780f7c4e0fb028b9fb5b400030.tar.gz uscxml-7659ef059fa31c780f7c4e0fb028b9fb5b400030.tar.bz2 |
Unified DOM traversal and removed iostreams
Diffstat (limited to 'src/uscxml/plugins')
5 files changed, 25 insertions, 25 deletions
diff --git a/src/uscxml/plugins/Factory.cpp b/src/uscxml/plugins/Factory.cpp index 0b9104e..5b767b6 100644 --- a/src/uscxml/plugins/Factory.cpp +++ b/src/uscxml/plugins/Factory.cpp @@ -37,7 +37,6 @@ #include <xercesc/util/PlatformUtils.hpp> #include "uscxml/util/DOM.h" -#include <iostream> // see http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system @@ -246,19 +245,19 @@ while(iter != name.end()) { \ std::list<std::string> names = iter->second->getNames(); \ std::list<std::string>::iterator nameIter = names.begin(); \ if (nameIter != names.end()) { \ - std::cout << "\t" << *nameIter; \ + LOGD(USCXML_VERBATIM) << "\t" << *nameIter; \ nameIter++; \ std::string seperator = ""; \ if (nameIter != names.end()) { \ - std::cout << "\t("; \ + LOGD(USCXML_VERBATIM) << "\t("; \ while(nameIter != names.end()) { \ - std::cout << seperator << *nameIter; \ + LOGD(USCXML_VERBATIM) << seperator << *nameIter; \ seperator = ", "; \ nameIter++; \ } \ - std::cout << ")"; \ + LOGD(USCXML_VERBATIM) << ")"; \ } \ - std::cout << std::endl; \ + LOGD(USCXML_VERBATIM) << "\n"; \ } \ iter++; \ } @@ -266,28 +265,28 @@ while(iter != name.end()) { \ void Factory::listComponents() { { - std::cout << "Available Datamodels:" << std::endl; + LOGD(USCXML_VERBATIM) << "Available Datamodels:" << std::endl; LIST_COMPONENTS(DataModelImpl, _dataModels); - std::cout << std::endl; + LOGD(USCXML_VERBATIM) << "\n"; } { - std::cout << "Available Invokers:" << std::endl; + LOGD(USCXML_VERBATIM) << "Available Invokers:" << std::endl; LIST_COMPONENTS(InvokerImpl, _invokers); - std::cout << std::endl; + LOGD(USCXML_VERBATIM) << "\n"; } { - std::cout << "Available I/O Processors:" << std::endl; + LOGD(USCXML_VERBATIM) << "Available I/O Processors:" << std::endl; LIST_COMPONENTS(IOProcessorImpl, _ioProcessors); - std::cout << std::endl; + LOGD(USCXML_VERBATIM) << "\n"; } { - std::cout << "Available Elements:" << std::endl; + LOGD(USCXML_VERBATIM) << "Available Elements:" << std::endl; std::map<std::pair<std::string, std::string>, ExecutableContentImpl*>::iterator iter = _executableContent.begin(); while(iter != _executableContent.end()) { - std::cout << "\t" << iter->second->getNamespace() << " / " << iter->second->getLocalName() << std::endl; + LOGD(USCXML_VERBATIM) << "\t" << iter->second->getNamespace() << " / " << iter->second->getLocalName() << std::endl; iter++; } - std::cout << std::endl; + LOGD(USCXML_VERBATIM) << "\n"; } } diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp index 66bf45a..2a1ebab 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp @@ -769,7 +769,7 @@ JSValueRef JSCDataModel::jsPrint(JSContextRef ctx, JSObjectRef function, JSObjec std::string msg(buffer); free(buffer); - std::cout << msg; + INSTANCE->_callbacks->getLogger().log(USCXML_LOG) << msg; } } return JSValueMakeUndefined(ctx); diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp index 84cfa81..9eaa8c5 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp @@ -624,7 +624,9 @@ v8::Local<v8::Value> V8DataModel::getDataAsValue(const Data& data) { void V8DataModel::jsPrint(const v8::FunctionCallbackInfo<v8::Value>& info) { if (info.Length() > 0) { v8::String::AsciiValue printMsg(info[0]->ToString()); - std::cout << *printMsg; + v8::Local<v8::External> field = v8::Local<v8::External>::Cast(info.Data()); + V8DataModel* dataModel = (V8DataModel*)field->Value(); + dataModel->_callbacks->getLogger().log(USCXML_LOG) << *printMsg; } } diff --git a/src/uscxml/plugins/datamodel/promela/PromelaParser.cpp b/src/uscxml/plugins/datamodel/promela/PromelaParser.cpp index 44f8bdd..e2b8819 100644 --- a/src/uscxml/plugins/datamodel/promela/PromelaParser.cpp +++ b/src/uscxml/plugins/datamodel/promela/PromelaParser.cpp @@ -20,8 +20,8 @@ #include "PromelaParser.h" #include "parser/promela.tab.hpp" #include "uscxml/messages/Event.h" +#include "uscxml/interpreter/Logging.h" -#include <iostream> #include <string.h> // memcpy struct yy_buffer_state; @@ -169,13 +169,13 @@ PromelaParserNode* PromelaParser::value(int type, void* location, const char* va void PromelaParser::dump() { switch (type) { case PROMELA_EXPR: - std::cout << "Promela Expression" << std::endl; + LOGD(USCXML_VERBATIM) << "Promela Expression" << std::endl; break; case PROMELA_DECL: - std::cout << "Promela Declarations" << std::endl; + LOGD(USCXML_VERBATIM) << "Promela Declarations" << std::endl; break; case PROMELA_STMNT: - std::cout << "Promela Statement" << std::endl; + LOGD(USCXML_VERBATIM) << "Promela Statement" << std::endl; break; } ast->dump(); @@ -201,11 +201,11 @@ void PromelaParserNode::dump(size_t indent) { for (size_t i = 0; i < indent; i++) { padding += " "; } - std::cout << padding << typeToDesc(type) << ": " << value; + LOGD(USCXML_VERBATIM) << padding << typeToDesc(type) << ": " << value; if (loc != NULL) { - std::cout << " (" << loc->firstLine << ":" << loc->firstCol << ")-(" << loc->lastLine << ":" << loc->lastCol << ")"; + LOGD(USCXML_VERBATIM) << " (" << loc->firstLine << ":" << loc->firstCol << ")-(" << loc->lastLine << ":" << loc->lastCol << ")"; } - std::cout << std::endl; + LOGD(USCXML_VERBATIM) << "\n"; for (std::list<PromelaParserNode*>::iterator iter = operands.begin(); iter != operands.end(); iter++) { (*iter)->dump(indent + 1); diff --git a/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp index cc0c9d4..2f8f0aa 100644 --- a/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp +++ b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp @@ -23,7 +23,6 @@ #include "uscxml/messages/Event.h" #include "uscxml/util/DOM.h" -#include <iostream> #include <event2/dns.h> #include <event2/buffer.h> #include <event2/keyvalq_struct.h> |