diff options
Diffstat (limited to 'src/uscxml/messages')
-rw-r--r-- | src/uscxml/messages/Data.cpp | 4 | ||||
-rw-r--r-- | src/uscxml/messages/Event.h | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/uscxml/messages/Data.cpp b/src/uscxml/messages/Data.cpp index 089de96..a75e774 100644 --- a/src/uscxml/messages/Data.cpp +++ b/src/uscxml/messages/Data.cpp @@ -24,7 +24,7 @@ #include "uscxml/util/DOM.h" -#include "easylogging++.h" +#include "uscxml/interpreter/Logging.h" #ifdef HAS_STRING_H #include <string.h> @@ -290,4 +290,4 @@ std::string Data::toJSON(const Data& data) { return os.str(); } -}
\ No newline at end of file +} diff --git a/src/uscxml/messages/Event.h b/src/uscxml/messages/Event.h index 8b7bb91..2edbd3e 100644 --- a/src/uscxml/messages/Event.h +++ b/src/uscxml/messages/Event.h @@ -90,7 +90,7 @@ public: }; Event() : eventType(INTERNAL), hideSendId(false), uuid(UUID::getUUID()) {} - Event(const std::string& name, Type type = INTERNAL) : name(name), eventType(type), hideSendId(false) {} + explicit Event(const std::string& name, Type type = INTERNAL) : name(name), eventType(type), hideSendId(false) {} bool operator< (const Event& other) const { return this < &other; } @@ -109,6 +109,12 @@ public: return name.size() > 0; } + operator std::string() { + std::stringstream ss; + ss << *this; + return ss.str(); + } + typedef std::multimap<std::string, Data> params_t; typedef std::map<std::string, Data> namelist_t; @@ -192,7 +198,7 @@ class USCXML_API ErrorEvent : public Event { public: ErrorEvent() : Event() {} ErrorEvent(const std::string& msg) : Event("error.platform") { - data.compound["msg"] = msg; + data.compound["msg"] = Data(msg, Data::VERBATIM); } }; |