diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-11-03 16:21:13 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-11-03 16:21:13 (GMT) |
commit | cb30bd1f44fcc3a0642a362afd4eaea0d8a7d199 (patch) | |
tree | 8cfcf2ceca801c5d506e03d0e187f440094d1674 /src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.cpp | |
parent | 9caf9ade8ff87a1cb94fb612df4abd96fb5ed239 (diff) | |
download | uscxml-cb30bd1f44fcc3a0642a362afd4eaea0d8a7d199.zip uscxml-cb30bd1f44fcc3a0642a362afd4eaea0d8a7d199.tar.gz uscxml-cb30bd1f44fcc3a0642a362afd4eaea0d8a7d199.tar.bz2 |
First signs of WebSockets and some changes to miles
Diffstat (limited to 'src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.cpp')
-rw-r--r-- | src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.cpp index 8eccc66..1328b19 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.cpp @@ -76,6 +76,36 @@ void V8ArrayBuffer::mimeTypeAttrSetter(v8::Local<v8::String> property, v8::Local privData->nativeObj->setMimeType(*localMimeType); } +v8::Handle<v8::Value> V8ArrayBuffer::md5Callback(const v8::Arguments& args) { + + v8::Local<v8::Object> self = args.Holder(); + struct V8ArrayBufferPrivate* privData = V8DOM::toClassPtr<V8ArrayBufferPrivate >(self->GetInternalField(0)); + if (false) { + } else if (args.Length() == 0) { + + std::string retVal = privData->nativeObj->md5(); + + return v8::String::New(retVal.c_str()); + } + throw V8Exception("Parameter mismatch while calling md5"); + return v8::Undefined(); +} + +v8::Handle<v8::Value> V8ArrayBuffer::base64Callback(const v8::Arguments& args) { + + v8::Local<v8::Object> self = args.Holder(); + struct V8ArrayBufferPrivate* privData = V8DOM::toClassPtr<V8ArrayBufferPrivate >(self->GetInternalField(0)); + if (false) { + } else if (args.Length() == 0) { + + std::string retVal = privData->nativeObj->base64(); + + return v8::String::New(retVal.c_str()); + } + throw V8Exception("Parameter mismatch while calling base64"); + return v8::Undefined(); +} + v8::Handle<v8::Value> V8ArrayBuffer::sliceCallback(const v8::Arguments& args) { v8::Local<v8::Object> self = args.Holder(); |