summaryrefslogtreecommitdiffstats
path: root/src/uscxml/plugins/datamodel/ecmascript/v8
diff options
context:
space:
mode:
Diffstat (limited to 'src/uscxml/plugins/datamodel/ecmascript/v8')
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp12
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h10
2 files changed, 14 insertions, 8 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
index bfa29d8..3ccadcd 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
+++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
@@ -33,17 +33,17 @@
#include "uscxml/util/DOM.h"
#include <easylogging++.h>
-using namespace xercesc;
+using namespace XERCESC_NS;
static v8::Local<v8::Value> XMLString2JS(const XMLCh* input) {
- char* res = xercesc::XMLString::transcode(input);
+ char* res = XERCESC_NS::XMLString::transcode(input);
v8::Local<v8::Value> handle = v8::String::New(res);
return handle;
}
static XMLCh* JS2XMLString(const v8::Local<v8::Value>& value) {
v8::String::AsciiValue s(value);
- XMLCh* ret = xercesc::XMLString::transcode(*s);
+ XMLCh* ret = XERCESC_NS::XMLString::transcode(*s);
return(ret);
}
@@ -137,11 +137,11 @@ std::mutex V8DataModel::_initMutex;
v8::Isolate* V8DataModel::_isolate = NULL;
void V8NodeListIndexedPropertyHandler(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) {
- xercesc::DOMNodeList* list;
+ XERCESC_NS::DOMNodeList* list;
SWIG_V8_GetInstancePtr(info.Holder(), (void**)&list);
if (list->getLength() >= index) {
- xercesc::DOMNode* node = list->item(index);
+ XERCESC_NS::DOMNode* node = list->item(index);
v8::Handle<v8::Value> val = SWIG_NewPointerObj(SWIG_as_voidptr(node), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&node)), 0 | 0 );
info.GetReturnValue().Set(val);
@@ -528,7 +528,7 @@ Data V8DataModel::getValueAsData(const v8::Local<v8::Value>& value, std::set<v8:
return data;
}
-v8::Local<v8::Value> V8DataModel::getNodeAsValue(const xercesc::DOMNode* node) {
+v8::Local<v8::Value> V8DataModel::getNodeAsValue(const XERCESC_NS::DOMNode* node) {
return SWIG_NewPointerObj(SWIG_as_voidptr(node),
SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,
SWIG_as_voidptrptr(&node)),
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h
index 29b2b58..91ac48d 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h
+++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h
@@ -20,7 +20,8 @@
#ifndef V8DATAMODEL_H_KN8TWG0V
#define V8DATAMODEL_H_KN8TWG0V
-#include "uscxml/plugins/DataModel.h"
+#include "uscxml/plugins/DataModelImpl.h"
+
#include <list>
#include <set>
#include <v8.h>
@@ -36,6 +37,11 @@ class Data;
namespace uscxml {
+/**
+ * @ingroup datamodel
+ * ECMAScript data-model via Google's V8.
+ */
+
class V8DataModel : public DataModelImpl {
public:
V8DataModel();
@@ -95,7 +101,7 @@ protected:
v8::Local<v8::Value> evalAsValue(const std::string& expr, bool dontThrow = false);
v8::Local<v8::Value> getDataAsValue(const Data& data);
Data getValueAsData(const v8::Local<v8::Value>& value);
- v8::Local<v8::Value> getNodeAsValue(const xercesc::DOMNode* node);
+ v8::Local<v8::Value> getNodeAsValue(const XERCESC_NS::DOMNode* node);
void throwExceptionEvent(const v8::TryCatch& tryCatch);
std::set<DataModelExtension*> _extensions;