diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-01-21 23:47:54 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-01-21 23:47:54 (GMT) |
commit | 3be96d1aa3024c1acc129e587f5d3165c9434e48 (patch) | |
tree | fae65a932b899ed9424a5a76b9b98562d979fe40 /src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCharacterData.cpp | |
parent | 3bda299c6d2efce71d76b44dea8e732a073304f3 (diff) | |
download | uscxml-3be96d1aa3024c1acc129e587f5d3165c9434e48.zip uscxml-3be96d1aa3024c1acc129e587f5d3165c9434e48.tar.gz uscxml-3be96d1aa3024c1acc129e587f5d3165c9434e48.tar.bz2 |
See detailed commitlog
- Started DirectoryMonitor invoker
- Refactored Invoker / IOProcessor interface
- Started with JavaScriptCore bindings
- Embedding applications can now use setParentQueue to receive events
sent to #_parent
Diffstat (limited to 'src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCharacterData.cpp')
-rw-r--r-- | src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCharacterData.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCharacterData.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCharacterData.cpp new file mode 100644 index 0000000..5108625 --- /dev/null +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCharacterData.cpp @@ -0,0 +1,40 @@ +#include "JSCCharacterData.h" +#include "JSCNode.h" + +namespace Arabica { +namespace DOM { + + +JSStaticValue JSCCharacterData::staticValues[] = { + { "data", dataAttrGetter, dataAttrSetter, kJSPropertyAttributeDontDelete }, + { "length", lengthAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, + + { 0, 0, 0, 0 } +}; + +JSStaticFunction JSCCharacterData::staticFunctions[] = { + { "substringData", substringDataCallback, kJSPropertyAttributeDontDelete }, + { "appendData", appendDataCallback, kJSPropertyAttributeDontDelete }, + { "insertData", insertDataCallback, kJSPropertyAttributeDontDelete }, + { "deleteData", deleteDataCallback, kJSPropertyAttributeDontDelete }, + { "replaceData", replaceDataCallback, kJSPropertyAttributeDontDelete }, + { 0, 0, 0 } +}; + +JSValueRef JSCCharacterData::dataAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception) { + struct JSCCharacterDataPrivate* privData = static_cast<JSCCharacterData::JSCCharacterDataPrivate* >(JSObjectGetPrivate(thisObj)); + JSStringRef retString = JSStringCreateWithUTF8CString(privData->arabicaThis->getData().c_str()); + JSValueRef retObj = JSValueMakeString(ctx, retString); + JSStringRelease(retString); + return retObj; + +} + +JSValueRef JSCCharacterData::lengthAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception) { + struct JSCCharacterDataPrivate* privData = static_cast<JSCCharacterData::JSCCharacterDataPrivate* >(JSObjectGetPrivate(thisObj)); + + return JSValueMakeNumber(ctx, privData->arabicaThis->getLength()); +} + +} +} |