diff options
Diffstat (limited to 'src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNotation.cpp')
-rw-r--r-- | src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNotation.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNotation.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNotation.cpp new file mode 100644 index 0000000..04bb8ec --- /dev/null +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNotation.cpp @@ -0,0 +1,38 @@ +#include "JSCNode.h" +#include "JSCNotation.h" + +namespace Arabica { +namespace DOM { + + +JSStaticValue JSCNotation::staticValues[] = { + { "publicId", publicIdAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, + { "systemId", systemIdAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, + + { 0, 0, 0, 0 } +}; + +JSStaticFunction JSCNotation::staticFunctions[] = { + { 0, 0, 0 } +}; + +JSValueRef JSCNotation::publicIdAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception) { + struct JSCNotationPrivate* privData = static_cast<JSCNotation::JSCNotationPrivate* >(JSObjectGetPrivate(thisObj)); + JSStringRef retString = JSStringCreateWithUTF8CString(privData->arabicaThis->getPublicId().c_str()); + JSValueRef retObj = JSValueMakeString(ctx, retString); + JSStringRelease(retString); + return retObj; + +} + +JSValueRef JSCNotation::systemIdAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception) { + struct JSCNotationPrivate* privData = static_cast<JSCNotation::JSCNotationPrivate* >(JSObjectGetPrivate(thisObj)); + JSStringRef retString = JSStringCreateWithUTF8CString(privData->arabicaThis->getSystemId().c_str()); + JSValueRef retObj = JSValueMakeString(ctx, retString); + JSStringRelease(retString); + return retObj; + +} + +} +} |