diff options
author | Stefan Radomski <github@mintwerk.de> | 2016-05-12 13:12:33 (GMT) |
---|---|---|
committer | Stefan Radomski <github@mintwerk.de> | 2016-05-12 13:12:33 (GMT) |
commit | b62e7979600feee23dc7cdb61042a8fc7673122b (patch) | |
tree | f7351372f37979dd2d048e0b68a16a4cd3b2aadb /src/uscxml/plugins | |
parent | 1b11b310be61e51b3ac5ebb83f7c8a33aef3d6e8 (diff) | |
download | uscxml-b62e7979600feee23dc7cdb61042a8fc7673122b.zip uscxml-b62e7979600feee23dc7cdb61042a8fc7673122b.tar.gz uscxml-b62e7979600feee23dc7cdb61042a8fc7673122b.tar.bz2 |
Major Refactoring v2.0
Diffstat (limited to 'src/uscxml/plugins')
298 files changed, 30978 insertions, 52618 deletions
diff --git a/src/uscxml/plugins/DataModel.h b/src/uscxml/plugins/DataModel.h index 5cbd0c8..b08f934 100644 --- a/src/uscxml/plugins/DataModel.h +++ b/src/uscxml/plugins/DataModel.h @@ -20,10 +20,9 @@ #ifndef DATAMODEL_H_F1F776F9 #define DATAMODEL_H_F1F776F9 -#include "uscxml/config.h" #include "uscxml/Common.h" -#include "uscxml/InterpreterInfo.h" -#include "uscxml/plugins/EventHandler.h" +#include "uscxml/plugins/Invoker.h" +#include "uscxml/plugins/IOProcessor.h" #ifndef TIME_BLOCK # ifdef BUILD_PROFILING @@ -35,17 +34,27 @@ #endif #include <list> -#include <boost/shared_ptr.hpp> #include <string> +#include <memory> #include <sstream> -#include "DOM/Document.hpp" +#include <xercesc/dom/DOM.hpp> namespace uscxml { class InterpreterImpl; class DataModelImpl; +class USCXML_API DataModelCallbacks { +public: + virtual const std::string& getName() = 0; + virtual const std::string& getSessionId() = 0; + virtual const std::map<std::string, IOProcessor>& getIOProcessors() = 0; + virtual bool isInState(const std::string& stateId) = 0; + virtual xercesc::DOMDocument* getDocument() const = 0; + virtual const std::map<std::string, Invoker>& getInvokers() = 0; +}; + class USCXML_API DataModelExtension { public: DataModelExtension() : dm(NULL) {} @@ -59,16 +68,13 @@ public: class USCXML_API DataModelImpl { public: virtual ~DataModelImpl() {} - virtual boost::shared_ptr<DataModelImpl> create(InterpreterInfo* interpreter) = 0; + virtual std::shared_ptr<DataModelImpl> create(DataModelCallbacks* interpreter) = 0; virtual std::list<std::string> getNames() = 0; - virtual bool validate(const std::string& location, const std::string& schema) = 0; - virtual bool isLocation(const std::string& expr) = 0; virtual bool isValidSyntax(const std::string& expr) { return true; // overwrite when datamodel supports it } virtual void setEvent(const Event& event) = 0; - virtual Data getStringAsData(const std::string& content) = 0; size_t replaceExpressions(std::string& content); @@ -78,19 +84,10 @@ public: const std::string& array, const std::string& index, uint32_t iteration) = 0; - virtual void pushContext() = 0; - virtual void popContext() = 0; - - virtual void eval(const Arabica::DOM::Element<std::string>& scriptElem, - const std::string& expr) = 0; - virtual std::string evalAsString(const std::string& expr) = 0; - - virtual bool evalAsBool(const Arabica::DOM::Element<std::string>& scriptNode, - const std::string& expr) = 0; - virtual bool evalAsBool(const std::string& expr) { - return evalAsBool(Arabica::DOM::Element<std::string>(), expr); - } + virtual Data getAsData(const std::string& content) = 0; + virtual Data evalAsData(const std::string& content) = 0; + virtual bool evalAsBool(const std::string& expr) = 0; virtual bool isDeclared(const std::string& expr) = 0; @@ -107,18 +104,11 @@ public: * <data id="Var1" expr="return"/> * */ - virtual void assign(const Arabica::DOM::Element<std::string>& assignElem, - const Arabica::DOM::Node<std::string>& node, - const std::string& content) = 0; virtual void assign(const std::string& location, const Data& data) = 0; - - virtual void init(const Arabica::DOM::Element<std::string>& dataElem, - const Arabica::DOM::Node<std::string>& node, - const std::string& content) = 0; virtual void init(const std::string& location, const Data& data) = 0; - virtual void setInterpreter(InterpreterInfo* interpreter) { - _interpreter = interpreter; + virtual void setCallbacks(DataModelCallbacks* callbacks) { + _callbacks = callbacks; } virtual void addExtension(DataModelExtension* ext); @@ -127,14 +117,14 @@ public: } protected: - InterpreterInfo* _interpreter; + DataModelCallbacks* _callbacks; }; class USCXML_API DataModel { public: DataModel() : _impl() {} - DataModel(const boost::shared_ptr<DataModelImpl> impl) : _impl(impl) { } + DataModel(const std::shared_ptr<DataModelImpl> impl) : _impl(impl) { } DataModel(const DataModel& other) : _impl(other._impl) { } virtual ~DataModel() {}; @@ -160,14 +150,6 @@ public: return _impl->getNames(); } - virtual bool validate(const std::string& location, const std::string& schema) { - TIME_BLOCK - return _impl->validate(location, schema); - } - virtual bool isLocation(const std::string& expr) { - TIME_BLOCK - return _impl->isLocation(expr); - } virtual bool isValidSyntax(const std::string& expr) { TIME_BLOCK return _impl->isValidSyntax(expr); @@ -177,38 +159,19 @@ public: TIME_BLOCK return _impl->setEvent(event); } - virtual Data getStringAsData(const std::string& content) { + virtual Data getAsData(const std::string& content) { TIME_BLOCK - return _impl->getStringAsData(content); + return _impl->getAsData(content); } - - virtual void pushContext() { + virtual Data evalAsData(const std::string& content) { TIME_BLOCK - return _impl->pushContext(); - } - virtual void popContext() { - TIME_BLOCK - return _impl->popContext(); + return _impl->evalAsData(content); } - virtual void eval(const Arabica::DOM::Element<std::string>& scriptElem, - const std::string& expr) { - TIME_BLOCK - return _impl->eval(scriptElem, expr); - } - virtual std::string evalAsString(const std::string& expr) { - TIME_BLOCK - return _impl->evalAsString(expr); - } virtual bool evalAsBool(const std::string& expr) { TIME_BLOCK return _impl->evalAsBool(expr); } - virtual bool evalAsBool(const Arabica::DOM::Element<std::string>& scriptNode, - const std::string& expr) { - TIME_BLOCK - return _impl->evalAsBool(scriptNode, expr); - } virtual uint32_t getLength(const std::string& expr) { TIME_BLOCK @@ -222,23 +185,11 @@ public: return _impl->setForeach(item, array, index, iteration); } - virtual void assign(const Arabica::DOM::Element<std::string>& assignElem, - const Arabica::DOM::Node<std::string>& node, - const std::string& content) { - TIME_BLOCK - return _impl->assign(assignElem, node, content); - } virtual void assign(const std::string& location, const Data& data) { TIME_BLOCK return _impl->assign(location, data); } - virtual void init(const Arabica::DOM::Element<std::string>& dataElem, - const Arabica::DOM::Node<std::string>& node, - const std::string& content) { - TIME_BLOCK - return _impl->init(dataElem, node, content); - } virtual void init(const std::string& location, const Data& data) { TIME_BLOCK return _impl->init(location, data); @@ -259,9 +210,9 @@ public: return _impl->andExpressions(expressions); } - virtual void setInterpreter(InterpreterInfo* interpreter) { + virtual void setCallbacks(DataModelCallbacks* callbacks) { TIME_BLOCK - _impl->setInterpreter(interpreter); + _impl->setCallbacks(callbacks); } virtual void addExtension(DataModelExtension* ext) { @@ -274,7 +225,7 @@ public: #endif protected: - boost::shared_ptr<DataModelImpl> _impl; + std::shared_ptr<DataModelImpl> _impl; }; diff --git a/src/uscxml/plugins/EventHandler.h b/src/uscxml/plugins/EventHandler.h index 91703fc..401afec 100644 --- a/src/uscxml/plugins/EventHandler.h +++ b/src/uscxml/plugins/EventHandler.h @@ -21,14 +21,15 @@ #define EVENTHANDLER_H_2801243E #include "uscxml/Common.h" +#include "uscxml/messages/Data.h" +#include "uscxml/messages/Event.h" #include <list> -#include <boost/shared_ptr.hpp> #include <string> +#include <memory> #include <sstream> -#include "DOM/Document.hpp" -#include "uscxml/messages/SendRequest.h" +#include <xercesc/dom/DOM.hpp> namespace uscxml { @@ -36,54 +37,19 @@ class InterpreterImpl; class USCXML_API EventHandlerImpl { public: + EventHandlerImpl() {} virtual ~EventHandlerImpl() {} virtual std::list<std::string> getNames() = 0; - - virtual void setInterpreter(InterpreterImpl* interpreter) { - _interpreter = interpreter; - } - void setInvokeId(const std::string& invokeId) { - _invokeId = invokeId; - } - void setType(const std::string& type) { - _type = type; - } - std::string getType() { - return _type; - } - - void setElement(const Arabica::DOM::Element<std::string>& element) { - _element = element; - } - - Arabica::DOM::Element<std::string> getElement() { - return _element; - } - virtual Data getDataModelVariables() = 0; - virtual void send(const SendRequest& req) = 0; - - virtual void runOnMainThread() {}; - void returnErrorExecution(const std::string&); - void returnErrorCommunication(const std::string&); - void returnEvent(Event& event, bool internal = false); protected: InterpreterImpl* _interpreter; - Arabica::DOM::Element<std::string> _element; - std::string _invokeId; - std::string _type; - - }; class USCXML_API EventHandler { public: - EventHandler() : _impl() {} - EventHandler(boost::shared_ptr<EventHandlerImpl> const impl) : _impl(impl) { } - EventHandler(const EventHandler& other) : _impl(other._impl) { } - virtual ~EventHandler() {}; + PIMPL_OPERATORS(EventHandler); virtual std::list<std::string> getNames() { return _impl->getNames(); @@ -92,37 +58,9 @@ public: virtual Data getDataModelVariables() const { return _impl->getDataModelVariables(); }; - virtual void send(const SendRequest& req) { - return _impl->send(req); - }; - virtual void runOnMainThread() { - return _impl->runOnMainThread(); - } - - void setInterpreter(InterpreterImpl* interpreter) { - _impl->setInterpreter(interpreter); - } - void setInvokeId(const std::string& invokeId) { - _impl->setInvokeId(invokeId); - } - - void setType(const std::string& type) { - _impl->setType(type); - } - std::string getType() { - return _impl->getType(); - } - - void setElement(const Arabica::DOM::Element<std::string>& element) { - _impl->setElement(element); - } - - Arabica::DOM::Element<std::string> getElement() { - return _impl->getElement(); - } protected: - boost::shared_ptr<EventHandlerImpl> _impl; + std::shared_ptr<EventHandlerImpl> _impl; friend class InterpreterImpl; }; diff --git a/src/uscxml/plugins/ExecutableContent.h b/src/uscxml/plugins/ExecutableContent.h index 6df197c..0190820 100644 --- a/src/uscxml/plugins/ExecutableContent.h +++ b/src/uscxml/plugins/ExecutableContent.h @@ -21,10 +21,10 @@ #define EXECUTABLECONTENT_H_1E028A2D #include "uscxml/Common.h" -#include <boost/shared_ptr.hpp> #include <string> +#include <memory> #include <sstream> -#include "DOM/Document.hpp" +#include "xercesc/dom/DOM.hpp" namespace uscxml { @@ -34,7 +34,7 @@ class USCXML_API ExecutableContentImpl { public: ExecutableContentImpl() {}; virtual ~ExecutableContentImpl() {}; - virtual boost::shared_ptr<ExecutableContentImpl> create(InterpreterImpl* interpreter) = 0; + virtual std::shared_ptr<ExecutableContentImpl> create(InterpreterImpl* interpreter) = 0; virtual void setInterpreter(InterpreterImpl* interpreter) { _interpreter = interpreter; @@ -44,8 +44,8 @@ public: virtual std::string getNamespace() { return "http://www.w3.org/2005/07/scxml"; ///< The namespace of the element. } - virtual void enterElement(const Arabica::DOM::Element<std::string>& node) = 0; ///< Invoked when entering the element as part of evaluating executable content. - virtual void exitElement(const Arabica::DOM::Element<std::string>& node) = 0; ///< Invoked when exiting the element as part of evaluating executable content. + virtual void enterElement(xercesc::DOMElement* node) = 0; ///< Invoked when entering the element as part of evaluating executable content. + virtual void exitElement(xercesc::DOMElement* node) = 0; ///< Invoked when exiting the element as part of evaluating executable content. virtual bool processChildren() = 0; ///< Whether or not the interpreter should process this elements children. protected: @@ -55,7 +55,7 @@ protected: class USCXML_API ExecutableContent { public: ExecutableContent() : _impl() {} - ExecutableContent(boost::shared_ptr<ExecutableContentImpl> const impl) : _impl(impl) { } + ExecutableContent(std::shared_ptr<ExecutableContentImpl> const impl) : _impl(impl) { } ExecutableContent(const ExecutableContent& other) : _impl(other._impl) { } virtual ~ExecutableContent() {}; @@ -86,17 +86,17 @@ public: std::string getNamespace() { return _impl->getNamespace(); } - void enterElement(const Arabica::DOM::Element<std::string>& node) { + void enterElement(xercesc::DOMElement* node) { return _impl->enterElement(node); } - void exitElement(const Arabica::DOM::Element<std::string>& node) { + void exitElement(xercesc::DOMElement* node) { return _impl->exitElement(node); } bool processChildren() { return _impl->processChildren(); } protected: - boost::shared_ptr<ExecutableContentImpl> _impl; + std::shared_ptr<ExecutableContentImpl> _impl; }; diff --git a/src/uscxml/plugins/Factory.cpp b/src/uscxml/plugins/Factory.cpp new file mode 100644 index 0000000..7c68a30 --- /dev/null +++ b/src/uscxml/plugins/Factory.cpp @@ -0,0 +1,476 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @copyright Simplified BSD + * + * @cond + * This program is free software: you can redistribute it and/or modify + * it under the terms of the FreeBSD license as published by the FreeBSD + * project. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the FreeBSD license along with this + * program. If not, see <http://www.opensource.org/licenses/bsd-license>. + * @endcond + */ + +#include "uscxml/config.h" + +#include "uscxml/plugins/Factory.h" +#include "uscxml/messages/Data.h" +#include "uscxml/Interpreter.h" +#include <easylogging++.h> + +// see http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system + +// we will always include these in a build +#include "uscxml/plugins/datamodel/null/NULLDataModel.h" +#include "uscxml/plugins/invoker/scxml/USCXMLInvoker.h" +#include "uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.h" +#include "uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h" + +# ifdef V8_FOUND +# include "uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h" +# endif + +# ifdef JSC_FOUND +# include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h" +# endif + +# ifdef LUA_FOUND +# include "uscxml/plugins/datamodel/lua/LuaDataModel.h" +# endif + + +namespace uscxml { + +Factory::Factory(Factory* parentFactory) : _parentFactory(parentFactory) { +} + +Factory::Factory(const std::string& pluginPath, Factory* parentFactory) : _parentFactory(parentFactory), _pluginPath(pluginPath) { + registerPlugins(); +} + +Factory::Factory(const std::string& pluginPath) : _parentFactory(NULL), _pluginPath(pluginPath) { + registerPlugins(); +} + +void Factory::setDefaultPluginPath(const std::string& path) { + _defaultPluginPath = path; +} +std::string Factory::getDefaultPluginPath() { + return _defaultPluginPath; +} + +void Factory::registerPlugins() { + + { + USCXMLInvoker* invoker = new USCXMLInvoker(); + registerInvoker(invoker); + } + + { + SCXMLIOProcessor* ioProcessor = new SCXMLIOProcessor(); + registerIOProcessor(ioProcessor); + } + + { + BasicHTTPIOProcessor* ioProcessor = new BasicHTTPIOProcessor(); + registerIOProcessor(ioProcessor); + } + + { + NULLDataModel* dataModel = new NULLDataModel(); + registerDataModel(dataModel); + } + +#ifdef V8_FOUND + { + V8DataModel* dataModel = new V8DataModel(); + registerDataModel(dataModel); + } +#endif + +#ifdef JSC_FOUND + { + JSCDataModel* dataModel = new JSCDataModel(); + registerDataModel(dataModel); + } +#endif + +#ifdef LUA_FOUND + { + LuaDataModel* dataModel = new LuaDataModel(); + registerDataModel(dataModel); + } +#endif + + +} + +Factory::~Factory() { +#ifdef BUILD_AS_PLUGINS + pluma.unloadAll(); +#endif +} + +#define LIST_COMPONENTS(type, name) \ +std::map<std::string, type*>::iterator iter = name.begin(); \ +while(iter != name.end()) { \ + std::list<std::string> names = iter->second->getNames(); \ + std::list<std::string>::iterator nameIter = names.begin(); \ + if (nameIter != names.end()) { \ + std::cout << "\t" << *nameIter; \ + nameIter++; \ + std::string seperator = ""; \ + if (nameIter != names.end()) { \ + std::cout << "\t("; \ + while(nameIter != names.end()) { \ + std::cout << seperator << *nameIter; \ + seperator = ", "; \ + nameIter++; \ + } \ + std::cout << ")"; \ + } \ + std::cout << std::endl; \ + } \ + iter++; \ +} + + +void Factory::listComponents() { + { + std::cout << "Available Datamodels:" << std::endl; + LIST_COMPONENTS(DataModelImpl, _dataModels); + std::cout << std::endl; + } + { + std::cout << "Available Invokers:" << std::endl; + LIST_COMPONENTS(InvokerImpl, _invokers); + std::cout << std::endl; + } + { + std::cout << "Available I/O Processors:" << std::endl; + LIST_COMPONENTS(IOProcessorImpl, _ioProcessors); + std::cout << std::endl; + } + { + std::cout << "Available Elements:" << std::endl; + std::map<std::pair<std::string, std::string>, ExecutableContentImpl*>::iterator iter = _executableContent.begin(); + while(iter != _executableContent.end()) { + std::cout << "\t" << iter->second->getNamespace() << " / " << iter->second->getLocalName() << std::endl; + iter++; + } + std::cout << std::endl; + } +} + +void Factory::registerIOProcessor(IOProcessorImpl* ioProcessor) { + std::list<std::string> names = ioProcessor->getNames(); + std::list<std::string>::iterator nameIter = names.begin(); + if (nameIter != names.end()) { + std::string canonicalName = *nameIter; + _ioProcessors[canonicalName] = ioProcessor; + while(nameIter != names.end()) { + _ioProcessorAliases[*nameIter] = canonicalName; + nameIter++; + } + } +} + +void Factory::registerDataModel(DataModelImpl* dataModel) { + std::list<std::string> names = dataModel->getNames(); + std::list<std::string>::iterator nameIter = names.begin(); + if (nameIter != names.end()) { + std::string canonicalName = *nameIter; + _dataModels[canonicalName] = dataModel; + while(nameIter != names.end()) { + _dataModelAliases[*nameIter] = canonicalName; + nameIter++; + } + } +} + +void Factory::registerInvoker(InvokerImpl* invoker) { + std::list<std::string> names = invoker->getNames(); + std::list<std::string>::iterator nameIter = names.begin(); + if (nameIter != names.end()) { + std::string canonicalName = *nameIter; + _invokers[canonicalName] = invoker; + while(nameIter != names.end()) { + _invokerAliases[*nameIter] = canonicalName; + nameIter++; + } + } +} + +void Factory::registerExecutableContent(ExecutableContentImpl* executableContent) { + std::string localName = executableContent->getLocalName(); + std::string nameSpace = executableContent->getNamespace(); + _executableContent[std::make_pair(localName, nameSpace)] = executableContent; +} + +std::map<std::string, IOProcessorImpl*> Factory::getIOProcessors() { + std::map<std::string, IOProcessorImpl*> ioProcs; + if (_parentFactory) { + ioProcs = _parentFactory->getIOProcessors(); + } + + std::map<std::string, IOProcessorImpl*>::iterator ioProcIter = _ioProcessors.begin(); + while(ioProcIter != _ioProcessors.end()) { + ioProcs.insert(std::make_pair(ioProcIter->first, ioProcIter->second)); + ioProcIter++; + } + + return ioProcs; +} + +bool Factory::hasInvoker(const std::string& type) { + if (_invokerAliases.find(type) != _invokerAliases.end()) { + return true; + } else if(_parentFactory) { + return _parentFactory->hasInvoker(type); + } + return false; +} + +std::shared_ptr<InvokerImpl> Factory::createInvoker(const std::string& type, InterpreterImpl* interpreter) { + + // do we have this type ourself? + if (_invokerAliases.find(type) != _invokerAliases.end()) { + std::string canonicalName = _invokerAliases[type]; + if (_invokers.find(canonicalName) != _invokers.end()) { + std::shared_ptr<InvokerImpl> invoker = _invokers[canonicalName]->create(interpreter); + return invoker; + } + } + + // lookup in parent factory + if (_parentFactory) { + return _parentFactory->createInvoker(type, interpreter); + } else { + ERROR_EXECUTION_THROW("No Invoker named '" + type + "' known"); + } + + return std::shared_ptr<InvokerImpl>(); +} + + +bool Factory::hasDataModel(const std::string& type) { + if (_dataModelAliases.find(type) != _dataModelAliases.end()) { + return true; + } else if(_parentFactory) { + return _parentFactory->hasDataModel(type); + } + return false; +} + +std::shared_ptr<DataModelImpl> Factory::createDataModel(const std::string& type, DataModelCallbacks* callbacks) { + + // do we have this type ourself? + if (_dataModelAliases.find(type) != _dataModelAliases.end()) { + std::string canonicalName = _dataModelAliases[type]; + if (_dataModels.find(canonicalName) != _dataModels.end()) { + std::shared_ptr<DataModelImpl> dataModel = _dataModels[canonicalName]->create(callbacks); + dataModel->setCallbacks(callbacks); + return dataModel; + } + } + + // lookup in parent factory + if (_parentFactory) { + return _parentFactory->createDataModel(type, callbacks); + } else { + ERROR_EXECUTION_THROW("No Datamodel name '" + type + "' known"); + } + + return std::shared_ptr<DataModelImpl>(); +} + + +bool Factory::hasIOProcessor(const std::string& type) { + if (_ioProcessorAliases.find(type) != _ioProcessorAliases.end()) { + return true; + } else if(_parentFactory) { + return _parentFactory->hasIOProcessor(type); + } + return false; +} + +std::shared_ptr<IOProcessorImpl> Factory::createIOProcessor(const std::string& type, InterpreterImpl* interpreter) { + // do we have this type ourself? + if (_ioProcessorAliases.find(type) != _ioProcessorAliases.end()) { + std::string canonicalName = _ioProcessorAliases[type]; + if (_ioProcessors.find(canonicalName) != _ioProcessors.end()) { + std::shared_ptr<IOProcessorImpl> ioProc = _ioProcessors[canonicalName]->create(interpreter); +// ioProc->setInterpreter(interpreter); + return ioProc; + } + } + + // lookup in parent factory + if (_parentFactory) { + return _parentFactory->createIOProcessor(type, interpreter); + } else { + ERROR_EXECUTION_THROW("No IOProcessor named '" + type + "' known"); + } + + return std::shared_ptr<IOProcessorImpl>(); +} + +bool Factory::hasExecutableContent(const std::string& localName, const std::string& nameSpace) { + std::string actualNameSpace = (nameSpace.length() == 0 ? "http://www.w3.org/2005/07/scxml" : nameSpace); + if (_executableContent.find(std::make_pair(localName, actualNameSpace)) != _executableContent.end()) { + return true; + } else if(_parentFactory) { + return _parentFactory->hasExecutableContent(localName, nameSpace); + } + return false; +} + +std::shared_ptr<ExecutableContentImpl> Factory::createExecutableContent(const std::string& localName, const std::string& nameSpace, InterpreterImpl* interpreter) { + // do we have this type in this factory? + std::string actualNameSpace = (nameSpace.length() == 0 ? "http://www.w3.org/2005/07/scxml" : nameSpace); + if (_executableContent.find(std::make_pair(localName, actualNameSpace)) != _executableContent.end()) { + std::shared_ptr<ExecutableContentImpl> execContent = _executableContent[std::make_pair(localName, actualNameSpace)]->create(interpreter); + execContent->setInterpreter(interpreter); + return execContent; + } + + // lookup in parent factory + if (_parentFactory) { + return _parentFactory->createExecutableContent(localName, nameSpace, interpreter); + } else { + ERROR_EXECUTION_THROW("No Executable content name '" + localName + "' in namespace '" + actualNameSpace + "' known"); + } + + return std::shared_ptr<ExecutableContentImpl>(); + +} + +void DataModelImpl::addExtension(DataModelExtension* ext) { + ERROR_EXECUTION_THROW("DataModel does not support extensions"); +} + +size_t DataModelImpl::replaceExpressions(std::string& content) { + std::stringstream ss; + size_t replacements = 0; + size_t indent = 0; + size_t pos = 0; + size_t start = std::string::npos; + size_t end = 0; + while (true) { + // find any of ${} + pos = content.find_first_of("${}", pos); + if (pos == std::string::npos) { + ss << content.substr(end, content.length() - end); + break; + } + if (content[pos] == '$') { + if (content.size() > pos && content[pos+1] == '{') { + pos++; + start = pos + 1; + // copy everything in between + ss << content.substr(end, (start - 2) - end); + } + } else if (content[pos] == '{' && start != std::string::npos) { + indent++; + } else if (content[pos] == '}' && start != std::string::npos) { + if (!indent) { + end = pos; + // we found a token to substitute + std::string expr = content.substr(start, end - start); + end++; + try { + Data data = getAsData(expr); +// if (data.type == Data::VERBATIM) { +// ss << "\"" << data.atom << "\""; +// } else { +// ss << data.atom; +// } + if (data.atom.length() > 0) { + ss << data.atom; + } else { + ss << Data::toJSON(data); + } + replacements++; + } catch (Event e) { + // insert unsubstituted + start -= 2; + ss << content.substr(start, end - start); + } + start = std::string::npos; + } else { + indent--; + } + } + pos++; + } + if (replacements) + content = ss.str(); + + return replacements; +} + + +Factory* Factory::getInstance() { + if (_instance == NULL) { + _instance = new Factory(Factory::_defaultPluginPath); + } + return _instance; +} + +//void EventHandlerImpl::returnErrorExecution(const std::string& cause) { +// ERROR_EXECUTION(exc, cause); +// returnEvent(exc); +//} +// +//void EventHandlerImpl::returnErrorCommunication(const std::string& cause) { +// ERROR_COMMUNICATION(exc, cause); +// returnEvent(exc); +//} + +void IOProcessorImpl::eventToSCXML(Event& event, + const std::string& type, + const std::string& origin, + bool internal) { + if (event.eventType == 0) + event.eventType = (internal ? Event::INTERNAL : Event::EXTERNAL); + if (event.origin.length() == 0 && origin.length() > 0) + event.origin = origin; + if (event.origintype.length() == 0) + event.origintype = type; + + if (internal) { + _interpreter->enqueueInternal(event); + } else { + _interpreter->enqueueExternal(event); + } +} + +void InvokerImpl::eventToSCXML(Event& event, + const std::string& type, + const std::string& invokeId, + bool internal) { + if (event.invokeid.length() == 0) + event.invokeid = invokeId; + if (event.eventType == 0) + event.eventType = (internal ? Event::INTERNAL : Event::EXTERNAL); + if (event.origin.length() == 0 && invokeId.length() > 0) + event.origin = "#_" + invokeId; + if (event.origintype.length() == 0) + event.origintype = type; + + if (internal) { + _interpreter->enqueueInternal(event); + } else { + _interpreter->enqueueExternal(event); + } +} + +Factory* Factory::_instance = NULL; +std::string Factory::_defaultPluginPath; +}
\ No newline at end of file diff --git a/src/uscxml/plugins/Factory.h b/src/uscxml/plugins/Factory.h new file mode 100644 index 0000000..0ce2af9 --- /dev/null +++ b/src/uscxml/plugins/Factory.h @@ -0,0 +1,102 @@ +/** + * @file + * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @copyright Simplified BSD + * + * @cond + * This program is free software: you can redistribute it and/or modify + * it under the terms of the FreeBSD license as published by the FreeBSD + * project. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the FreeBSD license along with this + * program. If not, see <http://www.opensource.org/licenses/bsd-license>. + * @endcond + */ + +#ifndef FACTORY_H_5WKLGPRB +#define FACTORY_H_5WKLGPRB + +#include "uscxml/Common.h" + +#include "uscxml/plugins/ExecutableContent.h" +#include "uscxml/plugins/EventHandler.h" +#include "uscxml/plugins/IOProcessor.h" +#include "uscxml/plugins/Invoker.h" +#include "uscxml/plugins/DataModel.h" + +#include <string.h> + +#ifdef BUILD_AS_PLUGINS +#include "Pluma/Pluma.hpp" +#endif + +#include <string> +#include <memory> +#include <set> +#include <limits> + +namespace uscxml { + +class InterpreterImpl; + +class USCXML_API Factory { +public: + Factory(Factory* parentFactory); + Factory(const std::string& pluginPath, Factory* parentFactory); + + void registerIOProcessor(IOProcessorImpl* ioProcessor); + void registerDataModel(DataModelImpl* dataModel); + void registerInvoker(InvokerImpl* invoker); + void registerExecutableContent(ExecutableContentImpl* executableContent); + + std::shared_ptr<DataModelImpl> createDataModel(const std::string& type, DataModelCallbacks* callbacks); + std::shared_ptr<IOProcessorImpl> createIOProcessor(const std::string& type, InterpreterImpl* interpreter); + std::shared_ptr<InvokerImpl> createInvoker(const std::string& type, InterpreterImpl* interpreter); + std::shared_ptr<ExecutableContentImpl> createExecutableContent(const std::string& localName, const std::string& nameSpace, InterpreterImpl* interpreter); + + bool hasDataModel(const std::string& type); + bool hasIOProcessor(const std::string& type); + bool hasInvoker(const std::string& type); + bool hasExecutableContent(const std::string& localName, const std::string& nameSpace); + + std::map<std::string, IOProcessorImpl*> getIOProcessors(); + + void listComponents(); + + static Factory* getInstance(); + + static void setDefaultPluginPath(const std::string& path); + static std::string getDefaultPluginPath(); + +protected: + std::map<std::string, DataModelImpl*> _dataModels; + std::map<std::string, std::string> _dataModelAliases; + std::map<std::string, IOProcessorImpl*> _ioProcessors; + std::map<std::string, std::string> _ioProcessorAliases; + std::map<std::string, InvokerImpl*> _invokers; + std::map<std::string, std::string> _invokerAliases; + std::map<std::pair<std::string, std::string>, ExecutableContentImpl*> _executableContent; + +#ifdef BUILD_AS_PLUGINS + pluma::Pluma pluma; +#endif + + void registerPlugins(); + + Factory(const std::string&); + ~Factory(); + Factory* _parentFactory; + std::string _pluginPath; + static Factory* _instance; + static std::string _defaultPluginPath; + +}; + + +} + +#endif /* end of include guard: FACTORY_H_5WKLGPRB */ diff --git a/src/uscxml/plugins/IOProcessor.h b/src/uscxml/plugins/IOProcessor.h index c770719..c7d90e5 100644 --- a/src/uscxml/plugins/IOProcessor.h +++ b/src/uscxml/plugins/IOProcessor.h @@ -22,6 +22,7 @@ #include "uscxml/Common.h" #include "uscxml/plugins/EventHandler.h" +#include "uscxml/messages/Event.h" namespace uscxml { @@ -29,38 +30,30 @@ class InterpreterImpl; class USCXML_API IOProcessorImpl : public EventHandlerImpl { public: - IOProcessorImpl() {}; - virtual ~IOProcessorImpl() {}; - virtual boost::shared_ptr<IOProcessorImpl> create(InterpreterImpl* interpreter) = 0; + + virtual std::shared_ptr<IOProcessorImpl> create(InterpreterImpl* interpreter) = 0; + virtual void eventFromSCXML(const std::string& target, const Event& event) = 0; + virtual bool isValidTarget(const std::string& target) = 0; + +protected: + void eventToSCXML(Event& event, const std::string& type, const std::string& origin, bool internal = false); + }; class USCXML_API IOProcessor : public EventHandler { public: - IOProcessor() : _impl() {} - IOProcessor(boost::shared_ptr<IOProcessorImpl> const impl) : EventHandler(impl), _impl(impl) { } - IOProcessor(const IOProcessor& other) : EventHandler(other._impl), _impl(other._impl) { } - virtual ~IOProcessor() {}; + PIMPL_OPERATORS2(IOProcessor, EventHandler) - operator bool() const { - return !!_impl; + virtual void eventFromSCXML(const std::string& target, const Event& event) { + _impl->eventFromSCXML(target, event); } - bool operator< (const IOProcessor& other) const { - return _impl < other._impl; - } - bool operator==(const IOProcessor& other) const { - return _impl == other._impl; - } - bool operator!=(const IOProcessor& other) const { - return _impl != other._impl; - } - IOProcessor& operator= (const IOProcessor& other) { - _impl = other._impl; - EventHandler::_impl = _impl; - return *this; + + virtual bool isValidTarget(const std::string& target) { + return _impl->isValidTarget(target); } protected: - boost::shared_ptr<IOProcessorImpl> _impl; + std::shared_ptr<IOProcessorImpl> _impl; friend class InterpreterImpl; }; diff --git a/src/uscxml/plugins/Invoker.h b/src/uscxml/plugins/Invoker.h index b9b767b..c22b7e3 100644 --- a/src/uscxml/plugins/Invoker.h +++ b/src/uscxml/plugins/Invoker.h @@ -23,64 +23,63 @@ #include "uscxml/Common.h" #include "uscxml/plugins/EventHandler.h" -#include "uscxml/messages/InvokeRequest.h" +#include "uscxml/messages/Event.h" namespace uscxml { -class InterpreterImpl; +class Interpreter; class USCXML_API InvokerImpl : public EventHandlerImpl { public: + InvokerImpl() : _finalize(NULL) {}; virtual ~InvokerImpl() {} - virtual void invoke(const InvokeRequest& req) = 0; - virtual void uninvoke() {} + virtual std::list<std::string> getNames() = 0; - virtual bool deleteOnUninvoke() { - return true; + virtual void invoke(const std::string& source, const Event& invokeEvent) = 0; + virtual void uninvoke() = 0; + + virtual void eventFromSCXML(const Event& event) = 0; + + virtual std::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter) = 0; + virtual xercesc::DOMElement* getFinalize() { + return _finalize; + } + virtual void setFinalize(xercesc::DOMElement* finalize) { + _finalize = finalize; + } + virtual void setInvokeId(const std::string& invokeId) { + _invokeId = invokeId; } - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter) = 0; +protected: + void eventToSCXML(Event& event, const std::string& type, const std::string& invokeId, bool internal = false); + + xercesc::DOMElement* _finalize; + std::string _invokeId; + }; class USCXML_API Invoker : public EventHandler { public: - Invoker() : _impl() {} - Invoker(boost::shared_ptr<InvokerImpl> const impl) : EventHandler(impl), _impl(impl) { } - Invoker(const Invoker& other) : EventHandler(other._impl), _impl(other._impl) { } - virtual ~Invoker() {}; + PIMPL_OPERATORS2(Invoker, EventHandler); - operator bool() const { - return !!_impl; - } - bool operator< (const Invoker& other) const { - return _impl < other._impl; - } - bool operator==(const Invoker& other) const { - return _impl == other._impl; - } - bool operator!=(const Invoker& other) const { - return _impl != other._impl; - } - Invoker& operator= (const Invoker& other) { - _impl = other._impl; - EventHandler::_impl = _impl; - return *this; - } - - virtual void invoke(InvokeRequest& req) { - _impl->invoke(req); + virtual void invoke(const std::string& source, const Event& invokeEvent) { + _impl->invoke(source, invokeEvent); } virtual void uninvoke() { _impl->uninvoke(); } - virtual bool deleteOnUninvoke() { - return _impl->deleteOnUninvoke(); + virtual void eventFromSCXML(const Event& event) { + _impl->eventFromSCXML(event); } + virtual xercesc::DOMElement* getFinalize() { + return _impl->getFinalize(); + } protected: - boost::shared_ptr<InvokerImpl> _impl; + std::shared_ptr<InvokerImpl> _impl; }; diff --git a/src/uscxml/plugins/Plugins.cpp b/src/uscxml/plugins/Plugins.cpp deleted file mode 100644 index b2643f7..0000000 --- a/src/uscxml/plugins/Plugins.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "Plugins.h" - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_PROVIDER_SOURCE(DataModelImpl, 1, 1); -PLUMA_PROVIDER_SOURCE(IOProcessorImpl, 1, 1); -PLUMA_PROVIDER_SOURCE(InvokerImpl, 1, 1); -PLUMA_PROVIDER_SOURCE(ExecutableContentImpl, 1, 1); -#endif - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/Plugins.h b/src/uscxml/plugins/Plugins.h deleted file mode 100644 index 537d3fe..0000000 --- a/src/uscxml/plugins/Plugins.h +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef PLUGINS_H_M6G1NF1E -#define PLUGINS_H_M6G1NF1E - -#include <Pluma/Pluma.hpp> -#include "uscxml/Factory.h" - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_PROVIDER_HEADER(IOProcessorImpl); -PLUMA_PROVIDER_HEADER(InvokerImpl); -PLUMA_PROVIDER_HEADER(ExecutableContentImpl); -PLUMA_PROVIDER_HEADER(DataModelImpl); -#endif - -} - -#endif /* end of include guard: PLUGINS_H_M6G1NF1E */ diff --git a/src/uscxml/plugins/Pluma/Config.hpp b/src/uscxml/plugins/Pluma/Config.hpp deleted file mode 100755 index efd98c9..0000000 --- a/src/uscxml/plugins/Pluma/Config.hpp +++ /dev/null @@ -1,141 +0,0 @@ -////////////////////////////////////////////////////////////
-//
-// Pluma - Plug-in Management Framework
-// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-
-////////////////////////////////////////////////////////////
-//
-// Based on SFML configuration header
-// SFML Config.hpp:
-// http://www.sfml-dev.org/documentation/2.0/Config_8hpp-source.htm
-//
-// Acknowledgements to Simple and Fast Multimedia Library
-// http://www.sfml-dev.org/
-//
-////////////////////////////////////////////////////////////
-
-
-#ifndef PLUMA_CONFIG_HPP
-#define PLUMA_CONFIG_HPP
-
-
-////////////////////////////////////////////////////////////
-// Identify the operating system
-////////////////////////////////////////////////////////////
-#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
-
- // Windows
- #define PLUMA_SYS_WINDOWS
- #ifndef WIN32_LEAN_AND_MEAN
- #define WIN32_LEAN_AND_MEAN
- #endif
- #ifndef NOMINMAX
- #define NOMINMAX
- #endif
-
-#elif defined(linux) || defined(__linux)
-
- // Linux
- #define PLUMA_SYS_LINUX
-
-#elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)
-
- // MacOS
- #define PLUMA_SYS_MACOS
-
-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-
- // FreeBSD
- #define PLUMA_SYS_FREEBSD
-
-#else
-
- // Unsupported system
- #error This operating system is not supported by this library
-
-#endif
-
-
-
-////////////////////////////////////////////////////////////
-// Define library file extension based on OS
-////////////////////////////////////////////////////////////
-#ifdef PLUMA_SYS_WINDOWS
- #define PLUMA_LIB_EXTENSION "dll"
-#elif defined(PLUMA_SYS_MACOS)
- #define PLUMA_LIB_EXTENSION "dylib"
-#elif defined(PLUMA_SYS_LINUX) || defined(PLUMA_SYS_FREEBSD)
- #define PLUMA_LIB_EXTENSION "so"
-#else
- // unknown library file type
- #error Unknown library file extension for this operating system
-#endif
-
-
-////////////////////////////////////////////////////////////
-// Define portable import / export macros
-////////////////////////////////////////////////////////////
-#if defined(PLUMA_SYS_WINDOWS)
-
- #ifndef PLUMA_STATIC
-
- // Windows platforms
- #ifdef PLUMA_EXPORTS
-
- // From DLL side, we must export
- #define PLUMA_API __declspec(dllexport)
-
- #else
-
- // From client application side, we must import
- #define PLUMA_API __declspec(dllimport)
-
- #endif
-
- // For Visual C++ compilers, we also need to turn off this annoying C4251 warning.
- // You can read lots ot different things about it, but the point is the code will
- // just work fine, and so the simplest way to get rid of this warning is to disable it
- #ifdef _MSC_VER
-
- #pragma warning(disable : 4251)
-
- #endif
-
- #else
-
- // No specific directive needed for static build
- #define PLUMA_API
-
- #endif
-
-#else
-
- // Other platforms don't need to define anything
- #define PLUMA_API
-
-#endif
-
-
-
-
-#endif // PLUMA_CONFIG_HPP
diff --git a/src/uscxml/plugins/Pluma/Connector.hpp b/src/uscxml/plugins/Pluma/Connector.hpp deleted file mode 100755 index 3c227e7..0000000 --- a/src/uscxml/plugins/Pluma/Connector.hpp +++ /dev/null @@ -1,86 +0,0 @@ -////////////////////////////////////////////////////////////
-//
-// Pluma - Plug-in Management Framework
-// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef PLUMA_CONNECTOR_HPP
-#define PLUMA_CONNECTOR_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <Pluma/Config.hpp>
-#include <Pluma/Pluma.hpp>
-
-
-/////////////////////////////////////////////////////////////////
-// Define portable import/export macros for Plugin registration
-/////////////////////////////////////////////////////////////////
-#if defined(PLUMA_SYS_WINDOWS)
-
- #ifndef PLUMA_STATIC_PLUGIN
-
- // Windows platforms
- #ifndef PLUGIN_IMPORTS
-
- // From DLL side, we must export
- #ifdef __cplusplus
- #define PLUMA_CONNECTOR extern "C" __declspec(dllexport)
- #else
- #define PLUMA_CONNECTOR __declspec(dllexport)
- #endif
-
- #else
-
- // From client application side, we must import
- #ifdef __cplusplus
- #define PLUMA_CONNECTOR extern "C" __declspec(dllimport)
- #else
- #define PLUMA_CONNECTOR __declspec(dllimport)
- #endif
-
- #endif
-
- #else
-
- // Only define the extern "C" for static build
- #ifdef __cplusplus
- #define PLUMA_CONNECTOR extern "C"
- #else
- #define PLUMA_CONNECTOR
- #endif
-
- #endif
-
-#else
-
- // Only define the extern "C" for other platforms
- #ifdef __cplusplus
- #define PLUMA_CONNECTOR extern "C"
- #else
- #define PLUMA_CONNECTOR
- #endif
-
-#endif
-
-
-#endif // PLUMA_CONNECTOR_HPP
diff --git a/src/uscxml/plugins/Pluma/DLibrary.cpp b/src/uscxml/plugins/Pluma/DLibrary.cpp deleted file mode 100644 index 0cbf309..0000000 --- a/src/uscxml/plugins/Pluma/DLibrary.cpp +++ /dev/null @@ -1,105 +0,0 @@ -////////////////////////////////////////////////////////////
-//
-// Pluma - Plug-in Management Framework
-// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <Pluma/DLibrary.hpp>
-#include <cstdio>
-#include <string>
-
-
-namespace pluma {
-
-////////////////////////////////////////////////////////////
-DLibrary* DLibrary::load(const std::string& path) {
- if ( path.empty() ) {
- fprintf(stderr, "Failed to load library: Empty path\n");
- return NULL;
- }
- void* handle = NULL;
-
- // load library - OS dependent operation
-#ifdef PLUMA_SYS_WINDOWS
- handle = ::LoadLibraryA(path.c_str());
- if (!handle) {
- fprintf(stderr, "Failed to load library \"%s\".\n", path.c_str());
- return NULL;
- }
-#else
- handle = ::dlopen(path.c_str(), RTLD_NOW);
- if (!handle) {
- const char* errorString = ::dlerror();
- fprintf(stderr, "Failed to load library \"%s\".", path.c_str());
- if(errorString) fprintf(stderr, " OS returned error: \"%s\".", errorString);
- fprintf(stderr, "\n");
- return NULL;
- }
-#endif
- // return a DLibrary with the DLL handle
- return new DLibrary(handle);
-}
-
-
-////////////////////////////////////////////////////////////
-DLibrary::~DLibrary() {
- if (handle) {
-#ifdef PLUMA_SYS_WINDOWS
- ::FreeLibrary( (HMODULE)handle );
-#else
- ::dlclose(handle);
-#endif
- }
-}
-
-
-////////////////////////////////////////////////////////////
-void* DLibrary::getSymbol(const std::string& symbol) {
- if (!handle) {
- fprintf(stderr, "Cannot inspect library symbols, library isn't loaded.\n");
- return NULL;
- }
- void* res;
-#ifdef PLUMA_SYS_WINDOWS
- res = (void*)(::GetProcAddress((HMODULE)handle, symbol.c_str()));
-#else
- res = (void*)(::dlsym(handle, symbol.c_str()));
-#endif
- if (!res) {
- fprintf(stderr, "Library symbol \"%s\" not found.\n", symbol.c_str());
- return NULL;
- }
- return res;
-}
-
-
-////////////////////////////////////////////////////////////
-DLibrary::DLibrary(void* handle):
- handle(handle) {
- // Nothing to do
-}
-
-} // namespace pluma
-
diff --git a/src/uscxml/plugins/Pluma/DLibrary.hpp b/src/uscxml/plugins/Pluma/DLibrary.hpp deleted file mode 100755 index 1bb9bac..0000000 --- a/src/uscxml/plugins/Pluma/DLibrary.hpp +++ /dev/null @@ -1,123 +0,0 @@ -////////////////////////////////////////////////////////////
-//
-// Pluma - Plug-in Management Framework
-// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef PLUMA_DYNAMIC_LIBRARY_HPP
-#define PLUMA_DYNAMIC_LIBRARY_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <Pluma/Config.hpp>
-#include <string>
-
-// include OS dependent support for DLL
-#ifdef PLUMA_SYS_WINDOWS
- #include <Windows.h>
-#else
- #include <dlfcn.h>
-#endif
-
-
-
-namespace pluma{
-
-////////////////////////////////////////////////////////////
-/// \brief Manages a Dynamic Linking Library.
-///
-////////////////////////////////////////////////////////////
-class DLibrary{
-
-
-public:
-
- ////////////////////////////////////////////////////////////
- /// \brief Load a library.
- ///
- /// \param path Path to the library.
- ///
- /// \return Pointer to the loaded library, or NULL if failed.
- ///
- ////////////////////////////////////////////////////////////
- static DLibrary* load(const std::string& path);
-
- ////////////////////////////////////////////////////////////
- /// \brief Destructor.
- ///
- /// Close and free the opened library (if any).
- ///
- ////////////////////////////////////////////////////////////
- ~DLibrary();
-
- ////////////////////////////////////////////////////////////
- /// \brief Get a symbol from the library.
- ///
- /// \param symbol Symbol that we're looking for.
- ///
- /// \return Pointer to what the symbol refers to, or NULL if
- /// the symbol is not found.
- ///
- ////////////////////////////////////////////////////////////
- void* getSymbol(const std::string& symbol);
-
-
-private:
-
- ////////////////////////////////////////////////////////////
- /// \brief Default constructor.
- ///
- /// Library instances cannot be created, use load instead.
- ///
- /// \see load
- ///
- ////////////////////////////////////////////////////////////
- DLibrary();
-
- ////////////////////////////////////////////////////////////
- /// \brief Constructor via library handle.
- ///
- /// Used on load function.
- ///
- /// \see load
- ///
- ////////////////////////////////////////////////////////////
- DLibrary(void* handle);
-
-
-
-////////////////////////////////////////////////////////////
-// Member data
-////////////////////////////////////////////////////////////
-
-
-private:
-
- void* handle; ///< Library handle.
-
-};
-
-
-} // namespace pluma
-
-
-#endif // PLUMA_DYNAMIC_LIBRARY_HPP
diff --git a/src/uscxml/plugins/Pluma/Dir.cpp b/src/uscxml/plugins/Pluma/Dir.cpp deleted file mode 100644 index 73271ea..0000000 --- a/src/uscxml/plugins/Pluma/Dir.cpp +++ /dev/null @@ -1,103 +0,0 @@ -////////////////////////////////////////////////////////////
-//
-// Pluma - Plug-in Management Framework
-// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <Pluma/Dir.hpp>
-#include <Pluma/uce-dirent.h>
-#include <cstdio>
-#include <queue>
-
-
-namespace pluma {
-
-namespace dir {
-
-
-////////////////////////////////////////////////////////////
-void listFiles(std::list<std::string>& list, const std::string& folder, const std::string& extension, bool recursive) {
- DIR* dir;
- DIR* subDir;
- struct dirent *ent;
- // try to open top folder
- dir = opendir(folder.c_str());
- if (dir == NULL) {
- // could not open directory
- fprintf(stderr, "Could not open \"%s\" directory.\n", folder.c_str());
- return;
- } else {
- // close, we'll process it next
- closedir(dir);
- }
- // enqueue top folder
- std::queue<std::string> folders;
- folders.push(folder);
-
- // run while has queued folders
- while (!folders.empty()) {
- std::string currFolder = folders.front();
- folders.pop();
- dir = opendir(currFolder.c_str());
- if (dir == NULL) continue;
- // iterate through all the files and directories
- while ((ent = readdir (dir)) != NULL) {
- std::string name(ent->d_name);
- // ignore "." and ".." directories
- if ( name.compare(".") == 0 || name.compare("..") == 0) continue;
- // add path to the file name
- std::string path = currFolder;
- path.append("/");
- path.append(name);
- // check if it's a folder by trying to open it
- subDir = opendir(path.c_str());
- if (subDir != NULL) {
- // it's a folder: close, we can process it later
- closedir(subDir);
- if (recursive) folders.push(path);
- } else {
- // it's a file
- if (extension.empty()) {
- list.push_back(path);
- } else {
- // check file extension
- size_t lastDot = name.find_last_of('.');
- std::string ext = name.substr(lastDot+1);
- if (ext.compare(extension) == 0) {
- // match
- list.push_back(path);
- }
- } // endif (extension test)
- } // endif (folder test)
- } // endwhile (nextFile)
- closedir(dir);
- } // endwhile (queued folders)
-
-} // end listFiles
-
-
-} // namespace dir
-
-} // namespace pluma
diff --git a/src/uscxml/plugins/Pluma/Dir.hpp b/src/uscxml/plugins/Pluma/Dir.hpp deleted file mode 100755 index a94c477..0000000 --- a/src/uscxml/plugins/Pluma/Dir.hpp +++ /dev/null @@ -1,64 +0,0 @@ -////////////////////////////////////////////////////////////
-//
-// Pluma - Plug-in Management Framework
-// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef PLUMA_DIRECTORY_HPP
-#define PLUMA_DIRECTORY_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <Pluma/Config.hpp>
-#include <string>
-#include <list>
-
-
-namespace pluma{
-
-namespace dir{
-
-////////////////////////////////////////////////////////////
-/// \brief List files of a directory.
-///
-/// \param list The output files list.
-/// \param folder The folder where to search in
-/// \param extension A file extension filter,
-/// empty extension will match all files.
-/// \param recursive If true it will list files in
-/// sub directories as well.
-///
-////////////////////////////////////////////////////////////
-void listFiles(
- std::list<std::string>& list,
- const std::string& folder,
- const std::string& extension = "",
- bool recursive = false
-);
-
-
-} // namespace dir
-
-} // namespace pluma
-
-
-#endif // PLUMA_DIRECTORY_HPP
diff --git a/src/uscxml/plugins/Pluma/Host.cpp b/src/uscxml/plugins/Pluma/Host.cpp deleted file mode 100644 index 73979a6..0000000 --- a/src/uscxml/plugins/Pluma/Host.cpp +++ /dev/null @@ -1,179 +0,0 @@ -////////////////////////////////////////////////////////////
-//
-// Pluma - Plug-in Management Framework
-// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <Pluma/Host.hpp>
-#include <cstdio>
-
-
-namespace pluma {
-
-////////////////////////////////////////////////////////////
-Host::Host() {
- // Nothing to do
-}
-
-
-////////////////////////////////////////////////////////////
-bool Host::add(Provider* provider) {
- if (provider == NULL) {
- fprintf(stderr, "Trying to add a null provider.\n");
- return false;
- }
- if (!validateProvider(provider)) {
- delete provider;
- return false;
- }
- addRequests[ provider->plumaGetType() ].push_back(provider);
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-Host::~Host() {
- clearProviders();
- // map frees itself
-}
-
-
-////////////////////////////////////////////////////////////
-void Host::clearProviders() {
- ProvidersMap::iterator it;
- for (it = knownTypes.begin() ; it != knownTypes.end() ; ++it) {
- std::list<Provider*>& providers = it->second.providers;
- std::list<Provider*>::iterator provIt;
- for (provIt = providers.begin() ; provIt != providers.end() ; ++provIt) {
- delete *provIt;
- }
- std::list<Provider*>().swap(providers);
- }
-}
-
-
-////////////////////////////////////////////////////////////
-bool Host::knows(const std::string& type) const {
- return knownTypes.find(type) != knownTypes.end();
-}
-
-
-////////////////////////////////////////////////////////////
-unsigned int Host::getVersion(const std::string& type) const {
- ProvidersMap::const_iterator it = knownTypes.find(type);
- if (it != knownTypes.end())
- return it->second.version;
- return 0;
-}
-
-
-////////////////////////////////////////////////////////////
-unsigned int Host::getLowestVersion(const std::string& type) const {
- ProvidersMap::const_iterator it = knownTypes.find(type);
- if (it != knownTypes.end())
- return it->second.lowestVersion;
- return 0;
-}
-
-
-////////////////////////////////////////////////////////////
-void Host::registerType(const std::string& type, unsigned int version, unsigned int lowestVersion) {
- if (!knows(type)) {
- ProviderInfo pi;
- pi.version = version;
- pi.lowestVersion = lowestVersion;
- knownTypes[type] = pi;
- }
-}
-
-
-////////////////////////////////////////////////////////////
-const std::list<Provider*>* Host::getProviders(const std::string& type) const {
- ProvidersMap::const_iterator it = knownTypes.find(type);
- if (it != knownTypes.end())
- return &it->second.providers;
- return NULL;
-}
-
-
-////////////////////////////////////////////////////////////
-bool Host::validateProvider(Provider* provider) const {
- const std::string& type = provider->plumaGetType();
- if ( !knows(type) ) {
- fprintf(stderr, "%s provider type isn't registered.\n", type.c_str());
- return false;
- }
- if (!provider->isCompatible(*this)) {
- fprintf(stderr, "Incompatible %s provider version.\n", type.c_str());
- return false;
- }
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-bool Host::registerProvider(Provider* provider) {
- if (!validateProvider(provider)) {
- delete provider;
- return false;
- }
- knownTypes[ provider->plumaGetType() ].providers.push_back(provider);
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-void Host::cancelAddictions() {
- TempProvidersMap::iterator it;
- for( it = addRequests.begin() ; it != addRequests.end() ; ++it) {
- std::list<Provider*> lst = it->second;
- std::list<Provider*>::iterator providerIt;
- for (providerIt = lst.begin() ; providerIt != lst.end() ; ++providerIt) {
- delete *providerIt;
- }
- }
- // clear map
- TempProvidersMap().swap(addRequests);
-}
-
-
-////////////////////////////////////////////////////////////
-bool Host::confirmAddictions() {
- if (addRequests.empty()) return false;
- TempProvidersMap::iterator it;
- for( it = addRequests.begin() ; it != addRequests.end() ; ++it) {
- std::list<Provider*> lst = it->second;
- std::list<Provider*>::iterator providerIt;
- for (providerIt = lst.begin() ; providerIt != lst.end() ; ++providerIt) {
- knownTypes[it->first].providers.push_back(*providerIt);
- }
- }
- // clear map
- TempProvidersMap().swap(addRequests);
- return true;
-}
-
-
-} //namespace pluma
diff --git a/src/uscxml/plugins/Pluma/Host.hpp b/src/uscxml/plugins/Pluma/Host.hpp deleted file mode 100755 index cf049f5..0000000 --- a/src/uscxml/plugins/Pluma/Host.hpp +++ /dev/null @@ -1,212 +0,0 @@ -////////////////////////////////////////////////////////////
-//
-// Pluma - Plug-in Management Framework
-// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef PLUMA_HOST_HPP
-#define PLUMA_HOST_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <Pluma/Config.hpp>
-#include <Pluma/Provider.hpp>
-
-#include <vector>
-#include <list>
-#include <map>
-
-namespace pluma{
-
-////////////////////////////////////////////////////////////
-/// \brief Manages providers.
-///
-////////////////////////////////////////////////////////////
-class PLUMA_API Host{
-friend class PluginManager;
-friend class Provider;
-
-
-public:
-
- ////////////////////////////////////////////////////////////
- /// \brief Add provider.
- ///
- /// Provider type and version are checked. Only known and
- /// valid provider types are accepted.
- ///
- /// \param provider Provider to be added.
- ///
- /// \return True if the provider is accepted.
- ///
- ////////////////////////////////////////////////////////////
- bool add(Provider* provider);
-
-
-private:
-
- ////////////////////////////////////////////////////////////
- /// \brief Default constructor.
- ///
- /// New Host instances are not publicly allowed.
- ///
- ////////////////////////////////////////////////////////////
- Host();
-
- ////////////////////////////////////////////////////////////
- /// \brief Destructor.
- ///
- /// Clears all hosted providers
- ///
- ////////////////////////////////////////////////////////////
- ~Host();
-
- ////////////////////////////////////////////////////////////
- /// \brief Ckeck if a provider type is registered.
- ///
- /// \param type Provider type id.
- ///
- /// \return True if the type is registered
- ///
- ////////////////////////////////////////////////////////////
- bool knows(const std::string& type) const;
-
- ////////////////////////////////////////////////////////////
- /// \brief Get version of a type of providers.
- ///
- /// \param type Provider type.
- ///
- /// \return The version of the provider type.
- ///
- ////////////////////////////////////////////////////////////
- unsigned int getVersion(const std::string& type) const;
-
- ////////////////////////////////////////////////////////////
- /// \brief Get lowest compatible version of a type of providers.
- ///
- /// \param type Provider type.
- ///
- /// \return The lowest compatible version of the provider type.
- ///
- ////////////////////////////////////////////////////////////
- unsigned int getLowestVersion(const std::string& type) const;
-
- ////////////////////////////////////////////////////////////
- /// \brief Register a type of providers.
- ///
- /// \param type Provider type.
- /// \param version Current version of that provider type.
- /// \param lowestVersion Lowest compatible version of that provider type.
- ///
- ////////////////////////////////////////////////////////////
- void registerType(const std::string& type, unsigned int version, unsigned int lowestVersion);
-
- ////////////////////////////////////////////////////////////
- /// \brief Get providers of a certain type.
- ///
- /// \param type Provider type.
- ///
- /// \return Pointer to the list of providers of that \a type,
- /// or NULL if \a type is not registered.
- ///
- ////////////////////////////////////////////////////////////
- const std::list<Provider*>* getProviders(const std::string& type) const;
-
- ////////////////////////////////////////////////////////////
- /// \brief Clears all hosted providers.
- ///
- ////////////////////////////////////////////////////////////
- void clearProviders();
-
- ////////////////////////////////////////////////////////////
- /// \brief Validate provider type and version.
- ///
- /// \return True if the provider is acceptable.
- ///
- ////////////////////////////////////////////////////////////
- bool validateProvider(Provider* provider) const;
-
- ////////////////////////////////////////////////////////////
- /// \brief Clearly add a provider.
- ///
- /// Provider type and version are checked. Only known and
- /// valid provider types are accepted.
- /// If acepted, provider is directly stored.
- ///
- /// \param provider Provider to be added.
- ///
- /// \return True if the provider is accepted.
- ///
- ////////////////////////////////////////////////////////////
- bool registerProvider(Provider* provider);
-
- ////////////////////////////////////////////////////////////
- /// \brief Previous add calls are canceled.
- ///
- /// Added providers are not stored.
- ///
- /// \see add
- ///
- ////////////////////////////////////////////////////////////
- void cancelAddictions();
-
- ////////////////////////////////////////////////////////////
- /// \brief Previous add calls are confirmed.
- ///
- /// Added providers are finally stored.
- ///
- /// \return True if something was stored.
- ///
- /// \see add
- ///
- ////////////////////////////////////////////////////////////
- bool confirmAddictions();
-
-
-
-////////////////////////////////////////////////////////////
-// Member data
-////////////////////////////////////////////////////////////
-
-private:
-
- ////////////////////////////////////////////////////////////
- /// \brief Structure with information about a provider type.
- ///
- ////////////////////////////////////////////////////////////
- struct ProviderInfo{
- unsigned int version;
- unsigned int lowestVersion;
- std::list<Provider*> providers;
- };
-
- typedef std::map<std::string, ProviderInfo > ProvidersMap;
- typedef std::map<std::string, std::list<Provider*> > TempProvidersMap;
-
- ProvidersMap knownTypes; ///< Map of registered types.
- TempProvidersMap addRequests; ///< Temporarily added providers
-
-};
-
-} // namespace pluma
-
-#endif // PLUMA_HOST_HPP
diff --git a/src/uscxml/plugins/Pluma/PluginManager.cpp b/src/uscxml/plugins/Pluma/PluginManager.cpp deleted file mode 100644 index 22e0438..0000000 --- a/src/uscxml/plugins/Pluma/PluginManager.cpp +++ /dev/null @@ -1,201 +0,0 @@ -////////////////////////////////////////////////////////////
-//
-// Pluma - Plug-in Management Framework
-// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <Pluma/PluginManager.hpp>
-#include <Pluma/DLibrary.hpp>
-#include <Pluma/Dir.hpp>
-#include <cstdio>
-
-namespace pluma {
-
-////////////////////////////////////////////////////////////
-PluginManager::PluginManager() {
- // Nothing to do
-}
-
-
-////////////////////////////////////////////////////////////
-PluginManager::~PluginManager() {
- unloadAll();
-}
-
-
-////////////////////////////////////////////////////////////
-bool PluginManager::load(const std::string& path) {
- std::string plugName = getPluginName(path);
- std::string realPath = resolvePathExtension(path);
- DLibrary* lib = DLibrary::load(realPath);
- if (!lib) return false;
-
- fnRegisterPlugin* registerFunction;
- registerFunction = reinterpret_cast<fnRegisterPlugin*>(lib->getSymbol("pluginConnect"));
-
- if(!registerFunction) {
- fprintf(stderr, "Failed to initialize plugin \"%s\": pluginConnect function not found\n", plugName.c_str());
- delete lib;
- return false;
- }
- // try to initialize plugin:
- if (!registerFunction(host)) {
- // plugin decided to fail
- fprintf(stderr, "Self registry failed on plugin \"%s\".\n", plugName.c_str());
- host.cancelAddictions();
- delete lib;
- return false;
- }
- // Store the library if addictions are confirmed
- if (host.confirmAddictions())
- libraries[plugName] = lib;
- else {
- // otherwise nothing was registered
- fprintf(stderr, "Nothing registered by plugin \"%s\".\n", plugName.c_str());
- delete lib;
- return false;
- }
- return true;
-}
-
-
-////////////////////////////////////////////////////////////
-bool PluginManager::load(const std::string& folder, const std::string& pluginName) {
- if (folder.empty())
- return load(pluginName);
- else if (folder[folder.size()-1] == '/' || folder[folder.size()-1] == '\\')
- return load(folder + pluginName);
- return load(folder + '/' + pluginName);
-}
-
-
-////////////////////////////////////////////////////////////
-int PluginManager::loadFromFolder(const std::string& folder, bool recursive) {
- std::list<std::string> files;
- dir::listFiles(files, folder, PLUMA_LIB_EXTENSION, recursive);
- // try to load every library
- int res = 0;
- std::list<std::string>::const_iterator it;
- for (it = files.begin() ; it != files.end() ; ++it) {
- if ( load(*it) ) ++res;
- }
- return res;
-}
-
-
-////////////////////////////////////////////////////////////
-bool PluginManager::unload(const std::string& pluginName) {
- std::string plugName = getPluginName(pluginName);
- LibMap::iterator it = libraries.find(plugName);
- if( it != libraries.end() ) {
- delete it->second;
- libraries.erase(it);
- return true;
- }
- return false;
-}
-
-
-////////////////////////////////////////////////////////////
-void PluginManager::unloadAll() {
-
- host.clearProviders();
- LibMap::iterator it;
- for (it = libraries.begin() ; it != libraries.end() ; ++it) {
- delete it->second;
- }
- libraries.clear();
-}
-
-
-////////////////////////////////////////////////////////////
-std::string PluginManager::getPluginName(const std::string& path) {
- size_t lastDash = path.find_last_of("/\\");
- size_t lastDot = path.find_last_of('.');
- if (lastDash == std::string::npos) lastDash = 0;
- else ++lastDash;
- if (lastDot < lastDash || lastDot == std::string::npos) {
- // path without extension
- lastDot = path.length();
- }
- return path.substr(lastDash, lastDot-lastDash);
-}
-
-
-////////////////////////////////////////////////////////////
-std::string PluginManager::resolvePathExtension(const std::string& path) {
- size_t lastDash = path.find_last_of("/\\");
- size_t lastDot = path.find_last_of('.');
- if (lastDash == std::string::npos) lastDash = 0;
- else ++lastDash;
- if (lastDot < lastDash || lastDot == std::string::npos) {
- // path without extension, add it
- return path + "." + PLUMA_LIB_EXTENSION;
- }
- return path;
-}
-
-
-////////////////////////////////////////////////////////////
-void PluginManager::registerType(const std::string& type, unsigned int version, unsigned int lowestVersion) {
- host.registerType(type, version, lowestVersion);
-}
-
-
-////////////////////////////////////////////////////////////
-bool PluginManager::addProvider(Provider* provider) {
- if (provider == NULL) {
- fprintf(stderr, "Trying to add null provider\n");
- return false;
- }
- return host.registerProvider(provider);
-}
-
-
-////////////////////////////////////////////////////////////
-void PluginManager::getLoadedPlugins(std::vector<const std::string*>& pluginNames) const {
- pluginNames.reserve(pluginNames.size()+libraries.size());
- LibMap::const_iterator it;
- for(it = libraries.begin() ; it != libraries.end() ; ++it) {
- pluginNames.push_back(&(it->first));
- }
-}
-
-
-////////////////////////////////////////////////////////////
-bool PluginManager::isLoaded(const std::string& pluginName) const {
- return libraries.find(getPluginName(pluginName)) != libraries.end();
-}
-
-
-////////////////////////////////////////////////////////////
-const std::list<Provider*>* PluginManager::getProviders(const std::string& type) const {
- return host.getProviders(type);
-}
-
-
-
-} // namespace pluma
-
diff --git a/src/uscxml/plugins/Pluma/PluginManager.hpp b/src/uscxml/plugins/Pluma/PluginManager.hpp deleted file mode 100755 index e5ddf06..0000000 --- a/src/uscxml/plugins/Pluma/PluginManager.hpp +++ /dev/null @@ -1,245 +0,0 @@ -////////////////////////////////////////////////////////////
-//
-// Pluma - Plug-in Management Framework
-// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef PLUMA_PLUGIN_MANAGER_HPP
-#define PLUMA_PLUGIN_MANAGER_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <Pluma/Config.hpp>
-#include <Pluma/Host.hpp>
-
-#include <string>
-#include <map>
-
-namespace pluma{
-class DLibrary;
-
-////////////////////////////////////////////////////////////
-/// \brief Manages loaded plugins.
-///
-////////////////////////////////////////////////////////////
-class PLUMA_API PluginManager{
-
-
-public:
-
- ////////////////////////////////////////////////////////////
- /// \brief Destructor.
- ///
- ////////////////////////////////////////////////////////////
- ~PluginManager();
-
- ////////////////////////////////////////////////////////////
- /// \brief Load a plugin given it's path
- ///
- /// \param path Path for the plugin, including plugin name. File extension
- /// may be included, but is discouraged for better cross platform code.
- /// If file extension isn't present on the path, Pluma will deduce it
- /// from the operating system.
- ///
- /// \return True if the plugin is successfully loaded.
- ///
- /// \see load(const std::string&, const std::string&)
- /// \see loadFromFolder
- /// \see unload
- /// \see unloadAll
- ///
- ////////////////////////////////////////////////////////////
- bool load(const std::string& path);
-
-
- ////////////////////////////////////////////////////////////
- /// \brief Load a plugin from a given folder
- ///
- /// \param folder The folder path.
- /// \param pluginName Name of the plugin. File extension
- /// may be included, but is discouraged for better cross platform code.
- /// If file extension is omitted, Pluma will deduce it
- /// from the operating system.
- ///
- /// \return True if the plugin is successfully loaded.
- ///
- /// \see load(const std::string&)
- /// \see loadFromFolder
- /// \see unload
- /// \see unloadAll
- ///
- ////////////////////////////////////////////////////////////
- bool load(const std::string& folder, const std::string& pluginName);
-
- ////////////////////////////////////////////////////////////
- /// \brief Load all plugins from a given folder
- ///
- /// \param folder Path for the folder where the plug-ins are.
- /// \param recursive If true it will search on sub-folders as well
- ///
- /// \return Number of successfully loaded plug-ins.
- ///
- /// \see load(const std::string&, const std::string&)
- /// \see load(const std::string&)
- /// \see unload
- /// \see unloadAll
- ///
- ////////////////////////////////////////////////////////////
- int loadFromFolder(const std::string& folder, bool recursive = false);
-
- ////////////////////////////////////////////////////////////
- /// \brief Unload a plugin.
- ///
- /// \param pluginName Name or path of the plugin.
- ///
- /// \return True if the plugin is successfully unloaded,
- /// false if no such plugin exists on the manager.
- ///
- /// \see load(const std::string&, const std::string&)
- /// \see load(const std::string&)
- /// \see loadFromFolder
- /// \see unloadAll
- ///
- ////////////////////////////////////////////////////////////
- bool unload(const std::string& pluginName);
-
- ////////////////////////////////////////////////////////////
- /// \brief Unload all loaded plugins.
- ///
- /// \see load(const std::string&, const std::string&)
- /// \see load(const std::string&)
- /// \see loadFromFolder
- /// \see unload
- ///
- ////////////////////////////////////////////////////////////
- void unloadAll();
-
- ////////////////////////////////////////////////////////////
- /// \brief Directly add a new provider.
- ///
- /// \param provider Provider.
- ///
- ////////////////////////////////////////////////////////////
- bool addProvider(Provider* provider);
-
- ////////////////////////////////////////////////////////////
- /// \brief Get the name of all loaded plugins.
- ///
- /// \param pluginNames A vector to fill with the plugins names.
- ///
- ////////////////////////////////////////////////////////////
- void getLoadedPlugins(std::vector<const std::string*>& pluginNames) const;
-
- ////////////////////////////////////////////////////////////
- /// \brief Check if a plug-in is loaded.
- ///
- /// \param pluginName the plug-in tname o check.
- ///
- ////////////////////////////////////////////////////////////
- bool isLoaded(const std::string& pluginName) const;
-
-
-protected:
-
- ////////////////////////////////////////////////////////////
- /// \brief Default constructor.
- ///
- /// PluginManager cannot be publicly instantiated.
- ///
- ////////////////////////////////////////////////////////////
- PluginManager();
-
- ////////////////////////////////////////////////////////////
- /// \brief Register a provider type
- ///
- /// \param type Provider type.
- /// \param version Current version of that provider type.
- /// \param lowestVersion Lowest compatible version of that provider type.
- ///
- /// \see Host::registerType
- ///
- ////////////////////////////////////////////////////////////
- void registerType(const std::string& type, unsigned int version, unsigned int lowestVersion);
-
- ////////////////////////////////////////////////////////////
- /// \brief Get providers of a certain type.
- ///
- /// \param type Provider type.
- ///
- /// \return Pointer to the list of providers of that \a type,
- /// or NULL if \a type is not registered.
- ///
- /// \see Host::getProviders
- ///
- ////////////////////////////////////////////////////////////
- const std::list<Provider*>* getProviders(const std::string& type) const;
-
-
-private:
-
- ////////////////////////////////////////////////////////////
- /// \brief Get the plugin name (without extension) from its path
- ///
- /// \param path Plugin path.
- ///
- /// \return Name of the plugin.
- ///
- /// \see resolvePathExtension
- /// \see load(const std::string&, const std::string&)
- /// \see load(const std::string&)
- /// \see unload
- ///
- ////////////////////////////////////////////////////////////
- static std::string getPluginName(const std::string& path);
-
- ////////////////////////////////////////////////////////////
- /// \brief If the plugin path omits it's extension, this method returns
- /// the path plus the OS specific dll extension.
- /// Return a copy of the path otherwise.
- ///
- /// \param path Plugin path.
- ///
- /// \return Path with extension.
- ///
- /// \see getPluginName
- /// \see load(const std::string&, const std::string&)
- /// \see load(const std::string&)
- /// \see unload
- ///
- ////////////////////////////////////////////////////////////
- static std::string resolvePathExtension(const std::string& path);
-
-
-private:
-
- /// Signature for the plugin's registration function
- typedef bool fnRegisterPlugin(Host&);
- typedef std::map<std::string,DLibrary*> LibMap;
-
- LibMap libraries; ///< Map containing the loaded libraries
- Host host; ///< Host app proxy, holding all providers
-
-};
-
-} // namespace pluma
-
-#endif // PLUMA_PLUGIN_MANAGER_HPP
diff --git a/src/uscxml/plugins/Pluma/Pluma.hpp b/src/uscxml/plugins/Pluma/Pluma.hpp deleted file mode 100755 index a9d614e..0000000 --- a/src/uscxml/plugins/Pluma/Pluma.hpp +++ /dev/null @@ -1,171 +0,0 @@ -////////////////////////////////////////////////////////////
-//
-// Pluma - Plug-in Management Framework
-// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef PLUMA_PLUMA_HPP
-#define PLUMA_PLUMA_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <Pluma/Config.hpp>
-#include <Pluma/Provider.hpp>
-#include <Pluma/PluginManager.hpp>
-
-////////////////////////////////////////////////////////////
-// Andy macro to convert parameter to string
-////////////////////////////////////////////////////////////
-#define PLUMA_2STRING(X) #X
-
-////////////////////////////////////////////////////////////
-// Macro that helps host applications defining
-// their provider classes
-////////////////////////////////////////////////////////////
-#define PLUMA_PROVIDER_HEADER(TYPE)\
-PLUMA_PROVIDER_HEADER_BEGIN(TYPE)\
-virtual TYPE* create() const = 0;\
-PLUMA_PROVIDER_HEADER_END
-
-////////////////////////////////////////////////////////////
-// Macro that generate first part of the provider definition
-////////////////////////////////////////////////////////////
-#define PLUMA_PROVIDER_HEADER_BEGIN(TYPE)\
-class TYPE##Provider: public pluma::Provider{\
-private:\
- friend class pluma::Pluma;\
- static const unsigned int PLUMA_INTERFACE_VERSION;\
- static const unsigned int PLUMA_INTERFACE_LOWEST_VERSION;\
- static const std::string PLUMA_PROVIDER_TYPE;\
- std::string plumaGetType() const{ return PLUMA_PROVIDER_TYPE; }\
-public:\
- unsigned int getVersion() const{ return PLUMA_INTERFACE_VERSION; }
-
-////////////////////////////////////////////////////////////
-// Macro that generate last part of the provider definition
-////////////////////////////////////////////////////////////
-#define PLUMA_PROVIDER_HEADER_END };
-
-////////////////////////////////////////////////////////////
-// Macro that generate the provider declaration
-////////////////////////////////////////////////////////////
-#define PLUMA_PROVIDER_SOURCE(TYPE, Version, LowestVersion)\
-const std::string TYPE##Provider::PLUMA_PROVIDER_TYPE = PLUMA_2STRING( TYPE );\
-const unsigned int TYPE##Provider::PLUMA_INTERFACE_VERSION = Version;\
-const unsigned int TYPE##Provider::PLUMA_INTERFACE_LOWEST_VERSION = LowestVersion;
-
-
-////////////////////////////////////////////////////////////
-// Macro that helps plugins generating their provider implementations
-// PRE: SPECIALIZED_TYPE must inherit from BASE_TYPE
-////////////////////////////////////////////////////////////
-#define PLUMA_INHERIT_PROVIDER(SPECIALIZED_TYPE, BASE_TYPE)\
-class SPECIALIZED_TYPE##Provider: public BASE_TYPE##Provider{\
-public:\
- BASE_TYPE * create() const{ return new SPECIALIZED_TYPE (); }\
-};
-
-
-namespace pluma{
-
-////////////////////////////////////////////////////////////
-/// \brief Pluma plugins management
-///
-////////////////////////////////////////////////////////////
-class Pluma: public PluginManager{
-
-public:
- ////////////////////////////////////////////////////////////
- /// \brief Default Constructor
- ///
- ////////////////////////////////////////////////////////////
- Pluma();
-
- ////////////////////////////////////////////////////////////
- /// \brief Tell Pluma to accept a certain type of providers
- ///
- /// A Pluma object is able to accept multiple types of providers.
- /// When a plugin is loaded, it tries to register it's providers
- /// implementations. Those are only accepted by the host
- /// application if it's accepting providers of that kind.
- ///
- /// \tparam ProviderType type of provider.
- ///
- ////////////////////////////////////////////////////////////
- template<typename ProviderType>
- void acceptProviderType();
-
- ////////////////////////////////////////////////////////////
- /// \brief Get the stored providers of a certain type.
- ///
- /// Providers are added at the end of the \a providers vector.
- ///
- /// \tparam ProviderType type of provider to be returned.
- /// \param[out] providers Vector to fill with the existing
- /// providers.
- ///
- ////////////////////////////////////////////////////////////
- template<typename ProviderType>
- void getProviders(std::vector<ProviderType*>& providers);
-};
-
-#include <Pluma/Pluma.inl>
-
-}
-
-
-#endif // PLUMA_PLUMA_HPP
-
-
-////////////////////////////////////////////////////////////
-/// \class pluma::Pluma
-///
-/// Pluma is the main class of Pluma library. Allows hosting
-/// applications to load/unload dlls in runtime (plugins), and
-/// to get providers of shared interface objects.
-///
-/// Example:
-/// \code
-/// pluma::Pluma pluma;
-/// // Tell it to accept providers of the type DeviceProvider
-/// pluma.acceptProviderType<DeviceProvider>();
-/// // Load some dll
-/// pluma.load("plugins/standard_devices");
-/// // Get device providers into a vector
-/// std::vector<DeviceProvider*> providers;
-/// pluma.getProviders(providers);
-/// // create a Device from the first provider
-/// if (!providers.empty()){
-/// Device* myDevice = providers.first()->create();
-/// // do something with myDevice
-/// std::cout << device->getDescription() << std::endl;
-/// // (...)
-/// delete myDevice;
-/// }
-/// \endcode
-///
-/// It is also possible to add local providers, providers that
-/// are defined directly on the host application. That can
-/// be useful to provide and use default implementations of certain
-/// interfaces, along with plugin implementations.
-///
-////////////////////////////////////////////////////////////
diff --git a/src/uscxml/plugins/Pluma/Pluma.inl b/src/uscxml/plugins/Pluma/Pluma.inl deleted file mode 100755 index c3b6ce7..0000000 --- a/src/uscxml/plugins/Pluma/Pluma.inl +++ /dev/null @@ -1,52 +0,0 @@ -////////////////////////////////////////////////////////////
-//
-// Pluma - Plug-in Management Framework
-// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-
-////////////////////////////////////////////////////////////
-inline Pluma::Pluma(){
- // Nothing to do
-}
-
-
-////////////////////////////////////////////////////////////
-template<typename ProviderType>
-void Pluma::acceptProviderType(){
- PluginManager::registerType(
- ProviderType::PLUMA_PROVIDER_TYPE,
- ProviderType::PLUMA_INTERFACE_VERSION,
- ProviderType::PLUMA_INTERFACE_LOWEST_VERSION
- );
-}
-
-
-////////////////////////////////////////////////////////////
-template<typename ProviderType>
-void Pluma::getProviders(std::vector<ProviderType*>& providers){
- const std::list<Provider*>* lst = PluginManager::getProviders(ProviderType::PLUMA_PROVIDER_TYPE);
- if (!lst) return;
- providers.reserve(providers.size() + lst->size());
- std::list<Provider*>::const_iterator it;
- for (it = lst->begin() ; it != lst->end() ; ++it)
- providers.push_back(static_cast<ProviderType*>(*it));
-}
diff --git a/src/uscxml/plugins/Pluma/Provider.cpp b/src/uscxml/plugins/Pluma/Provider.cpp deleted file mode 100644 index 7691eb1..0000000 --- a/src/uscxml/plugins/Pluma/Provider.cpp +++ /dev/null @@ -1,52 +0,0 @@ -////////////////////////////////////////////////////////////
-//
-// Pluma - Plug-in Management Framework
-// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <Pluma/Provider.hpp>
-#include <Pluma/Host.hpp>
-
-
-namespace pluma {
-
-////////////////////////////////////////////////////////////
-Provider::~Provider() {
- // Nothing to do
-}
-
-
-////////////////////////////////////////////////////////////
-bool Provider::isCompatible(const Host& host) const {
- // check compatibility with host
- const std::string& type = this->plumaGetType();
- if (!host.knows(type)) return false;
- unsigned int lowest = host.getLowestVersion(type);
- unsigned int current = host.getVersion(type);
- unsigned int myVersion = this->getVersion();
- return lowest <= myVersion && myVersion <= current;
-}
-
-} // namespace pluma
diff --git a/src/uscxml/plugins/Pluma/Provider.hpp b/src/uscxml/plugins/Pluma/Provider.hpp deleted file mode 100755 index d01e7f4..0000000 --- a/src/uscxml/plugins/Pluma/Provider.hpp +++ /dev/null @@ -1,204 +0,0 @@ -////////////////////////////////////////////////////////////
-//
-// Pluma - Plug-in Management Framework
-// Copyright (C) 2010-2012 Gil Costa (gsaurus@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef PLUMA_PROVIDER_HPP
-#define PLUMA_PROVIDER_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include <Pluma/Config.hpp>
-#include <string>
-
-
-namespace pluma{
-class Host;
-
-////////////////////////////////////////////////////////////
-/// \brief Interface to provide applications with objects from plugins.
-///
-////////////////////////////////////////////////////////////
-class PLUMA_API Provider{
-friend class Host;
-
-
-public:
-
- ////////////////////////////////////////////////////////////
- /// \brief Destructor.
- ///
- ////////////////////////////////////////////////////////////
- virtual ~Provider();
-
- ////////////////////////////////////////////////////////////
- /// \brief Get provider version.
- ///
- /// \return Version number.
- ///
- ////////////////////////////////////////////////////////////
- virtual unsigned int getVersion() const = 0;
-
- ////////////////////////////////////////////////////////////
- /// \brief Check compatibility with host.
- ///
- /// The same provider may be compiled with different versions
- /// on host side and on plugins side. This function checks if
- /// a plugin provider is compatible with the current version of
- /// the same provider type on the host side.
- ///
- /// \param host Host, proxy of host application.
- ///
- /// \return True if it's compatible with \a host.
- ///
- ////////////////////////////////////////////////////////////
- bool isCompatible(const Host& host) const;
-
-
-private:
-
- ////////////////////////////////////////////////////////////
- /// \brief Get provider type.
- ///
- /// Each provider defined on the host application is identified by
- /// a unique type. Those types are automatically managed internally by
- /// pluma.
- ///
- /// \return Provider type id.
- ///
- ////////////////////////////////////////////////////////////
- virtual std::string plumaGetType() const = 0;
-
-};
-
-} // namespace pluma
-
-
-#endif // PLUMA_PROVIDER_HPP
-
-
-////////////////////////////////////////////////////////////
-/// \class pluma::Provider
-/// The plugin specific implementations are unknown at the host side,
-/// only their shared interfaces are known. Then, host app needs a generic
-/// way of create interface objects. That's what provider classes are for.
-/// It is the factory design pattern
-/// (http://www.oodesign.com/factory-pattern.html)
-///
-/// Shared interfaces define their provider types (by inheriting from
-/// pluma::Provider). Hosts then use those tipes to get objects from the
-/// plugins.
-/// Plugins derive the shared interface providers so that they can provide
-/// host with specific implementations of the shared interface.
-/// Those specific providers are given to the host through a connect function.
-///
-///
-/// Example: A host app uses objects of type Device. A certain plugin
-/// defines a Keyboard, witch is a Device.
-/// The Host will use DeviceProviders to create objects of type Device.
-/// The plugin will provide host specifically with a KeyboardProvider.
-/// Other plugins may provide host with other derived DeviceProvider types.
-///
-/// Device hpp (shared):
-/// \code
-/// #include <Pluma/Pluma.hpp>
-/// class Device{
-/// public:
-/// virtual std::string getDescription() const = 0;
-/// };
-/// // create DevicedProvider class
-/// PLUMA_PROVIDER_HEADER(Device);
-/// \endcode
-///
-/// Device cpp (shared):
-/// \code
-/// #include "Device.hpp"
-/// generate DevicedProvider with version 6, and compatible with at least v.3
-/// PLUMA_PROVIDER_SOURCE(Device, 6, 3);
-/// \endcode
-///
-///
-/// <br>
-/// Keyboard code on the plugin side:
-/// \code
-/// #include <Pluma/Pluma.hpp>
-/// #include "Device.hpp"
-///
-/// class Keyboard: public Device{
-/// public:
-/// std::string getDescription() const{
-/// return "keyboard";
-/// }
-/// };
-///
-/// // create KeyboardProvider, it implements DeviceProvider
-/// PLUMA_INHERIT_PROVIDER(Keyboard, Device);
-/// \endcode
-///
-/// plugin connector:
-/// \code
-/// #include <Pluma/Connector.hpp>
-/// #include "Keyboard.hpp"
-///
-/// PLUMA_CONNECTOR
-/// bool pluginConnect(pluma::Host& host){
-/// // add a keyboard provider to host
-/// host.add( new KeyboardProvider() );
-/// return true;
-/// }
-/// \endcode
-///
-///
-/// Host application code:
-/// \code
-/// #include <Pluma/Pluma.hpp>
-///
-/// #include "Device.hpp"
-/// #include <iostream>
-/// #include <vector>
-///
-/// int main(){
-///
-/// pluma::Pluma plugins;
-/// // Tell plugins manager to accept providers of the type DeviceProvider
-/// plugins.acceptProviderType<DeviceProvider>();
-/// // Load library "standard_devices" from folder "plugins"
-/// plugins.load("plugins", "standard_devices");
-///
-/// // Get device providers into a vector
-/// std::vector<DeviceProvider*> providers;
-/// plugins.getProviders(providers);
-///
-/// // create a Device from the first provider
-/// if (!providers.empty()){
-/// Device* myDevice = providers.first()->create();
-/// // do something with myDevice
-/// std::cout << device->getDescription() << std::endl;
-/// // and delete it in the end
-/// delete myDevice;
-/// }
-/// return 0;
-/// }
-/// \endcode
-///
-////////////////////////////////////////////////////////////
diff --git a/src/uscxml/plugins/Pluma/uce-dirent.h b/src/uscxml/plugins/Pluma/uce-dirent.h deleted file mode 100644 index bafd4e4..0000000 --- a/src/uscxml/plugins/Pluma/uce-dirent.h +++ /dev/null @@ -1,671 +0,0 @@ -/* - * uce-dirent.h - operating system independent dirent implementation - * - * Copyright (C) 1998-2002 Toni Ronkko - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * ``Software''), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL TONI RONKKO BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * - * May 28 1998, Toni Ronkko <tronkko@messi.uku.fi> - * - * $Id: uce-dirent.h,v 1.7 2002/05/13 10:48:35 tr Exp $ - * - * $Log: uce-dirent.h,v $ - * Revision 1.7 2002/05/13 10:48:35 tr - * embedded some source code directly to the header so that no source - * modules need to be included in the MS Visual C project using the - * interface, removed all the dependencies to other headers of the `uce' - * library so that the header can be made public - * - * Revision 1.6 2002/04/12 16:22:04 tr - * Unified Compiling Environment (UCE) replaced `std' library - * - * Revision 1.5 2001/07/20 16:33:40 tr - * moved to `std' library and re-named defines accordingly - * - * Revision 1.4 2001/07/10 16:47:18 tronkko - * revised comments - * - * Revision 1.3 2001/01/11 13:16:43 tr - * using ``uce-machine.h'' for finding out defines such as `FREEBSD' - * - * Revision 1.2 2000/10/08 16:00:41 tr - * copy of FreeBSD man page - * - * Revision 1.1 2000/07/10 05:53:16 tr - * Initial revision - * - * Revision 1.2 1998/07/19 18:29:14 tr - * Added error reporting capabilities and some asserts. - * - * Revision 1.1 1998/07/04 16:27:51 tr - * Initial revision - * - * - * MSVC 1.0 scans automatic dependencies incorrectly when your project - * contains this very header. The problem is that MSVC cannot handle - * include directives inside #if..#endif block those are never entered. - * Since this header ought to compile in many different operating systems, - * there had to be several conditional blocks that are compiled only in - * operating systems for what they were designed for. MSVC 1.0 cannot - * handle inclusion of sys/dir.h in a part that is compiled only in Apollo - * operating system. To fix the problem you need to insert DIR.H into - * SYSINCL.DAT located in MSVC\BIN directory and restart visual C++. - * Consult manuals for more informaton about the problem. - * - * Since many UNIX systems have dirent.h we assume to have one also. - * However, if your UNIX system does not have dirent.h you can download one - * for example at: http://ftp.uni-mannheim.de/ftp/GNU/dirent/dirent.tar.gz. - * You can also see if you have one of dirent.h, direct.h, dir.h, ndir.h, - * sys/dir.h and sys/ndir.h somewhere. Try defining HAVE_DIRENT_H, - * HAVE_DIRECT_H, HAVE_DIR_H, HAVE_NDIR_H, HAVE_SYS_DIR_H and - * HAVE_SYS_NDIR_H according to the files found. - */ -#ifndef DIRENT_H -#define DIRENT_H -#define DIRENT_H_INCLUDED - -/* find out platform */ -#if defined(MSDOS) /* MS-DOS */ -#elif defined(__MSDOS__) /* Turbo C/Borland */ -# define MSDOS -#elif defined(__DOS__) /* Watcom */ -# define MSDOS -#endif - -#if defined(WIN32) /* MS-Windows */ -#elif defined(__NT__) /* Watcom */ -# define WIN32 -#elif defined(_WIN32) /* Microsoft */ -# define WIN32 -#elif defined(__WIN32__) /* Borland */ -# define WIN32 -#endif - -/* - * See what kind of dirent interface we have unless autoconf has already - * determinated that. - */ -#if !defined(HAVE_DIRENT_H) && !defined(HAVE_DIRECT_H) && !defined(HAVE_SYS_DIR_H) && !defined(HAVE_NDIR_H) && !defined(HAVE_SYS_NDIR_H) && !defined(HAVE_DIR_H) -# if defined(_MSC_VER) /* Microsoft C/C++ */ -/* no dirent.h */ -# elif defined(__BORLANDC__) /* Borland C/C++ */ -# define HAVE_DIRENT_H -# define VOID_CLOSEDIR -# elif defined(__TURBOC__) /* Borland Turbo C */ -/* no dirent.h */ -# elif defined(__WATCOMC__) /* Watcom C/C++ */ -# define HAVE_DIRECT_H -# elif defined(__apollo) /* Apollo */ -# define HAVE_SYS_DIR_H -# elif defined(__hpux) /* HP-UX */ -# define HAVE_DIRENT_H -# elif defined(__alpha) || defined(__alpha__) /* Alpha OSF1 */ -# error "not implemented" -# elif defined(__sgi) /* Silicon Graphics */ -# define HAVE_DIRENT_H -# elif defined(sun) || defined(_sun) /* Sun Solaris */ -# define HAVE_DIRENT_H -# elif defined(__FreeBSD__) /* FreeBSD */ -# define HAVE_DIRENT_H -# elif defined(__linux__) /* Linux */ -# define HAVE_DIRENT_H -# elif defined(__GNUC__) /* GNU C/C++ */ -# define HAVE_DIRENT_H -# else -# error "not implemented" -# endif -#endif - -/* include proper interface headers */ -#if defined(HAVE_DIRENT_H) -# include <dirent.h> -# ifdef FREEBSD -# define NAMLEN(dp) ((int)((dp)->d_namlen)) -# else -# define NAMLEN(dp) ((int)(strlen((dp)->d_name))) -# endif - -#elif defined(HAVE_NDIR_H) -# include <ndir.h> -# define NAMLEN(dp) ((int)((dp)->d_namlen)) - -#elif defined(HAVE_SYS_NDIR_H) -# include <sys/ndir.h> -# define NAMLEN(dp) ((int)((dp)->d_namlen)) - -#elif defined(HAVE_DIRECT_H) -# include <direct.h> -# define NAMLEN(dp) ((int)((dp)->d_namlen)) - -#elif defined(HAVE_DIR_H) -# include <dir.h> -# define NAMLEN(dp) ((int)((dp)->d_namlen)) - -#elif defined(HAVE_SYS_DIR_H) -# include <sys/types.h> -# include <sys/dir.h> -# ifndef dirent -# define dirent direct -# endif -# define NAMLEN(dp) ((int)((dp)->d_namlen)) - -#elif defined(MSDOS) || defined(WIN32) - -/* figure out type of underlaying directory interface to be used */ -# if defined(WIN32) -# define DIRENT_WIN32_INTERFACE -# elif defined(MSDOS) -# define DIRENT_MSDOS_INTERFACE -# else -# error "missing native dirent interface" -# endif - -/*** WIN32 specifics ***/ -# if defined(DIRENT_WIN32_INTERFACE) -# include <windows.h> -# if !defined(DIRENT_MAXNAMLEN) -# define DIRENT_MAXNAMLEN (MAX_PATH) -# endif - - -/*** MS-DOS specifics ***/ -# elif defined(DIRENT_MSDOS_INTERFACE) -# include <dos.h> - -/* Borland defines file length macros in dir.h */ -# if defined(__BORLANDC__) -# include <dir.h> -# if !defined(DIRENT_MAXNAMLEN) -# define DIRENT_MAXNAMLEN ((MAXFILE)+(MAXEXT)) -# endif -# if !defined(_find_t) -# define _find_t find_t -# endif - -/* Turbo C defines ffblk structure in dir.h */ -# elif defined(__TURBOC__) -# include <dir.h> -# if !defined(DIRENT_MAXNAMLEN) -# define DIRENT_MAXNAMLEN ((MAXFILE)+(MAXEXT)) -# endif -# define DIRENT_USE_FFBLK - -/* MSVC */ -# elif defined(_MSC_VER) -# if !defined(DIRENT_MAXNAMLEN) -# define DIRENT_MAXNAMLEN (12) -# endif - -/* Watcom */ -# elif defined(__WATCOMC__) -# if !defined(DIRENT_MAXNAMLEN) -# if defined(__OS2__) || defined(__NT__) -# define DIRENT_MAXNAMLEN (255) -# else -# define DIRENT_MAXNAMLEN (12) -# endif -# endif - -# endif -# endif - -/*** generic MS-DOS and MS-Windows stuff ***/ -# if !defined(NAME_MAX) && defined(DIRENT_MAXNAMLEN) -# define NAME_MAX DIRENT_MAXNAMLEN -# endif -# if NAME_MAX < DIRENT_MAXNAMLEN -# error "assertion failed: NAME_MAX >= DIRENT_MAXNAMLEN" -# endif - - -/* - * Substitute for real dirent structure. Note that `d_name' field is a - * true character array although we have it copied in the implementation - * dependent data. We could save some memory if we had declared `d_name' - * as a pointer refering the name within implementation dependent data. - * We have not done that since some code may rely on sizeof(d_name) to be - * something other than four. Besides, directory entries are typically so - * small that it takes virtually no time to copy them from place to place. - */ -typedef struct dirent { - char d_name[NAME_MAX + 1]; - - /*** Operating system specific part ***/ -# if defined(DIRENT_WIN32_INTERFACE) /*WIN32*/ - WIN32_FIND_DATA data; -# elif defined(DIRENT_MSDOS_INTERFACE) /*MSDOS*/ -# if defined(DIRENT_USE_FFBLK) - struct ffblk data; -# else - struct _find_t data; -# endif -# endif -} dirent; - -/* DIR substitute structure containing directory name. The name is - * essential for the operation of ``rewinndir'' function. */ -typedef struct DIR { - char *dirname; /* directory being scanned */ - dirent current; /* current entry */ - int dirent_filled; /* is current un-processed? */ - - /*** Operating system specific part ***/ -# if defined(DIRENT_WIN32_INTERFACE) - HANDLE search_handle; -# elif defined(DIRENT_MSDOS_INTERFACE) -# endif -} DIR; - -# ifdef __cplusplus -extern "C" { -# endif - -/* supply prototypes for dirent functions */ -static DIR *opendir (const char *dirname); -static struct dirent *readdir (DIR *dirp); -static int closedir (DIR *dirp); -static void rewinddir (DIR *dirp); - -/* - * Implement dirent interface as static functions so that the user does not - * need to change his project in any way to use dirent function. With this - * it is sufficient to include this very header from source modules using - * dirent functions and the functions will be pulled in automatically. - */ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <assert.h> -#include <errno.h> - -/* use ffblk instead of _find_t if requested */ -#if defined(DIRENT_USE_FFBLK) -# define _A_ARCH (FA_ARCH) -# define _A_HIDDEN (FA_HIDDEN) -# define _A_NORMAL (0) -# define _A_RDONLY (FA_RDONLY) -# define _A_SUBDIR (FA_DIREC) -# define _A_SYSTEM (FA_SYSTEM) -# define _A_VOLID (FA_LABEL) -# define _dos_findnext(dest) findnext(dest) -# define _dos_findfirst(name,flags,dest) findfirst(name,dest,flags) -#endif - -static int _initdir (DIR *p); -static const char *_getdirname (const struct dirent *dp); -static void _setdirname (struct DIR *dirp); - -/* - * <function name="opendir"> - * <intro>open directory stream for reading - * <syntax>DIR *opendir (const char *dirname); - * - * <desc>Open named directory stream for read and return pointer to the - * internal working area that is used for retrieving individual directory - * entries. The internal working area has no fields of your interest. - * - * <ret>Returns a pointer to the internal working area or NULL in case the - * directory stream could not be opened. Global `errno' variable will set - * in case of error as follows: - * - * <table> - * [EACESS |Permission denied. - * [EMFILE |Too many open files used by the process. - * [ENFILE |Too many open files in system. - * [ENOENT |Directory does not exist. - * [ENOMEM |Insufficient memory. - * [ENOTDIR |dirname does not refer to directory. This value is not - * reliable on MS-DOS and MS-Windows platforms. Many - * implementations return ENOENT even when the name refers to a - * file.] - * </table> - * </function> - */ -static DIR * -opendir( - const char *dirname) { - DIR *dirp; - assert (dirname != NULL); - - dirp = (DIR*)malloc (sizeof (struct DIR)); - if (dirp != NULL) { - char *p; - - /* allocate room for directory name */ - dirp->dirname = (char*) malloc (strlen (dirname) + 1 + strlen ("\\*.*")); - if (dirp->dirname == NULL) { - /* failed to duplicate directory name. errno set by malloc() */ - free (dirp); - return NULL; - } - /* Copy directory name while appending directory separator and "*.*". - * Directory separator is not appended if the name already ends with - * drive or directory separator. Directory separator is assumed to be - * '/' or '\' and drive separator is assumed to be ':'. */ - strcpy (dirp->dirname, dirname); - p = strchr (dirp->dirname, '\0'); - if (dirp->dirname < p && - *(p - 1) != '\\' && *(p - 1) != '/' && *(p - 1) != ':') { - strcpy (p++, "/"); - } -# ifdef DIRENT_WIN32_INTERFACE - strcpy (p, "*"); /*scan files with and without extension in win32*/ -# else - strcpy (p, "*.*"); /*scan files with and without extension in DOS*/ -# endif - - /* open stream */ - if (_initdir (dirp) == 0) { - /* initialization failed */ - free (dirp->dirname); - free (dirp); - return NULL; - } - } - return dirp; -} - - -/* - * <function name="readdir"> - * <intro>read a directory entry - * <syntax>struct dirent *readdir (DIR *dirp); - * - * <desc>Read individual directory entry and return pointer to a structure - * containing the name of the entry. Individual directory entries returned - * include normal files, sub-directories, pseudo-directories "." and ".." - * and also volume labels, hidden files and system files in MS-DOS and - * MS-Windows. You might want to use stat(2) function to determinate which - * one are you dealing with. Many dirent implementations already contain - * equivalent information in dirent structure but you cannot depend on - * this. - * - * The dirent structure contains several system dependent fields that - * generally have no interest to you. The only interesting one is char - * d_name[] that is also portable across different systems. The d_name - * field contains the name of the directory entry without leading path. - * While d_name is portable across different systems the actual storage - * capacity of d_name varies from system to system and there is no portable - * way to find out it at compile time as different systems define the - * capacity of d_name with different macros and some systems do not define - * capacity at all (besides actual declaration of the field). If you really - * need to find out storage capacity of d_name then you might want to try - * NAME_MAX macro. The NAME_MAX is defined in POSIX standard althought - * there are many MS-DOS and MS-Windows implementations those do not define - * it. There are also systems that declare d_name as "char d_name[1]" and - * then allocate suitable amount of memory at run-time. Thanks to Alain - * Decamps (Alain.Decamps@advalvas.be) for pointing it out to me. - * - * This all leads to the fact that it is difficult to allocate space - * for the directory names when the very same program is being compiled on - * number of operating systems. Therefore I suggest that you always - * allocate space for directory names dynamically. - * - * <ret> - * Returns a pointer to a structure containing name of the directory entry - * in `d_name' field or NULL if there was an error. In case of an error the - * global `errno' variable will set as follows: - * - * <table> - * [EBADF |dir parameter refers to an invalid directory stream. This value - * is not set reliably on all implementations.] - * </table> - * </function> - */ -static struct dirent * -readdir (DIR *dirp) { - assert (dirp != NULL); - if (dirp == NULL) { - errno = EBADF; - return NULL; - } - -#if defined(DIRENT_WIN32_INTERFACE) - if (dirp->search_handle == INVALID_HANDLE_VALUE) { - /* directory stream was opened/rewound incorrectly or it ended normally */ - errno = EBADF; - return NULL; - } -#endif - - if (dirp->dirent_filled != 0) { - /* - * Directory entry has already been retrieved and there is no need to - * retrieve a new one. Directory entry will be retrieved in advance - * when the user calls readdir function for the first time. This is so - * because real dirent has separate functions for opening and reading - * the stream whereas Win32 and DOS dirents open the stream - * automatically when we retrieve the first file. Therefore, we have to - * save the first file when opening the stream and later we have to - * return the saved entry when the user tries to read the first entry. - */ - dirp->dirent_filled = 0; - } else { - /* fill in entry and return that */ -#if defined(DIRENT_WIN32_INTERFACE) - if (FindNextFile (dirp->search_handle, &dirp->current.data) == FALSE) { - /* Last file has been processed or an error occured */ - FindClose (dirp->search_handle); - dirp->search_handle = INVALID_HANDLE_VALUE; - errno = ENOENT; - return NULL; - } - -# elif defined(DIRENT_MSDOS_INTERFACE) - if (_dos_findnext (&dirp->current.data) != 0) { - /* _dos_findnext and findnext will set errno to ENOENT when no - * more entries could be retrieved. */ - return NULL; - } -# endif - - _setdirname (dirp); - assert (dirp->dirent_filled == 0); - } - return &dirp->current; -} - - -/* - * <function name="closedir"> - * <intro>close directory stream. - * <syntax>int closedir (DIR *dirp); - * - * <desc>Close directory stream opened by the `opendir' function. Close of - * directory stream invalidates the DIR structure as well as previously read - * dirent entry. - * - * <ret>The function typically returns 0 on success and -1 on failure but - * the function may be declared to return void on same systems. At least - * Borland C/C++ and some UNIX implementations use void as a return type. - * The dirent wrapper tries to define VOID_CLOSEDIR whenever closedir is - * known to return nothing. The very same definition is made by the GNU - * autoconf if you happen to use it. - * - * The global `errno' variable will set to EBADF in case of error. - * </function> - */ -static int -closedir (DIR *dirp) { - int retcode = 0; - - /* make sure that dirp points to legal structure */ - assert (dirp != NULL); - if (dirp == NULL) { - errno = EBADF; - return -1; - } - - /* free directory name and search handles */ - if (dirp->dirname != NULL) free (dirp->dirname); - -#if defined(DIRENT_WIN32_INTERFACE) - if (dirp->search_handle != INVALID_HANDLE_VALUE) { - if (FindClose (dirp->search_handle) == FALSE) { - /* Unknown error */ - retcode = -1; - errno = EBADF; - } - } -#endif - - /* clear dirp structure to make sure that it cannot be used anymore*/ - memset (dirp, 0, sizeof (*dirp)); -# if defined(DIRENT_WIN32_INTERFACE) - dirp->search_handle = INVALID_HANDLE_VALUE; -# endif - - free (dirp); - return retcode; -} - - -/* - * <function name="rewinddir"> - * <intro>rewind directory stream to the beginning - * <syntax>void rewinddir (DIR *dirp); - * - * <desc>Rewind directory stream to the beginning so that the next call of - * readdir() returns the very first directory entry again. However, note - * that next call of readdir() may not return the same directory entry as it - * did in first time. The directory stream may have been affected by newly - * created files. - * - * Almost every dirent implementation ensure that rewinddir will update - * the directory stream to reflect any changes made to the directory entries - * since the previous ``opendir'' or ``rewinddir'' call. Keep an eye on - * this if your program depends on the feature. I know at least one dirent - * implementation where you are required to close and re-open the stream to - * see the changes. - * - * <ret>Returns nothing. If something went wrong while rewinding, you will - * notice it later when you try to retrieve the first directory entry. - */ -static void -rewinddir (DIR *dirp) { - /* make sure that dirp is legal */ - assert (dirp != NULL); - if (dirp == NULL) { - errno = EBADF; - return; - } - assert (dirp->dirname != NULL); - - /* close previous stream */ -#if defined(DIRENT_WIN32_INTERFACE) - if (dirp->search_handle != INVALID_HANDLE_VALUE) { - if (FindClose (dirp->search_handle) == FALSE) { - /* Unknown error */ - errno = EBADF; - } - } -#endif - - /* re-open previous stream */ - if (_initdir (dirp) == 0) { - /* initialization failed but we cannot deal with error. User will notice - * error later when she tries to retrieve first directory enty. */ - /*EMPTY*/; - } -} - - -/* - * Open native directory stream object and retrieve first file. - * Be sure to close previous stream before opening new one. - */ -static int -_initdir (DIR *dirp) { - assert (dirp != NULL); - assert (dirp->dirname != NULL); - dirp->dirent_filled = 0; - -# if defined(DIRENT_WIN32_INTERFACE) - /* Open stream and retrieve first file */ - dirp->search_handle = FindFirstFile (dirp->dirname, &dirp->current.data); - if (dirp->search_handle == INVALID_HANDLE_VALUE) { - /* something went wrong but we don't know what. GetLastError() could - * give us more information about the error, but then we should map - * the error code into errno. */ - errno = ENOENT; - return 0; - } - -# elif defined(DIRENT_MSDOS_INTERFACE) - if (_dos_findfirst (dirp->dirname, - _A_SUBDIR | _A_RDONLY | _A_ARCH | _A_SYSTEM | _A_HIDDEN, - &dirp->current.data) != 0) { - /* _dos_findfirst and findfirst will set errno to ENOENT when no - * more entries could be retrieved. */ - return 0; - } -# endif - - /* initialize DIR and it's first entry */ - _setdirname (dirp); - dirp->dirent_filled = 1; - return 1; -} - - -/* - * Return implementation dependent name of the current directory entry. - */ -static const char * -_getdirname (const struct dirent *dp) { -#if defined(DIRENT_WIN32_INTERFACE) - return dp->data.cFileName; - -#elif defined(DIRENT_USE_FFBLK) - return dp->data.ff_name; - -#else - return dp->data.name; -#endif -} - - -/* - * Copy name of implementation dependent directory entry to the d_name field. - */ -static void -_setdirname (struct DIR *dirp) { - /* make sure that d_name is long enough */ - assert (strlen (_getdirname (&dirp->current)) <= NAME_MAX); - - strncpy (dirp->current.d_name, - _getdirname (&dirp->current), - NAME_MAX); - dirp->current.d_name[NAME_MAX] = '\0'; /*char d_name[NAME_MAX+1]*/ -} - -# ifdef __cplusplus -} -# endif -# define NAMLEN(dp) ((int)(strlen((dp)->d_name))) - -#else -# error "missing dirent interface" -#endif - - -#endif /*DIRENT_H*/ - diff --git a/src/uscxml/plugins/datamodel/CMakeLists.txt b/src/uscxml/plugins/datamodel/CMakeLists.txt index 2570dda..b004a33 100644 --- a/src/uscxml/plugins/datamodel/CMakeLists.txt +++ b/src/uscxml/plugins/datamodel/CMakeLists.txt @@ -1,99 +1,3 @@ -if (BUILD_DM_ECMA) - if (JSC_FOUND) - set(USCXML_DATAMODELS "ecmascript(JSC) ${USCXML_DATAMODELS}") - # JavaScriptCore ecmascript datamodel - file(GLOB JSC_DATAMODEL - ecmascript/JavaScriptCore/*.cpp - ecmascript/JavaScriptCore/*.h - ecmascript/*.cpp - ecmascript/*.h - ) - file(GLOB_RECURSE JSC_DOM - ecmascript/JavaScriptCore/dom/*.cpp - ecmascript/JavaScriptCore/dom/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("JavaScriptCore" FILES ${JSC_DATAMODEL}) - source_group("dom" FILES ${JSC_DOM}) - - add_library( - datamodel_jsc SHARED - ${JSC_DATAMODEL} - ${JSC_DOM} - "../Plugins.cpp") - target_link_libraries(datamodel_jsc uscxml ${JSC_LIBRARY}) - set_target_properties(datamodel_jsc PROPERTIES FOLDER "Plugin DataModel") - set_target_properties(datamodel_jsc PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(datamodel_jsc PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${JSC_DATAMODEL}) - list (APPEND USCXML_FILES ${JSC_DOM}) - list (APPEND USCXML_OPT_LIBS ${JSC_LIBRARY}) - endif() - - elseif(V8_FOUND) - - # GOOGLE V8 ecmascript datamodel - set(USCXML_DATAMODELS "ecmascript(V8) ${USCXML_DATAMODELS}") - # set(ENV{V8_SRC} ${CMAKE_SOURCE_DIR}/../v8) - if (V8_FOUND AND BUILD_DM_ECMA) - file(GLOB V8_DATAMODEL - ecmascript/v8/*.cpp - ecmascript/v8/*.h - ecmascript/*.cpp - ecmascript/*.h - ) - file(GLOB_RECURSE V8_DOM - ecmascript/v8/dom/*.cpp - ecmascript/v8/dom/*.h - ) - - if (BUILD_AS_PLUGINS) - source_group("V8" FILES ${V8_DATAMODEL}) - source_group("dom" FILES ${V8_DOM}) - - add_library( - datamodel_v8 SHARED - ${V8_DATAMODEL} - ${V8_DOM} - "../Plugins.cpp") - target_link_libraries(datamodel_v8 uscxml ${V8_LIBRARY}) - set_target_properties(datamodel_v8 PROPERTIES FOLDER "Plugin DataModel") - set_target_properties(datamodel_v8 PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(datamodel_v8 PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${V8_DATAMODEL}) - list (APPEND USCXML_FILES ${V8_DOM}) - endif() - endif() - elseif(SPIDERMONKEY_FOUND) - set(USCXML_DATAMODELS "ecmascript(SpiderMonkey) ${USCXML_DATAMODELS}") - # set(ENV{V8_SRC} ${CMAKE_SOURCE_DIR}/../v8) - file(GLOB SPIDERMONKEY_DATAMODEL - ecmascript/SpiderMonkey/*.cpp - ecmascript/SpiderMonkey/*.h - ecmascript/*.cpp - ecmascript/*.h - ) - - if (BUILD_AS_PLUGINS) - source_group("SpiderMonkey" FILES ${SPIDERMONKEY_DATAMODEL}) - - add_library( - datamodel_spidermonkey SHARED - ${SPIDERMONKEY_DATAMODEL} - "../Plugins.cpp") - target_link_libraries(datamodel_spidermonkey uscxml ${SPIDERMONKEY_LIBRARY}) - set_target_properties(datamodel_spidermonkey PROPERTIES FOLDER "Plugin DataModel") - set_target_properties(datamodel_spidermonkey PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(datamodel_spidermonkey PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${SPIDERMONKEY_DATAMODEL}) - endif() - endif() -endif() - - # NULL datamodel (not useful as plugin) set(USCXML_DATAMODELS "null ${USCXML_DATAMODELS}") @@ -104,115 +8,109 @@ file(GLOB NULL_DATAMODEL list (APPEND USCXML_FILES ${NULL_DATAMODEL}) -# Lua datamodel +if (JSC_FOUND) + set(USCXML_DATAMODELS "ecmascript(JSC) ${USCXML_DATAMODELS}") + # JavaScriptCore ecmascript datamodel + file(GLOB JSC_DATAMODEL + ecmascript/JavaScriptCore/*.cpp + ecmascript/JavaScriptCore/*.h + ecmascript/*.cpp + ecmascript/*.h + ) + list (APPEND USCXML_FILES ${JSC_DATAMODEL}) + list (APPEND USCXML_OPT_LIBS ${JSC_LIBRARY}) +endif() + + +if (V8_FOUND) + set(USCXML_DATAMODELS "ecmascript(V8) ${USCXML_DATAMODELS}") + # JavaScriptCore ecmascript datamodel + file(GLOB V8_DATAMODEL + ecmascript/v8/*.cpp + ecmascript/v8/*.h + ecmascript/*.cpp + ecmascript/*.h + ) + list (APPEND USCXML_FILES ${V8_DATAMODEL}) + list (APPEND USCXML_OPT_LIBS ${V8_LIBRARY}) +endif() + -if (BUILD_DM_LUA AND LUA_FOUND AND NOT BUILD_MINIMAL) +if (LUA_FOUND) set(USCXML_DATAMODELS "lua ${USCXML_DATAMODELS}") + # Lua ecmascript datamodel file(GLOB LUA_DATAMODEL lua/*.cpp lua/*.h ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${LUA_DATAMODEL}) - add_library(datamodel_lua SHARED ${LUA_DATAMODEL} "../Plugins.cpp") - target_link_libraries(datamodel_lua - uscxml - ${LUA_LIBRARIES} - ) - set_target_properties(datamodel_lua PROPERTIES FOLDER "Plugin DataModel") - set_target_properties(datamodel_lua PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(datamodel_lua PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${LUA_DATAMODEL}) - endif() + list (APPEND USCXML_FILES ${LUA_DATAMODEL}) + list (APPEND USCXML_OPT_LIBS ${LUA_LIBRARY}) endif() -# XPath datamodel - -if (BUILD_DM_XPATH AND NOT BUILD_MINIMAL) - set(USCXML_DATAMODELS "xpath ${USCXML_DATAMODELS}") - file(GLOB XPATH_DATAMODEL - xpath/*.cpp - xpath/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${XPATH_DATAMODEL}) - add_library(datamodel_xpath SHARED ${XPATH_DATAMODEL} "../Plugins.cpp") - target_link_libraries(datamodel_xpath uscxml) - set_target_properties(datamodel_xpath PROPERTIES FOLDER "Plugin DataModel") - set_target_properties(datamodel_xpath PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(datamodel_xpath PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${XPATH_DATAMODEL}) +find_package(SWIG) +if (NOT SWIG_FOUND) + message(STATUS "No swig binary found, not generating DOM classes") +elseif(SWIG_VERSION VERSION_LESS 3.0.8) + message(STATUS "SWIG version > 3.0.8 is recommended, found ${SWIG_VERSION} - skipping DOM generation") +else() + if (JSC_FOUND) + add_custom_target(jsc-bindings + COMMAND ${SWIG_EXECUTABLE} + -I${XercesC_INCLUDE_DIRS} + -I${PROJECT_SOURCE_DIR}/src + -I${CMAKE_BINARY_DIR} + -javascript + -jsc + -c++ + -o ${CMAKE_CURRENT_SOURCE_DIR}/ecmascript/JavaScriptCore/JSCDOM.cpp.inc + ecmascript/JavaScriptCore/bindings.i + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Creating the DOM for JavaScriptCore ...") + + # list (APPEND JSC_DATAMODEL ${CMAKE_CURRENT_SOURCE_DIR}/ecmascript/JavaScriptCore/JSCDOM.cpp.inc) + set_target_properties(jsc-bindings PROPERTIES FOLDER "Bindings") endif() -endif() -# SWI PROLOG datamodel - -if (SWI_FOUND AND BUILD_DM_PROLOG AND NOT BUILD_MINIMAL) - set(USCXML_DATAMODELS "prolog ${USCXML_DATAMODELS}") - - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/prolog/swi/SWIConfig.h.in ${CMAKE_BINARY_DIR}/uscxml/SWIConfig.h) - -# message(FATAL_ERROR "SWI_INCLUDE_DIR: ${SWI_INCLUDE_DIR}") - - # if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") - # set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -read_only_relocs suppress") - # set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -read_only_relocs suppress") - # set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -read_only_relocs suppress") - # set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -read_only_relocs suppress") - # endif() - file(GLOB_RECURSE SWI_DATAMODEL - prolog/swi/*.cpp - prolog/swi/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${SWI_DATAMODEL}) - add_library( - datamodel_swi SHARED - ${SWI_DATAMODEL} - "../Plugins.cpp") - target_link_libraries(datamodel_swi - uscxml - ${GMP_LIBRARY} - ${CURSES_LIBRARIES} - ${SWI_LIBRARY}) - set_target_properties(datamodel_swi PROPERTIES FOLDER "Plugin DataModel") - set_target_properties(datamodel_swi PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(datamodel_swi PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${SWI_DATAMODEL}) + if (V8_FOUND) + add_custom_target(v8-bindings + COMMAND ${SWIG_EXECUTABLE} + -I${XercesC_INCLUDE_DIRS} + -I${PROJECT_SOURCE_DIR}/src + -I${CMAKE_BINARY_DIR} + -javascript + -v8 + -c++ + -o ${CMAKE_CURRENT_SOURCE_DIR}/ecmascript/v8/V8DOM.cpp.inc + ecmascript/v8/bindings.i + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Creating the DOM for V8 ...") + + # list (APPEND V8_DATAMODEL ${CMAKE_CURRENT_SOURCE_DIR}/ecmascript/v8/V8DOM.cpp.inc) + set_target_properties(v8-bindings PROPERTIES FOLDER "Bindings") + endif() -endif() - -# Promela datamodel - -if (BUILD_DM_PROMELA AND NOT BUILD_MINIMAL) - set(USCXML_DATAMODELS "promela ${USCXML_DATAMODELS}") - - file(GLOB_RECURSE PROMELA_DATAMODEL - promela/*.cpp - promela/*.c - promela/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES PROMELA_DATAMODEL) - add_library( - datamodel_promela SHARED - ${PROMELA_DATAMODEL} - "../Plugins.cpp") - target_link_libraries(datamodel_promela uscxml) - set_target_properties(datamodel_promela PROPERTIES FOLDER "Plugin DataModel") - set_target_properties(datamodel_promela PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(datamodel_promela PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${PROMELA_DATAMODEL}) + if (LUA_FOUND) + add_custom_target(lua-bindings + COMMAND ${SWIG_EXECUTABLE} + -I${XercesC_INCLUDE_DIRS} + -I${PROJECT_SOURCE_DIR}/src + -I${CMAKE_BINARY_DIR} + -lua + -c++ + -o ${CMAKE_CURRENT_SOURCE_DIR}/lua/LuaDOM.cpp.inc + lua/bindings.i + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Creating the DOM for Lua ...") + + # list (APPEND V8_DATAMODEL ${CMAKE_CURRENT_SOURCE_DIR}/ecmascript/v8/V8DOM.cpp.inc) + set_target_properties(lua-bindings PROPERTIES FOLDER "Bindings") endif() endif() + set(USCXML_INCLUDE_DIRS ${USCXML_INCLUDE_DIRS} PARENT_SCOPE) set(USCXML_FILES ${USCXML_FILES} PARENT_SCOPE) set(USCXML_DATAMODELS ${USCXML_DATAMODELS} PARENT_SCOPE) diff --git a/src/uscxml/plugins/datamodel/common/bindings/dom/defines.i b/src/uscxml/plugins/datamodel/common/bindings/dom/defines.i new file mode 100644 index 0000000..0ef7f0e --- /dev/null +++ b/src/uscxml/plugins/datamodel/common/bindings/dom/defines.i @@ -0,0 +1,247 @@ +/* + * Copyright 2002,2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * defines.i - This file contains all directives included + * verbatim into the C++ output file + */ + +%{ +#include "xercesc/sax/InputSource.hpp" +#include "xercesc/sax/SAXException.hpp" +#include "xercesc/sax/SAXParseException.hpp" +#include "xercesc/sax/Locator.hpp" +#include "xercesc/sax/HandlerBase.hpp" +#include "xercesc/sax2/Attributes.hpp" +#include "xercesc/sax2/ContentHandler.hpp" +#include "xercesc/sax2/LexicalHandler.hpp" +#include "xercesc/sax2/DefaultHandler.hpp" +#include "xercesc/sax2/SAX2XMLReader.hpp" +#include "xercesc/sax2/XMLReaderFactory.hpp" +#include "xercesc/util/PlatformUtils.hpp" +#include "xercesc/util/TransService.hpp" +#include "xercesc/util/XMLString.hpp" +#include "xercesc/util/XMLUri.hpp" +#include "xercesc/util/QName.hpp" +#include "xercesc/util/HexBin.hpp" +#include "xercesc/util/Base64.hpp" +#include "xercesc/parsers/AbstractDOMParser.hpp" +#include "xercesc/parsers/XercesDOMParser.hpp" +#include "xercesc/parsers/SAXParser.hpp" +#include "xercesc/dom/DOM.hpp" +#include "xercesc/framework/LocalFileInputSource.hpp" +#include "xercesc/framework/MemBufInputSource.hpp" +#include "xercesc/framework/StdInInputSource.hpp" +#include "xercesc/framework/URLInputSource.hpp" +#include "xercesc/framework/XMLGrammarDescription.hpp" +#include "xercesc/framework/XMLDTDDescription.hpp" +#include "xercesc/framework/XMLSchemaDescription.hpp" +#include "xercesc/util/NameIdPool.hpp" +#include "xercesc/util/XMLEnumerator.hpp" +#include "xercesc/framework/XMLValidator.hpp" +#include "xercesc/validators/common/Grammar.hpp" +#include "xercesc/validators/DTD/DTDAttDef.hpp" +#include "xercesc/validators/DTD/DTDAttDefList.hpp" +#include "xercesc/validators/DTD/DTDGrammar.hpp" +#include "xercesc/validators/DTD/DTDValidator.hpp" +#include "xercesc/validators/schema/SchemaGrammar.hpp" +#include "xercesc/validators/schema/SchemaValidator.hpp" +#include "xercesc/validators/schema/SchemaAttDefList.hpp" +#include "xercesc/validators/schema/SchemaAttDef.hpp" +#include "xercesc/framework/XMLFormatter.hpp" +#include "xercesc/framework/MemBufFormatTarget.hpp" +#include "xercesc/framework/LocalFileFormatTarget.hpp" +#include "xercesc/framework/StdOutFormatTarget.hpp" +#include "xercesc/framework/Wrapper4InputSource.hpp" +#include "xercesc/framework/psvi/PSVIHandler.hpp" + +// for resolving XMLExceptions +#include "xercesc/util/ArrayIndexOutOfBoundsException.hpp" +#include "xercesc/util/EmptyStackException.hpp" +#include "xercesc/util/IllegalArgumentException.hpp" +#include "xercesc/util/InvalidCastException.hpp" +#include "xercesc/util/IOException.hpp" +#include "xercesc/util/NoSuchElementException.hpp" +#include "xercesc/util/NullPointerException.hpp" +#include "xercesc/util/NumberFormatException.hpp" +#include "xercesc/util/ParseException.hpp" +#include "xercesc/util/RuntimeException.hpp" +#include "xercesc/util/SchemaDateTimeException.hpp" +#include "xercesc/util/TranscodingException.hpp" +#include "xercesc/util/UnexpectedEOFException.hpp" +#include "xercesc/util/UnsupportedEncodingException.hpp" +#include "xercesc/util/UTFDataFormatException.hpp" +#include "xercesc/util/XMLNetAccessor.hpp" +#include "xercesc/internal/XSerializationException.hpp" +#include "xercesc/validators/datatype/InvalidDatatypeFacetException.hpp" +#include "xercesc/validators/datatype/InvalidDatatypeValueException.hpp" +#include "xercesc/validators/schema/identity/XPathException.hpp" + +XERCES_CPP_NAMESPACE_USE + +// we initialize the static UTF-8 transcoding info +// these are used by the typemaps to convert between +// Xerces internal UTF-16 and Perl's internal UTF-8 +static XMLCh* UTF8_ENCODING = NULL; +static XMLTranscoder* UTF8_TRANSCODER = NULL; + +static bool DEBUG_UTF8_OUT = 0; +static bool DEBUG_UTF8_IN = 0; + +%} + +/* + * Import the language specific includes + */ + +#ifdef SWIGPERL +%include "interface/Perl/defines.i" +%include "interface/Perl/transcode.i" +%include "interface/Perl/errors.i" +#endif + + +// These get wrapped by SWIG so that we can modify them from the scripting language +bool DEBUG_UTF8_OUT; +bool DEBUG_UTF8_IN; + +/* + +%{ +XMLException* +copyXMLException(const XMLException& e) +{ + if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgArrayIndexOutOfBoundsException_Name) + { + return (XMLException*)((ArrayIndexOutOfBoundsException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgEmptyStackException_Name) + { + return (XMLException*)((EmptyStackException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgIllegalArgumentException_Name) + { + return (XMLException*)((IllegalArgumentException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgInvalidCastException_Name) + { + return (XMLException*)((InvalidCastException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgIOException_Name) + { + return (XMLException*)((IOException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgNoSuchElementException_Name) + { + return (XMLException*)((NoSuchElementException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgNullPointerException_Name) + { + return (XMLException*)((NullPointerException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgNumberFormatException_Name) + { + return (XMLException*)((NumberFormatException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgParseException_Name) + { + return (XMLException*)((ParseException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgXMLPlatformUtilsException_Name) + { + return (XMLException*)((XMLPlatformUtilsException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgRuntimeException_Name) + { + return (XMLException*)((RuntimeException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgSchemaDateTimeException_Name) + { + return (XMLException*)((SchemaDateTimeException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgTranscodingException_Name) + { + return (XMLException*)((TranscodingException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgUnexpectedEOFException_Name) + { + return (XMLException*)((UnexpectedEOFException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgUnsupportedEncodingException_Name) + { + return (XMLException*)((UnsupportedEncodingException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgUTFDataFormatException_Name) + { + return (XMLException*)((UTFDataFormatException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgNetAccessorException_Name) + { + return (XMLException*)((NetAccessorException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgMalformedURLException_Name) + { + return (XMLException*)((MalformedURLException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgXSerializationException_Name) + { + return (XMLException*)((XSerializationException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgInvalidDatatypeFacetException_Name) + { + return (XMLException*)((InvalidDatatypeFacetException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgInvalidDatatypeValueException_Name) + { + return (XMLException*)((InvalidDatatypeValueException*)&e)->duplicate(); + } + else if(e.getType() == XERCES_CPP_NAMESPACE::XMLUni::fgXPathException_Name) + { + return (XMLException*)((XPathException*)&e)->duplicate(); + } + else + { + SWIG_Perl_SetErrorf("Unknown Exception type: %d", e.getType()); + } +} + +void +makeXMLException(const XMLException& e){ + SV *error = ERRSV; + SWIG_MakePtr(error, (void *) copyXMLException(e), SWIGTYPE_p_XERCES_CPP_NAMESPACE__XMLException, SWIG_SHADOW|0); +} + +void +makeDOMException(const DOMException& e){ + SV *error = ERRSV; + SWIG_MakePtr(error, (void *) new DOMException(e), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException, SWIG_SHADOW|0); +} + +void +makeSAXNotRecognizedException(const SAXNotRecognizedException& e){ + SV *error = ERRSV; + SWIG_MakePtr(error, (void *) new SAXNotRecognizedException(e), SWIGTYPE_p_XERCES_CPP_NAMESPACE__SAXNotRecognizedException, SWIG_SHADOW|0); +} + +void +makeSAXNotSupportedException(const SAXNotSupportedException& e){ + SV *error = ERRSV; + SWIG_MakePtr(error, (void *) new SAXNotSupportedException(e), SWIGTYPE_p_XERCES_CPP_NAMESPACE__SAXNotSupportedException, SWIG_SHADOW|0); +} + +%} + +*/
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/common/bindings/dom/dom.i b/src/uscxml/plugins/datamodel/common/bindings/dom/dom.i new file mode 100644 index 0000000..abe808b --- /dev/null +++ b/src/uscxml/plugins/datamodel/common/bindings/dom/dom.i @@ -0,0 +1,125 @@ +/* + * Copyright 2002,2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * All DOM classes and their related SWIG alterations go in this interface file + */ + +/* + * the DOM classes gets a special exception handler + * 'goto fail' must be called - either explicitly, or via SWIG_croak() + * to ensure that any variable cleanup is done - to avoid memory leaks. + * By making these macros, it reduces the code size dramatically + */ +/* +%{ +#define CATCH_DOM_EXCEPTION \ + catch (const XMLException& e) \ + { \ + makeXMLException(e); \ + goto fail; \ + } \ + catch (const DOMException& e) \ + { \ + makeDOMException(e); \ + goto fail; \ + } \ + catch (...) \ + { \ + SWIG_croak("Handling Unknown exception"); \ + goto fail; \ + } +%} + +%exception { + try + { + $action + } + CATCH_DOM_EXCEPTION +} +*/ +// Introduced in DOM Level 1 +%include "xercesc/dom/DOMException.hpp" +%include "xercesc/dom/DOMNode.hpp" +%include "xercesc/dom/DOMAttr.hpp" +%include "xercesc/dom/DOMElement.hpp" +%include "xercesc/dom/DOMEntity.hpp" +%include "xercesc/dom/DOMDocumentType.hpp" +%include "xercesc/dom/DOMCharacterData.hpp" +%include "xercesc/dom/DOMComment.hpp" +%include "xercesc/dom/DOMText.hpp" +%include "xercesc/dom/DOMCDATASection.hpp" +%include "xercesc/dom/DOMNodeList.hpp" +%include "xercesc/dom/DOMNamedNodeMap.hpp" +%include "xercesc/dom/DOMDocumentFragment.hpp" +%include "xercesc/dom/DOMDocumentType.hpp" +%include "xercesc/dom/DOMEntityReference.hpp" +%include "xercesc/dom/DOMNotation.hpp" +%include "xercesc/dom/DOMProcessingInstruction.hpp" + +// Introduced in DOM Level 2 +/* +%include "xercesc/dom/DOMDocumentRange.hpp" +%include "xercesc/dom/DOMDocumentTraversal.hpp" +%include "xercesc/dom/DOMNodeIterator.hpp" +%include "xercesc/dom/DOMNodeFilter.hpp" +%include "xercesc/dom/DOMRange.hpp" +%include "xercesc/dom/DOMRangeException.hpp" +%include "xercesc/dom/DOMTreeWalker.hpp" +%include "xercesc/dom/DOMDocumentTraversal.hpp" + +%ignore XERCES_CPP_NAMESPACE::DOMImplementation::loadDOMExceptionMsg; +*/ + +/* + * Introduced in DOM Level 3 + */ +/* +%include "xercesc/dom/DOMImplementationLS.hpp" +%include "xercesc/dom/DOMImplementation.hpp" +%include "xercesc/dom/DOMImplementationSource.hpp" +%include "xercesc/dom/DOMImplementationRegistry.hpp" + +%include "xercesc/dom/DOMErrorHandler.hpp" +%include "xercesc/dom/DOMEntityResolver.hpp" +%include "xercesc/dom/DOMDocument.hpp" +%include "xercesc/dom/DOMLocator.hpp" + +// DOMBuiler +%include "xercesc/dom/DOMInputSource.hpp" +%include "xercesc/framework/Wrapper4InputSource.hpp" +%include "xercesc/framework/Wrapper4DOMInputSource.hpp" +%include "xercesc/dom/DOMBuilder.hpp" + +// DOMWriter +%import "xercesc/framework/XMLFormatter.hpp" +%include "xercesc/framework/StdOutFormatTarget.hpp" +%include "xercesc/framework/LocalFileFormatTarget.hpp" +%include "xercesc/framework/MemBufFormatTarget.hpp" +%include "xercesc/dom/DOMWriter.hpp" +%include "xercesc/dom/DOMWriterFilter.hpp" +*/ + +%extend XERCES_CPP_NAMESPACE::DOMNode { + bool operator==(const DOMNode *other) { + return self->isSameNode(other); + } + bool operator!=(const DOMNode *other) { + return !self->isSameNode(other); + } +}; + diff --git a/src/uscxml/plugins/datamodel/common/bindings/dom/ignore.i b/src/uscxml/plugins/datamodel/common/bindings/dom/ignore.i new file mode 100644 index 0000000..a4a6194 --- /dev/null +++ b/src/uscxml/plugins/datamodel/common/bindings/dom/ignore.i @@ -0,0 +1,392 @@ +// Operators we don't want to wrap +%ignore operator =; +%ignore operator new; +%ignore operator delete; +%ignore operator <<; + + +// both of these static variables cause trouble +// the transcoding service is only useful to C++ anyway. +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::fgTransService; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::fgNetAccessor; + +// these are other static variables that are useless to Perl +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::fgUserPanicHandler; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::fgDefaultPanicHandler; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::fgMemoryManager; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::fgDefaulPanicHandler; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::fgArrayMemoryManager; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::fgAtomicMutex; + +// these are methods that are useless in Perl +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::curFilePos; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::closeFile; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::fileSize; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::openFile; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::openFileToWrite; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::openStdInHandle; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::readFileBuffer; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::writeBufferToFile; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::resetFile; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::getFullPath; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::getCurrentDirectory; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::isAnySlash; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::removeDotSlash; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::removeDotDotSlash; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::isRelative; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::weavePaths; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::getCurrentMillis; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::closeMutex; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::lockMutex; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::makeMutex; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::unlockMutex; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::loadMsgSet; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::compareAndSwap; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::atomicIncrement; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::atomicDecrement; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::recognizeNEL; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::isNELRecognized; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::strictIANAEncoding; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::isStrictIANAEncoding; +%ignore XERCES_CPP_NAMESPACE::XMLPlatformUtils::alignPointerForNewBlockAllocation; + +%ignore PerlErrorCallbackHandler::warning(const SAXParseException&); +%ignore PerlErrorCallbackHandler::error(const SAXParseException&); +%ignore PerlErrorCallbackHandler::fatalError(const SAXParseException&); + +// ignore the char* versions of ALL constructors +%ignore XERCES_CPP_NAMESPACE::DOMBuilder::parseURI(const char *const ); +%ignore MemBufInputSource(const XMLByte* const, const unsigned int, const char* const, + const bool foo=false, + MemoryManager* const foo=XMLPlatformUtils::fgMemoryManager); + +%ignore XMLURL(const XMLURL&,const char* const, + MemoryManager* const foo=XMLPlatformUtils::fgMemoryManager); +%ignore XMLURL(const char* const, + MemoryManager* const foo=XMLPlatformUtils::fgMemoryManager); +%ignore XMLURL(const XMLCh* const, const char* const, + MemoryManager* const foo=XMLPlatformUtils::fgMemoryManager); +%ignore URLInputSource(const XMLCh* const, const char* const, + MemoryManager* const foo=XMLPlatformUtils::fgMemoryManager); +%ignore URLInputSource(const XMLCh* const, const char* const, const char* const, + MemoryManager* const foo=XMLPlatformUtils::fgMemoryManager); +%ignore XMLFormatter( + const char* const outEncoding + , const char* const docVersion + , XMLFormatTarget* const target + , const EscapeFlags escapeFlags = NoEscapes + , const UnRepFlags unrepFlags = UnRep_Fail + , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); + +%ignore XMLFormatter( + const char* const outEncoding + , XMLFormatTarget* const target + , const EscapeFlags escapeFlags = NoEscapes + , const UnRepFlags unrepFlags = UnRep_Fail + , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); + +%ignore XERCES_CPP_NAMESPACE::AttributeList::getValue(const char* const) const; +%ignore setExternalSchemaLocation(const char* const); +%ignore setExternalNoNamespaceSchemaLocation(const char* const); + +/* + * Ignore these char* methods for all Parsers + */ +%ignore loadGrammar(const char* const systemId, + const short grammarType, + const bool toCache = false); + + +%ignore parse(const char* const); +%ignore parseFirst(const char *const,XMLPScanToken&,const bool); + +/* + * We need these constructors to always adopt the input strings + * unfortunately, the default is set to FALSE, so we must ignore + * all constructors that use the default, and explicitly set it + * in a typemap. While we are at it, we also ignore the constructor + * that sets the MemoryManager + */ +%ignore MemBufInputSource(const XMLByte* const, const unsigned int, const XMLCh* const); +%ignore MemBufInputSource(const XMLByte* const, const unsigned int, const XMLCh* const, + const bool, MemoryManager *const); +%ignore Wrapper4InputSource(InputSource* const); +%ignore Wrapper4InputSource(InputSource* const, const bool adoptFlag + , MemoryManager* const); +%ignore Wrapper4DOMInputSource( + DOMInputSource* const inputSource + , const bool + , MemoryManager* const); +%ignore Wrapper4DOMInputSource( + DOMInputSource* const inputSource); + +// These are odd cases. We want access to skip the method with the +// memory manager argument, but we want access to the optional argument +// *after* the memory manager. So we just ignore the method that doesn't +// include the memory manager - since our typemap defaults that argument +// they are redundant +%ignore createDOMBuilder(short const,const XMLCh* const); +%ignore SAXParser(XMLValidator* const); +%ignore createXMLReader(); + +/* + * ignore the constructors which set the MemoryManager + */ +%ignore createDocument(const XMLCh *,const XMLCh *,DOMDocumentType *,MemoryManager *const); +%ignore createDocument(MemoryManager *const); +%ignore createDOMWriter(MemoryManager *const); +%ignore XMLFormatter( + const XMLCh* const + , const XMLCh* const + , XMLFormatTarget* const + , const EscapeFlags + , const UnRepFlags + , MemoryManager* const); +%ignore XMLFormatter( + const XMLCh* const + , XMLFormatTarget* const + , const EscapeFlags + , const UnRepFlags + , MemoryManager* const); +%ignore LocalFileFormatTarget(const XMLCh* const, MemoryManager* const); +%ignore LocalFileFormatTarget(const char* const, + MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); +%ignore MemBufFormatTarget(int, MemoryManager* const); +%ignore XercesDOMParser(XMLValidator* const, MemoryManager* const); +%ignore URLInputSource(const XMLURL&, MemoryManager *const); +%ignore URLInputSource(const XMLCh* const, MemoryManager *const); +%ignore URLInputSource(const XMLCh* const, const XMLCh* const,MemoryManager *const); +%ignore URLInputSource(const XMLCh* const, const XMLCh* const, const XMLCh* const,MemoryManager *const); +%ignore StdInInputSource(MemoryManager* const); +%ignore LocalFileInputSource(const XMLCh* const,MemoryManager* const); +%ignore LocalFileInputSource(const XMLCh* const,const XMLCh* const,MemoryManager* const); +%ignore XMLUri(MemoryManager* const); +%ignore XMLUri(const XMLCh* const,MemoryManager* const); +%ignore XMLUri(const XMLUri* const,const XMLCh* const,MemoryManager* const); +%ignore XMLURL(MemoryManager* const); +%ignore XMLURL(const XMLCh* const,MemoryManager* const); +%ignore XMLURL(const XMLCh* const,const XMLCh* const,MemoryManager* const); +%ignore XMLNotationDecl(MemoryManager* const); +%ignore XMLNotationDecl( + const XMLCh* const + , const XMLCh* const + , const XMLCh* const + , const XMLCh* const + , MemoryManager* const + ); +%ignore getAttTypeString(const AttTypes + , MemoryManager* const); +%ignore getDefAttTypeString(const DefAttTypes + , MemoryManager* const); + +%ignore DTDGrammar(MemoryManager *const); +%ignore SchemaValidator(XMLErrorReporter *const,MemoryManager *const); +%ignore SchemaGrammar(MemoryManager *const); +%ignore QName(MemoryManager* const); +%ignore QName + ( + const XMLCh* const prefix + , const XMLCh* const localPart + , const unsigned int uriId + , MemoryManager* const + ); +%ignore QName + ( + const XMLCh* const rawName + , const unsigned int uriId + , MemoryManager* const + ); + + +// changing the locale and the NLS home is probably useful +// but changing the panic manager and memory manager is not +%ignore Initialize(const char* const + , const char* const + , PanicHandler* const + , MemoryManager* const); +%ignore Initialize(const char* const + , const char* const + , PanicHandler* const); + +// this constructor has a single XMLCh that interfers with another bool constructor +%ignore DTDEntityDecl( + const XMLCh* const + , const XMLCh + , const bool fromIntSubset = false + , const bool specialChar = false); + +/* + * Perl won't need to create exceptions + */ + +%ignore DOMException(); +%ignore DOMException( + short code + , const XMLCh* message + , MemoryManager* const memoryManager = XMLPlatformUtils::fgMemoryManager + ); + +%ignore DOMException(const DOMException &other); + +%ignore DOMRangeException(); +%ignore DOMRangeException( + RangeExceptionCode code + , const XMLCh* message + , MemoryManager* const memoryManager + ); +%ignore DOMRangeException(const DOMRangeException &other); + +%ignore SAXException(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) ; +%ignore SAXException(const XMLCh* const msg, + MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) ; +%ignore SAXException(const char* const msg, + MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) ; +%ignore SAXException(const SAXException& toCopy) ; + +%ignore SAXNotSupportedException(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) ; +%ignore SAXNotSupportedException(const XMLCh* const msg, + MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) ; +%ignore SAXNotSupportedException(const char* const msg, + MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) ; + +%ignore SAXNotRecognizedException(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) ; +%ignore SAXNotRecognizedException(const XMLCh* const msg, + MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) ; +%ignore SAXNotRecognizedException(const char* const msg, + MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) ; + +%ignore SAXParseException(const XMLCh* const message, const Locator& locator, + MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); +%ignore SAXParseException + ( + const XMLCh* const message + , const XMLCh* const publicId + , const XMLCh* const systemId + , const XMLSSize_t lineNumber + , const XMLSSize_t columnNumber + , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager + ); +%ignore SAXParseException(const SAXParseException& toCopy); + +/* + * methods not needed by the XMLValidator interfaces + */ +%ignore XERCES_CPP_NAMESPACE::XMLValidator::emitError; +%ignore XERCES_CPP_NAMESPACE::XMLValidator::checkRootElement; +%ignore XERCES_CPP_NAMESPACE::XMLValidator::reinitMsgMutex; +%ignore XERCES_CPP_NAMESPACE::XMLValidator::reinitMsgLoader; +%ignore XERCES_CPP_NAMESPACE::XMLValidator::setErrorReporter; +%ignore XERCES_CPP_NAMESPACE::XMLValidator::setScannerInfo; +%ignore XERCES_CPP_NAMESPACE::XMLValidator::handlesSchema; +%ignore XERCES_CPP_NAMESPACE::XMLValidator::handlesDTD; +%ignore XERCES_CPP_NAMESPACE::XMLValidator::validateElement; +%ignore XERCES_CPP_NAMESPACE::XMLValidator::validateAttrValue; +%ignore XERCES_CPP_NAMESPACE::XMLValidator::requiresNamespaces; +%ignore XERCES_CPP_NAMESPACE::XMLValidator::reset; +%ignore XERCES_CPP_NAMESPACE::XMLValidator::postParseValidation; +%ignore XERCES_CPP_NAMESPACE::XMLValidator::preContentValidation; +%ignore XERCES_CPP_NAMESPACE::XMLValidator::faultInAttr; +%ignore XERCES_CPP_NAMESPACE::XMLValidator::checkContent; + +// ignore all the constructors for the Grammar components +%ignore XERCES_CPP_NAMESPACE::DTDAttDef::DTDAttDef; +%ignore XERCES_CPP_NAMESPACE::DTDElementDecl::DTDElementDecl; +%ignore XERCES_CPP_NAMESPACE::DTDEntityDecl::DTDEntityDecl; +%ignore XERCES_CPP_NAMESPACE::SchemaElementDecl::SchemaElementDecl; +%ignore XERCES_CPP_NAMESPACE::SchemaAttDef::SchemaAttDef; +%ignore XERCES_CPP_NAMESPACE::DTDAttDefList::DTDAttDefList; +%ignore XERCES_CPP_NAMESPACE::SchemaAttDefList::SchemaAttDefList; + +// desperate attempt to get this working +// FIXME +%ignore SchemaAttDefList + ( + RefHash2KeysTableOf<SchemaAttDef>* const listToUse, + MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager + ); + +%ignore DTDAttDefList + ( + RefHashTableOf<DTDAttDef>* const listToUse, + MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager + ); + +/* + * methods not needed by the public Parser interfaces + * + * this is probably because I'm not using AdvDocHandlers and things + * that want to control the parsing process, but until someone asks + * for them, I'm going to leave them out. + */ + +// XMLEntityHandler interface +%ignore endInputSource; +%ignore expandSystemId; +%ignore resetEntities; +%ignore resolveEntity; +%ignore startInputSource; + +// XMLDocumentHandler interface. +%ignore docCharacters; +%ignore docComment; +%ignore docPI; +%ignore endDocument; +%ignore endElement; +%ignore endEntityReference; +%ignore ignorableWhitespace; +%ignore resetDocument; +%ignore startDocument; +%ignore startElement; +%ignore startEntityReference; +%ignore XMLDecl; + +// depricated methods - don't ask me to include these +%ignore getDoValidation; +%ignore setDoValidation; +%ignore attDef; +%ignore doctypeComment; +%ignore doctypeDecl; +%ignore doctypePI; +%ignore doctypeWhitespace; +%ignore elementDecl; +%ignore endAttList; +%ignore endIntSubset; +%ignore endExtSubset; +%ignore entityDecl; +%ignore resetDocType; +%ignore notationDecl; +%ignore startAttList; +%ignore startIntSubset; +%ignore startExtSubset; +%ignore TextDecl; + +// const methods +%ignore getDocumentHandler() const; +%ignore getErrorHandler() const; +%ignore getEntityResolver() const; +%ignore getXMLEntityResolver() const; +%ignore getPSVIHandler() const; + +%ignore getContentSpec() const; +%ignore getBaseName() const; +%ignore getElementName() const; +%ignore findAttDef(unsigned long const,XMLCh const *const) const; +%ignore findAttDef(XMLCh const *const,XMLCh const *const) const; +%ignore getAttDef(unsigned int) const; +%ignore getAttDef(XMLCh const *const) const; +%ignore getAttDef(XMLCh const *const,int const) const; +%ignore getElemDecl(unsigned int const) const; +%ignore getElemDecl(unsigned int const,XMLCh const *const,XMLCh const *const,unsigned int) const; +%ignore getNotationDecl(XMLCh const *const) const; +%ignore getEntityDecl(XMLCh const *const) const; +%ignore getEntityDeclPool() const; +%ignore getAttWildCard() const; +%ignore getAnnotation() const; +%ignore getAnnotation(void const *const) const; +%ignore getAnnotations() const; +%ignore findAttDefLocalPart(unsigned long const,XMLCh const *const) const; +%ignore getBaseAttDecl() const; +%ignore getFilter() const; +%ignore getPrefix() const; +%ignore getLocalPart() const; +%ignore getRawName() const; diff --git a/src/uscxml/plugins/datamodel/common/bindings/dom/typemaps-general.i b/src/uscxml/plugins/datamodel/common/bindings/dom/typemaps-general.i new file mode 100644 index 0000000..d82e508 --- /dev/null +++ b/src/uscxml/plugins/datamodel/common/bindings/dom/typemaps-general.i @@ -0,0 +1,169 @@ +/* + * Copyright 2002,2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * Scripting languages are not going to change the default memory manager + * so we always default this argument + */ +/*%typemap(in,numinputs=0) XERCES_CPP_NAMESPACE::MemoryManager* const manager "$1 = XERCES_CPP_NAMESPACE::XMLPlatformUtils::fgMemoryManager;"*/ + +/* + * MemBufInputSource::MemBufInputSource() + * + * ALWAYS ADOPT BUFFER (I.E. MAKE A COPY OF IT) SINCE IT IS TAKEN FROM + * THE SCRIPTING LANGUAGE, AND WHO KNOWS WHAT WILL HAPPEN TO IT AFTER + * IT IS GIVEN TO THE + * CONSTRUCTOR + */ + +// %typemap(in,numinputs=0) (unsigned int byteCount) "$1 = 0;" + +/* + * These arguments are used to indicate that Xerces-C should + * adopt a resource being passed as an argument. We should + * *always* tell Xerces-C to adopt. + */ +/*%typemap(in,numinputs=0) const bool adoptFlag "$1 = true;" // for Wrapper4InputSource + // and Wrapper4DOMInputSource +%typemap(in,numinputs=0) const bool adoptBuffer "$1 = true;" // for MemBufInputSource +*/ +// SAX2XMLReader::setProperty() should refuse the option to set the +// security manager + +/*%extend XERCES_CPP_NAMESPACE::SAX2XMLReader { +%typemap(check) (const XMLCh* const name, void* value) { + if (XMLString::compareIStringASCII($1, XMLUni::fgXercesSecurityManager) == 0) { + makeSAXNotSupportedException(SAXNotSupportedException("Setting security manager not supported")); + goto fail; + } +} +} +*/ +/* + * Enable conversion of void* => XMLCh* in setProperty() + * + * The in typemap converts the void* to an XMLCh* + * + * The freearg typemap deletes the transcoded string + * + */ +/*%typemap(in) (void* value) { + // now check the value + if ($input == &PL_sv_undef) { + SWIG_Perl_NullRef("perl-string",$argnum,"$symname"); + goto fail; + } else { + // we convert *everything* into a string that isn't undef + $1 = Perl2XMLString($input); + } +} + +%typemap(freearg) void * %{ + delete[] $1; +%} +*/ +/* + * Dynamic Casts + * + * This very cool SWIG feature enables use to return the correct object + * type to Perl when a C++ method is defined as returning a base class + * object. We define a method that tells what type subclass the object + * is in. + */ + +/* + * Grammar* + */ + +/*%typemap(out) XERCES_CPP_NAMESPACE::Grammar * = SWIGTYPE *DYNAMIC; + +DYNAMIC_CAST(SWIGTYPE_p_XERCES_CPP_NAMESPACE__Grammar, Grammar_dynamic_cast); + +%{ +static swig_type_info * +Grammar_dynamic_cast(void **ptr) { + Grammar **nptr = (Grammar **) ptr; + if (*nptr == NULL) { + return NULL; + } + short int type = (*nptr)->getGrammarType(); + if (type == Grammar::DTDGrammarType) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DTDGrammar; + } + if (type == Grammar::SchemaGrammarType) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__SchemaGrammar; + } + return NULL; +} +%} +*/ + +/* + * DOM_Node* + */ + +%typemap(out) XERCES_CPP_NAMESPACE::DOMNode * = SWIGTYPE *DYNAMIC; + +DYNAMIC_CAST(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, DOMNode_dynamic_cast); + +%{ +static swig_type_info * +DOMNode_dynamic_cast(void **ptr) { + DOMNode **nptr = (DOMNode **) ptr; + if (*nptr == NULL) { + return NULL; + } + short int type = (*nptr)->getNodeType(); + if (type == DOMNode::TEXT_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText; + } + if (type == DOMNode::PROCESSING_INSTRUCTION_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction; + } + if (type == DOMNode::DOCUMENT_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocument; + } + if (type == DOMNode::ELEMENT_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement; + } + if (type == DOMNode::ENTITY_REFERENCE_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntityReference; + } + if (type == DOMNode::CDATA_SECTION_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCDATASection; + } + if (type == DOMNode::CDATA_SECTION_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCDATASection; + } + if (type == DOMNode::COMMENT_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMComment; + } + if (type == DOMNode::DOCUMENT_TYPE_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType; + } + if (type == DOMNode::ENTITY_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity; + } + if (type == DOMNode::ATTRIBUTE_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr; + } + if (type == DOMNode::NOTATION_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNotation; + } + return NULL; +} +%} + diff --git a/src/uscxml/plugins/datamodel/common/bindings/event.i b/src/uscxml/plugins/datamodel/common/bindings/event.i new file mode 100644 index 0000000..b7ef165 --- /dev/null +++ b/src/uscxml/plugins/datamodel/common/bindings/event.i @@ -0,0 +1,22 @@ +/* + * we will have to manage these by hand + */ + +%ignore uscxml::Event::data; // too ambituous +%ignore uscxml::Event::namelist; // not needed +%ignore uscxml::Event::params; // not needed +%ignore uscxml::Event::uuid; // only for internal use + +%ignore uscxml::Event::hideSendId; // not needed +%ignore uscxml::Event::sendid; // supposed to be undef not empty string +%ignore uscxml::Event::invokeid; // supposed to be undef not empty string + +%ignore uscxml::Event::eventtype; // not an enum but a string +%ignore uscxml::Event::origin; // supposed to be undef not empty string +%ignore uscxml::Event::origintype; // supposed to be undef not empty string + +%{ +using uscxml::Data; +%} + +%include "uscxml/messages/Event.h" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.cpp deleted file mode 100644 index 402152d..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "JSCDOM.h" - -namespace Arabica { -namespace DOM { - -JSCDOM::JSCDOM() { - nsInfo = NULL; - xpath = NULL; - storage = NULL; -} - -JSCDOM::~JSCDOM() { - if (nsInfo) - delete(nsInfo); - if (xpath) - delete(xpath); - if (storage) - delete(storage); - -} - -} -}
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.cpp.inc b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.cpp.inc new file mode 100644 index 0000000..11a8863 --- /dev/null +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.cpp.inc @@ -0,0 +1,9576 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 3.0.8 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ +template<typename T> class SwigValueWrapper { + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs); + SwigValueWrapper(const SwigValueWrapper<T>& rhs); +public: + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } +}; + +template <typename T> T SwigValueInit() { + return T(); +} +#endif + +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + +/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ +#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) +# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#endif + +/* Intel's compiler complains if a variable which was never initialised is + * cast to void, which is a common idiom which we use to indicate that we + * are aware a variable isn't used. So we just silence that warning. + * See: https://github.com/swig/swig/issues/192 for more discussion. + */ +#ifdef __INTEL_COMPILER +# pragma warning disable 592 +#endif + + +#define SWIG_AsCharPtrAndSize(val, cptr, psize, alloc) SWIG_JSC_AsCharPtrAndSize(context, val, cptr, psize, alloc) +#define SWIG_FromCharPtrAndSize(cptr, size) SWIG_JSC_FromCharPtrAndSize(context, cptr, size) +#define SWIG_FromCharPtr(cptr) SWIG_JSC_FromCharPtr(context, cptr) + + +#define SWIG_JSC_FROM_DECL_ARGS(arg1) (JSContextRef context, arg1) +#define SWIG_JSC_FROM_CALL_ARGS(arg1) (context, arg1) +#define SWIG_JSC_AS_DECL_ARGS(arg1, arg2) (JSContextRef context, arg1, arg2) +#define SWIG_JSC_AS_CALL_ARGS(arg1, arg2) (context, arg1, arg2) + + + +#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) + +#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else + + + +#include <JavaScriptCore/JavaScript.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <errno.h> +#include <limits.h> + +/* ----------------------------------------------------------------------------- + * swigrun.swg + * + * This file contains generic C API SWIG runtime support for pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +/* This should only be incremented when either the layout of swig_type_info changes, + or for whatever reason, the runtime changes incompatibly */ +#define SWIG_RUNTIME_VERSION "4" + +/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ +#ifdef SWIG_TYPE_TABLE +# define SWIG_QUOTE_STRING(x) #x +# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) +# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) +#else +# define SWIG_TYPE_TABLE_NAME +#endif + +/* + You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. + + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. +*/ + +#ifndef SWIGRUNTIME +# define SWIGRUNTIME SWIGINTERN +#endif + +#ifndef SWIGRUNTIMEINLINE +# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE +#endif + +/* Generic buffer size */ +#ifndef SWIG_BUFFER_SIZE +# define SWIG_BUFFER_SIZE 1024 +#endif + +/* Flags for pointer conversions */ +#define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 + +/* Flags for new pointer objects */ +#define SWIG_POINTER_OWN 0x1 + + +/* + Flags/methods for returning states. + + The SWIG conversion methods, as ConvertPtr, return an integer + that tells if the conversion was successful or not. And if not, + an error code can be returned (see swigerrors.swg for the codes). + + Use the following macros/flags to set or process the returning + states. + + In old versions of SWIG, code such as the following was usually written: + + if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { + // success code + } else { + //fail code + } + + Now you can be more explicit: + + int res = SWIG_ConvertPtr(obj,vptr,ty.flags); + if (SWIG_IsOK(res)) { + // success code + } else { + // fail code + } + + which is the same really, but now you can also do + + Type *ptr; + int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); + if (SWIG_IsOK(res)) { + // success code + if (SWIG_IsNewObj(res) { + ... + delete *ptr; + } else { + ... + } + } else { + // fail code + } + + I.e., now SWIG_ConvertPtr can return new objects and you can + identify the case and take care of the deallocation. Of course that + also requires SWIG_ConvertPtr to return new result values, such as + + int SWIG_ConvertPtr(obj, ptr,...) { + if (<obj is ok>) { + if (<need new object>) { + *ptr = <ptr to new allocated object>; + return SWIG_NEWOBJ; + } else { + *ptr = <ptr to old object>; + return SWIG_OLDOBJ; + } + } else { + return SWIG_BADOBJ; + } + } + + Of course, returning the plain '0(success)/-1(fail)' still works, but you can be + more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the + SWIG errors code. + + Finally, if the SWIG_CASTRANK_MODE is enabled, the result code + allows to return the 'cast rank', for example, if you have this + + int food(double) + int fooi(int); + + and you call + + food(1) // cast rank '1' (1 -> 1.0) + fooi(1) // cast rank '0' + + just use the SWIG_AddCast()/SWIG_CheckState() +*/ + +#define SWIG_OK (0) +#define SWIG_ERROR (-1) +#define SWIG_IsOK(r) (r >= 0) +#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) + +/* The CastRankLimit says how many bits are used for the cast rank */ +#define SWIG_CASTRANKLIMIT (1 << 8) +/* The NewMask denotes the object was created (using new/malloc) */ +#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) +/* The TmpMask is for in/out typemaps that use temporal objects */ +#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) +/* Simple returning values */ +#define SWIG_BADOBJ (SWIG_ERROR) +#define SWIG_OLDOBJ (SWIG_OK) +#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) +#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) +/* Check, add and del mask methods */ +#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) +#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) +#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) +#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) +#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) +#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) + +/* Cast-Rank Mode */ +#if defined(SWIG_CASTRANK_MODE) +# ifndef SWIG_TypeRank +# define SWIG_TypeRank unsigned long +# endif +# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ +# define SWIG_MAXCASTRANK (2) +# endif +# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) +# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) +SWIGINTERNINLINE int SWIG_AddCast(int r) { + return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; +} +SWIGINTERNINLINE int SWIG_CheckState(int r) { + return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; +} +#else /* no cast-rank mode */ +# define SWIG_AddCast(r) (r) +# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) +#endif + + +#include <string.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *(*swig_converter_func)(void *, int *); +typedef struct swig_type_info *(*swig_dycast_func)(void **); + +/* Structure to store information on one type */ +typedef struct swig_type_info { + const char *name; /* mangled name of this type */ + const char *str; /* human readable name of this type */ + swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ + struct swig_cast_info *cast; /* linked list of types that can cast into this type */ + void *clientdata; /* language specific type data */ + int owndata; /* flag if the structure owns the clientdata */ +} swig_type_info; + +/* Structure to store a type and conversion function used for casting */ +typedef struct swig_cast_info { + swig_type_info *type; /* pointer to type that is equivalent to this type */ + swig_converter_func converter; /* function to cast the void pointers */ + struct swig_cast_info *next; /* pointer to next cast in linked list */ + struct swig_cast_info *prev; /* pointer to the previous cast */ +} swig_cast_info; + +/* Structure used to store module information + * Each module generates one structure like this, and the runtime collects + * all of these structures and stores them in a circularly linked list.*/ +typedef struct swig_module_info { + swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ + size_t size; /* Number of types in this module */ + struct swig_module_info *next; /* Pointer to next element in circularly linked list */ + swig_type_info **type_initial; /* Array of initially generated type structures */ + swig_cast_info **cast_initial; /* Array of initially generated casting structures */ + void *clientdata; /* Language specific module data */ +} swig_module_info; + +/* + Compare two type names skipping the space characters, therefore + "char*" == "char *" and "Class<int>" == "Class<int >", etc. + + Return 0 when the two name types are equivalent, as in + strncmp, but skipping ' '. +*/ +SWIGRUNTIME int +SWIG_TypeNameComp(const char *f1, const char *l1, + const char *f2, const char *l2) { + for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { + while ((*f1 == ' ') && (f1 != l1)) ++f1; + while ((*f2 == ' ') && (f2 != l2)) ++f2; + if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; + } + return (int)((l1 - f1) - (l2 - f2)); +} + +/* + Check type equivalence in a name list like <name1>|<name2>|... + Return 0 if equal, -1 if nb < tb, 1 if nb > tb +*/ +SWIGRUNTIME int +SWIG_TypeCmp(const char *nb, const char *tb) { + int equiv = 1; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (equiv != 0 && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = SWIG_TypeNameComp(nb, ne, tb, te); + if (*ne) ++ne; + } + return equiv; +} + +/* + Check type equivalence in a name list like <name1>|<name2>|... + Return 0 if not equal, 1 if equal +*/ +SWIGRUNTIME int +SWIG_TypeEquiv(const char *nb, const char *tb) { + return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; +} + +/* + Check the typename +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheck(const char *c, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Cast a pointer up an inheritance hierarchy +*/ +SWIGRUNTIMEINLINE void * +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); +} + +/* + Dynamic pointer casting. Down an inheritance hierarchy +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { + swig_type_info *lastty = ty; + if (!ty || !ty->dcast) return ty; + while (ty && (ty->dcast)) { + ty = (*ty->dcast)(ptr); + if (ty) lastty = ty; + } + return lastty; +} + +/* + Return the name associated with this type +*/ +SWIGRUNTIMEINLINE const char * +SWIG_TypeName(const swig_type_info *ty) { + return ty->name; +} + +/* + Return the pretty name associated with this type, + that is an unmangled type name in a form presentable to the user. +*/ +SWIGRUNTIME const char * +SWIG_TypePrettyName(const swig_type_info *type) { + /* The "str" field contains the equivalent pretty names of the + type, separated by vertical-bar characters. We choose + to print the last name, as it is often (?) the most + specific. */ + if (!type) return NULL; + if (type->str != NULL) { + const char *last_name = type->str; + const char *s; + for (s = type->str; *s; s++) + if (*s == '|') last_name = s+1; + return last_name; + } + else + return type->name; +} + +/* + Set the clientdata field for a type +*/ +SWIGRUNTIME void +SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { + swig_cast_info *cast = ti->cast; + /* if (ti->clientdata == clientdata) return; */ + ti->clientdata = clientdata; + + while (cast) { + if (!cast->converter) { + swig_type_info *tc = cast->type; + if (!tc->clientdata) { + SWIG_TypeClientData(tc, clientdata); + } + } + cast = cast->next; + } +} +SWIGRUNTIME void +SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { + SWIG_TypeClientData(ti, clientdata); + ti->owndata = 1; +} + +/* + Search for a swig_type_info structure only by mangled name + Search is a O(log #types) + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_MangledTypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + swig_module_info *iter = start; + do { + if (iter->size) { + size_t l = 0; + size_t r = iter->size - 1; + do { + /* since l+r >= 0, we can (>> 1) instead (/ 2) */ + size_t i = (l + r) >> 1; + const char *iname = iter->types[i]->name; + if (iname) { + int compare = strcmp(name, iname); + if (compare == 0) { + return iter->types[i]; + } else if (compare < 0) { + if (i) { + r = i - 1; + } else { + break; + } + } else if (compare > 0) { + l = i + 1; + } + } else { + break; /* should never happen */ + } + } while (l <= r); + } + iter = iter->next; + } while (iter != end); + return 0; +} + +/* + Search for a swig_type_info structure for either a mangled name or a human readable name. + It first searches the mangled names of the types, which is a O(log #types) + If a type is not found it then searches the human readable names, which is O(#types). + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + /* STEP 1: Search the name field using binary search */ + swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); + if (ret) { + return ret; + } else { + /* STEP 2: If the type hasn't been found, do a complete search + of the str field (the human readable name) */ + swig_module_info *iter = start; + do { + size_t i = 0; + for (; i < iter->size; ++i) { + if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) + return iter->types[i]; + } + iter = iter->next; + } while (iter != end); + } + + /* neither found a match */ + return 0; +} + +/* + Pack binary data into a string +*/ +SWIGRUNTIME char * +SWIG_PackData(char *c, void *ptr, size_t sz) { + static const char hex[17] = "0123456789abcdef"; + const unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + unsigned char uu = *u; + *(c++) = hex[(uu & 0xf0) >> 4]; + *(c++) = hex[uu & 0xf]; + } + return c; +} + +/* + Unpack binary data from a string +*/ +SWIGRUNTIME const char * +SWIG_UnpackData(const char *c, void *ptr, size_t sz) { + unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + char d = *(c++); + unsigned char uu; + if ((d >= '0') && (d <= '9')) + uu = ((d - '0') << 4); + else if ((d >= 'a') && (d <= 'f')) + uu = ((d - ('a'-10)) << 4); + else + return (char *) 0; + d = *(c++); + if ((d >= '0') && (d <= '9')) + uu |= (d - '0'); + else if ((d >= 'a') && (d <= 'f')) + uu |= (d - ('a'-10)); + else + return (char *) 0; + *u = uu; + } + return c; +} + +/* + Pack 'void *' into a string buffer. +*/ +SWIGRUNTIME char * +SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { + char *r = buff; + if ((2*sizeof(void *) + 2) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,&ptr,sizeof(void *)); + if (strlen(name) + 1 > (bsz - (r - buff))) return 0; + strcpy(r,name); + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + *ptr = (void *) 0; + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sizeof(void *)); +} + +SWIGRUNTIME char * +SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { + char *r = buff; + size_t lname = (name ? strlen(name) : 0); + if ((2*sz + 2 + lname) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + if (lname) { + strncpy(r,name,lname+1); + } else { + *r = 0; + } + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + memset(ptr,0,sz); + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sz); +} + +#ifdef __cplusplus +} +#endif + +/* Errors in SWIG */ +#define SWIG_UnknownError -1 +#define SWIG_IOError -2 +#define SWIG_RuntimeError -3 +#define SWIG_IndexError -4 +#define SWIG_TypeError -5 +#define SWIG_DivisionByZero -6 +#define SWIG_OverflowError -7 +#define SWIG_SyntaxError -8 +#define SWIG_ValueError -9 +#define SWIG_SystemError -10 +#define SWIG_AttributeError -11 +#define SWIG_MemoryError -12 +#define SWIG_NullReferenceError -13 + + + +/* ---------------------------------------------------------------------------- + * Errors and exceptions + * + * ---------------------------------------------------------------------------*/ + +#define SWIG_Error(code, msg) SWIG_JSC_exception(context, exception, code, msg) +#define SWIG_exception(code, msg) SWIG_JSC_exception(context, exception, code, msg) +#define SWIG_fail goto fail + +SWIGRUNTIME void SWIG_Javascript_Raise(JSContextRef context, JSValueRef *exception, const char* type) { + JSStringRef message = JSStringCreateWithUTF8CString(type); + JSValueRef error_arguments[1]; + JSObjectRef exception_object; + JSValueRef exception_value; + exception_value = JSValueMakeString(context, message); + /* Converting the result to an object will let JavascriptCore add + "sourceURL" (file) and "line" (number) and "message" to the exception, + instead of just returning a raw string. This is extremely important for debugging your errors. + Using JSObjectMakeError is better than JSValueToObject because the latter only populates + "sourceURL" and "line", but not "message" or any others I don't know about. + */ + error_arguments[0] = exception_value; + exception_object = JSObjectMakeError(context, 1, error_arguments, NULL); + + /* Return the exception_object */ + *exception = exception_object; + + JSStringRelease(message); +} + +SWIGRUNTIME void SWIG_JSC_exception(JSContextRef context, JSValueRef *exception, int code, const char* msg) { + SWIG_Javascript_Raise(context, exception, msg); +} + +/* ---------------------------------------------------------------------------- + * The parent class of all Proxies + * + * ---------------------------------------------------------------------------*/ + +typedef struct { + bool swigCMemOwn; + void *swigCObject; + swig_type_info *info; +} SwigPrivData; + +SWIGRUNTIME JSValueRef _wrap_SwigObject_disown(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + JSValueRef jsresult; + + JSObjectRef obj = JSValueToObject(context, thisObject, NULL); + SwigPrivData *cdata = (SwigPrivData *) JSObjectGetPrivate(obj); + + cdata->swigCMemOwn = false; + + jsresult = JSValueMakeUndefined(context); + return jsresult; +} + +SWIGRUNTIME JSValueRef _wrap_SwigObject_getCPtr(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + JSValueRef jsresult; + long result; + + JSObjectRef obj = JSValueToObject(context, thisObject, NULL); + SwigPrivData *cdata = (SwigPrivData*) JSObjectGetPrivate(obj); + + result = (long) cdata->swigCObject; + jsresult = JSValueMakeNumber(context, result); + + return jsresult; +} + +SWIGRUNTIME JSValueRef _wrap_SwigObject_equals(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + JSValueRef jsresult; + bool result; + + JSObjectRef obj = JSValueToObject(context, thisObject, NULL); + SwigPrivData *cdata = (SwigPrivData*) JSObjectGetPrivate(obj); + + JSObjectRef obj2 = JSValueToObject(context, argv[0], NULL); + SwigPrivData *cdata2 = (SwigPrivData*) JSObjectGetPrivate(obj2); + + result = (cdata->swigCObject == cdata2->swigCObject); + jsresult = JSValueMakeBoolean(context, result); + + return jsresult; +} + +SWIGRUNTIME JSStaticValue _SwigObject_values[] = { + { + 0, 0, 0, 0 + } +}; + +SWIGRUNTIME JSStaticFunction _SwigObject_functions[] = { + { + "disown",_wrap_SwigObject_disown, kJSPropertyAttributeNone + }, + { + "equals",_wrap_SwigObject_equals, kJSPropertyAttributeNone + }, + { + "getCPtr",_wrap_SwigObject_getCPtr, kJSPropertyAttributeNone + }, + { + 0, 0, 0 + } +}; + +SWIGRUNTIME JSClassDefinition _SwigObject_objectDefinition; + +SWIGRUNTIME JSClassRef _SwigObject_classRef; + + +SWIGRUNTIME int SWIG_JSC_ConvertInstancePtr(JSContextRef context, JSObjectRef objRef, void** ptr, swig_type_info *info, int flags) { + SwigPrivData *cdata; + + cdata = (SwigPrivData *) JSObjectGetPrivate(objRef); + if(cdata == NULL) { + return SWIG_ERROR; + } + if(cdata->info != info) { + bool type_valid = false; + swig_cast_info *t = info->cast; + while(t != NULL) { + if(t->type == cdata->info) { + type_valid = true; + break; + } + t = t->next; + } + if(!type_valid) { + return SWIG_TypeError; + } + } + + *ptr = cdata->swigCObject; + + if(flags & SWIG_POINTER_DISOWN) { + cdata->swigCMemOwn = false; + } + + return SWIG_OK; +} + +SWIGRUNTIME int SWIG_JSC_ConvertPtr(JSContextRef context, JSValueRef valRef, void** ptr, swig_type_info *info, int flags) { + JSObjectRef objRef; + + /* special case: JavaScript null => C NULL pointer */ + if(JSValueIsNull(context, valRef)) { + *ptr=0; + return SWIG_OK; + } + + if(!JSValueIsObject(context, valRef)) { + return SWIG_TypeError; + } + + objRef = JSValueToObject(context, valRef, NULL); + if(objRef == NULL) { + return SWIG_ERROR; + } + + return SWIG_JSC_ConvertInstancePtr(context, objRef, ptr, info, flags); +} + +SWIGRUNTIME JSObjectRef SWIG_JSC_NewPointerObj(JSContextRef context, void *ptr, swig_type_info *info, int flags) { + JSClassRef classRef; + JSObjectRef result; + SwigPrivData *cdata; + + if (ptr == NULL) { + // HACK: it is not possible to use JSValueToObject (causing seg-fault) + // This static cast turned out to be a workaround + // In future, we should change the interface of this method + // to return JSValueRef instead of JSObjectRef. + return (JSObjectRef) JSValueMakeNull(context); + } + + if(info->clientdata == NULL) { + classRef = _SwigObject_classRef; + } else { + classRef = (JSClassRef) info->clientdata; + } + + result = JSObjectMake(context, classRef, NULL); + + cdata = (SwigPrivData*) malloc(sizeof(SwigPrivData)); + cdata->swigCObject = ptr; + cdata->swigCMemOwn = (flags & SWIG_POINTER_OWN) ? 1 : 0; + cdata->info = info; + + JSObjectSetPrivate(result, cdata); + + return result; +} + +#define SWIG_ConvertPtr(obj, ptr, info, flags) SWIG_JSC_ConvertPtr(context, obj, ptr, info, flags) +#define SWIG_NewPointerObj(ptr, info, flags) SWIG_JSC_NewPointerObj(context, ptr, info, flags) + +#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_JSC_ConvertInstancePtr(context, obj, pptr, type, flags) +#define SWIG_NewInstanceObj(thisvalue, type, flags) SWIG_JSC_NewPointerObj(context, thisvalue, type, flags) + +#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_JSC_ConvertPtr(context, obj, pptr, type, 0) +#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_JSC_NewPointerObj(context, ptr, type, 0) + +/* ---------------------------------------------------------------------------- + * A class for packed data + * + * ---------------------------------------------------------------------------*/ + +typedef struct { + void *data; + size_t size; + swig_type_info *type; +} SwigPackedData; + +SWIGRUNTIME JSStaticValue _SwigPackedData_values[] = { + { + 0, 0, 0, 0 + } +}; +SWIGRUNTIME JSStaticFunction _SwigPackedData_functions[] = { + { + 0, 0, 0 + } +}; +SWIGRUNTIME JSClassDefinition _SwigPackedData_objectDefinition; +SWIGRUNTIME JSClassRef _SwigPackedData_classRef; + +SWIGRUNTIMEINLINE +int SwigJSCPacked_Check(JSContextRef context, JSValueRef valRef) { + return JSValueIsObjectOfClass(context, valRef, _SwigPackedData_classRef); +} + +SWIGRUNTIME +swig_type_info* SwigJSCPacked_UnpackData(JSContextRef context, JSValueRef valRef, void *ptr, size_t size) { + if (SwigJSCPacked_Check(context, valRef)) { + JSObjectRef objRef = JSValueToObject(context, valRef, NULL); + SwigPackedData *sobj = (SwigPackedData *) JSObjectGetPrivate(objRef); + if (sobj->size != size) return 0; + memcpy(ptr, sobj->data, size); + return sobj->type; + } else { + return 0; + } +} + +SWIGRUNTIME +int SWIG_JSC_ConvertPacked(JSContextRef context, JSValueRef valRef, void *ptr, size_t sz, swig_type_info *ty) { + swig_type_info *to = SwigJSCPacked_UnpackData(context, valRef, ptr, sz); + if (!to) return SWIG_ERROR; + if (ty) { + if (to != ty) { + /* check type cast? */ + swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); + if (!tc) return SWIG_ERROR; + } + } + return SWIG_OK; +} + +SWIGRUNTIME +JSValueRef SWIG_JSC_NewPackedObj(JSContextRef context, void *data, size_t size, swig_type_info *type) { + + JSClassRef classRef = _SwigObject_classRef; + JSObjectRef result = JSObjectMake(context, classRef, NULL); + + SwigPackedData* cdata = (SwigPackedData*) malloc(sizeof(SwigPackedData)); + cdata->data = data; + cdata->size = size; + cdata->type = type; + + JSObjectSetPrivate(result, cdata); + + return result; +} + +/* SwigPackedData wrappers */ +SWIGRUNTIME +void _wrap_SwigPackedData_delete(JSObjectRef obj) +{ + SwigPackedData* cdata = (SwigPackedData*) JSObjectGetPrivate(obj); + if (cdata) { + free(cdata->data); + } +} + +/* for C++ member pointers, ie, member methods */ + +#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_JSC_ConvertPacked(context, obj, ptr, sz, ty) +#define SWIG_NewMemberObj(ptr, sz, type) SWIG_JSC_NewPackedObj(context, ptr, sz, type) + + +/* --------------------------------------------------------------------------- + * Support for IN/OUTPUT typemaps (see Lib/typemaps/inoutlist.swg) + * + * ---------------------------------------------------------------------------*/ +SWIGRUNTIME +unsigned int SWIGJSC_ArrayLength(JSContextRef context, JSObjectRef arr) { + static JSStringRef LENGTH = 0; + JSValueRef exception = NULL; + JSValueRef js_length; + double length; + + if (LENGTH == 0) { + LENGTH = JSStringCreateWithUTF8CString("length"); + } + + js_length = JSObjectGetProperty(context, arr, LENGTH, &exception); + if (exception == 0 && JSValueIsNumber(context, js_length)) { + length = JSValueToNumber(context, js_length, 0); + return (unsigned int) length; + } else { + return 0; + } +} + +SWIGRUNTIME +JSValueRef SWIGJSC_AppendOutput(JSContextRef context, JSValueRef value, JSValueRef obj) { + JSObjectRef arr; + unsigned int length; + + if (JSValueIsUndefined(context, value)) { + arr = JSObjectMakeArray(context, 0, 0, 0); + } else { + arr = JSValueToObject(context, value, 0); + } + + length = SWIGJSC_ArrayLength(context, arr); + JSObjectSetPropertyAtIndex(context, arr, length, obj, 0); + return arr; +} + + +/* -------- TYPES TABLE (BEGIN) -------- */ + +#define SWIGTYPE_p_Data swig_types[0] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr swig_types[1] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCDATASection swig_types[2] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData swig_types[3] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMComment swig_types[4] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocument swig_types[5] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentFragment swig_types[6] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType swig_types[7] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement swig_types[8] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity swig_types[9] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntityReference swig_types[10] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException swig_types[11] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap swig_types[12] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode swig_types[13] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList swig_types[14] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNotation swig_types[15] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction swig_types[16] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText swig_types[17] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMTypeInfo swig_types[18] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMUserDataHandler swig_types[19] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__MemoryManager swig_types[20] +#define SWIGTYPE_p_bool swig_types[21] +#define SWIGTYPE_p_char swig_types[22] +#define SWIGTYPE_p_int16_t swig_types[23] +#define SWIGTYPE_p_int32_t swig_types[24] +#define SWIGTYPE_p_int64_t swig_types[25] +#define SWIGTYPE_p_namelist_t swig_types[26] +#define SWIGTYPE_p_params_t swig_types[27] +#define SWIGTYPE_p_size_t swig_types[28] +#define SWIGTYPE_p_ssize_t swig_types[29] +#define SWIGTYPE_p_std__listT_Data_t swig_types[30] +#define SWIGTYPE_p_std__multimapT_std__string_Data_t swig_types[31] +#define SWIGTYPE_p_uint16_t swig_types[32] +#define SWIGTYPE_p_uint32_t swig_types[33] +#define SWIGTYPE_p_uint64_t swig_types[34] +#define SWIGTYPE_p_unsigned_char swig_types[35] +#define SWIGTYPE_p_uscxml__ErrorEvent swig_types[36] +#define SWIGTYPE_p_uscxml__Event swig_types[37] +#define SWIGTYPE_p_void swig_types[38] +static swig_type_info *swig_types[40]; +static swig_module_info swig_module = {swig_types, 39, 0, 0, 0, 0}; +#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) +#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) + +/* -------- TYPES TABLE (END) -------- */ + + + +#define SWIGVERSION 0x030008 +#define SWIG_VERSION SWIGVERSION + + +#define SWIG_as_voidptr(a) (void *)((const void *)(a)) +#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) + + +#include <stdexcept> + + +SWIGINTERNINLINE JSValueRef + SWIG_From_int SWIG_JSC_FROM_DECL_ARGS(int value) +{ + return JSValueMakeNumber(context, value); +} + + +#include <string> + + +#include "xercesc/sax/InputSource.hpp" +#include "xercesc/sax/SAXException.hpp" +#include "xercesc/sax/SAXParseException.hpp" +#include "xercesc/sax/Locator.hpp" +#include "xercesc/sax/HandlerBase.hpp" +#include "xercesc/sax2/Attributes.hpp" +#include "xercesc/sax2/ContentHandler.hpp" +#include "xercesc/sax2/LexicalHandler.hpp" +#include "xercesc/sax2/DefaultHandler.hpp" +#include "xercesc/sax2/SAX2XMLReader.hpp" +#include "xercesc/sax2/XMLReaderFactory.hpp" +#include "xercesc/util/PlatformUtils.hpp" +#include "xercesc/util/TransService.hpp" +#include "xercesc/util/XMLString.hpp" +#include "xercesc/util/XMLUri.hpp" +#include "xercesc/util/QName.hpp" +#include "xercesc/util/HexBin.hpp" +#include "xercesc/util/Base64.hpp" +#include "xercesc/parsers/AbstractDOMParser.hpp" +#include "xercesc/parsers/XercesDOMParser.hpp" +#include "xercesc/parsers/SAXParser.hpp" +#include "xercesc/dom/DOM.hpp" +#include "xercesc/framework/LocalFileInputSource.hpp" +#include "xercesc/framework/MemBufInputSource.hpp" +#include "xercesc/framework/StdInInputSource.hpp" +#include "xercesc/framework/URLInputSource.hpp" +#include "xercesc/framework/XMLGrammarDescription.hpp" +#include "xercesc/framework/XMLDTDDescription.hpp" +#include "xercesc/framework/XMLSchemaDescription.hpp" +#include "xercesc/util/NameIdPool.hpp" +#include "xercesc/util/XMLEnumerator.hpp" +#include "xercesc/framework/XMLValidator.hpp" +#include "xercesc/validators/common/Grammar.hpp" +#include "xercesc/validators/DTD/DTDAttDef.hpp" +#include "xercesc/validators/DTD/DTDAttDefList.hpp" +#include "xercesc/validators/DTD/DTDGrammar.hpp" +#include "xercesc/validators/DTD/DTDValidator.hpp" +#include "xercesc/validators/schema/SchemaGrammar.hpp" +#include "xercesc/validators/schema/SchemaValidator.hpp" +#include "xercesc/validators/schema/SchemaAttDefList.hpp" +#include "xercesc/validators/schema/SchemaAttDef.hpp" +#include "xercesc/framework/XMLFormatter.hpp" +#include "xercesc/framework/MemBufFormatTarget.hpp" +#include "xercesc/framework/LocalFileFormatTarget.hpp" +#include "xercesc/framework/StdOutFormatTarget.hpp" +#include "xercesc/framework/Wrapper4InputSource.hpp" +#include "xercesc/framework/psvi/PSVIHandler.hpp" + +// for resolving XMLExceptions +#include "xercesc/util/ArrayIndexOutOfBoundsException.hpp" +#include "xercesc/util/EmptyStackException.hpp" +#include "xercesc/util/IllegalArgumentException.hpp" +#include "xercesc/util/InvalidCastException.hpp" +#include "xercesc/util/IOException.hpp" +#include "xercesc/util/NoSuchElementException.hpp" +#include "xercesc/util/NullPointerException.hpp" +#include "xercesc/util/NumberFormatException.hpp" +#include "xercesc/util/ParseException.hpp" +#include "xercesc/util/RuntimeException.hpp" +#include "xercesc/util/SchemaDateTimeException.hpp" +#include "xercesc/util/TranscodingException.hpp" +#include "xercesc/util/UnexpectedEOFException.hpp" +#include "xercesc/util/UnsupportedEncodingException.hpp" +#include "xercesc/util/UTFDataFormatException.hpp" +#include "xercesc/util/XMLNetAccessor.hpp" +#include "xercesc/internal/XSerializationException.hpp" +#include "xercesc/validators/datatype/InvalidDatatypeFacetException.hpp" +#include "xercesc/validators/datatype/InvalidDatatypeValueException.hpp" +#include "xercesc/validators/schema/identity/XPathException.hpp" + +XERCES_CPP_NAMESPACE_USE + +// we initialize the static UTF-8 transcoding info +// these are used by the typemaps to convert between +// Xerces internal UTF-16 and Perl's internal UTF-8 +static XMLCh* UTF8_ENCODING = NULL; +static XMLTranscoder* UTF8_TRANSCODER = NULL; + +static bool DEBUG_UTF8_OUT = 0; +static bool DEBUG_UTF8_IN = 0; + + + +SWIGINTERN int +SWIG_AsVal_double SWIG_JSC_AS_DECL_ARGS(JSValueRef obj, double *val) +{ + if(!JSValueIsNumber(context, obj)) { + return SWIG_TypeError; + } + if(val) *val = JSValueToNumber(context, obj, NULL); + + return SWIG_OK; +} + + +#include <float.h> + + +#include <math.h> + + +SWIGINTERNINLINE int +SWIG_CanCastAsInteger(double *d, double min, double max) { + double x = *d; + if ((min <= x && x <= max)) { + double fx = floor(x); + double cx = ceil(x); + double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ + if ((errno == EDOM) || (errno == ERANGE)) { + errno = 0; + } else { + double summ, reps, diff; + if (rd < x) { + diff = x - rd; + } else if (rd > x) { + diff = rd - x; + } else { + return 1; + } + summ = rd + x; + reps = diff/summ; + if (reps < 8*DBL_EPSILON) { + *d = rd; + return 1; + } + } + } + return 0; +} + + +SWIGINTERN int +SWIG_AsVal_long SWIG_JSC_AS_DECL_ARGS(JSValueRef obj, long* val) +{ + if (!JSValueIsNumber(context, obj)) { + return SWIG_TypeError; + } + if(val) *val = (long) JSValueToNumber(context, obj, NULL); + + return SWIG_OK; +} + + +SWIGINTERN +int SWIG_AsVal_bool SWIG_JSC_AS_DECL_ARGS(JSValueRef obj, bool *val) +{ + if(!JSValueIsBoolean(context, obj)) { + return SWIG_ERROR; + } + if (val) *val = JSValueToBoolean(context, obj); + return SWIG_OK; +} + + +SWIGINTERNINLINE +JSValueRef SWIG_From_bool SWIG_JSC_FROM_DECL_ARGS(bool value) +{ + return JSValueMakeBoolean(context, value); +} + + +static swig_type_info * +DOMNode_dynamic_cast(void **ptr) { + DOMNode **nptr = (DOMNode **) ptr; + if (*nptr == NULL) { + return NULL; + } + short int type = (*nptr)->getNodeType(); + if (type == DOMNode::TEXT_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText; + } + if (type == DOMNode::PROCESSING_INSTRUCTION_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction; + } + if (type == DOMNode::DOCUMENT_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocument; + } + if (type == DOMNode::ELEMENT_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement; + } + if (type == DOMNode::ENTITY_REFERENCE_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntityReference; + } + if (type == DOMNode::CDATA_SECTION_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCDATASection; + } + if (type == DOMNode::CDATA_SECTION_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCDATASection; + } + if (type == DOMNode::COMMENT_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMComment; + } + if (type == DOMNode::DOCUMENT_TYPE_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType; + } + if (type == DOMNode::ENTITY_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity; + } + if (type == DOMNode::ATTRIBUTE_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr; + } + if (type == DOMNode::NOTATION_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNotation; + } + return NULL; +} + + +#include <limits.h> +#if !defined(SWIG_NO_LLONG_MAX) +# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) +# define LLONG_MAX __LONG_LONG_MAX__ +# define LLONG_MIN (-LLONG_MAX - 1LL) +# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) +# endif +#endif + + +SWIGINTERN int +SWIG_AsVal_short SWIG_JSC_AS_DECL_ARGS(JSValueRef obj, short *val) +{ + long v; + int res = SWIG_AsVal_long SWIG_JSC_AS_CALL_ARGS(obj, &v); + if (SWIG_IsOK(res)) { + if ((v < SHRT_MIN || v > SHRT_MAX)) { + return SWIG_OverflowError; + } else { + if (val) *val = (short)(v); + } + } + return res; +} + + +SWIGINTERNINLINE JSValueRef +SWIG_From_long SWIG_JSC_FROM_DECL_ARGS(long value) +{ + return JSValueMakeNumber(context, value); +} + + +SWIGINTERNINLINE JSValueRef +SWIG_From_short SWIG_JSC_FROM_DECL_ARGS(short value) +{ + return SWIG_From_long SWIG_JSC_FROM_CALL_ARGS(value); +} + + +SWIGINTERNINLINE JSValueRef +SWIG_From_unsigned_SS_long SWIG_JSC_FROM_DECL_ARGS(unsigned long value) +{ + return (value > LONG_MAX) ? + JSValueMakeNumber(context, value) : JSValueMakeNumber(context, (long)(value)); +} + + +SWIGINTERNINLINE JSValueRef +SWIG_From_size_t SWIG_JSC_FROM_DECL_ARGS(size_t value) +{ + return SWIG_From_unsigned_SS_long SWIG_JSC_FROM_CALL_ARGS((unsigned long)(value)); +} + + +SWIGINTERN int +SWIG_AsVal_unsigned_SS_long SWIG_JSC_AS_DECL_ARGS(JSValueRef obj, unsigned long *val) +{ + long longVal; + if(!JSValueIsNumber(context, obj)) { + return SWIG_TypeError; + } + + longVal = (long) JSValueToNumber(context, obj, NULL); + + if(longVal < 0) { + return SWIG_OverflowError; + } + + if(val) *val = longVal; + + return SWIG_OK; +} + + +SWIGINTERNINLINE int +SWIG_AsVal_size_t SWIG_JSC_AS_DECL_ARGS(JSValueRef obj, size_t *val) +{ + unsigned long v; + int res = SWIG_AsVal_unsigned_SS_long SWIG_JSC_AS_CALL_ARGS(obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) *val = (size_t)(v); + return res; +} + + +using uscxml::Data; + + +SWIGINTERN swig_type_info* +SWIG_pchar_descriptor(void) +{ + static int init = 0; + static swig_type_info* info = 0; + if (!init) { + info = SWIG_TypeQuery("_p_char"); + init = 1; + } + return info; +} + + +SWIGINTERN int +SWIG_JSC_AsCharPtrAndSize(JSContextRef context, JSValueRef valRef, char** cptr, size_t* psize, int *alloc) +{ + if(JSValueIsString(context, valRef)) { + JSStringRef js_str = JSValueToStringCopy(context, valRef, NULL); + size_t len = JSStringGetMaximumUTF8CStringSize(js_str); + char* cstr = (char*) (new char[len]); + /* JSStringGetUTF8CString returns the length including 0-terminator */ + len = JSStringGetUTF8CString(js_str, cstr, len); + + if(alloc) *alloc = SWIG_NEWOBJ; + if(psize) *psize = len; + if(cptr) *cptr = cstr; + + return SWIG_OK; + } else { + if(JSValueIsObject(context, valRef)) { + JSObjectRef obj = JSValueToObject(context, valRef, NULL); + // try if the object is a wrapped char[] + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + if (pchar_descriptor) { + void* vptr = 0; + if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { + if (cptr) *cptr = (char *) vptr; + if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; + if (alloc) *alloc = SWIG_OLDOBJ; + return SWIG_OK; + } + } + return SWIG_TypeError; + } else { + return SWIG_TypeError; + } + } +} + + +SWIGINTERN int +SWIG_AsPtr_std_string SWIG_JSC_AS_DECL_ARGS(JSValueRef obj, std::string **val) +{ + char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ; + if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) { + if (buf) { + if (val) *val = new std::string(buf, size - 1); + if (alloc == SWIG_NEWOBJ) delete[] buf; + return SWIG_NEWOBJ; + } else { + if (val) *val = 0; + return SWIG_OLDOBJ; + } + } else { + static int init = 0; + static swig_type_info* descriptor = 0; + if (!init) { + descriptor = SWIG_TypeQuery("std::string" " *"); + init = 1; + } + if (descriptor) { + std::string *vptr; + int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0); + if (SWIG_IsOK(res) && val) *val = vptr; + return res; + } + } + return SWIG_ERROR; +} + + +SWIGINTERN int +SWIG_AsVal_int SWIG_JSC_AS_DECL_ARGS(JSValueRef obj, int *val) +{ + long v; + int res = SWIG_AsVal_long SWIG_JSC_AS_CALL_ARGS(obj, &v); + if (SWIG_IsOK(res)) { + if ((v < INT_MIN || v > INT_MAX)) { + return SWIG_OverflowError; + } else { + if (val) *val = (int)(v); + } + } + return res; +} + + +SWIGINTERNINLINE JSValueRef +SWIG_JSC_FromCharPtrAndSize(JSContextRef context, const char* carray, size_t size) +{ + if (carray) { + if (size > INT_MAX) { + // TODO: handle extra long strings + //swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + //return pchar_descriptor ? + // SWIG_InternalNewPointerObj(%const_cast(carray,char *), pchar_descriptor, 0) : SWIG_Py_Void(); + return JSValueMakeUndefined(context); + } else { + JSStringRef jsstring; + JSValueRef result; + if(size < 2) { + char c[2]; + int i; + for(i=0;i<size;++i) { + c[i] = carray[i]; + } + c[size] = 0; + jsstring = JSStringCreateWithUTF8CString(c); + } else { + jsstring = JSStringCreateWithUTF8CString(carray); + } + result = JSValueMakeString(context, jsstring); + JSStringRelease(jsstring); + return result; + } + } else { + return JSValueMakeUndefined(context); + } +} + + +SWIGINTERNINLINE JSValueRef +SWIG_From_std_string SWIG_JSC_FROM_DECL_ARGS(const std::string& s) +{ + return SWIG_FromCharPtrAndSize(s.data(), s.size()); +} + + +#define SWIGJSC_INIT JSCDOM_initialize + + + + +SWIGINTERN bool JS_registerClass(JSGlobalContextRef context, JSObjectRef parentObject, + const char* className, + JSClassDefinition* definition) { + + JSStringRef js_className = JSStringCreateWithUTF8CString(className); + JSObjectRef classObject = JSObjectMake(context, JSClassCreate(definition), NULL); + JSObjectSetProperty(context, parentObject, + js_className, classObject, + kJSPropertyAttributeNone, NULL); + JSStringRelease(js_className); + + return true; +} + +SWIGINTERN bool JS_registerNamespace(JSGlobalContextRef context, + JSObjectRef namespaceObj, JSObjectRef parentNamespace, + const char* name) +{ + JSStringRef js_name = JSStringCreateWithUTF8CString(name); + JSObjectSetProperty(context, parentNamespace, + js_name, namespaceObj, + kJSPropertyAttributeNone, NULL); + JSStringRelease(js_name); + + return true; +} + + +SWIGINTERN bool JS_registerFunction(JSGlobalContextRef context, JSObjectRef object, + const char* functionName, JSObjectCallAsFunctionCallback callback) +{ + JSStringRef js_functionName = JSStringCreateWithUTF8CString(functionName); + JSObjectSetProperty(context, object, js_functionName, + JSObjectMakeFunctionWithCallback(context, js_functionName, callback), + kJSPropertyAttributeNone, NULL); + JSStringRelease(js_functionName); + return true; +} + +SWIGINTERN bool JS_veto_set_variable(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) +{ + char buffer[256]; + char msg[512]; + int res; + + JSStringGetUTF8CString(propertyName, buffer, 256); + res = sprintf(msg, "Tried to write read-only variable: %s.", buffer); + + if(res<0) { + SWIG_exception(SWIG_ERROR, "Tried to write read-only variable."); + } else { + SWIG_exception(SWIG_ERROR, msg); + } + + return false; +} + +SWIGINTERN JSValueRef JS_CharPtrToJSValue(JSContextRef context, char* cstr) { + JSValueRef val; + + JSStringRef jsstring = JSStringCreateWithUTF8CString((char*) cstr); + val = JSValueMakeString(context, jsstring); + JSStringRelease(jsstring); + + return val; +} + + +static JSValueRef _wrap_XERCES_HAS_CPP_NAMESPACE(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(1)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static bool _wrap_DEBUG_UTF8_OUT_set(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) +{ + bool arg1 ; + bool val1 ; + int ecode1 = 0 ; + + ecode1 = SWIG_AsVal_bool SWIG_JSC_AS_CALL_ARGS(value, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "DEBUG_UTF8_OUT_set" "', argument " "1"" of type '" "bool""'"); + } + arg1 = (bool)(val1); + DEBUG_UTF8_OUT = arg1; + + + + return true; + + goto fail; +fail: + return false; +} + + +static JSValueRef _wrap_DEBUG_UTF8_OUT_get(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + bool result; + + JSValueRef jsresult; + + result = (bool)DEBUG_UTF8_OUT; + jsresult = SWIG_From_bool SWIG_JSC_FROM_CALL_ARGS((bool)(result)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static bool _wrap_DEBUG_UTF8_IN_set(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) +{ + bool arg1 ; + bool val1 ; + int ecode1 = 0 ; + + ecode1 = SWIG_AsVal_bool SWIG_JSC_AS_CALL_ARGS(value, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "DEBUG_UTF8_IN_set" "', argument " "1"" of type '" "bool""'"); + } + arg1 = (bool)(val1); + DEBUG_UTF8_IN = arg1; + + + + return true; + + goto fail; +fail: + return false; +} + + +static JSValueRef _wrap_DEBUG_UTF8_IN_get(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + bool result; + + JSValueRef jsresult; + + result = (bool)DEBUG_UTF8_IN; + jsresult = SWIG_From_bool SWIG_JSC_FROM_CALL_ARGS((bool)(result)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSClassDefinition _exports_DOMException_classDefinition; + +static JSClassDefinition _exports_DOMException_objectDefinition; + +static JSClassRef _exports_DOMException_classRef; + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMException_INDEX_SIZE_ERR(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMException::INDEX_SIZE_ERR)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMException_DOMSTRING_SIZE_ERR(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMException::DOMSTRING_SIZE_ERR)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMException_HIERARCHY_REQUEST_ERR(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMException::HIERARCHY_REQUEST_ERR)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMException_WRONG_DOCUMENT_ERR(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMException::WRONG_DOCUMENT_ERR)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMException_INVALID_CHARACTER_ERR(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMException::INVALID_CHARACTER_ERR)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMException_NO_DATA_ALLOWED_ERR(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMException::NO_DATA_ALLOWED_ERR)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMException_NO_MODIFICATION_ALLOWED_ERR(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMException::NO_MODIFICATION_ALLOWED_ERR)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMException_NOT_FOUND_ERR(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMException::NOT_FOUND_ERR)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMException_NOT_SUPPORTED_ERR(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMException::NOT_SUPPORTED_ERR)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMException_INUSE_ATTRIBUTE_ERR(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMException::INUSE_ATTRIBUTE_ERR)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMException_INVALID_STATE_ERR(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMException::INVALID_STATE_ERR)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMException_SYNTAX_ERR(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMException::SYNTAX_ERR)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMException_INVALID_MODIFICATION_ERR(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMException::INVALID_MODIFICATION_ERR)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMException_NAMESPACE_ERR(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMException::NAMESPACE_ERR)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMException_INVALID_ACCESS_ERR(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMException::INVALID_ACCESS_ERR)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMException_VALIDATION_ERR(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMException::VALIDATION_ERR)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMException_TYPE_MISMATCH_ERR(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMException::TYPE_MISMATCH_ERR)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSObjectRef _wrap_new_DOMException__SWIG_0(JSContextRef context, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + short arg1 ; + short arg2 ; + XERCES_CPP_NAMESPACE::MemoryManager *arg3 = (XERCES_CPP_NAMESPACE::MemoryManager *) (XERCES_CPP_NAMESPACE::MemoryManager *)0 ; + short val1 ; + int ecode1 = 0 ; + short val2 ; + int ecode2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + XERCES_CPP_NAMESPACE::DOMException *result; + ecode1 = SWIG_AsVal_short SWIG_JSC_AS_CALL_ARGS(argv[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_DOMException" "', argument " "1"" of type '" "short""'"); + } + arg1 = (short)(val1); + ecode2 = SWIG_AsVal_short SWIG_JSC_AS_CALL_ARGS(argv[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_DOMException" "', argument " "2"" of type '" "short""'"); + } + arg2 = (short)(val2); + res3 = SWIG_ConvertPtr(argv[2], &argp3,SWIGTYPE_p_XERCES_CPP_NAMESPACE__MemoryManager, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_DOMException" "', argument " "3"" of type '" "XERCES_CPP_NAMESPACE::MemoryManager *const""'"); + } + arg3 = (XERCES_CPP_NAMESPACE::MemoryManager *)(argp3); + result = (XERCES_CPP_NAMESPACE::DOMException *)new XERCES_CPP_NAMESPACE::DOMException(arg1,arg2,arg3); + + + + + + return SWIG_JSC_NewPointerObj(context, result, SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException, SWIG_POINTER_OWN); + + goto fail; +fail: + return NULL; +} + + +static JSObjectRef _wrap_new_DOMException__SWIG_1(JSContextRef context, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + short arg1 ; + short arg2 ; + short val1 ; + int ecode1 = 0 ; + short val2 ; + int ecode2 = 0 ; + XERCES_CPP_NAMESPACE::DOMException *result; + ecode1 = SWIG_AsVal_short SWIG_JSC_AS_CALL_ARGS(argv[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_DOMException" "', argument " "1"" of type '" "short""'"); + } + arg1 = (short)(val1); + ecode2 = SWIG_AsVal_short SWIG_JSC_AS_CALL_ARGS(argv[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_DOMException" "', argument " "2"" of type '" "short""'"); + } + arg2 = (short)(val2); + result = (XERCES_CPP_NAMESPACE::DOMException *)new XERCES_CPP_NAMESPACE::DOMException(arg1,arg2); + + + + + return SWIG_JSC_NewPointerObj(context, result, SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException, SWIG_POINTER_OWN); + + goto fail; +fail: + return NULL; +} + + +static JSObjectRef _wrap_new_DOMException__SWIG_2(JSContextRef context, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + short arg1 ; + short val1 ; + int ecode1 = 0 ; + XERCES_CPP_NAMESPACE::DOMException *result; + ecode1 = SWIG_AsVal_short SWIG_JSC_AS_CALL_ARGS(argv[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_DOMException" "', argument " "1"" of type '" "short""'"); + } + arg1 = (short)(val1); + result = (XERCES_CPP_NAMESPACE::DOMException *)new XERCES_CPP_NAMESPACE::DOMException(arg1); + + + + return SWIG_JSC_NewPointerObj(context, result, SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException, SWIG_POINTER_OWN); + + goto fail; +fail: + return NULL; +} + + +static JSObjectRef _wrap_new_DOMException(JSContextRef context, JSObjectRef ctorObject, + size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + JSObjectRef thisObject = NULL; + + // switch all cases by means of series of if-returns. + + if(argc == 3) { + thisObject = _wrap_new_DOMException__SWIG_0(context, NULL, argc, argv, exception); + if(thisObject != NULL) { + *exception=0; return thisObject; + } /* reset exception and return */ + } + + if(argc == 2) { + thisObject = _wrap_new_DOMException__SWIG_1(context, NULL, argc, argv, exception); + if(thisObject != NULL) { + *exception=0; return thisObject; + } /* reset exception and return */ + } + + if(argc == 1) { + thisObject = _wrap_new_DOMException__SWIG_2(context, NULL, argc, argv, exception); + if(thisObject != NULL) { + *exception=0; return thisObject; + } /* reset exception and return */ + } + + + // default: + SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for construction of $jsname"); + +fail: + return thisObject; +} + + +static void _wrap_delete_DOMException(JSObjectRef thisObject) +{ + SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); + if(t) { + if (t->swigCMemOwn) { + XERCES_CPP_NAMESPACE::DOMException * arg1 = (XERCES_CPP_NAMESPACE::DOMException *)t->swigCObject; + delete arg1; + } + /* remove the private data to make sure that it isn't accessed elsewhere */ + JSObjectSetPrivate(thisObject, NULL); + free(t); + } +} + + +static JSValueRef _wrap_DOMException_getMessage(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMException *arg1 = (XERCES_CPP_NAMESPACE::DOMException *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMException_getMessage."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMException_getMessage" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMException const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMException *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMException const *)arg1)->getMessage(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static bool _wrap_DOMException_code_set(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMException *arg1 = (XERCES_CPP_NAMESPACE::DOMException *) 0 ; + short arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + short val2 ; + int ecode2 = 0 ; + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMException_code_set" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMException *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMException *)(argp1); + ecode2 = SWIG_AsVal_short SWIG_JSC_AS_CALL_ARGS(value, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DOMException_code_set" "', argument " "2"" of type '" "short""'"); + } + arg2 = (short)(val2); + if (arg1) (arg1)->code = arg2; + + + + + return true; + + goto fail; +fail: + return false; +} + + +static JSValueRef _wrap_DOMException_code_get(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMException *arg1 = (XERCES_CPP_NAMESPACE::DOMException *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + short result; + + JSValueRef jsresult; + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMException_code_get" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMException *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMException *)(argp1); + result = (short) ((arg1)->code); + jsresult = SWIG_From_short SWIG_JSC_FROM_CALL_ARGS((short)(result)); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static bool _wrap_DOMException_msg_set(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMException *arg1 = (XERCES_CPP_NAMESPACE::DOMException *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMException_msg_set" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMException *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMException *)(argp1); + + arg2 = JS2XMLString(value, context); + + if (arg1) (arg1)->msg = (XMLCh const *)arg2; + + + delete[] arg2; + + + + return true; + + goto fail; +fail: + return false; +} + + +static JSValueRef _wrap_DOMException_msg_get(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMException *arg1 = (XERCES_CPP_NAMESPACE::DOMException *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMException_msg_get" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMException *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMException *)(argp1); + result = (XMLCh *) ((arg1)->msg); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSStaticValue _exports_DOMException_staticValues[] = { + { + "INDEX_SIZE_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_INDEX_SIZE_ERR, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "DOMSTRING_SIZE_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_DOMSTRING_SIZE_ERR, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "HIERARCHY_REQUEST_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_HIERARCHY_REQUEST_ERR, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "WRONG_DOCUMENT_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_WRONG_DOCUMENT_ERR, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "INVALID_CHARACTER_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_INVALID_CHARACTER_ERR, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "NO_DATA_ALLOWED_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_NO_DATA_ALLOWED_ERR, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "NO_MODIFICATION_ALLOWED_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_NO_MODIFICATION_ALLOWED_ERR, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "NOT_FOUND_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_NOT_FOUND_ERR, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "NOT_SUPPORTED_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_NOT_SUPPORTED_ERR, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "INUSE_ATTRIBUTE_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_INUSE_ATTRIBUTE_ERR, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "INVALID_STATE_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_INVALID_STATE_ERR, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "SYNTAX_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_SYNTAX_ERR, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "INVALID_MODIFICATION_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_INVALID_MODIFICATION_ERR, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "NAMESPACE_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_NAMESPACE_ERR, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "INVALID_ACCESS_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_INVALID_ACCESS_ERR, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "VALIDATION_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_VALIDATION_ERR, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "TYPE_MISMATCH_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_TYPE_MISMATCH_ERR, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMException_staticFunctions[] = { + { + 0, 0, 0 + } +}; + +static JSStaticValue _exports_DOMException_values[] = { + { + "code", _wrap_DOMException_code_get, _wrap_DOMException_code_set, kJSPropertyAttributeNone + }, + + + { + "msg", _wrap_DOMException_msg_get, _wrap_DOMException_msg_set, kJSPropertyAttributeNone + }, + + + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMException_functions[] = { + { + "getMessage", _wrap_DOMException_getMessage, kJSPropertyAttributeNone + }, + + + { + 0, 0, 0 + } +}; + + +static JSClassDefinition _exports_DOMNode_classDefinition; + +static JSClassDefinition _exports_DOMNode_objectDefinition; + +static JSClassRef _exports_DOMNode_classRef; + + +static void _wrap_delete_DOMNode(JSObjectRef thisObject) +{ + SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); + if(t) { + if (t->swigCMemOwn) { + XERCES_CPP_NAMESPACE::DOMNode * arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)t->swigCObject; + delete arg1; + } + /* remove the private data to make sure that it isn't accessed elsewhere */ + JSObjectSetPrivate(thisObject, NULL); + free(t); + } +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMNode_ELEMENT_NODE(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMNode::ELEMENT_NODE)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMNode_ATTRIBUTE_NODE(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMNode::ATTRIBUTE_NODE)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMNode_TEXT_NODE(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMNode::TEXT_NODE)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMNode_CDATA_SECTION_NODE(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMNode::CDATA_SECTION_NODE)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMNode_ENTITY_REFERENCE_NODE(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMNode::ENTITY_REFERENCE_NODE)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMNode_ENTITY_NODE(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMNode::ENTITY_NODE)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMNode_PROCESSING_INSTRUCTION_NODE(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMNode::PROCESSING_INSTRUCTION_NODE)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMNode_COMMENT_NODE(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMNode::COMMENT_NODE)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_NODE(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_NODE)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_TYPE_NODE(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_TYPE_NODE)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_FRAGMENT_NODE(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_FRAGMENT_NODE)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMNode_NOTATION_NODE(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMNode::NOTATION_NODE)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_DISCONNECTED(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_DISCONNECTED)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_PRECEDING(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_PRECEDING)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_FOLLOWING(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_FOLLOWING)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_CONTAINS(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_CONTAINS)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_CONTAINED_BY(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_CONTAINED_BY)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_getNodeName(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getNodeName."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getNodeName" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getNodeName(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_getNodeValue(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getNodeValue."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getNodeValue" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getNodeValue(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_getNodeType(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode::NodeType result; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getNodeType."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getNodeType" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMNode::NodeType)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getNodeType(); + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(result)); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_getParentNode(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getParentNode."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getParentNode" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getParentNode(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_getChildNodes(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNodeList *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getChildNodes."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getChildNodes" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMNodeList *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getChildNodes(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList, 0 | 0 ); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_getFirstChild(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getFirstChild."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getFirstChild" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getFirstChild(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_getLastChild(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getLastChild."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getLastChild" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getLastChild(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_getPreviousSibling(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getPreviousSibling."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getPreviousSibling" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getPreviousSibling(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_getNextSibling(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getNextSibling."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getNextSibling" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getNextSibling(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_getAttributes(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getAttributes."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getAttributes" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getAttributes(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_getOwnerDocument(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMDocument *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getOwnerDocument."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getOwnerDocument" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMDocument *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getOwnerDocument(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocument, 0 | 0 ); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_cloneNode(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + bool arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool val2 ; + int ecode2 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_cloneNode."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_cloneNode" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + ecode2 = SWIG_AsVal_bool SWIG_JSC_AS_CALL_ARGS(argv[0], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DOMNode_cloneNode" "', argument " "2"" of type '" "bool""'"); + } + arg2 = (bool)(val2); + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->cloneNode(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_insertBefore(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg3 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + JSValueRef jsresult; + + if(argc != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_insertBefore."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_insertBefore" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMNode_insertBefore" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp2); + res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DOMNode_insertBefore" "', argument " "3"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg3 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp3); + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->insertBefore(arg2,arg3); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_replaceChild(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg3 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + JSValueRef jsresult; + + if(argc != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_replaceChild."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_replaceChild" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMNode_replaceChild" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp2); + res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DOMNode_replaceChild" "', argument " "3"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg3 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp3); + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->replaceChild(arg2,arg3); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_removeChild(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_removeChild."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_removeChild" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMNode_removeChild" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp2); + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->removeChild(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_appendChild(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_appendChild."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_appendChild" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMNode_appendChild" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp2); + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->appendChild(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_hasChildNodes(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool result; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_hasChildNodes."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_hasChildNodes" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (bool)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->hasChildNodes(); + jsresult = SWIG_From_bool SWIG_JSC_FROM_CALL_ARGS((bool)(result)); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_setNodeValue(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_setNodeValue."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_setNodeValue" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + (arg1)->setNodeValue((XMLCh const *)arg2); + jsresult = JSValueMakeUndefined(context); + + + delete[] arg2; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_normalize(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_normalize."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_normalize" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + (arg1)->normalize(); + jsresult = JSValueMakeUndefined(context); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_isSupported(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool result; + + JSValueRef jsresult; + + if(argc != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_isSupported."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_isSupported" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + + arg3 = JS2XMLString(argv[1], context); + + result = (bool)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->isSupported((XMLCh const *)arg2,(XMLCh const *)arg3); + jsresult = SWIG_From_bool SWIG_JSC_FROM_CALL_ARGS((bool)(result)); + + + delete[] arg2; + + + delete[] arg3; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_getNamespaceURI(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getNamespaceURI."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getNamespaceURI" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getNamespaceURI(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_getLocalName(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getLocalName."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getLocalName" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getLocalName(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_setPrefix(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_setPrefix."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_setPrefix" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + (arg1)->setPrefix((XMLCh const *)arg2); + jsresult = JSValueMakeUndefined(context); + + + delete[] arg2; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_hasAttributes(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool result; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_hasAttributes."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_hasAttributes" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (bool)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->hasAttributes(); + jsresult = SWIG_From_bool SWIG_JSC_FROM_CALL_ARGS((bool)(result)); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_isSameNode(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + bool result; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_isSameNode."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_isSameNode" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMNode_isSameNode" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp2); + result = (bool)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->isSameNode((XERCES_CPP_NAMESPACE::DOMNode const *)arg2); + jsresult = SWIG_From_bool SWIG_JSC_FROM_CALL_ARGS((bool)(result)); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_isEqualNode(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + bool result; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_isEqualNode."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_isEqualNode" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMNode_isEqualNode" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp2); + result = (bool)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->isEqualNode((XERCES_CPP_NAMESPACE::DOMNode const *)arg2); + jsresult = SWIG_From_bool SWIG_JSC_FROM_CALL_ARGS((bool)(result)); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_setUserData(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *arg3 = (void *) 0 ; + XERCES_CPP_NAMESPACE::DOMUserDataHandler *arg4 = (XERCES_CPP_NAMESPACE::DOMUserDataHandler *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res3 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *result = 0 ; + + JSValueRef jsresult; + + if(argc != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_setUserData."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_setUserData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + res3 = SWIG_ConvertPtr(argv[1],SWIG_as_voidptrptr(&arg3), 0, 0); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DOMNode_setUserData" "', argument " "3"" of type '" "void *""'"); + } + res4 = SWIG_ConvertPtr(argv[2], &argp4,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMUserDataHandler, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "DOMNode_setUserData" "', argument " "4"" of type '" "XERCES_CPP_NAMESPACE::DOMUserDataHandler *""'"); + } + arg4 = (XERCES_CPP_NAMESPACE::DOMUserDataHandler *)(argp4); + result = (void *)(arg1)->setUserData((XMLCh const *)arg2,arg3,arg4); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); + + + delete[] arg2; + + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_getUserData(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *result = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getUserData."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getUserData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + result = (void *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getUserData((XMLCh const *)arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); + + + delete[] arg2; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_getBaseURI(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getBaseURI."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getBaseURI" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getBaseURI(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_compareDocumentPosition(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + short result; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_compareDocumentPosition."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_compareDocumentPosition" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMNode_compareDocumentPosition" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp2); + result = (short)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->compareDocumentPosition((XERCES_CPP_NAMESPACE::DOMNode const *)arg2); + jsresult = SWIG_From_short SWIG_JSC_FROM_CALL_ARGS((short)(result)); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_getTextContent(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getTextContent."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getTextContent" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getTextContent(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_setTextContent(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_setTextContent."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_setTextContent" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + (arg1)->setTextContent((XMLCh const *)arg2); + jsresult = JSValueMakeUndefined(context); + + + delete[] arg2; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_lookupPrefix(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_lookupPrefix."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_lookupPrefix" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->lookupPrefix((XMLCh const *)arg2); + + jsresult = XMLString2JS(result, context); + + + + delete[] arg2; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_isDefaultNamespace(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool result; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_isDefaultNamespace."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_isDefaultNamespace" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + result = (bool)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->isDefaultNamespace((XMLCh const *)arg2); + jsresult = SWIG_From_bool SWIG_JSC_FROM_CALL_ARGS((bool)(result)); + + + delete[] arg2; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_lookupNamespaceURI(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_lookupNamespaceURI."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_lookupNamespaceURI" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->lookupNamespaceURI((XMLCh const *)arg2); + + jsresult = XMLString2JS(result, context); + + + + delete[] arg2; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_getFeature(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *result = 0 ; + + JSValueRef jsresult; + + if(argc != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getFeature."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getFeature" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + + arg3 = JS2XMLString(argv[1], context); + + result = (void *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getFeature((XMLCh const *)arg2,(XMLCh const *)arg3); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); + + + delete[] arg2; + + + delete[] arg3; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNode_release(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_release."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_release" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + (arg1)->release(); + jsresult = JSValueMakeUndefined(context); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSStaticValue _exports_DOMNode_staticValues[] = { + { + "ELEMENT_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_ELEMENT_NODE, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "ATTRIBUTE_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_ATTRIBUTE_NODE, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "TEXT_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_TEXT_NODE, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "CDATA_SECTION_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_CDATA_SECTION_NODE, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "ENTITY_REFERENCE_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_ENTITY_REFERENCE_NODE, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "ENTITY_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_ENTITY_NODE, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "PROCESSING_INSTRUCTION_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_PROCESSING_INSTRUCTION_NODE, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "COMMENT_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_COMMENT_NODE, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "DOCUMENT_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_NODE, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "DOCUMENT_TYPE_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_TYPE_NODE, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "DOCUMENT_FRAGMENT_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_FRAGMENT_NODE, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "NOTATION_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_NOTATION_NODE, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "DOCUMENT_POSITION_DISCONNECTED", _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_DISCONNECTED, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "DOCUMENT_POSITION_PRECEDING", _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_PRECEDING, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "DOCUMENT_POSITION_FOLLOWING", _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_FOLLOWING, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "DOCUMENT_POSITION_CONTAINS", _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_CONTAINS, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "DOCUMENT_POSITION_CONTAINED_BY", _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_CONTAINED_BY, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC", _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMNode_staticFunctions[] = { + { + 0, 0, 0 + } +}; + +static JSStaticValue _exports_DOMNode_values[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMNode_functions[] = { + { + "getNodeName", _wrap_DOMNode_getNodeName, kJSPropertyAttributeNone + }, + + + { + "getNodeValue", _wrap_DOMNode_getNodeValue, kJSPropertyAttributeNone + }, + + + { + "getNodeType", _wrap_DOMNode_getNodeType, kJSPropertyAttributeNone + }, + + + { + "getParentNode", _wrap_DOMNode_getParentNode, kJSPropertyAttributeNone + }, + + + { + "getChildNodes", _wrap_DOMNode_getChildNodes, kJSPropertyAttributeNone + }, + + + { + "getFirstChild", _wrap_DOMNode_getFirstChild, kJSPropertyAttributeNone + }, + + + { + "getLastChild", _wrap_DOMNode_getLastChild, kJSPropertyAttributeNone + }, + + + { + "getPreviousSibling", _wrap_DOMNode_getPreviousSibling, kJSPropertyAttributeNone + }, + + + { + "getNextSibling", _wrap_DOMNode_getNextSibling, kJSPropertyAttributeNone + }, + + + { + "getAttributes", _wrap_DOMNode_getAttributes, kJSPropertyAttributeNone + }, + + + { + "getOwnerDocument", _wrap_DOMNode_getOwnerDocument, kJSPropertyAttributeNone + }, + + + { + "cloneNode", _wrap_DOMNode_cloneNode, kJSPropertyAttributeNone + }, + + + { + "insertBefore", _wrap_DOMNode_insertBefore, kJSPropertyAttributeNone + }, + + + { + "replaceChild", _wrap_DOMNode_replaceChild, kJSPropertyAttributeNone + }, + + + { + "removeChild", _wrap_DOMNode_removeChild, kJSPropertyAttributeNone + }, + + + { + "appendChild", _wrap_DOMNode_appendChild, kJSPropertyAttributeNone + }, + + + { + "hasChildNodes", _wrap_DOMNode_hasChildNodes, kJSPropertyAttributeNone + }, + + + { + "setNodeValue", _wrap_DOMNode_setNodeValue, kJSPropertyAttributeNone + }, + + + { + "normalize", _wrap_DOMNode_normalize, kJSPropertyAttributeNone + }, + + + { + "isSupported", _wrap_DOMNode_isSupported, kJSPropertyAttributeNone + }, + + + { + "getNamespaceURI", _wrap_DOMNode_getNamespaceURI, kJSPropertyAttributeNone + }, + + + { + "getLocalName", _wrap_DOMNode_getLocalName, kJSPropertyAttributeNone + }, + + + { + "setPrefix", _wrap_DOMNode_setPrefix, kJSPropertyAttributeNone + }, + + + { + "hasAttributes", _wrap_DOMNode_hasAttributes, kJSPropertyAttributeNone + }, + + + { + "isSameNode", _wrap_DOMNode_isSameNode, kJSPropertyAttributeNone + }, + + + { + "isEqualNode", _wrap_DOMNode_isEqualNode, kJSPropertyAttributeNone + }, + + + { + "setUserData", _wrap_DOMNode_setUserData, kJSPropertyAttributeNone + }, + + + { + "getUserData", _wrap_DOMNode_getUserData, kJSPropertyAttributeNone + }, + + + { + "getBaseURI", _wrap_DOMNode_getBaseURI, kJSPropertyAttributeNone + }, + + + { + "compareDocumentPosition", _wrap_DOMNode_compareDocumentPosition, kJSPropertyAttributeNone + }, + + + { + "getTextContent", _wrap_DOMNode_getTextContent, kJSPropertyAttributeNone + }, + + + { + "setTextContent", _wrap_DOMNode_setTextContent, kJSPropertyAttributeNone + }, + + + { + "lookupPrefix", _wrap_DOMNode_lookupPrefix, kJSPropertyAttributeNone + }, + + + { + "isDefaultNamespace", _wrap_DOMNode_isDefaultNamespace, kJSPropertyAttributeNone + }, + + + { + "lookupNamespaceURI", _wrap_DOMNode_lookupNamespaceURI, kJSPropertyAttributeNone + }, + + + { + "getFeature", _wrap_DOMNode_getFeature, kJSPropertyAttributeNone + }, + + + { + "release", _wrap_DOMNode_release, kJSPropertyAttributeNone + }, + + + { + 0, 0, 0 + } +}; + + +static JSObjectRef _wrap_new_veto_DOMNode(JSContextRef context, JSObjectRef ctorObject, + size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + SWIG_exception(SWIG_ERROR, "Class DOMNode can not be instantiated"); + return 0; +} + + +static JSClassDefinition _exports_DOMAttr_classDefinition; + +static JSClassDefinition _exports_DOMAttr_objectDefinition; + +static JSClassRef _exports_DOMAttr_classRef; + + +static void _wrap_delete_DOMAttr(JSObjectRef thisObject) +{ + SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); + if(t) { + if (t->swigCMemOwn) { + XERCES_CPP_NAMESPACE::DOMAttr * arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *)t->swigCObject; + delete arg1; + } + /* remove the private data to make sure that it isn't accessed elsewhere */ + JSObjectSetPrivate(thisObject, NULL); + free(t); + } +} + + +static JSValueRef _wrap_DOMAttr_getName(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMAttr_getName."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMAttr_getName" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMAttr const *)arg1)->getName(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMAttr_getSpecified(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool result; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMAttr_getSpecified."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMAttr_getSpecified" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp1); + result = (bool)((XERCES_CPP_NAMESPACE::DOMAttr const *)arg1)->getSpecified(); + jsresult = SWIG_From_bool SWIG_JSC_FROM_CALL_ARGS((bool)(result)); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMAttr_getValue(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMAttr_getValue."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMAttr_getValue" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMAttr const *)arg1)->getValue(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMAttr_setValue(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMAttr_setValue."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMAttr_setValue" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + (arg1)->setValue((XMLCh const *)arg2); + jsresult = JSValueMakeUndefined(context); + + + delete[] arg2; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMAttr_getOwnerElement(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMElement *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMAttr_getOwnerElement."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMAttr_getOwnerElement" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMElement *)((XERCES_CPP_NAMESPACE::DOMAttr const *)arg1)->getOwnerElement(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMAttr_isId(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool result; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMAttr_isId."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMAttr_isId" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp1); + result = (bool)((XERCES_CPP_NAMESPACE::DOMAttr const *)arg1)->isId(); + jsresult = SWIG_From_bool SWIG_JSC_FROM_CALL_ARGS((bool)(result)); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMAttr_getSchemaTypeInfo(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMTypeInfo *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMAttr_getSchemaTypeInfo."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMAttr_getSchemaTypeInfo" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMTypeInfo *)((XERCES_CPP_NAMESPACE::DOMAttr const *)arg1)->getSchemaTypeInfo(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMTypeInfo, 0 | 0 ); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSStaticValue _exports_DOMAttr_staticValues[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMAttr_staticFunctions[] = { + { + 0, 0, 0 + } +}; + +static JSStaticValue _exports_DOMAttr_values[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMAttr_functions[] = { + { + "getName", _wrap_DOMAttr_getName, kJSPropertyAttributeNone + }, + + + { + "getSpecified", _wrap_DOMAttr_getSpecified, kJSPropertyAttributeNone + }, + + + { + "getValue", _wrap_DOMAttr_getValue, kJSPropertyAttributeNone + }, + + + { + "setValue", _wrap_DOMAttr_setValue, kJSPropertyAttributeNone + }, + + + { + "getOwnerElement", _wrap_DOMAttr_getOwnerElement, kJSPropertyAttributeNone + }, + + + { + "isId", _wrap_DOMAttr_isId, kJSPropertyAttributeNone + }, + + + { + "getSchemaTypeInfo", _wrap_DOMAttr_getSchemaTypeInfo, kJSPropertyAttributeNone + }, + + + { + 0, 0, 0 + } +}; + + +static JSObjectRef _wrap_new_veto_DOMAttr(JSContextRef context, JSObjectRef ctorObject, + size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + SWIG_exception(SWIG_ERROR, "Class DOMAttr can not be instantiated"); + return 0; +} + + +static JSClassDefinition _exports_DOMElement_classDefinition; + +static JSClassDefinition _exports_DOMElement_objectDefinition; + +static JSClassRef _exports_DOMElement_classRef; + + +static void _wrap_delete_DOMElement(JSObjectRef thisObject) +{ + SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); + if(t) { + if (t->swigCMemOwn) { + XERCES_CPP_NAMESPACE::DOMElement * arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)t->swigCObject; + delete arg1; + } + /* remove the private data to make sure that it isn't accessed elsewhere */ + JSObjectSetPrivate(thisObject, NULL); + free(t); + } +} + + +static JSValueRef _wrap_DOMElement_getTagName(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getTagName."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getTagName" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getTagName(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_getAttribute(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getAttribute."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getAttribute" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getAttribute((XMLCh const *)arg2); + + jsresult = XMLString2JS(result, context); + + + + delete[] arg2; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_getAttributeNode(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *result = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getAttributeNode."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getAttributeNode" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + result = (XERCES_CPP_NAMESPACE::DOMAttr *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getAttributeNode((XMLCh const *)arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + + + delete[] arg2; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_getElementsByTagName(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNodeList *result = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getElementsByTagName."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getElementsByTagName" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + result = (XERCES_CPP_NAMESPACE::DOMNodeList *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getElementsByTagName((XMLCh const *)arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList, 0 | 0 ); + + + delete[] arg2; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_setAttribute(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + JSValueRef jsresult; + + if(argc != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_setAttribute."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_setAttribute" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + + arg3 = JS2XMLString(argv[1], context); + + (arg1)->setAttribute((XMLCh const *)arg2,(XMLCh const *)arg3); + jsresult = JSValueMakeUndefined(context); + + + delete[] arg2; + + + delete[] arg3; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_setAttributeNode(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *arg2 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *result = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_setAttributeNode."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_setAttributeNode" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMElement_setAttributeNode" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp2); + result = (XERCES_CPP_NAMESPACE::DOMAttr *)(arg1)->setAttributeNode(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_removeAttributeNode(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *arg2 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *result = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_removeAttributeNode."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_removeAttributeNode" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMElement_removeAttributeNode" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp2); + result = (XERCES_CPP_NAMESPACE::DOMAttr *)(arg1)->removeAttributeNode(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_removeAttribute(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_removeAttribute."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_removeAttribute" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + (arg1)->removeAttribute((XMLCh const *)arg2); + jsresult = JSValueMakeUndefined(context); + + + delete[] arg2; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_getAttributeNS(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getAttributeNS."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getAttributeNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + + arg3 = JS2XMLString(argv[1], context); + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getAttributeNS((XMLCh const *)arg2,(XMLCh const *)arg3); + + jsresult = XMLString2JS(result, context); + + + + delete[] arg2; + + + delete[] arg3; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_setAttributeNS(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + XMLCh *arg4 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + JSValueRef jsresult; + + if(argc != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_setAttributeNS."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_setAttributeNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + + arg3 = JS2XMLString(argv[1], context); + + + arg4 = JS2XMLString(argv[2], context); + + (arg1)->setAttributeNS((XMLCh const *)arg2,(XMLCh const *)arg3,(XMLCh const *)arg4); + jsresult = JSValueMakeUndefined(context); + + + delete[] arg2; + + + delete[] arg3; + + + delete[] arg4; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_removeAttributeNS(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + JSValueRef jsresult; + + if(argc != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_removeAttributeNS."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_removeAttributeNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + + arg3 = JS2XMLString(argv[1], context); + + (arg1)->removeAttributeNS((XMLCh const *)arg2,(XMLCh const *)arg3); + jsresult = JSValueMakeUndefined(context); + + + delete[] arg2; + + + delete[] arg3; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_getAttributeNodeNS(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *result = 0 ; + + JSValueRef jsresult; + + if(argc != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getAttributeNodeNS."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getAttributeNodeNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + + arg3 = JS2XMLString(argv[1], context); + + result = (XERCES_CPP_NAMESPACE::DOMAttr *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getAttributeNodeNS((XMLCh const *)arg2,(XMLCh const *)arg3); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + + + delete[] arg2; + + + delete[] arg3; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_setAttributeNodeNS(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *arg2 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *result = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_setAttributeNodeNS."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_setAttributeNodeNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMElement_setAttributeNodeNS" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp2); + result = (XERCES_CPP_NAMESPACE::DOMAttr *)(arg1)->setAttributeNodeNS(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_getElementsByTagNameNS(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNodeList *result = 0 ; + + JSValueRef jsresult; + + if(argc != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getElementsByTagNameNS."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getElementsByTagNameNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + + arg3 = JS2XMLString(argv[1], context); + + result = (XERCES_CPP_NAMESPACE::DOMNodeList *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getElementsByTagNameNS((XMLCh const *)arg2,(XMLCh const *)arg3); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList, 0 | 0 ); + + + delete[] arg2; + + + delete[] arg3; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_hasAttribute(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool result; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_hasAttribute."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_hasAttribute" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + result = (bool)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->hasAttribute((XMLCh const *)arg2); + jsresult = SWIG_From_bool SWIG_JSC_FROM_CALL_ARGS((bool)(result)); + + + delete[] arg2; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_hasAttributeNS(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool result; + + JSValueRef jsresult; + + if(argc != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_hasAttributeNS."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_hasAttributeNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + + arg3 = JS2XMLString(argv[1], context); + + result = (bool)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->hasAttributeNS((XMLCh const *)arg2,(XMLCh const *)arg3); + jsresult = SWIG_From_bool SWIG_JSC_FROM_CALL_ARGS((bool)(result)); + + + delete[] arg2; + + + delete[] arg3; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_setIdAttribute(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + bool arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool val3 ; + int ecode3 = 0 ; + + JSValueRef jsresult; + + if(argc != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_setIdAttribute."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_setIdAttribute" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + ecode3 = SWIG_AsVal_bool SWIG_JSC_AS_CALL_ARGS(argv[1], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DOMElement_setIdAttribute" "', argument " "3"" of type '" "bool""'"); + } + arg3 = (bool)(val3); + (arg1)->setIdAttribute((XMLCh const *)arg2,arg3); + jsresult = JSValueMakeUndefined(context); + + + delete[] arg2; + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_setIdAttributeNS(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + bool arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool val4 ; + int ecode4 = 0 ; + + JSValueRef jsresult; + + if(argc != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_setIdAttributeNS."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_setIdAttributeNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + + arg3 = JS2XMLString(argv[1], context); + + ecode4 = SWIG_AsVal_bool SWIG_JSC_AS_CALL_ARGS(argv[2], &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "DOMElement_setIdAttributeNS" "', argument " "4"" of type '" "bool""'"); + } + arg4 = (bool)(val4); + (arg1)->setIdAttributeNS((XMLCh const *)arg2,(XMLCh const *)arg3,arg4); + jsresult = JSValueMakeUndefined(context); + + + delete[] arg2; + + + delete[] arg3; + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_setIdAttributeNode(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *arg2 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + bool arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + bool val3 ; + int ecode3 = 0 ; + + JSValueRef jsresult; + + if(argc != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_setIdAttributeNode."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_setIdAttributeNode" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMElement_setIdAttributeNode" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr const *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp2); + ecode3 = SWIG_AsVal_bool SWIG_JSC_AS_CALL_ARGS(argv[1], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DOMElement_setIdAttributeNode" "', argument " "3"" of type '" "bool""'"); + } + arg3 = (bool)(val3); + (arg1)->setIdAttributeNode((XERCES_CPP_NAMESPACE::DOMAttr const *)arg2,arg3); + jsresult = JSValueMakeUndefined(context); + + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_getSchemaTypeInfo(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMTypeInfo *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getSchemaTypeInfo."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getSchemaTypeInfo" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMTypeInfo *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getSchemaTypeInfo(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMTypeInfo, 0 | 0 ); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_getFirstElementChild(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMElement *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getFirstElementChild."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getFirstElementChild" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMElement *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getFirstElementChild(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_getLastElementChild(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMElement *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getLastElementChild."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getLastElementChild" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMElement *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getLastElementChild(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_getPreviousElementSibling(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMElement *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getPreviousElementSibling."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getPreviousElementSibling" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMElement *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getPreviousElementSibling(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_getNextElementSibling(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMElement *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getNextElementSibling."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getNextElementSibling" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMElement *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getNextElementSibling(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMElement_getChildElementCount(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLSize_t result; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getChildElementCount."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getChildElementCount" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + result = ((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getChildElementCount(); + jsresult = SWIG_From_size_t SWIG_JSC_FROM_CALL_ARGS((size_t)(result)); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSStaticValue _exports_DOMElement_staticValues[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMElement_staticFunctions[] = { + { + 0, 0, 0 + } +}; + +static JSStaticValue _exports_DOMElement_values[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMElement_functions[] = { + { + "getTagName", _wrap_DOMElement_getTagName, kJSPropertyAttributeNone + }, + + + { + "getAttribute", _wrap_DOMElement_getAttribute, kJSPropertyAttributeNone + }, + + + { + "getAttributeNode", _wrap_DOMElement_getAttributeNode, kJSPropertyAttributeNone + }, + + + { + "getElementsByTagName", _wrap_DOMElement_getElementsByTagName, kJSPropertyAttributeNone + }, + + + { + "setAttribute", _wrap_DOMElement_setAttribute, kJSPropertyAttributeNone + }, + + + { + "setAttributeNode", _wrap_DOMElement_setAttributeNode, kJSPropertyAttributeNone + }, + + + { + "removeAttributeNode", _wrap_DOMElement_removeAttributeNode, kJSPropertyAttributeNone + }, + + + { + "removeAttribute", _wrap_DOMElement_removeAttribute, kJSPropertyAttributeNone + }, + + + { + "getAttributeNS", _wrap_DOMElement_getAttributeNS, kJSPropertyAttributeNone + }, + + + { + "setAttributeNS", _wrap_DOMElement_setAttributeNS, kJSPropertyAttributeNone + }, + + + { + "removeAttributeNS", _wrap_DOMElement_removeAttributeNS, kJSPropertyAttributeNone + }, + + + { + "getAttributeNodeNS", _wrap_DOMElement_getAttributeNodeNS, kJSPropertyAttributeNone + }, + + + { + "setAttributeNodeNS", _wrap_DOMElement_setAttributeNodeNS, kJSPropertyAttributeNone + }, + + + { + "getElementsByTagNameNS", _wrap_DOMElement_getElementsByTagNameNS, kJSPropertyAttributeNone + }, + + + { + "hasAttribute", _wrap_DOMElement_hasAttribute, kJSPropertyAttributeNone + }, + + + { + "hasAttributeNS", _wrap_DOMElement_hasAttributeNS, kJSPropertyAttributeNone + }, + + + { + "setIdAttribute", _wrap_DOMElement_setIdAttribute, kJSPropertyAttributeNone + }, + + + { + "setIdAttributeNS", _wrap_DOMElement_setIdAttributeNS, kJSPropertyAttributeNone + }, + + + { + "setIdAttributeNode", _wrap_DOMElement_setIdAttributeNode, kJSPropertyAttributeNone + }, + + + { + "getSchemaTypeInfo", _wrap_DOMElement_getSchemaTypeInfo, kJSPropertyAttributeNone + }, + + + { + "getFirstElementChild", _wrap_DOMElement_getFirstElementChild, kJSPropertyAttributeNone + }, + + + { + "getLastElementChild", _wrap_DOMElement_getLastElementChild, kJSPropertyAttributeNone + }, + + + { + "getPreviousElementSibling", _wrap_DOMElement_getPreviousElementSibling, kJSPropertyAttributeNone + }, + + + { + "getNextElementSibling", _wrap_DOMElement_getNextElementSibling, kJSPropertyAttributeNone + }, + + + { + "getChildElementCount", _wrap_DOMElement_getChildElementCount, kJSPropertyAttributeNone + }, + + + { + 0, 0, 0 + } +}; + + +static JSObjectRef _wrap_new_veto_DOMElement(JSContextRef context, JSObjectRef ctorObject, + size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + SWIG_exception(SWIG_ERROR, "Class DOMElement can not be instantiated"); + return 0; +} + + +static JSClassDefinition _exports_DOMEntity_classDefinition; + +static JSClassDefinition _exports_DOMEntity_objectDefinition; + +static JSClassRef _exports_DOMEntity_classRef; + + +static void _wrap_delete_DOMEntity(JSObjectRef thisObject) +{ + SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); + if(t) { + if (t->swigCMemOwn) { + XERCES_CPP_NAMESPACE::DOMEntity * arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *)t->swigCObject; + delete arg1; + } + /* remove the private data to make sure that it isn't accessed elsewhere */ + JSObjectSetPrivate(thisObject, NULL); + free(t); + } +} + + +static JSValueRef _wrap_DOMEntity_getPublicId(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMEntity *arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMEntity_getPublicId."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMEntity_getPublicId" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMEntity const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getPublicId(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMEntity_getSystemId(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMEntity *arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMEntity_getSystemId."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMEntity_getSystemId" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMEntity const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getSystemId(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMEntity_getNotationName(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMEntity *arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMEntity_getNotationName."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMEntity_getNotationName" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMEntity const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getNotationName(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMEntity_getInputEncoding(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMEntity *arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMEntity_getInputEncoding."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMEntity_getInputEncoding" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMEntity const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getInputEncoding(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMEntity_getXmlEncoding(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMEntity *arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMEntity_getXmlEncoding."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMEntity_getXmlEncoding" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMEntity const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getXmlEncoding(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMEntity_getXmlVersion(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMEntity *arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMEntity_getXmlVersion."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMEntity_getXmlVersion" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMEntity const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getXmlVersion(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSStaticValue _exports_DOMEntity_staticValues[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMEntity_staticFunctions[] = { + { + 0, 0, 0 + } +}; + +static JSStaticValue _exports_DOMEntity_values[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMEntity_functions[] = { + { + "getPublicId", _wrap_DOMEntity_getPublicId, kJSPropertyAttributeNone + }, + + + { + "getSystemId", _wrap_DOMEntity_getSystemId, kJSPropertyAttributeNone + }, + + + { + "getNotationName", _wrap_DOMEntity_getNotationName, kJSPropertyAttributeNone + }, + + + { + "getInputEncoding", _wrap_DOMEntity_getInputEncoding, kJSPropertyAttributeNone + }, + + + { + "getXmlEncoding", _wrap_DOMEntity_getXmlEncoding, kJSPropertyAttributeNone + }, + + + { + "getXmlVersion", _wrap_DOMEntity_getXmlVersion, kJSPropertyAttributeNone + }, + + + { + 0, 0, 0 + } +}; + + +static JSObjectRef _wrap_new_veto_DOMEntity(JSContextRef context, JSObjectRef ctorObject, + size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + SWIG_exception(SWIG_ERROR, "Class DOMEntity can not be instantiated"); + return 0; +} + + +static JSClassDefinition _exports_DOMDocumentType_classDefinition; + +static JSClassDefinition _exports_DOMDocumentType_objectDefinition; + +static JSClassRef _exports_DOMDocumentType_classRef; + + +static void _wrap_delete_DOMDocumentType(JSObjectRef thisObject) +{ + SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); + if(t) { + if (t->swigCMemOwn) { + XERCES_CPP_NAMESPACE::DOMDocumentType * arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *)t->swigCObject; + delete arg1; + } + /* remove the private data to make sure that it isn't accessed elsewhere */ + JSObjectSetPrivate(thisObject, NULL); + free(t); + } +} + + +static JSValueRef _wrap_DOMDocumentType_getName(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMDocumentType *arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMDocumentType_getName."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMDocumentType_getName" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMDocumentType const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getName(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMDocumentType_getEntities(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMDocumentType *arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMDocumentType_getEntities."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMDocumentType_getEntities" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMDocumentType const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getEntities(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMDocumentType_getNotations(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMDocumentType *arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMDocumentType_getNotations."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMDocumentType_getNotations" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMDocumentType const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getNotations(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMDocumentType_getPublicId(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMDocumentType *arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMDocumentType_getPublicId."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMDocumentType_getPublicId" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMDocumentType const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getPublicId(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMDocumentType_getSystemId(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMDocumentType *arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMDocumentType_getSystemId."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMDocumentType_getSystemId" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMDocumentType const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getSystemId(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMDocumentType_getInternalSubset(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMDocumentType *arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMDocumentType_getInternalSubset."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMDocumentType_getInternalSubset" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMDocumentType const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getInternalSubset(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSStaticValue _exports_DOMDocumentType_staticValues[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMDocumentType_staticFunctions[] = { + { + 0, 0, 0 + } +}; + +static JSStaticValue _exports_DOMDocumentType_values[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMDocumentType_functions[] = { + { + "getName", _wrap_DOMDocumentType_getName, kJSPropertyAttributeNone + }, + + + { + "getEntities", _wrap_DOMDocumentType_getEntities, kJSPropertyAttributeNone + }, + + + { + "getNotations", _wrap_DOMDocumentType_getNotations, kJSPropertyAttributeNone + }, + + + { + "getPublicId", _wrap_DOMDocumentType_getPublicId, kJSPropertyAttributeNone + }, + + + { + "getSystemId", _wrap_DOMDocumentType_getSystemId, kJSPropertyAttributeNone + }, + + + { + "getInternalSubset", _wrap_DOMDocumentType_getInternalSubset, kJSPropertyAttributeNone + }, + + + { + 0, 0, 0 + } +}; + + +static JSObjectRef _wrap_new_veto_DOMDocumentType(JSContextRef context, JSObjectRef ctorObject, + size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + SWIG_exception(SWIG_ERROR, "Class DOMDocumentType can not be instantiated"); + return 0; +} + + +static JSClassDefinition _exports_DOMCharacterData_classDefinition; + +static JSClassDefinition _exports_DOMCharacterData_objectDefinition; + +static JSClassRef _exports_DOMCharacterData_classRef; + + +static void _wrap_delete_DOMCharacterData(JSObjectRef thisObject) +{ + SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); + if(t) { + if (t->swigCMemOwn) { + XERCES_CPP_NAMESPACE::DOMCharacterData * arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *)t->swigCObject; + delete arg1; + } + /* remove the private data to make sure that it isn't accessed elsewhere */ + JSObjectSetPrivate(thisObject, NULL); + free(t); + } +} + + +static JSValueRef _wrap_DOMCharacterData_getData(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMCharacterData_getData."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMCharacterData_getData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMCharacterData const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMCharacterData const *)arg1)->getData(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMCharacterData_getLength(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLSize_t result; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMCharacterData_getLength."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMCharacterData_getLength" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMCharacterData const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *)(argp1); + result = ((XERCES_CPP_NAMESPACE::DOMCharacterData const *)arg1)->getLength(); + jsresult = SWIG_From_size_t SWIG_JSC_FROM_CALL_ARGS((size_t)(result)); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMCharacterData_substringData(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + XMLSize_t arg2 ; + XMLSize_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMCharacterData_substringData."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMCharacterData_substringData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMCharacterData const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *)(argp1); + ecode2 = SWIG_AsVal_size_t SWIG_JSC_AS_CALL_ARGS(argv[0], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DOMCharacterData_substringData" "', argument " "2"" of type '" "XMLSize_t""'"); + } + arg2 = (XMLSize_t)(val2); + ecode3 = SWIG_AsVal_size_t SWIG_JSC_AS_CALL_ARGS(argv[1], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DOMCharacterData_substringData" "', argument " "3"" of type '" "XMLSize_t""'"); + } + arg3 = (XMLSize_t)(val3); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMCharacterData const *)arg1)->substringData(arg2,arg3); + + jsresult = XMLString2JS(result, context); + + + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMCharacterData_appendData(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMCharacterData_appendData."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMCharacterData_appendData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMCharacterData *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + (arg1)->appendData((XMLCh const *)arg2); + jsresult = JSValueMakeUndefined(context); + + + delete[] arg2; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMCharacterData_insertData(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + XMLSize_t arg2 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + + JSValueRef jsresult; + + if(argc != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMCharacterData_insertData."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMCharacterData_insertData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMCharacterData *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *)(argp1); + ecode2 = SWIG_AsVal_size_t SWIG_JSC_AS_CALL_ARGS(argv[0], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DOMCharacterData_insertData" "', argument " "2"" of type '" "XMLSize_t""'"); + } + arg2 = (XMLSize_t)(val2); + + arg3 = JS2XMLString(argv[1], context); + + (arg1)->insertData(arg2,(XMLCh const *)arg3); + jsresult = JSValueMakeUndefined(context); + + + + delete[] arg3; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMCharacterData_deleteData(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + XMLSize_t arg2 ; + XMLSize_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + + JSValueRef jsresult; + + if(argc != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMCharacterData_deleteData."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMCharacterData_deleteData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMCharacterData *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *)(argp1); + ecode2 = SWIG_AsVal_size_t SWIG_JSC_AS_CALL_ARGS(argv[0], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DOMCharacterData_deleteData" "', argument " "2"" of type '" "XMLSize_t""'"); + } + arg2 = (XMLSize_t)(val2); + ecode3 = SWIG_AsVal_size_t SWIG_JSC_AS_CALL_ARGS(argv[1], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DOMCharacterData_deleteData" "', argument " "3"" of type '" "XMLSize_t""'"); + } + arg3 = (XMLSize_t)(val3); + (arg1)->deleteData(arg2,arg3); + jsresult = JSValueMakeUndefined(context); + + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMCharacterData_replaceData(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + XMLSize_t arg2 ; + XMLSize_t arg3 ; + XMLCh *arg4 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + + JSValueRef jsresult; + + if(argc != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMCharacterData_replaceData."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMCharacterData_replaceData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMCharacterData *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *)(argp1); + ecode2 = SWIG_AsVal_size_t SWIG_JSC_AS_CALL_ARGS(argv[0], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DOMCharacterData_replaceData" "', argument " "2"" of type '" "XMLSize_t""'"); + } + arg2 = (XMLSize_t)(val2); + ecode3 = SWIG_AsVal_size_t SWIG_JSC_AS_CALL_ARGS(argv[1], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DOMCharacterData_replaceData" "', argument " "3"" of type '" "XMLSize_t""'"); + } + arg3 = (XMLSize_t)(val3); + + arg4 = JS2XMLString(argv[2], context); + + (arg1)->replaceData(arg2,arg3,(XMLCh const *)arg4); + jsresult = JSValueMakeUndefined(context); + + + + + delete[] arg4; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMCharacterData_setData(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMCharacterData_setData."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMCharacterData_setData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMCharacterData *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + (arg1)->setData((XMLCh const *)arg2); + jsresult = JSValueMakeUndefined(context); + + + delete[] arg2; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSStaticValue _exports_DOMCharacterData_staticValues[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMCharacterData_staticFunctions[] = { + { + 0, 0, 0 + } +}; + +static JSStaticValue _exports_DOMCharacterData_values[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMCharacterData_functions[] = { + { + "getData", _wrap_DOMCharacterData_getData, kJSPropertyAttributeNone + }, + + + { + "getLength", _wrap_DOMCharacterData_getLength, kJSPropertyAttributeNone + }, + + + { + "substringData", _wrap_DOMCharacterData_substringData, kJSPropertyAttributeNone + }, + + + { + "appendData", _wrap_DOMCharacterData_appendData, kJSPropertyAttributeNone + }, + + + { + "insertData", _wrap_DOMCharacterData_insertData, kJSPropertyAttributeNone + }, + + + { + "deleteData", _wrap_DOMCharacterData_deleteData, kJSPropertyAttributeNone + }, + + + { + "replaceData", _wrap_DOMCharacterData_replaceData, kJSPropertyAttributeNone + }, + + + { + "setData", _wrap_DOMCharacterData_setData, kJSPropertyAttributeNone + }, + + + { + 0, 0, 0 + } +}; + + +static JSObjectRef _wrap_new_veto_DOMCharacterData(JSContextRef context, JSObjectRef ctorObject, + size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + SWIG_exception(SWIG_ERROR, "Class DOMCharacterData can not be instantiated"); + return 0; +} + + +static JSClassDefinition _exports_DOMComment_classDefinition; + +static JSClassDefinition _exports_DOMComment_objectDefinition; + +static JSClassRef _exports_DOMComment_classRef; + + +static void _wrap_delete_DOMComment(JSObjectRef thisObject) +{ + SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); + if(t) { + if (t->swigCMemOwn) { + XERCES_CPP_NAMESPACE::DOMComment * arg1 = (XERCES_CPP_NAMESPACE::DOMComment *)t->swigCObject; + delete arg1; + } + /* remove the private data to make sure that it isn't accessed elsewhere */ + JSObjectSetPrivate(thisObject, NULL); + free(t); + } +} + + +static JSStaticValue _exports_DOMComment_staticValues[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMComment_staticFunctions[] = { + { + 0, 0, 0 + } +}; + +static JSStaticValue _exports_DOMComment_values[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMComment_functions[] = { + { + 0, 0, 0 + } +}; + + +static JSObjectRef _wrap_new_veto_DOMComment(JSContextRef context, JSObjectRef ctorObject, + size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + SWIG_exception(SWIG_ERROR, "Class DOMComment can not be instantiated"); + return 0; +} + + +static JSClassDefinition _exports_DOMText_classDefinition; + +static JSClassDefinition _exports_DOMText_objectDefinition; + +static JSClassRef _exports_DOMText_classRef; + + +static void _wrap_delete_DOMText(JSObjectRef thisObject) +{ + SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); + if(t) { + if (t->swigCMemOwn) { + XERCES_CPP_NAMESPACE::DOMText * arg1 = (XERCES_CPP_NAMESPACE::DOMText *)t->swigCObject; + delete arg1; + } + /* remove the private data to make sure that it isn't accessed elsewhere */ + JSObjectSetPrivate(thisObject, NULL); + free(t); + } +} + + +static JSValueRef _wrap_DOMText_splitText(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMText *arg1 = (XERCES_CPP_NAMESPACE::DOMText *) 0 ; + XMLSize_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + XERCES_CPP_NAMESPACE::DOMText *result = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMText_splitText."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMText_splitText" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMText *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMText *)(argp1); + ecode2 = SWIG_AsVal_size_t SWIG_JSC_AS_CALL_ARGS(argv[0], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DOMText_splitText" "', argument " "2"" of type '" "XMLSize_t""'"); + } + arg2 = (XMLSize_t)(val2); + result = (XERCES_CPP_NAMESPACE::DOMText *)(arg1)->splitText(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText, 0 | 0 ); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMText_getIsElementContentWhitespace(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMText *arg1 = (XERCES_CPP_NAMESPACE::DOMText *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool result; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMText_getIsElementContentWhitespace."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMText_getIsElementContentWhitespace" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMText const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMText *)(argp1); + result = (bool)((XERCES_CPP_NAMESPACE::DOMText const *)arg1)->getIsElementContentWhitespace(); + jsresult = SWIG_From_bool SWIG_JSC_FROM_CALL_ARGS((bool)(result)); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMText_getWholeText(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMText *arg1 = (XERCES_CPP_NAMESPACE::DOMText *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMText_getWholeText."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMText_getWholeText" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMText const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMText *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMText const *)arg1)->getWholeText(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMText_replaceWholeText(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMText *arg1 = (XERCES_CPP_NAMESPACE::DOMText *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMText *result = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMText_replaceWholeText."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMText_replaceWholeText" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMText *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMText *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + result = (XERCES_CPP_NAMESPACE::DOMText *)(arg1)->replaceWholeText((XMLCh const *)arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText, 0 | 0 ); + + + delete[] arg2; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMText_isIgnorableWhitespace(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMText *arg1 = (XERCES_CPP_NAMESPACE::DOMText *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool result; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMText_isIgnorableWhitespace."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMText_isIgnorableWhitespace" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMText const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMText *)(argp1); + result = (bool)((XERCES_CPP_NAMESPACE::DOMText const *)arg1)->isIgnorableWhitespace(); + jsresult = SWIG_From_bool SWIG_JSC_FROM_CALL_ARGS((bool)(result)); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSStaticValue _exports_DOMText_staticValues[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMText_staticFunctions[] = { + { + 0, 0, 0 + } +}; + +static JSStaticValue _exports_DOMText_values[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMText_functions[] = { + { + "splitText", _wrap_DOMText_splitText, kJSPropertyAttributeNone + }, + + + { + "getIsElementContentWhitespace", _wrap_DOMText_getIsElementContentWhitespace, kJSPropertyAttributeNone + }, + + + { + "getWholeText", _wrap_DOMText_getWholeText, kJSPropertyAttributeNone + }, + + + { + "replaceWholeText", _wrap_DOMText_replaceWholeText, kJSPropertyAttributeNone + }, + + + { + "isIgnorableWhitespace", _wrap_DOMText_isIgnorableWhitespace, kJSPropertyAttributeNone + }, + + + { + 0, 0, 0 + } +}; + + +static JSObjectRef _wrap_new_veto_DOMText(JSContextRef context, JSObjectRef ctorObject, + size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + SWIG_exception(SWIG_ERROR, "Class DOMText can not be instantiated"); + return 0; +} + + +static JSClassDefinition _exports_DOMCDATASection_classDefinition; + +static JSClassDefinition _exports_DOMCDATASection_objectDefinition; + +static JSClassRef _exports_DOMCDATASection_classRef; + + +static void _wrap_delete_DOMCDATASection(JSObjectRef thisObject) +{ + SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); + if(t) { + if (t->swigCMemOwn) { + XERCES_CPP_NAMESPACE::DOMCDATASection * arg1 = (XERCES_CPP_NAMESPACE::DOMCDATASection *)t->swigCObject; + delete arg1; + } + /* remove the private data to make sure that it isn't accessed elsewhere */ + JSObjectSetPrivate(thisObject, NULL); + free(t); + } +} + + +static JSStaticValue _exports_DOMCDATASection_staticValues[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMCDATASection_staticFunctions[] = { + { + 0, 0, 0 + } +}; + +static JSStaticValue _exports_DOMCDATASection_values[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMCDATASection_functions[] = { + { + 0, 0, 0 + } +}; + + +static JSObjectRef _wrap_new_veto_DOMCDATASection(JSContextRef context, JSObjectRef ctorObject, + size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + SWIG_exception(SWIG_ERROR, "Class DOMCDATASection can not be instantiated"); + return 0; +} + + +static JSClassDefinition _exports_DOMNodeList_classDefinition; + +static JSClassDefinition _exports_DOMNodeList_objectDefinition; + +static JSClassRef _exports_DOMNodeList_classRef; + + +static void _wrap_delete_DOMNodeList(JSObjectRef thisObject) +{ + SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); + if(t) { + if (t->swigCMemOwn) { + XERCES_CPP_NAMESPACE::DOMNodeList * arg1 = (XERCES_CPP_NAMESPACE::DOMNodeList *)t->swigCObject; + delete arg1; + } + /* remove the private data to make sure that it isn't accessed elsewhere */ + JSObjectSetPrivate(thisObject, NULL); + free(t); + } +} + + +static JSValueRef _wrap_DOMNodeList_item(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNodeList *arg1 = (XERCES_CPP_NAMESPACE::DOMNodeList *) 0 ; + XMLSize_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNodeList_item."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNodeList_item" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNodeList const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNodeList *)(argp1); + ecode2 = SWIG_AsVal_size_t SWIG_JSC_AS_CALL_ARGS(argv[0], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DOMNodeList_item" "', argument " "2"" of type '" "XMLSize_t""'"); + } + arg2 = (XMLSize_t)(val2); + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNodeList const *)arg1)->item(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNodeList_getLength(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNodeList *arg1 = (XERCES_CPP_NAMESPACE::DOMNodeList *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLSize_t result; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNodeList_getLength."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNodeList_getLength" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNodeList const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNodeList *)(argp1); + result = ((XERCES_CPP_NAMESPACE::DOMNodeList const *)arg1)->getLength(); + jsresult = SWIG_From_size_t SWIG_JSC_FROM_CALL_ARGS((size_t)(result)); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSStaticValue _exports_DOMNodeList_staticValues[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMNodeList_staticFunctions[] = { + { + 0, 0, 0 + } +}; + +static JSStaticValue _exports_DOMNodeList_values[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMNodeList_functions[] = { + { + "item", _wrap_DOMNodeList_item, kJSPropertyAttributeNone + }, + + + { + "getLength", _wrap_DOMNodeList_getLength, kJSPropertyAttributeNone + }, + + + { + 0, 0, 0 + } +}; + + +static JSObjectRef _wrap_new_veto_DOMNodeList(JSContextRef context, JSObjectRef ctorObject, + size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + SWIG_exception(SWIG_ERROR, "Class DOMNodeList can not be instantiated"); + return 0; +} + + +static JSClassDefinition _exports_DOMNamedNodeMap_classDefinition; + +static JSClassDefinition _exports_DOMNamedNodeMap_objectDefinition; + +static JSClassRef _exports_DOMNamedNodeMap_classRef; + + +static void _wrap_delete_DOMNamedNodeMap(JSObjectRef thisObject) +{ + SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); + if(t) { + if (t->swigCMemOwn) { + XERCES_CPP_NAMESPACE::DOMNamedNodeMap * arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)t->swigCObject; + delete arg1; + } + /* remove the private data to make sure that it isn't accessed elsewhere */ + JSObjectSetPrivate(thisObject, NULL); + free(t); + } +} + + +static JSValueRef _wrap_DOMNamedNodeMap_setNamedItem(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNamedNodeMap_setNamedItem."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNamedNodeMap_setNamedItem" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNamedNodeMap *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)(argp1); + res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMNamedNodeMap_setNamedItem" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp2); + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->setNamedItem(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNamedNodeMap_item(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XMLSize_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNamedNodeMap_item."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNamedNodeMap_item" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)(argp1); + ecode2 = SWIG_AsVal_size_t SWIG_JSC_AS_CALL_ARGS(argv[0], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DOMNamedNodeMap_item" "', argument " "2"" of type '" "XMLSize_t""'"); + } + arg2 = (XMLSize_t)(val2); + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *)arg1)->item(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNamedNodeMap_getNamedItem(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNamedNodeMap_getNamedItem."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNamedNodeMap_getNamedItem" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *)arg1)->getNamedItem((XMLCh const *)arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + delete[] arg2; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNamedNodeMap_getLength(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLSize_t result; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNamedNodeMap_getLength."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNamedNodeMap_getLength" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)(argp1); + result = ((XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *)arg1)->getLength(); + jsresult = SWIG_From_size_t SWIG_JSC_FROM_CALL_ARGS((size_t)(result)); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNamedNodeMap_removeNamedItem(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNamedNodeMap_removeNamedItem."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNamedNodeMap_removeNamedItem" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNamedNodeMap *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->removeNamedItem((XMLCh const *)arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + delete[] arg2; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNamedNodeMap_getNamedItemNS(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + JSValueRef jsresult; + + if(argc != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNamedNodeMap_getNamedItemNS."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNamedNodeMap_getNamedItemNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + + arg3 = JS2XMLString(argv[1], context); + + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *)arg1)->getNamedItemNS((XMLCh const *)arg2,(XMLCh const *)arg3); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + delete[] arg2; + + + delete[] arg3; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNamedNodeMap_setNamedItemNS(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNamedNodeMap_setNamedItemNS."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNamedNodeMap_setNamedItemNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNamedNodeMap *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)(argp1); + res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMNamedNodeMap_setNamedItemNS" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp2); + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->setNamedItemNS(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNamedNodeMap_removeNamedItemNS(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + JSValueRef jsresult; + + if(argc != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNamedNodeMap_removeNamedItemNS."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNamedNodeMap_removeNamedItemNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNamedNodeMap *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + + arg3 = JS2XMLString(argv[1], context); + + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->removeNamedItemNS((XMLCh const *)arg2,(XMLCh const *)arg3); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + delete[] arg2; + + + delete[] arg3; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSStaticValue _exports_DOMNamedNodeMap_staticValues[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMNamedNodeMap_staticFunctions[] = { + { + 0, 0, 0 + } +}; + +static JSStaticValue _exports_DOMNamedNodeMap_values[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMNamedNodeMap_functions[] = { + { + "setNamedItem", _wrap_DOMNamedNodeMap_setNamedItem, kJSPropertyAttributeNone + }, + + + { + "item", _wrap_DOMNamedNodeMap_item, kJSPropertyAttributeNone + }, + + + { + "getNamedItem", _wrap_DOMNamedNodeMap_getNamedItem, kJSPropertyAttributeNone + }, + + + { + "getLength", _wrap_DOMNamedNodeMap_getLength, kJSPropertyAttributeNone + }, + + + { + "removeNamedItem", _wrap_DOMNamedNodeMap_removeNamedItem, kJSPropertyAttributeNone + }, + + + { + "getNamedItemNS", _wrap_DOMNamedNodeMap_getNamedItemNS, kJSPropertyAttributeNone + }, + + + { + "setNamedItemNS", _wrap_DOMNamedNodeMap_setNamedItemNS, kJSPropertyAttributeNone + }, + + + { + "removeNamedItemNS", _wrap_DOMNamedNodeMap_removeNamedItemNS, kJSPropertyAttributeNone + }, + + + { + 0, 0, 0 + } +}; + + +static JSObjectRef _wrap_new_veto_DOMNamedNodeMap(JSContextRef context, JSObjectRef ctorObject, + size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + SWIG_exception(SWIG_ERROR, "Class DOMNamedNodeMap can not be instantiated"); + return 0; +} + + +static JSClassDefinition _exports_DOMDocumentFragment_classDefinition; + +static JSClassDefinition _exports_DOMDocumentFragment_objectDefinition; + +static JSClassRef _exports_DOMDocumentFragment_classRef; + + +static void _wrap_delete_DOMDocumentFragment(JSObjectRef thisObject) +{ + SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); + if(t) { + if (t->swigCMemOwn) { + XERCES_CPP_NAMESPACE::DOMDocumentFragment * arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentFragment *)t->swigCObject; + delete arg1; + } + /* remove the private data to make sure that it isn't accessed elsewhere */ + JSObjectSetPrivate(thisObject, NULL); + free(t); + } +} + + +static JSStaticValue _exports_DOMDocumentFragment_staticValues[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMDocumentFragment_staticFunctions[] = { + { + 0, 0, 0 + } +}; + +static JSStaticValue _exports_DOMDocumentFragment_values[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMDocumentFragment_functions[] = { + { + 0, 0, 0 + } +}; + + +static JSObjectRef _wrap_new_veto_DOMDocumentFragment(JSContextRef context, JSObjectRef ctorObject, + size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + SWIG_exception(SWIG_ERROR, "Class DOMDocumentFragment can not be instantiated"); + return 0; +} + + +static JSClassDefinition _exports_DOMEntityReference_classDefinition; + +static JSClassDefinition _exports_DOMEntityReference_objectDefinition; + +static JSClassRef _exports_DOMEntityReference_classRef; + + +static void _wrap_delete_DOMEntityReference(JSObjectRef thisObject) +{ + SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); + if(t) { + if (t->swigCMemOwn) { + XERCES_CPP_NAMESPACE::DOMEntityReference * arg1 = (XERCES_CPP_NAMESPACE::DOMEntityReference *)t->swigCObject; + delete arg1; + } + /* remove the private data to make sure that it isn't accessed elsewhere */ + JSObjectSetPrivate(thisObject, NULL); + free(t); + } +} + + +static JSStaticValue _exports_DOMEntityReference_staticValues[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMEntityReference_staticFunctions[] = { + { + 0, 0, 0 + } +}; + +static JSStaticValue _exports_DOMEntityReference_values[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMEntityReference_functions[] = { + { + 0, 0, 0 + } +}; + + +static JSObjectRef _wrap_new_veto_DOMEntityReference(JSContextRef context, JSObjectRef ctorObject, + size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + SWIG_exception(SWIG_ERROR, "Class DOMEntityReference can not be instantiated"); + return 0; +} + + +static JSClassDefinition _exports_DOMNotation_classDefinition; + +static JSClassDefinition _exports_DOMNotation_objectDefinition; + +static JSClassRef _exports_DOMNotation_classRef; + + +static void _wrap_delete_DOMNotation(JSObjectRef thisObject) +{ + SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); + if(t) { + if (t->swigCMemOwn) { + XERCES_CPP_NAMESPACE::DOMNotation * arg1 = (XERCES_CPP_NAMESPACE::DOMNotation *)t->swigCObject; + delete arg1; + } + /* remove the private data to make sure that it isn't accessed elsewhere */ + JSObjectSetPrivate(thisObject, NULL); + free(t); + } +} + + +static JSValueRef _wrap_DOMNotation_getPublicId(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNotation *arg1 = (XERCES_CPP_NAMESPACE::DOMNotation *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNotation_getPublicId."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNotation, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNotation_getPublicId" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNotation const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNotation *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNotation const *)arg1)->getPublicId(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMNotation_getSystemId(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMNotation *arg1 = (XERCES_CPP_NAMESPACE::DOMNotation *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNotation_getSystemId."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNotation, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNotation_getSystemId" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNotation const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNotation *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNotation const *)arg1)->getSystemId(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSStaticValue _exports_DOMNotation_staticValues[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMNotation_staticFunctions[] = { + { + 0, 0, 0 + } +}; + +static JSStaticValue _exports_DOMNotation_values[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMNotation_functions[] = { + { + "getPublicId", _wrap_DOMNotation_getPublicId, kJSPropertyAttributeNone + }, + + + { + "getSystemId", _wrap_DOMNotation_getSystemId, kJSPropertyAttributeNone + }, + + + { + 0, 0, 0 + } +}; + + +static JSObjectRef _wrap_new_veto_DOMNotation(JSContextRef context, JSObjectRef ctorObject, + size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + SWIG_exception(SWIG_ERROR, "Class DOMNotation can not be instantiated"); + return 0; +} + + +static JSClassDefinition _exports_DOMProcessingInstruction_classDefinition; + +static JSClassDefinition _exports_DOMProcessingInstruction_objectDefinition; + +static JSClassRef _exports_DOMProcessingInstruction_classRef; + + +static void _wrap_delete_DOMProcessingInstruction(JSObjectRef thisObject) +{ + SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); + if(t) { + if (t->swigCMemOwn) { + XERCES_CPP_NAMESPACE::DOMProcessingInstruction * arg1 = (XERCES_CPP_NAMESPACE::DOMProcessingInstruction *)t->swigCObject; + delete arg1; + } + /* remove the private data to make sure that it isn't accessed elsewhere */ + JSObjectSetPrivate(thisObject, NULL); + free(t); + } +} + + +static JSValueRef _wrap_DOMProcessingInstruction_getTarget(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMProcessingInstruction *arg1 = (XERCES_CPP_NAMESPACE::DOMProcessingInstruction *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMProcessingInstruction_getTarget."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMProcessingInstruction_getTarget" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMProcessingInstruction const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMProcessingInstruction *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMProcessingInstruction const *)arg1)->getTarget(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMProcessingInstruction_getData(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMProcessingInstruction *arg1 = (XERCES_CPP_NAMESPACE::DOMProcessingInstruction *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + JSValueRef jsresult; + + if(argc != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMProcessingInstruction_getData."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMProcessingInstruction_getData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMProcessingInstruction const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMProcessingInstruction *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMProcessingInstruction const *)arg1)->getData(); + + jsresult = XMLString2JS(result, context); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_DOMProcessingInstruction_setData(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + XERCES_CPP_NAMESPACE::DOMProcessingInstruction *arg1 = (XERCES_CPP_NAMESPACE::DOMProcessingInstruction *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMProcessingInstruction_setData."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMProcessingInstruction_setData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMProcessingInstruction *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMProcessingInstruction *)(argp1); + + arg2 = JS2XMLString(argv[0], context); + + (arg1)->setData((XMLCh const *)arg2); + jsresult = JSValueMakeUndefined(context); + + + delete[] arg2; + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSStaticValue _exports_DOMProcessingInstruction_staticValues[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMProcessingInstruction_staticFunctions[] = { + { + 0, 0, 0 + } +}; + +static JSStaticValue _exports_DOMProcessingInstruction_values[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_DOMProcessingInstruction_functions[] = { + { + "getTarget", _wrap_DOMProcessingInstruction_getTarget, kJSPropertyAttributeNone + }, + + + { + "getData", _wrap_DOMProcessingInstruction_getData, kJSPropertyAttributeNone + }, + + + { + "setData", _wrap_DOMProcessingInstruction_setData, kJSPropertyAttributeNone + }, + + + { + 0, 0, 0 + } +}; + + +static JSObjectRef _wrap_new_veto_DOMProcessingInstruction(JSContextRef context, JSObjectRef ctorObject, + size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + SWIG_exception(SWIG_ERROR, "Class DOMProcessingInstruction can not be instantiated"); + return 0; +} + + +static JSClassDefinition _exports_Event_classDefinition; + +static JSClassDefinition _exports_Event_objectDefinition; + +static JSClassRef _exports_Event_classRef; + + +static JSValueRef _wrap_uscxml_Event_INTERNAL(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(uscxml::Event::INTERNAL)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_uscxml_Event_EXTERNAL(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(uscxml::Event::EXTERNAL)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_uscxml_Event_PLATFORM(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSValueRef jsresult; + + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(uscxml::Event::PLATFORM)); + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSObjectRef _wrap_new_Event__SWIG_0(JSContextRef context, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + uscxml::Event *result; + result = (uscxml::Event *)new uscxml::Event(); + + + return SWIG_JSC_NewPointerObj(context, result, SWIGTYPE_p_uscxml__Event, SWIG_POINTER_OWN); + + goto fail; +fail: + return NULL; +} + + +static JSObjectRef _wrap_new_Event__SWIG_1(JSContextRef context, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + std::string *arg1 = 0 ; + uscxml::Event::Type arg2 ; + int res1 = SWIG_OLDOBJ ; + int val2 ; + int ecode2 = 0 ; + uscxml::Event *result; + { + std::string *ptr = (std::string *)0; + res1 = SWIG_AsPtr_std_string SWIG_JSC_AS_CALL_ARGS(argv[0], &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Event" "', argument " "1"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Event" "', argument " "1"" of type '" "std::string const &""'"); + } + arg1 = ptr; + } + ecode2 = SWIG_AsVal_int SWIG_JSC_AS_CALL_ARGS(argv[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Event" "', argument " "2"" of type '" "uscxml::Event::Type""'"); + } + arg2 = (uscxml::Event::Type)(val2); + result = (uscxml::Event *)new uscxml::Event((std::string const &)*arg1,arg2); + + if (SWIG_IsNewObj(res1)) delete arg1; + + + return SWIG_JSC_NewPointerObj(context, result, SWIGTYPE_p_uscxml__Event, SWIG_POINTER_OWN); + + goto fail; +fail: + return NULL; +} + + +static JSObjectRef _wrap_new_Event__SWIG_2(JSContextRef context, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + std::string *arg1 = 0 ; + int res1 = SWIG_OLDOBJ ; + uscxml::Event *result; + { + std::string *ptr = (std::string *)0; + res1 = SWIG_AsPtr_std_string SWIG_JSC_AS_CALL_ARGS(argv[0], &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Event" "', argument " "1"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Event" "', argument " "1"" of type '" "std::string const &""'"); + } + arg1 = ptr; + } + result = (uscxml::Event *)new uscxml::Event((std::string const &)*arg1); + + if (SWIG_IsNewObj(res1)) delete arg1; + + return SWIG_JSC_NewPointerObj(context, result, SWIGTYPE_p_uscxml__Event, SWIG_POINTER_OWN); + + goto fail; +fail: + return NULL; +} + + +static JSObjectRef _wrap_new_Event(JSContextRef context, JSObjectRef ctorObject, + size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + JSObjectRef thisObject = NULL; + + // switch all cases by means of series of if-returns. + + if(argc == 0) { + thisObject = _wrap_new_Event__SWIG_0(context, NULL, argc, argv, exception); + if(thisObject != NULL) { + *exception=0; return thisObject; + } /* reset exception and return */ + } + + if(argc == 2) { + thisObject = _wrap_new_Event__SWIG_1(context, NULL, argc, argv, exception); + if(thisObject != NULL) { + *exception=0; return thisObject; + } /* reset exception and return */ + } + + if(argc == 1) { + thisObject = _wrap_new_Event__SWIG_2(context, NULL, argc, argv, exception); + if(thisObject != NULL) { + *exception=0; return thisObject; + } /* reset exception and return */ + } + + + // default: + SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for construction of $jsname"); + +fail: + return thisObject; +} + + +static JSValueRef _wrap_Event_operator_equal_to(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + uscxml::Event *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 ; + int res2 = 0 ; + bool result; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_Event_operator_equal_to."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_uscxml__Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_operator_equal_to" "', argument " "1"" of type '" "uscxml::Event const *""'"); + } + arg1 = (uscxml::Event *)(argp1); + res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_uscxml__Event, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Event_operator_equal_to" "', argument " "2"" of type '" "uscxml::Event const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_operator_equal_to" "', argument " "2"" of type '" "uscxml::Event const &""'"); + } + arg2 = (uscxml::Event *)(argp2); + result = (bool)((uscxml::Event const *)arg1)->operator ==((uscxml::Event const &)*arg2); + jsresult = SWIG_From_bool SWIG_JSC_FROM_CALL_ARGS((bool)(result)); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static JSValueRef _wrap_Event_operator_not_equal_to(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + uscxml::Event *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 ; + int res2 = 0 ; + bool result; + + JSValueRef jsresult; + + if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_Event_operator_not_equal_to."); + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_uscxml__Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_operator_not_equal_to" "', argument " "1"" of type '" "uscxml::Event const *""'"); + } + arg1 = (uscxml::Event *)(argp1); + res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_uscxml__Event, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Event_operator_not_equal_to" "', argument " "2"" of type '" "uscxml::Event const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_operator_not_equal_to" "', argument " "2"" of type '" "uscxml::Event const &""'"); + } + arg2 = (uscxml::Event *)(argp2); + result = (bool)((uscxml::Event const *)arg1)->operator !=((uscxml::Event const &)*arg2); + jsresult = SWIG_From_bool SWIG_JSC_FROM_CALL_ARGS((bool)(result)); + + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static int _wrap_Event_getParam__SWIG_0(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception, JSValueRef* p_result) +{ + uscxml::Event::params_t *arg1 = 0 ; + std::string *arg2 = 0 ; + Data *arg3 = 0 ; + void *argp1 ; + int res1 = 0 ; + int res2 = SWIG_OLDOBJ ; + void *argp3 = 0 ; + int res3 = 0 ; + bool result; + + JSValueRef jsresult; + + if(argc != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_Event_getParam__SWIG_0."); + + res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_std__multimapT_std__string_Data_t, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_getParam" "', argument " "1"" of type '" "uscxml::Event::params_t const &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_getParam" "', argument " "1"" of type '" "uscxml::Event::params_t const &""'"); + } + arg1 = (uscxml::Event::params_t *)(argp1); + { + std::string *ptr = (std::string *)0; + res2 = SWIG_AsPtr_std_string SWIG_JSC_AS_CALL_ARGS(argv[1], &ptr); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Event_getParam" "', argument " "2"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_getParam" "', argument " "2"" of type '" "std::string const &""'"); + } + arg2 = ptr; + } + res3 = SWIG_ConvertPtr(argv[2], &argp3, SWIGTYPE_p_Data, 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Event_getParam" "', argument " "3"" of type '" "Data &""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_getParam" "', argument " "3"" of type '" "Data &""'"); + } + arg3 = (Data *)(argp3); + result = (bool)uscxml::Event::getParam((std::multimap< std::string,Data > const &)*arg1,(std::string const &)*arg2,*arg3); + jsresult = SWIG_From_bool SWIG_JSC_FROM_CALL_ARGS((bool)(result)); + + if (SWIG_IsNewObj(res2)) delete arg2; + + + *p_result = jsresult; + return SWIG_OK; + + goto fail; +fail: + return SWIG_TypeError; +} + + +static int _wrap_Event_getParam__SWIG_1(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception, JSValueRef* p_result) +{ + uscxml::Event::params_t *arg1 = 0 ; + std::string *arg2 = 0 ; + std::list< Data > *arg3 = 0 ; + void *argp1 ; + int res1 = 0 ; + int res2 = SWIG_OLDOBJ ; + void *argp3 = 0 ; + int res3 = 0 ; + bool result; + + JSValueRef jsresult; + + if(argc != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_Event_getParam__SWIG_1."); + + res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_std__multimapT_std__string_Data_t, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_getParam" "', argument " "1"" of type '" "uscxml::Event::params_t const &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_getParam" "', argument " "1"" of type '" "uscxml::Event::params_t const &""'"); + } + arg1 = (uscxml::Event::params_t *)(argp1); + { + std::string *ptr = (std::string *)0; + res2 = SWIG_AsPtr_std_string SWIG_JSC_AS_CALL_ARGS(argv[1], &ptr); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Event_getParam" "', argument " "2"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_getParam" "', argument " "2"" of type '" "std::string const &""'"); + } + arg2 = ptr; + } + res3 = SWIG_ConvertPtr(argv[2], &argp3, SWIGTYPE_p_std__listT_Data_t, 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Event_getParam" "', argument " "3"" of type '" "std::list< Data > &""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_getParam" "', argument " "3"" of type '" "std::list< Data > &""'"); + } + arg3 = (std::list< Data > *)(argp3); + result = (bool)uscxml::Event::getParam((std::multimap< std::string,Data > const &)*arg1,(std::string const &)*arg2,*arg3); + jsresult = SWIG_From_bool SWIG_JSC_FROM_CALL_ARGS((bool)(result)); + + if (SWIG_IsNewObj(res2)) delete arg2; + + + *p_result = jsresult; + return SWIG_OK; + + goto fail; +fail: + return SWIG_TypeError; +} + + +static int _wrap_Event_getParam__SWIG_3(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception, JSValueRef* p_result) +{ + uscxml::Event::params_t *arg1 = 0 ; + std::string *arg2 = 0 ; + bool *arg3 = 0 ; + void *argp1 ; + int res1 = 0 ; + int res2 = SWIG_OLDOBJ ; + void *argp3 = 0 ; + int res3 = 0 ; + bool result; + + JSValueRef jsresult; + + if(argc != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_Event_getParam__SWIG_3."); + + res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_std__multimapT_std__string_Data_t, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_getParam" "', argument " "1"" of type '" "uscxml::Event::params_t const &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_getParam" "', argument " "1"" of type '" "uscxml::Event::params_t const &""'"); + } + arg1 = (uscxml::Event::params_t *)(argp1); + { + std::string *ptr = (std::string *)0; + res2 = SWIG_AsPtr_std_string SWIG_JSC_AS_CALL_ARGS(argv[1], &ptr); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Event_getParam" "', argument " "2"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_getParam" "', argument " "2"" of type '" "std::string const &""'"); + } + arg2 = ptr; + } + res3 = SWIG_ConvertPtr(argv[2], &argp3, SWIGTYPE_p_bool, 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Event_getParam" "', argument " "3"" of type '" "bool &""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_getParam" "', argument " "3"" of type '" "bool &""'"); + } + arg3 = (bool *)(argp3); + result = (bool)uscxml::Event::getParam((std::multimap< std::string,Data > const &)*arg1,(std::string const &)*arg2,*arg3); + jsresult = SWIG_From_bool SWIG_JSC_FROM_CALL_ARGS((bool)(result)); + + if (SWIG_IsNewObj(res2)) delete arg2; + + + *p_result = jsresult; + return SWIG_OK; + + goto fail; +fail: + return SWIG_TypeError; +} + + +static JSValueRef _wrap_Event__wrap_Event_getParam(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + JSValueRef jsresult; + int res; + + if(argc == 3) { + res = _wrap_Event_getParam__SWIG_0(context, function, thisObject, argc, argv, exception, &jsresult); + if(res == SWIG_OK) { + *exception = 0; return jsresult; + } + } + + if(argc == 3) { + res = _wrap_Event_getParam__SWIG_1(context, function, thisObject, argc, argv, exception, &jsresult); + if(res == SWIG_OK) { + *exception = 0; return jsresult; + } + } + + if(argc == 3) { + res = _wrap_Event_getParam__SWIG_3(context, function, thisObject, argc, argv, exception, &jsresult); + if(res == SWIG_OK) { + *exception = 0; return jsresult; + } + } + + + SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for function getParam."); + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static bool _wrap_Event_raw_set(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) +{ + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + std::string *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 = SWIG_OLDOBJ ; + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_uscxml__Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_raw_set" "', argument " "1"" of type '" "uscxml::Event *""'"); + } + arg1 = (uscxml::Event *)(argp1); + { + std::string *ptr = (std::string *)0; + res2 = SWIG_AsPtr_std_string SWIG_JSC_AS_CALL_ARGS(value, &ptr); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Event_raw_set" "', argument " "2"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_raw_set" "', argument " "2"" of type '" "std::string const &""'"); + } + arg2 = ptr; + } + if (arg1) (arg1)->raw = *arg2; + + if (SWIG_IsNewObj(res2)) delete arg2; + + + return true; + + goto fail; +fail: + return false; +} + + +static JSValueRef _wrap_Event_raw_get(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::string *result = 0 ; + + JSValueRef jsresult; + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_uscxml__Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_raw_get" "', argument " "1"" of type '" "uscxml::Event *""'"); + } + arg1 = (uscxml::Event *)(argp1); + result = (std::string *) & ((arg1)->raw); + jsresult = SWIG_From_std_string SWIG_JSC_FROM_CALL_ARGS((std::string)(*result)); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static bool _wrap_Event_name_set(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) +{ + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + std::string *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 = SWIG_OLDOBJ ; + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_uscxml__Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_name_set" "', argument " "1"" of type '" "uscxml::Event *""'"); + } + arg1 = (uscxml::Event *)(argp1); + { + std::string *ptr = (std::string *)0; + res2 = SWIG_AsPtr_std_string SWIG_JSC_AS_CALL_ARGS(value, &ptr); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Event_name_set" "', argument " "2"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_name_set" "', argument " "2"" of type '" "std::string const &""'"); + } + arg2 = ptr; + } + if (arg1) (arg1)->name = *arg2; + + if (SWIG_IsNewObj(res2)) delete arg2; + + + return true; + + goto fail; +fail: + return false; +} + + +static JSValueRef _wrap_Event_name_get(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::string *result = 0 ; + + JSValueRef jsresult; + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_uscxml__Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_name_get" "', argument " "1"" of type '" "uscxml::Event *""'"); + } + arg1 = (uscxml::Event *)(argp1); + result = (std::string *) & ((arg1)->name); + jsresult = SWIG_From_std_string SWIG_JSC_FROM_CALL_ARGS((std::string)(*result)); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static bool _wrap_Event_eventType_set(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) +{ + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + uscxml::Event::Type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_uscxml__Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_eventType_set" "', argument " "1"" of type '" "uscxml::Event *""'"); + } + arg1 = (uscxml::Event *)(argp1); + ecode2 = SWIG_AsVal_int SWIG_JSC_AS_CALL_ARGS(value, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Event_eventType_set" "', argument " "2"" of type '" "uscxml::Event::Type""'"); + } + arg2 = (uscxml::Event::Type)(val2); + if (arg1) (arg1)->eventType = arg2; + + + + + return true; + + goto fail; +fail: + return false; +} + + +static JSValueRef _wrap_Event_eventType_get(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + uscxml::Event::Type result; + + JSValueRef jsresult; + + res1 = SWIG_ConvertPtr(thisObject, &argp1,SWIGTYPE_p_uscxml__Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_eventType_get" "', argument " "1"" of type '" "uscxml::Event *""'"); + } + arg1 = (uscxml::Event *)(argp1); + result = (uscxml::Event::Type) ((arg1)->eventType); + jsresult = SWIG_From_int SWIG_JSC_FROM_CALL_ARGS((int)(result)); + + + return jsresult; + + goto fail; +fail: + return JSValueMakeUndefined(context); +} + + +static void _wrap_delete_Event(JSObjectRef thisObject) +{ + SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); + if(t) { + if (t->swigCMemOwn) { + uscxml::Event * arg1 = (uscxml::Event *)t->swigCObject; + delete arg1; + } + /* remove the private data to make sure that it isn't accessed elsewhere */ + JSObjectSetPrivate(thisObject, NULL); + free(t); + } +} + + +static JSStaticValue _exports_Event_staticValues[] = { + { + "INTERNAL", _wrap_uscxml_Event_INTERNAL, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "EXTERNAL", _wrap_uscxml_Event_EXTERNAL, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "PLATFORM", _wrap_uscxml_Event_PLATFORM, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_Event_staticFunctions[] = { + { + "getParam", _wrap_Event__wrap_Event_getParam, kJSPropertyAttributeNone + }, + + + { + 0, 0, 0 + } +}; + +static JSStaticValue _exports_Event_values[] = { + { + "raw", _wrap_Event_raw_get, _wrap_Event_raw_set, kJSPropertyAttributeNone + }, + + + { + "name", _wrap_Event_name_get, _wrap_Event_name_set, kJSPropertyAttributeNone + }, + + + { + "eventType", _wrap_Event_eventType_get, _wrap_Event_eventType_set, kJSPropertyAttributeNone + }, + + + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_Event_functions[] = { + { + "operator_equal_to", _wrap_Event_operator_equal_to, kJSPropertyAttributeNone + }, + + + { + "operator_not_equal_to", _wrap_Event_operator_not_equal_to, kJSPropertyAttributeNone + }, + + + { + 0, 0, 0 + } +}; + + +static JSClassDefinition _exports_ErrorEvent_classDefinition; + +static JSClassDefinition _exports_ErrorEvent_objectDefinition; + +static JSClassRef _exports_ErrorEvent_classRef; + + +static JSObjectRef _wrap_new_ErrorEvent__SWIG_0(JSContextRef context, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + uscxml::ErrorEvent *result; + result = (uscxml::ErrorEvent *)new uscxml::ErrorEvent(); + + + return SWIG_JSC_NewPointerObj(context, result, SWIGTYPE_p_uscxml__ErrorEvent, SWIG_POINTER_OWN); + + goto fail; +fail: + return NULL; +} + + +static JSObjectRef _wrap_new_ErrorEvent__SWIG_1(JSContextRef context, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + std::string *arg1 = 0 ; + int res1 = SWIG_OLDOBJ ; + uscxml::ErrorEvent *result; + { + std::string *ptr = (std::string *)0; + res1 = SWIG_AsPtr_std_string SWIG_JSC_AS_CALL_ARGS(argv[0], &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ErrorEvent" "', argument " "1"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_ErrorEvent" "', argument " "1"" of type '" "std::string const &""'"); + } + arg1 = ptr; + } + result = (uscxml::ErrorEvent *)new uscxml::ErrorEvent((std::string const &)*arg1); + + if (SWIG_IsNewObj(res1)) delete arg1; + + return SWIG_JSC_NewPointerObj(context, result, SWIGTYPE_p_uscxml__ErrorEvent, SWIG_POINTER_OWN); + + goto fail; +fail: + return NULL; +} + + +static JSObjectRef _wrap_new_ErrorEvent(JSContextRef context, JSObjectRef ctorObject, + size_t argc, const JSValueRef argv[], JSValueRef* exception) +{ + JSObjectRef thisObject = NULL; + + // switch all cases by means of series of if-returns. + + if(argc == 0) { + thisObject = _wrap_new_ErrorEvent__SWIG_0(context, NULL, argc, argv, exception); + if(thisObject != NULL) { + *exception=0; return thisObject; + } /* reset exception and return */ + } + + if(argc == 1) { + thisObject = _wrap_new_ErrorEvent__SWIG_1(context, NULL, argc, argv, exception); + if(thisObject != NULL) { + *exception=0; return thisObject; + } /* reset exception and return */ + } + + + // default: + SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for construction of $jsname"); + +fail: + return thisObject; +} + + +static void _wrap_delete_ErrorEvent(JSObjectRef thisObject) +{ + SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(thisObject); + if(t) { + if (t->swigCMemOwn) { + uscxml::ErrorEvent * arg1 = (uscxml::ErrorEvent *)t->swigCObject; + delete arg1; + } + /* remove the private data to make sure that it isn't accessed elsewhere */ + JSObjectSetPrivate(thisObject, NULL); + free(t); + } +} + + +static JSStaticValue _exports_ErrorEvent_staticValues[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_ErrorEvent_staticFunctions[] = { + { + 0, 0, 0 + } +}; + +static JSStaticValue _exports_ErrorEvent_values[] = { + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction _exports_ErrorEvent_functions[] = { + { + 0, 0, 0 + } +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ + +static void *_p_XERCES_CPP_NAMESPACE__DOMCDATASectionTo_p_XERCES_CPP_NAMESPACE__DOMText(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMText *) ((XERCES_CPP_NAMESPACE::DOMCDATASection *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMTextTo_p_XERCES_CPP_NAMESPACE__DOMCharacterData(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMCharacterData *) ((XERCES_CPP_NAMESPACE::DOMText *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMCommentTo_p_XERCES_CPP_NAMESPACE__DOMCharacterData(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMCharacterData *) ((XERCES_CPP_NAMESPACE::DOMComment *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMCDATASectionTo_p_XERCES_CPP_NAMESPACE__DOMCharacterData(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMCharacterData *) (XERCES_CPP_NAMESPACE::DOMText *) ((XERCES_CPP_NAMESPACE::DOMCDATASection *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMElementTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMElement *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMDocumentFragmentTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMDocumentFragment *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMAttrTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMAttr *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMDocumentTypeTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMDocumentType *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMCharacterDataTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMCharacterData *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMTextTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) (XERCES_CPP_NAMESPACE::DOMCharacterData *) ((XERCES_CPP_NAMESPACE::DOMText *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMCommentTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) (XERCES_CPP_NAMESPACE::DOMCharacterData *) ((XERCES_CPP_NAMESPACE::DOMComment *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMProcessingInstructionTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMProcessingInstruction *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMEntityTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMEntity *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMEntityReferenceTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMEntityReference *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMCDATASectionTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) (XERCES_CPP_NAMESPACE::DOMCharacterData *)(XERCES_CPP_NAMESPACE::DOMText *) ((XERCES_CPP_NAMESPACE::DOMCDATASection *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMNotationTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMNotation *) x)); +} +static void *_p_uscxml__ErrorEventTo_p_uscxml__Event(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((uscxml::Event *) ((uscxml::ErrorEvent *) x)); +} +static swig_type_info _swigt__p_Data = {"_p_Data", "Data *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMAttr = {"_p_XERCES_CPP_NAMESPACE__DOMAttr", "XERCES_CPP_NAMESPACE::DOMAttr *|p_XERCES_CPP_NAMESPACE__DOMAttr", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMCDATASection = {"_p_XERCES_CPP_NAMESPACE__DOMCDATASection", "p_XERCES_CPP_NAMESPACE__DOMCDATASection", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMCharacterData = {"_p_XERCES_CPP_NAMESPACE__DOMCharacterData", "XERCES_CPP_NAMESPACE::DOMCharacterData *|p_XERCES_CPP_NAMESPACE__DOMCharacterData", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMComment = {"_p_XERCES_CPP_NAMESPACE__DOMComment", "p_XERCES_CPP_NAMESPACE__DOMComment", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMDocument = {"_p_XERCES_CPP_NAMESPACE__DOMDocument", "XERCES_CPP_NAMESPACE::DOMDocument *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentFragment = {"_p_XERCES_CPP_NAMESPACE__DOMDocumentFragment", "p_XERCES_CPP_NAMESPACE__DOMDocumentFragment", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentType = {"_p_XERCES_CPP_NAMESPACE__DOMDocumentType", "XERCES_CPP_NAMESPACE::DOMDocumentType *|p_XERCES_CPP_NAMESPACE__DOMDocumentType", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMElement = {"_p_XERCES_CPP_NAMESPACE__DOMElement", "p_XERCES_CPP_NAMESPACE__DOMElement|XERCES_CPP_NAMESPACE::DOMElement *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMEntity = {"_p_XERCES_CPP_NAMESPACE__DOMEntity", "XERCES_CPP_NAMESPACE::DOMEntity *|p_XERCES_CPP_NAMESPACE__DOMEntity", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMEntityReference = {"_p_XERCES_CPP_NAMESPACE__DOMEntityReference", "p_XERCES_CPP_NAMESPACE__DOMEntityReference", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMException = {"_p_XERCES_CPP_NAMESPACE__DOMException", "p_XERCES_CPP_NAMESPACE__DOMException|XERCES_CPP_NAMESPACE::DOMException *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap = {"_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap", "p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap|XERCES_CPP_NAMESPACE::DOMNamedNodeMap *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMNode = {"_p_XERCES_CPP_NAMESPACE__DOMNode", "XERCES_CPP_NAMESPACE::DOMNode *|p_XERCES_CPP_NAMESPACE__DOMNode", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMNodeList = {"_p_XERCES_CPP_NAMESPACE__DOMNodeList", "p_XERCES_CPP_NAMESPACE__DOMNodeList|XERCES_CPP_NAMESPACE::DOMNodeList *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMNotation = {"_p_XERCES_CPP_NAMESPACE__DOMNotation", "XERCES_CPP_NAMESPACE::DOMNotation *|p_XERCES_CPP_NAMESPACE__DOMNotation", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction = {"_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction", "XERCES_CPP_NAMESPACE::DOMProcessingInstruction *|p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMText = {"_p_XERCES_CPP_NAMESPACE__DOMText", "XERCES_CPP_NAMESPACE::DOMText *|p_XERCES_CPP_NAMESPACE__DOMText", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMTypeInfo = {"_p_XERCES_CPP_NAMESPACE__DOMTypeInfo", "XERCES_CPP_NAMESPACE::DOMTypeInfo *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMUserDataHandler = {"_p_XERCES_CPP_NAMESPACE__DOMUserDataHandler", "XERCES_CPP_NAMESPACE::DOMUserDataHandler *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__MemoryManager = {"_p_XERCES_CPP_NAMESPACE__MemoryManager", "XERCES_CPP_NAMESPACE::MemoryManager *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_bool = {"_p_bool", "bool *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int16_t = {"_p_int16_t", "XMLInt16 *|int16_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int32_t = {"_p_int32_t", "int32_t *|XMLInt32 *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int64_t = {"_p_int64_t", "int64_t *|XMLInt64 *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_namelist_t = {"_p_namelist_t", "namelist_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_params_t = {"_p_params_t", "params_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_size_t = {"_p_size_t", "size_t *|XMLSize_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_ssize_t = {"_p_ssize_t", "ssize_t *|XMLSSize_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__listT_Data_t = {"_p_std__listT_Data_t", "std::list< Data > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__multimapT_std__string_Data_t = {"_p_std__multimapT_std__string_Data_t", "uscxml::Event::params_t *|std::multimap< std::string,Data > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_uint16_t = {"_p_uint16_t", "XMLUInt16 *|UTF16Ch *|XMLCh *|uint16_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_uint32_t = {"_p_uint32_t", "uint32_t *|XMLUInt32 *|UCS4Ch *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_uint64_t = {"_p_uint64_t", "uint64_t *|XMLUInt64 *|XMLFilePos *|XMLFileLoc *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *|XMLByte *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_uscxml__ErrorEvent = {"_p_uscxml__ErrorEvent", "p_uscxml__ErrorEvent", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_uscxml__Event = {"_p_uscxml__Event", "uscxml::Event *|p_uscxml__Event", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_void = {"_p_void", "void *", 0, 0, (void*)0, 0}; + +static swig_type_info *swig_type_initial[] = { + &_swigt__p_Data, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMAttr, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMCDATASection, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMCharacterData, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMComment, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMDocument, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentFragment, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentType, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMElement, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMEntity, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMEntityReference, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMException, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMNode, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMNodeList, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMNotation, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMText, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMTypeInfo, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMUserDataHandler, + &_swigt__p_XERCES_CPP_NAMESPACE__MemoryManager, + &_swigt__p_bool, + &_swigt__p_char, + &_swigt__p_int16_t, + &_swigt__p_int32_t, + &_swigt__p_int64_t, + &_swigt__p_namelist_t, + &_swigt__p_params_t, + &_swigt__p_size_t, + &_swigt__p_ssize_t, + &_swigt__p_std__listT_Data_t, + &_swigt__p_std__multimapT_std__string_Data_t, + &_swigt__p_uint16_t, + &_swigt__p_uint32_t, + &_swigt__p_uint64_t, + &_swigt__p_unsigned_char, + &_swigt__p_uscxml__ErrorEvent, + &_swigt__p_uscxml__Event, + &_swigt__p_void, +}; + +static swig_cast_info _swigc__p_Data[] = { {&_swigt__p_Data, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMAttr[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMAttr, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMCDATASection[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMCDATASection, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMCharacterData[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMText, _p_XERCES_CPP_NAMESPACE__DOMTextTo_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMComment, _p_XERCES_CPP_NAMESPACE__DOMCommentTo_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMCDATASection, _p_XERCES_CPP_NAMESPACE__DOMCDATASectionTo_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMComment[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMComment, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMDocument[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMDocument, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMDocumentFragment[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentFragment, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMDocumentType[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentType, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMElement[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMElement, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMEntity[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMEntity, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMEntityReference[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMEntityReference, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMException[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMException, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMNode[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMElement, _p_XERCES_CPP_NAMESPACE__DOMElementTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentFragment, _p_XERCES_CPP_NAMESPACE__DOMDocumentFragmentTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMAttr, _p_XERCES_CPP_NAMESPACE__DOMAttrTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentType, _p_XERCES_CPP_NAMESPACE__DOMDocumentTypeTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMCharacterData, _p_XERCES_CPP_NAMESPACE__DOMCharacterDataTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMText, _p_XERCES_CPP_NAMESPACE__DOMTextTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMComment, _p_XERCES_CPP_NAMESPACE__DOMCommentTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction, _p_XERCES_CPP_NAMESPACE__DOMProcessingInstructionTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMEntity, _p_XERCES_CPP_NAMESPACE__DOMEntityTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMEntityReference, _p_XERCES_CPP_NAMESPACE__DOMEntityReferenceTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMCDATASection, _p_XERCES_CPP_NAMESPACE__DOMCDATASectionTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMNotation, _p_XERCES_CPP_NAMESPACE__DOMNotationTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMNodeList[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMNodeList, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMNotation[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMNotation, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMText[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMText, 0, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMCDATASection, _p_XERCES_CPP_NAMESPACE__DOMCDATASectionTo_p_XERCES_CPP_NAMESPACE__DOMText, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMTypeInfo[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMTypeInfo, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMUserDataHandler[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMUserDataHandler, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__MemoryManager[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__MemoryManager, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_bool[] = { {&_swigt__p_bool, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int16_t[] = { {&_swigt__p_int16_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int32_t[] = { {&_swigt__p_int32_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int64_t[] = { {&_swigt__p_int64_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_namelist_t[] = { {&_swigt__p_namelist_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_params_t[] = { {&_swigt__p_params_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_size_t[] = { {&_swigt__p_size_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_ssize_t[] = { {&_swigt__p_ssize_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__listT_Data_t[] = { {&_swigt__p_std__listT_Data_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__multimapT_std__string_Data_t[] = { {&_swigt__p_std__multimapT_std__string_Data_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_uint16_t[] = { {&_swigt__p_uint16_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_uint32_t[] = { {&_swigt__p_uint32_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_uint64_t[] = { {&_swigt__p_uint64_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_uscxml__ErrorEvent[] = { {&_swigt__p_uscxml__ErrorEvent, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_uscxml__Event[] = { {&_swigt__p_uscxml__Event, 0, 0, 0}, {&_swigt__p_uscxml__ErrorEvent, _p_uscxml__ErrorEventTo_p_uscxml__Event, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_void[] = { {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}}; + +static swig_cast_info *swig_cast_initial[] = { + _swigc__p_Data, + _swigc__p_XERCES_CPP_NAMESPACE__DOMAttr, + _swigc__p_XERCES_CPP_NAMESPACE__DOMCDATASection, + _swigc__p_XERCES_CPP_NAMESPACE__DOMCharacterData, + _swigc__p_XERCES_CPP_NAMESPACE__DOMComment, + _swigc__p_XERCES_CPP_NAMESPACE__DOMDocument, + _swigc__p_XERCES_CPP_NAMESPACE__DOMDocumentFragment, + _swigc__p_XERCES_CPP_NAMESPACE__DOMDocumentType, + _swigc__p_XERCES_CPP_NAMESPACE__DOMElement, + _swigc__p_XERCES_CPP_NAMESPACE__DOMEntity, + _swigc__p_XERCES_CPP_NAMESPACE__DOMEntityReference, + _swigc__p_XERCES_CPP_NAMESPACE__DOMException, + _swigc__p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, + _swigc__p_XERCES_CPP_NAMESPACE__DOMNode, + _swigc__p_XERCES_CPP_NAMESPACE__DOMNodeList, + _swigc__p_XERCES_CPP_NAMESPACE__DOMNotation, + _swigc__p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction, + _swigc__p_XERCES_CPP_NAMESPACE__DOMText, + _swigc__p_XERCES_CPP_NAMESPACE__DOMTypeInfo, + _swigc__p_XERCES_CPP_NAMESPACE__DOMUserDataHandler, + _swigc__p_XERCES_CPP_NAMESPACE__MemoryManager, + _swigc__p_bool, + _swigc__p_char, + _swigc__p_int16_t, + _swigc__p_int32_t, + _swigc__p_int64_t, + _swigc__p_namelist_t, + _swigc__p_params_t, + _swigc__p_size_t, + _swigc__p_ssize_t, + _swigc__p_std__listT_Data_t, + _swigc__p_std__multimapT_std__string_Data_t, + _swigc__p_uint16_t, + _swigc__p_uint32_t, + _swigc__p_uint64_t, + _swigc__p_unsigned_char, + _swigc__p_uscxml__ErrorEvent, + _swigc__p_uscxml__Event, + _swigc__p_void, +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ + + + +static JSStaticValue exports_values[] = { + { + "XERCES_HAS_CPP_NAMESPACE", _wrap_XERCES_HAS_CPP_NAMESPACE, JS_veto_set_variable, kJSPropertyAttributeNone + }, + + + { + "DEBUG_UTF8_OUT", _wrap_DEBUG_UTF8_OUT_get, _wrap_DEBUG_UTF8_OUT_set, kJSPropertyAttributeNone + }, + + + { + "DEBUG_UTF8_IN", _wrap_DEBUG_UTF8_IN_get, _wrap_DEBUG_UTF8_IN_set, kJSPropertyAttributeNone + }, + + + { + 0, 0, 0, 0 + } +}; + +static JSStaticFunction exports_functions[] = { + { + 0, 0, 0 + } +}; + +static JSClassDefinition exports_classDefinition; +static JSObjectRef exports_object; + + +SWIGRUNTIME void +SWIG_JSC_SetModule(swig_module_info *swig_module) {} + +SWIGRUNTIME swig_module_info * +SWIG_JSC_GetModule(void) { + return 0; +} + +#define SWIG_GetModule(clientdata) SWIG_JSC_GetModule() +#define SWIG_SetModule(clientdata, pointer) SWIG_JSC_SetModule(pointer) + +/* ----------------------------------------------------------------------------- + * Type initialization: + * This problem is tough by the requirement that no dynamic + * memory is used. Also, since swig_type_info structures store pointers to + * swig_cast_info structures and swig_cast_info structures store pointers back + * to swig_type_info structures, we need some lookup code at initialization. + * The idea is that swig generates all the structures that are needed. + * The runtime then collects these partially filled structures. + * The SWIG_InitializeModule function takes these initial arrays out of + * swig_module, and does all the lookup, filling in the swig_module.types + * array with the correct data and linking the correct swig_cast_info + * structures together. + * + * The generated swig_type_info structures are assigned statically to an initial + * array. We just loop through that array, and handle each type individually. + * First we lookup if this type has been already loaded, and if so, use the + * loaded structure instead of the generated one. Then we have to fill in the + * cast linked list. The cast data is initially stored in something like a + * two-dimensional array. Each row corresponds to a type (there are the same + * number of rows as there are in the swig_type_initial array). Each entry in + * a column is one of the swig_cast_info structures for that type. + * The cast_initial array is actually an array of arrays, because each row has + * a variable number of columns. So to actually build the cast linked list, + * we find the array of casts associated with the type, and loop through it + * adding the casts to the list. The one last trick we need to do is making + * sure the type pointer in the swig_cast_info struct is correct. + * + * First off, we lookup the cast->type name to see if it is already loaded. + * There are three cases to handle: + * 1) If the cast->type has already been loaded AND the type we are adding + * casting info to has not been loaded (it is in this module), THEN we + * replace the cast->type pointer with the type pointer that has already + * been loaded. + * 2) If BOTH types (the one we are adding casting info to, and the + * cast->type) are loaded, THEN the cast info has already been loaded by + * the previous module so we just ignore it. + * 3) Finally, if cast->type has not already been loaded, then we add that + * swig_cast_info to the linked list (because the cast->type) pointer will + * be correct. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* c-mode */ +#endif +#endif + +#if 0 +#define SWIGRUNTIME_DEBUG +#endif + + +SWIGRUNTIME void +SWIG_InitializeModule(void *clientdata) { + size_t i; + swig_module_info *module_head, *iter; + int init; + + /* check to see if the circular list has been setup, if not, set it up */ + if (swig_module.next==0) { + /* Initialize the swig_module */ + swig_module.type_initial = swig_type_initial; + swig_module.cast_initial = swig_cast_initial; + swig_module.next = &swig_module; + init = 1; + } else { + init = 0; + } + + /* Try and load any already created modules */ + module_head = SWIG_GetModule(clientdata); + if (!module_head) { + /* This is the first module loaded for this interpreter */ + /* so set the swig module into the interpreter */ + SWIG_SetModule(clientdata, &swig_module); + } else { + /* the interpreter has loaded a SWIG module, but has it loaded this one? */ + iter=module_head; + do { + if (iter==&swig_module) { + /* Our module is already in the list, so there's nothing more to do. */ + return; + } + iter=iter->next; + } while (iter!= module_head); + + /* otherwise we must add our module into the list */ + swig_module.next = module_head->next; + module_head->next = &swig_module; + } + + /* When multiple interpreters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + + /* Now work on filling in swig_module.types */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: size %d\n", swig_module.size); +#endif + for (i = 0; i < swig_module.size; ++i) { + swig_type_info *type = 0; + swig_type_info *ret; + swig_cast_info *cast; + +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); +#endif + + /* if there is another module already loaded */ + if (swig_module.next != &swig_module) { + type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); + } + if (type) { + /* Overwrite clientdata field */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found type %s\n", type->name); +#endif + if (swig_module.type_initial[i]->clientdata) { + type->clientdata = swig_module.type_initial[i]->clientdata; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); +#endif + } + } else { + type = swig_module.type_initial[i]; + } + + /* Insert casting types */ + cast = swig_module.cast_initial[i]; + while (cast->type) { + + /* Don't need to add information already in the list */ + ret = 0; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); +#endif + if (swig_module.next != &swig_module) { + ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); +#ifdef SWIGRUNTIME_DEBUG + if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); +#endif + } + if (ret) { + if (type == swig_module.type_initial[i]) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: skip old type %s\n", ret->name); +#endif + cast->type = ret; + ret = 0; + } else { + /* Check for casting already in the list */ + swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); +#ifdef SWIGRUNTIME_DEBUG + if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); +#endif + if (!ocast) ret = 0; + } + } + + if (!ret) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); +#endif + if (type->cast) { + type->cast->prev = cast; + cast->next = type->cast; + } + type->cast = cast; + } + cast++; + } + /* Set entry in modules->types array equal to the type */ + swig_module.types[i] = type; + } + swig_module.types[i] = 0; + +#ifdef SWIGRUNTIME_DEBUG + printf("**** SWIG_InitializeModule: Cast List ******\n"); + for (i = 0; i < swig_module.size; ++i) { + int j = 0; + swig_cast_info *cast = swig_module.cast_initial[i]; + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + while (cast->type) { + printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); + cast++; + ++j; + } + printf("---- Total casts: %d\n",j); + } + printf("**** SWIG_InitializeModule: Cast List ******\n"); +#endif +} + +/* This function will propagate the clientdata field of type to +* any new swig_type_info structures that have been added into the list +* of equivalent types. It is like calling +* SWIG_TypeClientData(type, clientdata) a second time. +*/ +SWIGRUNTIME void +SWIG_PropagateClientData(void) { + size_t i; + swig_cast_info *equiv; + static int init_run = 0; + + if (init_run) return; + init_run = 1; + + for (i = 0; i < swig_module.size; i++) { + if (swig_module.types[i]->clientdata) { + equiv = swig_module.types[i]->cast; + while (equiv) { + if (!equiv->converter) { + if (equiv->type && !equiv->type->clientdata) + SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); + } + equiv = equiv->next; + } + } + } +} + +#ifdef __cplusplus +#if 0 +{ /* c-mode */ +#endif +} +#endif + + + +#ifdef __cplusplus +extern "C" { +#endif + +bool SWIGJSC_INIT (JSGlobalContextRef context, JSObjectRef *exports) { + SWIG_InitializeModule(0); + + + SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->dcast = (swig_dycast_func) DOMNode_dynamic_cast; + + +/* Initialize the base swig type object */ +_SwigObject_objectDefinition.staticFunctions = _SwigObject_functions; +_SwigObject_objectDefinition.staticValues = _SwigObject_values; +_SwigObject_classRef = JSClassCreate(&_SwigObject_objectDefinition); + +/* Initialize the PackedData class */ +_SwigPackedData_objectDefinition.staticFunctions = _SwigPackedData_functions; +_SwigPackedData_objectDefinition.staticValues = _SwigPackedData_values; +_SwigPackedData_objectDefinition.finalize = _wrap_SwigPackedData_delete; +_SwigPackedData_classRef = JSClassCreate(&_SwigPackedData_objectDefinition); + +/* Create objects for namespaces */ + +exports_classDefinition.staticFunctions = exports_functions; +exports_classDefinition.staticValues = exports_values; +exports_object = JSObjectMake(context, JSClassCreate(&exports_classDefinition), NULL); + + +/* Register classes */ + +_exports_DOMException_classDefinition.staticFunctions = _exports_DOMException_staticFunctions; +_exports_DOMException_classDefinition.staticValues = _exports_DOMException_staticValues; +_exports_DOMException_classDefinition.callAsConstructor = _wrap_new_DOMException; +_exports_DOMException_objectDefinition.finalize = _wrap_delete_DOMException; +_exports_DOMException_objectDefinition.staticValues = _exports_DOMException_values; +_exports_DOMException_objectDefinition.staticFunctions = _exports_DOMException_functions; + +_exports_DOMException_objectDefinition.parentClass = _SwigObject_classRef; + + +_exports_DOMException_classRef = JSClassCreate(&_exports_DOMException_objectDefinition); +SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException->clientdata = _exports_DOMException_classRef; + + +JS_registerClass(context, exports_object, "DOMException", &_exports_DOMException_classDefinition); + + +_exports_DOMNode_classDefinition.staticFunctions = _exports_DOMNode_staticFunctions; +_exports_DOMNode_classDefinition.staticValues = _exports_DOMNode_staticValues; +_exports_DOMNode_classDefinition.callAsConstructor = _wrap_new_veto_DOMNode; +_exports_DOMNode_objectDefinition.finalize = _wrap_delete_DOMNode; +_exports_DOMNode_objectDefinition.staticValues = _exports_DOMNode_values; +_exports_DOMNode_objectDefinition.staticFunctions = _exports_DOMNode_functions; + +_exports_DOMNode_objectDefinition.parentClass = _SwigObject_classRef; + + +_exports_DOMNode_classRef = JSClassCreate(&_exports_DOMNode_objectDefinition); +SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata = _exports_DOMNode_classRef; + + +JS_registerClass(context, exports_object, "DOMNode", &_exports_DOMNode_classDefinition); + + +_exports_DOMAttr_classDefinition.staticFunctions = _exports_DOMAttr_staticFunctions; +_exports_DOMAttr_classDefinition.staticValues = _exports_DOMAttr_staticValues; +_exports_DOMAttr_classDefinition.callAsConstructor = _wrap_new_veto_DOMAttr; +_exports_DOMAttr_objectDefinition.finalize = _wrap_delete_DOMAttr; +_exports_DOMAttr_objectDefinition.staticValues = _exports_DOMAttr_values; +_exports_DOMAttr_objectDefinition.staticFunctions = _exports_DOMAttr_functions; + +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode != NULL) { + _exports_DOMAttr_objectDefinition.parentClass = (JSClassRef) SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata; +} + + +_exports_DOMAttr_classRef = JSClassCreate(&_exports_DOMAttr_objectDefinition); +SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr->clientdata = _exports_DOMAttr_classRef; + + +JS_registerClass(context, exports_object, "DOMAttr", &_exports_DOMAttr_classDefinition); + + +_exports_DOMElement_classDefinition.staticFunctions = _exports_DOMElement_staticFunctions; +_exports_DOMElement_classDefinition.staticValues = _exports_DOMElement_staticValues; +_exports_DOMElement_classDefinition.callAsConstructor = _wrap_new_veto_DOMElement; +_exports_DOMElement_objectDefinition.finalize = _wrap_delete_DOMElement; +_exports_DOMElement_objectDefinition.staticValues = _exports_DOMElement_values; +_exports_DOMElement_objectDefinition.staticFunctions = _exports_DOMElement_functions; + +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode != NULL) { + _exports_DOMElement_objectDefinition.parentClass = (JSClassRef) SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata; +} + + +_exports_DOMElement_classRef = JSClassCreate(&_exports_DOMElement_objectDefinition); +SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement->clientdata = _exports_DOMElement_classRef; + + +JS_registerClass(context, exports_object, "DOMElement", &_exports_DOMElement_classDefinition); + + +_exports_DOMEntity_classDefinition.staticFunctions = _exports_DOMEntity_staticFunctions; +_exports_DOMEntity_classDefinition.staticValues = _exports_DOMEntity_staticValues; +_exports_DOMEntity_classDefinition.callAsConstructor = _wrap_new_veto_DOMEntity; +_exports_DOMEntity_objectDefinition.finalize = _wrap_delete_DOMEntity; +_exports_DOMEntity_objectDefinition.staticValues = _exports_DOMEntity_values; +_exports_DOMEntity_objectDefinition.staticFunctions = _exports_DOMEntity_functions; + +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode != NULL) { + _exports_DOMEntity_objectDefinition.parentClass = (JSClassRef) SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata; +} + + +_exports_DOMEntity_classRef = JSClassCreate(&_exports_DOMEntity_objectDefinition); +SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity->clientdata = _exports_DOMEntity_classRef; + + +JS_registerClass(context, exports_object, "DOMEntity", &_exports_DOMEntity_classDefinition); + + +_exports_DOMDocumentType_classDefinition.staticFunctions = _exports_DOMDocumentType_staticFunctions; +_exports_DOMDocumentType_classDefinition.staticValues = _exports_DOMDocumentType_staticValues; +_exports_DOMDocumentType_classDefinition.callAsConstructor = _wrap_new_veto_DOMDocumentType; +_exports_DOMDocumentType_objectDefinition.finalize = _wrap_delete_DOMDocumentType; +_exports_DOMDocumentType_objectDefinition.staticValues = _exports_DOMDocumentType_values; +_exports_DOMDocumentType_objectDefinition.staticFunctions = _exports_DOMDocumentType_functions; + +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode != NULL) { + _exports_DOMDocumentType_objectDefinition.parentClass = (JSClassRef) SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata; +} + + +_exports_DOMDocumentType_classRef = JSClassCreate(&_exports_DOMDocumentType_objectDefinition); +SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType->clientdata = _exports_DOMDocumentType_classRef; + + +JS_registerClass(context, exports_object, "DOMDocumentType", &_exports_DOMDocumentType_classDefinition); + + +_exports_DOMCharacterData_classDefinition.staticFunctions = _exports_DOMCharacterData_staticFunctions; +_exports_DOMCharacterData_classDefinition.staticValues = _exports_DOMCharacterData_staticValues; +_exports_DOMCharacterData_classDefinition.callAsConstructor = _wrap_new_veto_DOMCharacterData; +_exports_DOMCharacterData_objectDefinition.finalize = _wrap_delete_DOMCharacterData; +_exports_DOMCharacterData_objectDefinition.staticValues = _exports_DOMCharacterData_values; +_exports_DOMCharacterData_objectDefinition.staticFunctions = _exports_DOMCharacterData_functions; + +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode != NULL) { + _exports_DOMCharacterData_objectDefinition.parentClass = (JSClassRef) SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata; +} + + +_exports_DOMCharacterData_classRef = JSClassCreate(&_exports_DOMCharacterData_objectDefinition); +SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData->clientdata = _exports_DOMCharacterData_classRef; + + +JS_registerClass(context, exports_object, "DOMCharacterData", &_exports_DOMCharacterData_classDefinition); + + +_exports_DOMComment_classDefinition.staticFunctions = _exports_DOMComment_staticFunctions; +_exports_DOMComment_classDefinition.staticValues = _exports_DOMComment_staticValues; +_exports_DOMComment_classDefinition.callAsConstructor = _wrap_new_veto_DOMComment; +_exports_DOMComment_objectDefinition.finalize = _wrap_delete_DOMComment; +_exports_DOMComment_objectDefinition.staticValues = _exports_DOMComment_values; +_exports_DOMComment_objectDefinition.staticFunctions = _exports_DOMComment_functions; + +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData != NULL) { + _exports_DOMComment_objectDefinition.parentClass = (JSClassRef) SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData->clientdata; +} + + +_exports_DOMComment_classRef = JSClassCreate(&_exports_DOMComment_objectDefinition); +SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMComment->clientdata = _exports_DOMComment_classRef; + + +JS_registerClass(context, exports_object, "DOMComment", &_exports_DOMComment_classDefinition); + + +_exports_DOMText_classDefinition.staticFunctions = _exports_DOMText_staticFunctions; +_exports_DOMText_classDefinition.staticValues = _exports_DOMText_staticValues; +_exports_DOMText_classDefinition.callAsConstructor = _wrap_new_veto_DOMText; +_exports_DOMText_objectDefinition.finalize = _wrap_delete_DOMText; +_exports_DOMText_objectDefinition.staticValues = _exports_DOMText_values; +_exports_DOMText_objectDefinition.staticFunctions = _exports_DOMText_functions; + +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData != NULL) { + _exports_DOMText_objectDefinition.parentClass = (JSClassRef) SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData->clientdata; +} + + +_exports_DOMText_classRef = JSClassCreate(&_exports_DOMText_objectDefinition); +SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText->clientdata = _exports_DOMText_classRef; + + +JS_registerClass(context, exports_object, "DOMText", &_exports_DOMText_classDefinition); + + +_exports_DOMCDATASection_classDefinition.staticFunctions = _exports_DOMCDATASection_staticFunctions; +_exports_DOMCDATASection_classDefinition.staticValues = _exports_DOMCDATASection_staticValues; +_exports_DOMCDATASection_classDefinition.callAsConstructor = _wrap_new_veto_DOMCDATASection; +_exports_DOMCDATASection_objectDefinition.finalize = _wrap_delete_DOMCDATASection; +_exports_DOMCDATASection_objectDefinition.staticValues = _exports_DOMCDATASection_values; +_exports_DOMCDATASection_objectDefinition.staticFunctions = _exports_DOMCDATASection_functions; + +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText != NULL) { + _exports_DOMCDATASection_objectDefinition.parentClass = (JSClassRef) SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText->clientdata; +} + + +_exports_DOMCDATASection_classRef = JSClassCreate(&_exports_DOMCDATASection_objectDefinition); +SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCDATASection->clientdata = _exports_DOMCDATASection_classRef; + + +JS_registerClass(context, exports_object, "DOMCDATASection", &_exports_DOMCDATASection_classDefinition); + + +_exports_DOMNodeList_classDefinition.staticFunctions = _exports_DOMNodeList_staticFunctions; +_exports_DOMNodeList_classDefinition.staticValues = _exports_DOMNodeList_staticValues; +_exports_DOMNodeList_classDefinition.callAsConstructor = _wrap_new_veto_DOMNodeList; +_exports_DOMNodeList_objectDefinition.finalize = _wrap_delete_DOMNodeList; +_exports_DOMNodeList_objectDefinition.staticValues = _exports_DOMNodeList_values; +_exports_DOMNodeList_objectDefinition.staticFunctions = _exports_DOMNodeList_functions; + +_exports_DOMNodeList_objectDefinition.parentClass = _SwigObject_classRef; + + +_exports_DOMNodeList_classRef = JSClassCreate(&_exports_DOMNodeList_objectDefinition); +SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList->clientdata = _exports_DOMNodeList_classRef; + + +JS_registerClass(context, exports_object, "DOMNodeList", &_exports_DOMNodeList_classDefinition); + + +_exports_DOMNamedNodeMap_classDefinition.staticFunctions = _exports_DOMNamedNodeMap_staticFunctions; +_exports_DOMNamedNodeMap_classDefinition.staticValues = _exports_DOMNamedNodeMap_staticValues; +_exports_DOMNamedNodeMap_classDefinition.callAsConstructor = _wrap_new_veto_DOMNamedNodeMap; +_exports_DOMNamedNodeMap_objectDefinition.finalize = _wrap_delete_DOMNamedNodeMap; +_exports_DOMNamedNodeMap_objectDefinition.staticValues = _exports_DOMNamedNodeMap_values; +_exports_DOMNamedNodeMap_objectDefinition.staticFunctions = _exports_DOMNamedNodeMap_functions; + +_exports_DOMNamedNodeMap_objectDefinition.parentClass = _SwigObject_classRef; + + +_exports_DOMNamedNodeMap_classRef = JSClassCreate(&_exports_DOMNamedNodeMap_objectDefinition); +SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap->clientdata = _exports_DOMNamedNodeMap_classRef; + + +JS_registerClass(context, exports_object, "DOMNamedNodeMap", &_exports_DOMNamedNodeMap_classDefinition); + + +_exports_DOMDocumentFragment_classDefinition.staticFunctions = _exports_DOMDocumentFragment_staticFunctions; +_exports_DOMDocumentFragment_classDefinition.staticValues = _exports_DOMDocumentFragment_staticValues; +_exports_DOMDocumentFragment_classDefinition.callAsConstructor = _wrap_new_veto_DOMDocumentFragment; +_exports_DOMDocumentFragment_objectDefinition.finalize = _wrap_delete_DOMDocumentFragment; +_exports_DOMDocumentFragment_objectDefinition.staticValues = _exports_DOMDocumentFragment_values; +_exports_DOMDocumentFragment_objectDefinition.staticFunctions = _exports_DOMDocumentFragment_functions; + +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode != NULL) { + _exports_DOMDocumentFragment_objectDefinition.parentClass = (JSClassRef) SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata; +} + + +_exports_DOMDocumentFragment_classRef = JSClassCreate(&_exports_DOMDocumentFragment_objectDefinition); +SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentFragment->clientdata = _exports_DOMDocumentFragment_classRef; + + +JS_registerClass(context, exports_object, "DOMDocumentFragment", &_exports_DOMDocumentFragment_classDefinition); + + +_exports_DOMEntityReference_classDefinition.staticFunctions = _exports_DOMEntityReference_staticFunctions; +_exports_DOMEntityReference_classDefinition.staticValues = _exports_DOMEntityReference_staticValues; +_exports_DOMEntityReference_classDefinition.callAsConstructor = _wrap_new_veto_DOMEntityReference; +_exports_DOMEntityReference_objectDefinition.finalize = _wrap_delete_DOMEntityReference; +_exports_DOMEntityReference_objectDefinition.staticValues = _exports_DOMEntityReference_values; +_exports_DOMEntityReference_objectDefinition.staticFunctions = _exports_DOMEntityReference_functions; + +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode != NULL) { + _exports_DOMEntityReference_objectDefinition.parentClass = (JSClassRef) SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata; +} + + +_exports_DOMEntityReference_classRef = JSClassCreate(&_exports_DOMEntityReference_objectDefinition); +SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntityReference->clientdata = _exports_DOMEntityReference_classRef; + + +JS_registerClass(context, exports_object, "DOMEntityReference", &_exports_DOMEntityReference_classDefinition); + + +_exports_DOMNotation_classDefinition.staticFunctions = _exports_DOMNotation_staticFunctions; +_exports_DOMNotation_classDefinition.staticValues = _exports_DOMNotation_staticValues; +_exports_DOMNotation_classDefinition.callAsConstructor = _wrap_new_veto_DOMNotation; +_exports_DOMNotation_objectDefinition.finalize = _wrap_delete_DOMNotation; +_exports_DOMNotation_objectDefinition.staticValues = _exports_DOMNotation_values; +_exports_DOMNotation_objectDefinition.staticFunctions = _exports_DOMNotation_functions; + +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode != NULL) { + _exports_DOMNotation_objectDefinition.parentClass = (JSClassRef) SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata; +} + + +_exports_DOMNotation_classRef = JSClassCreate(&_exports_DOMNotation_objectDefinition); +SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNotation->clientdata = _exports_DOMNotation_classRef; + + +JS_registerClass(context, exports_object, "DOMNotation", &_exports_DOMNotation_classDefinition); + + +_exports_DOMProcessingInstruction_classDefinition.staticFunctions = _exports_DOMProcessingInstruction_staticFunctions; +_exports_DOMProcessingInstruction_classDefinition.staticValues = _exports_DOMProcessingInstruction_staticValues; +_exports_DOMProcessingInstruction_classDefinition.callAsConstructor = _wrap_new_veto_DOMProcessingInstruction; +_exports_DOMProcessingInstruction_objectDefinition.finalize = _wrap_delete_DOMProcessingInstruction; +_exports_DOMProcessingInstruction_objectDefinition.staticValues = _exports_DOMProcessingInstruction_values; +_exports_DOMProcessingInstruction_objectDefinition.staticFunctions = _exports_DOMProcessingInstruction_functions; + +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode != NULL) { + _exports_DOMProcessingInstruction_objectDefinition.parentClass = (JSClassRef) SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata; +} + + +_exports_DOMProcessingInstruction_classRef = JSClassCreate(&_exports_DOMProcessingInstruction_objectDefinition); +SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction->clientdata = _exports_DOMProcessingInstruction_classRef; + + +JS_registerClass(context, exports_object, "DOMProcessingInstruction", &_exports_DOMProcessingInstruction_classDefinition); + + +_exports_Event_classDefinition.staticFunctions = _exports_Event_staticFunctions; +_exports_Event_classDefinition.staticValues = _exports_Event_staticValues; +_exports_Event_classDefinition.callAsConstructor = _wrap_new_Event; +_exports_Event_objectDefinition.finalize = _wrap_delete_Event; +_exports_Event_objectDefinition.staticValues = _exports_Event_values; +_exports_Event_objectDefinition.staticFunctions = _exports_Event_functions; + +_exports_Event_objectDefinition.parentClass = _SwigObject_classRef; + + +_exports_Event_classRef = JSClassCreate(&_exports_Event_objectDefinition); +SWIGTYPE_p_uscxml__Event->clientdata = _exports_Event_classRef; + + +JS_registerClass(context, exports_object, "Event", &_exports_Event_classDefinition); + + +_exports_ErrorEvent_classDefinition.staticFunctions = _exports_ErrorEvent_staticFunctions; +_exports_ErrorEvent_classDefinition.staticValues = _exports_ErrorEvent_staticValues; +_exports_ErrorEvent_classDefinition.callAsConstructor = _wrap_new_ErrorEvent; +_exports_ErrorEvent_objectDefinition.finalize = _wrap_delete_ErrorEvent; +_exports_ErrorEvent_objectDefinition.staticValues = _exports_ErrorEvent_values; +_exports_ErrorEvent_objectDefinition.staticFunctions = _exports_ErrorEvent_functions; + +if (SWIGTYPE_p_uscxml__Event != NULL) { + _exports_ErrorEvent_objectDefinition.parentClass = (JSClassRef) SWIGTYPE_p_uscxml__Event->clientdata; +} + + +_exports_ErrorEvent_classRef = JSClassCreate(&_exports_ErrorEvent_objectDefinition); +SWIGTYPE_p_uscxml__ErrorEvent->clientdata = _exports_ErrorEvent_classRef; + + +JS_registerClass(context, exports_object, "ErrorEvent", &_exports_ErrorEvent_classDefinition); + + + +/* Register namespaces */ + + +*exports = exports_object; + +return true; +} +#ifdef __cplusplus +} +#endif + diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h deleted file mode 100644 index 0b49c92..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCDOM_H_1RC5LCG8 -#define JSCDOM_H_1RC5LCG8 - -#include "uscxml/InterpreterInfo.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include <XPath/XPath.hpp> -#include "../Storage.h" - -#define JSC_DESTRUCTOR(type) \ -static void jsDestructor(JSObjectRef object) { \ - type* thing = static_cast<type*>(JSObjectGetPrivate(object)); \ - if (thing) {\ - delete thing->nativeObj; \ - delete thing; \ - JSObjectSetPrivate(object, NULL);\ - }\ -} - -#define JSC_DESTRUCTOR_KEEP_WRAPPED(type) \ -static void jsDestructor(JSObjectRef object) { \ -type* thing = static_cast<type*>(JSObjectGetPrivate(object)); \ -delete thing; \ -} - -namespace Arabica { -namespace DOM { - -class JSCDOM { -public: - JSCDOM(); - virtual ~JSCDOM(); - uscxml::Storage* storage; - uscxml::NameSpaceInfo* nsInfo; - Arabica::XPath::XPath<std::string>* xpath; - -}; - -} -} - -#endif /* end of include guard: JSCDOM_H_1RC5LCG8 */ diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp index d3eb0ef..d43efbe 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp @@ -18,55 +18,66 @@ */ #include "uscxml/Common.h" -#include "uscxml/config.h" -#include "uscxml/URL.h" +#include "uscxml/util/URL.h" #include "uscxml/util/String.h" #include "JSCDataModel.h" -#include "JSCDOM.h" -#include "dom/JSCDocument.h" -#include "dom/JSCElement.h" -#include "dom/JSCText.h" -#include "dom/JSCCDATASection.h" -#include "dom/JSCSCXMLEvent.h" - -#include "dom/JSCArrayBuffer.h" -#include "dom/JSCInt8Array.h" -#include "dom/JSCUint8Array.h" -#include "dom/JSCUint8ClampedArray.h" -#include "dom/JSCInt16Array.h" -#include "dom/JSCUint16Array.h" -#include "dom/JSCInt32Array.h" -#include "dom/JSCUint32Array.h" -#include "dom/JSCFloat32Array.h" -#include "dom/JSCFloat64Array.h" -#include "dom/JSCDataView.h" - -#include "uscxml/Message.h" -#include "uscxml/dom/DOMUtils.h" -#include <glog/logging.h> +//#include "JSCSCXMLEvent.h" -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif +#include "uscxml/messages/Event.h" +#include "uscxml/util/DOM.h" +#include <easylogging++.h> -#define TO_JSC_DOMVALUE(type) \ -struct JSC##type::JSC##type##Private* privData = new JSC##type::JSC##type##Private(); \ -privData->dom = _dom; \ -privData->nativeObj = new type<std::string>(node); \ -JSObjectRef retObj = JSObjectMake(_ctx, JSC##type::getTmpl(), privData);\ -return retObj; +#define EVENT_STRING_OR_UNDEF(field, cond) \ +JSStringRef field##Name = JSStringCreateWithUTF8CString( #field ); \ +JSStringRef field##Val = JSStringCreateWithUTF8CString(event.field.c_str()); \ +JSObjectSetProperty(_ctx, \ + eventObj, \ + field##Name, \ + (cond ? JSValueMakeString(_ctx, field##Val) : JSValueMakeUndefined(_ctx)), \ + 0, \ + &exception); \ +JSStringRelease(field##Name); \ +JSStringRelease(field##Val); \ +if (exception) \ + handleException(exception); -#define JSC_ADD_GLOBAL_OBJECT(name, constructor)\ -JSStringRef name##Name = JSStringCreateWithUTF8CString(#name);\ -JSObjectRef name = JSObjectMake(dm->_ctx, constructor, NULL);\ -JSObjectSetProperty(dm->_ctx, JSContextGetGlobalObject(dm->_ctx), name##Name, name, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, NULL);\ -JSStringRelease(name##Name); -namespace uscxml { +using namespace xercesc; + +static JSValueRef XMLString2JS(const XMLCh* input, JSContextRef context) { + JSValueRef output; + + char* res = xercesc::XMLString::transcode(input); + + JSStringRef stringRef = JSStringCreateWithUTF8CString(res); + output = JSValueMakeString(context, stringRef); + JSStringRelease(stringRef); + + return output; +} + +static XMLCh* JS2XMLString(JSValueRef input, JSContextRef context) { + + if (!JSValueIsString(context, input)) + return NULL; + + JSValueRef exception = NULL; + JSStringRef stringInput = JSValueToStringCopy(context, input, &exception); + + // TODO: I am leaking! + size_t maxSize = JSStringGetMaximumUTF8CStringSize(stringInput); + char* output = new char[maxSize + 1]; + + JSStringGetUTF8CString(stringInput, output, maxSize); + XMLCh* ret = xercesc::XMLString::transcode(output); -using namespace Arabica::XPath; -using namespace Arabica::DOM; + return(ret); +} + +#include "JSCDOM.cpp.inc" + +namespace uscxml { #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR @@ -77,13 +88,10 @@ bool pluginConnect(pluma::Host& host) { #endif JSCDataModel::JSCDataModel() { - _dom = NULL; _ctx = NULL; } JSCDataModel::~JSCDataModel() { - if (_dom) - delete _dom; if (_ctx) JSGlobalContextRelease(_ctx); } @@ -159,31 +167,6 @@ JSValueRef JSCDataModel::jsExtension(JSContextRef ctx, JSObjectRef function, JSO return JSValueMakeNull(ctx); } -#if 0 -typedef struct { - int version; /* current (and only) version is 0 */ - JSClassAttributes attributes; - - const char* className; - JSClassRef parentClass; - - const JSStaticValue* staticValues; - const JSStaticFunction* staticFunctions; - - JSObjectInitializeCallback initialize; - JSObjectFinalizeCallback finalize; - JSObjectHasPropertyCallback hasProperty; - JSObjectGetPropertyCallback getProperty; - JSObjectSetPropertyCallback setProperty; - JSObjectDeletePropertyCallback deleteProperty; - JSObjectGetPropertyNamesCallback getPropertyNames; - JSObjectCallAsFunctionCallback callAsFunction; - JSObjectCallAsConstructorCallback callAsConstructor; - JSObjectHasInstanceCallback hasInstance; - JSObjectConvertToTypeCallback convertToType; -} JSClassDefinition; -#endif - // functions need to be objects to hold private data in JSC JSClassDefinition JSCDataModel::jsInClassDef = { 0, 0, "In", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, jsIn, 0, 0, 0 }; JSClassDefinition JSCDataModel::jsPrintClassDef = { 0, 0, "print", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, jsPrint, 0, 0, 0 }; @@ -192,17 +175,74 @@ JSClassDefinition JSCDataModel::jsExtensionClassDef = { 0, 0, "Extension", 0, 0, JSClassDefinition JSCDataModel::jsIOProcessorsClassDef = { 0, 0, "ioProcessors", 0, 0, 0, 0, 0, jsIOProcessorHasProp, jsIOProcessorGetProp, 0, 0, jsIOProcessorListProps, 0, 0, 0, 0 }; JSClassDefinition JSCDataModel::jsInvokersClassDef = { 0, 0, "invokers", 0, 0, 0, 0, 0, jsInvokerHasProp, jsInvokerGetProp, 0, 0, jsInvokerListProps, 0, 0, 0, 0 }; -boost::shared_ptr<DataModelImpl> JSCDataModel::create(InterpreterInfo* interpreter) { - boost::shared_ptr<JSCDataModel> dm = boost::shared_ptr<JSCDataModel>(new JSCDataModel()); +std::mutex JSCDataModel::_initMutex; + +bool JSCNodeListHasPropertyCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName) { + size_t propMaxSize = JSStringGetMaximumUTF8CStringSize(propertyName); + char* propBuffer = new char[propMaxSize]; + JSStringGetUTF8CString(propertyName, propBuffer, propMaxSize); + std::string propName(propBuffer); + free(propBuffer); + + std::string base = "0123456789"; + if (propName.find_first_not_of(base) != std::string::npos) { + return false; + } + + int index = strTo<int>(propName); + SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(object); + DOMNodeList* nodeList = (DOMNodeList*)t->swigCObject; + + if (nodeList->getLength() < index) { + return false; + } + + return true; +} + +JSValueRef JSCNodeListGetPropertyCallback(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { + size_t propMaxSize = JSStringGetMaximumUTF8CStringSize(propertyName); + char* propBuffer = new char[propMaxSize]; + JSStringGetUTF8CString(propertyName, propBuffer, propMaxSize); + std::string propName(propBuffer); + free(propBuffer); + + std::string base = "0123456789"; + if (propName.find_first_not_of(base) != std::string::npos) { + return JSValueMakeUndefined(context); + } + + int index = strTo<int>(propName); + SwigPrivData* t = (SwigPrivData*) JSObjectGetPrivate(object); + DOMNodeList* nodeList = (DOMNodeList*)t->swigCObject; + + if (nodeList->getLength() < index) { + return JSValueMakeUndefined(context); + } + + DOMNode* node = nodeList->item(index); + JSValueRef jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(node), + SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&node)), 0); + return jsresult; +} + +std::shared_ptr<DataModelImpl> JSCDataModel::create(DataModelCallbacks* callbacks) { + std::shared_ptr<JSCDataModel> dm(new JSCDataModel()); dm->_ctx = JSGlobalContextCreate(NULL); - dm->_interpreter = interpreter; + dm->_callbacks = callbacks; + + JSObjectRef exports; - dm->_dom = new JSCDOM(); - dm->_dom->xpath = new XPath<std::string>(); - dm->_dom->xpath->setNamespaceContext(*interpreter->getNameSpaceInfo().getNSContext()); - dm->_dom->storage = new Storage(URL::getResourceDir() + PATH_SEPERATOR + interpreter->getName() + ".storage"); - dm->_dom->nsInfo = new NameSpaceInfo(interpreter->getNameSpaceInfo()); + // register subscript operator with nodelist + _exports_DOMNodeList_objectDefinition.hasProperty = JSCNodeListHasPropertyCallback; + _exports_DOMNodeList_objectDefinition.getProperty = JSCNodeListGetPropertyCallback; + + // not thread safe! + { + std::lock_guard<std::mutex> lock(_initMutex); + JSCDOM_initialize(dm->_ctx, &exports); + } // introduce global functions as objects for private data JSClassRef jsInClassRef = JSClassCreate(&jsInClassDef); @@ -230,76 +270,68 @@ boost::shared_ptr<DataModelImpl> JSCDataModel::create(InterpreterInfo* interpret JSStringRelease(ioProcName); JSStringRef nameName = JSStringCreateWithUTF8CString("_name"); - JSStringRef name = JSStringCreateWithUTF8CString(dm->_interpreter->getName().c_str()); + JSStringRef name = JSStringCreateWithUTF8CString(dm->_callbacks->getName().c_str()); JSObjectSetProperty(dm->_ctx, JSContextGetGlobalObject(dm->_ctx), nameName, JSValueMakeString(dm->_ctx, name), kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, NULL); JSStringRelease(nameName); JSStringRelease(name); JSStringRef sessionIdName = JSStringCreateWithUTF8CString("_sessionid"); - JSStringRef sessionId = JSStringCreateWithUTF8CString(dm->_interpreter->getSessionId().c_str()); + JSStringRef sessionId = JSStringCreateWithUTF8CString(dm->_callbacks->getSessionId().c_str()); JSObjectSetProperty(dm->_ctx, JSContextGetGlobalObject(dm->_ctx), sessionIdName, JSValueMakeString(dm->_ctx, sessionId), kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, NULL); JSStringRelease(sessionIdName); JSStringRelease(sessionId); - JSC_ADD_GLOBAL_OBJECT(ArrayBuffer, JSCArrayBuffer::getTmpl()); - JSC_ADD_GLOBAL_OBJECT(Int8Array, JSCInt8Array::getTmpl()); - JSC_ADD_GLOBAL_OBJECT(Uint8Array, JSCUint8Array::getTmpl()); - JSC_ADD_GLOBAL_OBJECT(Uint8ClampedArray, JSCUint8ClampedArray::getTmpl()); - JSC_ADD_GLOBAL_OBJECT(Int16Array, JSCInt16Array::getTmpl()); - JSC_ADD_GLOBAL_OBJECT(Uint16Array, JSCUint16Array::getTmpl()); - JSC_ADD_GLOBAL_OBJECT(Int32Array, JSCInt32Array::getTmpl()); - JSC_ADD_GLOBAL_OBJECT(Uint32Array, JSCUint32Array::getTmpl()); - JSC_ADD_GLOBAL_OBJECT(Float32Array, JSCFloat32Array::getTmpl()); - JSC_ADD_GLOBAL_OBJECT(Float64Array, JSCFloat64Array::getTmpl()); - JSC_ADD_GLOBAL_OBJECT(DataView, JSCDataView::getTmpl()); - - JSCDocument::JSCDocumentPrivate* privData = new JSCDocument::JSCDocumentPrivate(); - if (interpreter) { - privData->nativeObj = new Document<std::string>(interpreter->getDocument()); - privData->dom = dm->_dom; - - JSObjectRef documentObject = JSObjectMake(dm->_ctx, JSCDocument::getTmpl(), privData); - JSObjectRef globalObject = JSContextGetGlobalObject(dm->_ctx); - JSStringRef documentName = JSStringCreateWithUTF8CString("document"); - - JSObjectSetProperty(dm->_ctx, globalObject, documentName, documentObject, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, NULL); - JSStringRelease(documentName); - } - - dm->eval(Element<std::string>(), "_x = {};"); + dm->evalAsValue("_x = {};"); return dm; } -void JSCDataModel::pushContext() { -} - -void JSCDataModel::popContext() { -} - void JSCDataModel::setEvent(const Event& event) { - JSCSCXMLEvent::JSCSCXMLEventPrivate* privData = new JSCSCXMLEvent::JSCSCXMLEventPrivate(); - privData->nativeObj = new Event(event); - privData->dom = _dom; + Event* evPtr = new Event(event); - JSObjectRef eventObj = JSObjectMake(_ctx, JSCSCXMLEvent::getTmpl(), privData); + JSObjectRef eventObj = SWIG_JSC_NewPointerObj(_ctx, evPtr, SWIGTYPE_p_uscxml__Event, SWIG_POINTER_OWN); JSObjectRef globalObject = JSContextGetGlobalObject(_ctx); JSValueRef exception = NULL; - if (event.raw.size() == 0) { - std::stringstream ssRaw; - ssRaw << event; - privData->nativeObj->raw = ssRaw.str(); + /* Manually handle swig ignored fields */ + EVENT_STRING_OR_UNDEF(sendid, !event.hideSendId); // test333 + EVENT_STRING_OR_UNDEF(origin, event.origin.size() > 0); // test335 + EVENT_STRING_OR_UNDEF(origintype, event.origintype.size() > 0); // test337 + EVENT_STRING_OR_UNDEF(invokeid, event.invokeid.size() > 0); // test339 + + /* Manually handle swig ignored event type */ + JSStringRef eventTypeName = JSStringCreateWithUTF8CString("type"); + JSStringRef eventTypeVal; + + // test 331 + switch (event.eventType) { + case Event::EXTERNAL: + eventTypeVal = JSStringCreateWithUTF8CString("external"); + break; + case Event::INTERNAL: + eventTypeVal = JSStringCreateWithUTF8CString("internal"); + break; + case Event::PLATFORM: + eventTypeVal = JSStringCreateWithUTF8CString("platform"); + break; } - if (event.dom) { + JSObjectSetProperty(_ctx, eventObj, eventTypeName, JSValueMakeString(_ctx, eventTypeVal), 0, &exception); + if (exception) + handleException(exception); + + JSStringRelease(eventTypeName); + JSStringRelease(eventTypeVal); + + /* Manually handle swig ignored event data */ + if (event.data.node) { JSStringRef propName = JSStringCreateWithUTF8CString("data"); - JSObjectSetProperty(_ctx, eventObj, propName, getNodeAsValue(event.dom), 0, &exception); + JSObjectSetProperty(_ctx, eventObj, propName, getNodeAsValue(event.data.node), 0, &exception); JSStringRelease(propName); if (exception) handleException(exception); - +#if 0 } else if (event.content.length() > 0) { // _event.data is a string or JSON Data json = Data::fromJSON(event.content); @@ -319,6 +351,7 @@ void JSCDataModel::setEvent(const Event& event) { if (exception) handleException(exception); } +#endif } else { // _event.data is KVP Event eventCopy(event); @@ -359,22 +392,21 @@ void JSCDataModel::setEvent(const Event& event) { } -Data JSCDataModel::getStringAsData(const std::string& content) { +Data JSCDataModel::evalAsData(const std::string& content) { JSValueRef result = evalAsValue(content); - Data data = getValueAsData(result); - return data; + return getValueAsData(result); +} + +Data JSCDataModel::getAsData(const std::string& content) { + // parse as JSON test 578 + return Data::fromJSON(content); } JSValueRef JSCDataModel::getDataAsValue(const Data& data) { JSValueRef exception = NULL; if (data.node) { - JSCNode::JSCNodePrivate* privData = new JSCNode::JSCNodePrivate(); - privData->nativeObj = new Node<std::string>(data.node); - privData->dom = _dom; - - JSObjectRef value = JSObjectMake(_ctx, JSCNode::getTmpl(), privData); - return value; + return getNodeAsValue(data.node); } if (data.compound.size() > 0) { JSObjectRef value = JSObjectMake(_ctx, 0, 0); @@ -417,16 +449,16 @@ JSValueRef JSCDataModel::getDataAsValue(const Data& data) { } } } - if (data.binary) { - uscxml::ArrayBuffer* localInstance = new uscxml::ArrayBuffer(data.binary); - - JSClassRef retClass = JSCArrayBuffer::getTmpl(); - struct JSCArrayBuffer::JSCArrayBufferPrivate* retPrivData = new JSCArrayBuffer::JSCArrayBufferPrivate(); - retPrivData->nativeObj = localInstance; - - JSObjectRef retObj = JSObjectMake(_ctx, retClass, retPrivData); - return retObj; - } +// if (data.binary) { +// uscxml::ArrayBuffer* localInstance = new uscxml::ArrayBuffer(data.binary); +// +// JSClassRef retClass = JSCArrayBuffer::getTmpl(); +// struct JSCArrayBuffer::JSCArrayBufferPrivate* retPrivData = new JSCArrayBuffer::JSCArrayBufferPrivate(); +// retPrivData->nativeObj = localInstance; +// +// JSObjectRef retObj = JSObjectMake(_ctx, retClass, retPrivData); +// return retObj; +// } return JSValueMakeUndefined(_ctx); } @@ -466,15 +498,18 @@ Data JSCDataModel::getValueAsData(const JSValueRef value) { JSObjectRef objValue = JSValueToObject(_ctx, value, &exception); if (exception) handleException(exception); - if (JSValueIsObjectOfClass(_ctx, value, JSCArrayBuffer::getTmpl())) { - // binary data - JSCArrayBuffer::JSCArrayBufferPrivate* privObj = (JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(objValue); - data.binary = privObj->nativeObj->_blob; - return data; - } else if (JSValueIsObjectOfClass(_ctx, value, JSCNode::getTmpl())) { +// if (JSValueIsObjectOfClass(_ctx, value, JSCArrayBuffer::getTmpl())) { +// // binary data +// JSCArrayBuffer::JSCArrayBufferPrivate* privObj = (JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(objValue); +// data.binary = privObj->nativeObj->_blob; +// return data; +// } else + + if (JSValueIsObjectOfClass(_ctx, value, _exports_DOMNode_classRef)) { // dom node - JSCNode::JSCNodePrivate* privObj = (JSCNode::JSCNodePrivate*)JSObjectGetPrivate(objValue); - data.node = *privObj->nativeObj; + void* privData = NULL; + SWIG_JSC_ConvertPtr(_ctx, value, &privData, SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0); + data.node = (xercesc::DOMNode*)privData; return data; } std::set<std::string> propertySet; @@ -518,10 +553,6 @@ Data JSCDataModel::getValueAsData(const JSValueRef value) { return data; } -bool JSCDataModel::validate(const std::string& location, const std::string& schema) { - return true; -} - uint32_t JSCDataModel::getLength(const std::string& expr) { JSValueRef result; @@ -558,10 +589,12 @@ void JSCDataModel::setForeach(const std::string& item, } } +#if 0 bool JSCDataModel::isLocation(const std::string& expr) { // location needs to be LHS and ++ is only valid for LHS return isValidSyntax(expr + "++"); } +#endif bool JSCDataModel::isValidSyntax(const std::string& expr) { JSStringRef scriptJS = JSStringCreateWithUTF8CString(expr.c_str()); @@ -587,34 +620,11 @@ bool JSCDataModel::isDeclared(const std::string& expr) { return true; } -void JSCDataModel::eval(const Element<std::string>& scriptElem, - const std::string& expr) { - evalAsValue(expr); -} - -bool JSCDataModel::evalAsBool(const Arabica::DOM::Element<std::string>& node, const std::string& expr) { +bool JSCDataModel::evalAsBool(const std::string& expr) { JSValueRef result = evalAsValue(expr); return JSValueToBoolean(_ctx, result); } -std::string JSCDataModel::evalAsString(const std::string& expr) { - JSValueRef result = evalAsValue(expr); - JSValueRef exception = NULL; - - JSStringRef stringValue = JSValueToStringCopy( _ctx, result, &exception); - if (exception) - handleException(exception); - - size_t maxSize = JSStringGetMaximumUTF8CStringSize(stringValue); - char data[maxSize]; - JSStringGetUTF8CString(stringValue, data, maxSize); - std::string retString(data); - - JSStringRelease(stringValue); - - return retString; -} - JSValueRef JSCDataModel::evalAsValue(const std::string& expr, bool dontThrow) { JSStringRef scriptJS = JSStringCreateWithUTF8CString(expr.c_str()); JSValueRef exception = NULL; @@ -627,24 +637,27 @@ JSValueRef JSCDataModel::evalAsValue(const std::string& expr, bool dontThrow) { return result; } -JSValueRef JSCDataModel::getNodeAsValue(const Node<std::string>& node) { - switch (node.getNodeType()) { - case Node_base::ELEMENT_NODE: { - TO_JSC_DOMVALUE(Element); - } - case Node_base::TEXT_NODE: { - TO_JSC_DOMVALUE(Text); - } - case Node_base::CDATA_SECTION_NODE: { - TO_JSC_DOMVALUE(CDATASection); - } - case Node_base::DOCUMENT_NODE: { - TO_JSC_DOMVALUE(Document); - } - default: { - TO_JSC_DOMVALUE(Node); - } - } +JSValueRef JSCDataModel::getNodeAsValue(const DOMNode* node) { + return SWIG_JSC_NewPointerObj(_ctx, + (void*)node, + SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, + SWIG_as_voidptrptr(&node)), + 0); + +// switch (node->getNodeType()) { +// case DOMNode::ELEMENT_NODE: +// return SWIG_JSC_NewPointerObj(_ctx, (void*)node, SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0); +// break; +// +// case DOMNode::COMMENT_NODE: +// return SWIG_JSC_NewPointerObj(_ctx, (void*)node, SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMComment, 0); +// break; +// +// // TODO: We need to dispatch more types here! +// default: +// return SWIG_JSC_NewPointerObj(_ctx, (void*)node, SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0); +// break; +// } } void JSCDataModel::assign(const std::string& location, const Data& data) { @@ -669,7 +682,7 @@ void JSCDataModel::assign(const std::string& location, const Data& data) { } /** - * test157: We need to evluate, as this will not throw for 'continue' = Var[5] in + * test157: We need to evaluate, as this will not throw for 'continue' = Var[5] in */ // JSObjectSetProperty(_ctx, JSContextGetGlobalObject(_ctx), JSStringCreateWithUTF8CString(location.c_str()), getDataAsValue(data), 0, &exception); @@ -677,66 +690,10 @@ void JSCDataModel::assign(const std::string& location, const Data& data) { handleException(exception); } -void JSCDataModel::assign(const Element<std::string>& assignElem, - const Node<std::string>& node, - const std::string& content) { - std::string key; - if (HAS_ATTR(assignElem, "id")) { - key = ATTR(assignElem, "id"); - } else if (HAS_ATTR(assignElem, "location")) { - key = ATTR(assignElem, "location"); - } - if (key.length() == 0) { - ERROR_EXECUTION_THROW("Assign element has neither id nor location"); - } - - if (HAS_ATTR(assignElem, "expr")) { - assign(key, Data(ATTR(assignElem, "expr"), Data::INTERPRETED)); - } else if (node) { - Data d; - d.node = node; - assign(key, d); - } else if (content.size() > 0) { - try { - Data d = Data::fromJSON(content); - if (d.empty()) - throw Event(); - assign(key, Data(d, Data::INTERPRETED)); - } catch (Event e) { - assign(key, Data("\"" + spaceNormalize(content) + "\"", Data::INTERPRETED)); - } - } else { - JSValueRef exception = NULL; - JSObjectSetProperty(_ctx, JSContextGetGlobalObject(_ctx), JSStringCreateWithUTF8CString(key.c_str()), JSValueMakeUndefined(_ctx), 0, &exception); - if (exception) - handleException(exception); - } -} - -void JSCDataModel::init(const Element<std::string>& dataElem, - const Node<std::string>& node, - const std::string& content) { - try { - assign(dataElem, node, content); - } catch (Event e) { - // test 277 - std::string key; - if (HAS_ATTR(dataElem, "id")) { - key = ATTR(dataElem, "id"); - } else if (HAS_ATTR(dataElem, "location")) { - key = ATTR(dataElem, "location"); - } - if (key.size() > 0) { - evalAsValue(key + " = undefined", true); - } - throw e; - } -} - void JSCDataModel::init(const std::string& location, const Data& data) { try { assign(location, data); - } catch (Event e) { + } catch (ErrorEvent e) { // test 277 evalAsValue(location + " = undefined", true); throw e; @@ -814,7 +771,7 @@ JSValueRef JSCDataModel::jsIn(JSContextRef ctx, JSObjectRef function, JSObjectRe std::string stateName(buffer); free(buffer); - if (INSTANCE->_interpreter->isInState(stateName)) { + if (INSTANCE->_callbacks->isInState(stateName)) { continue; } } @@ -826,7 +783,7 @@ JSValueRef JSCDataModel::jsIn(JSContextRef ctx, JSObjectRef function, JSObjectRe bool JSCDataModel::jsIOProcessorHasProp(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName) { JSCDataModel* INSTANCE = (JSCDataModel*)JSObjectGetPrivate(object); - std::map<std::string, IOProcessor> ioProcessors = INSTANCE->_interpreter->getIOProcessors(); + std::map<std::string, IOProcessor> ioProcessors = INSTANCE->_callbacks->getIOProcessors(); size_t maxSize = JSStringGetMaximumUTF8CStringSize(propertyName); char buffer[maxSize]; @@ -838,7 +795,7 @@ bool JSCDataModel::jsIOProcessorHasProp(JSContextRef ctx, JSObjectRef object, JS JSValueRef JSCDataModel::jsIOProcessorGetProp(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { JSCDataModel* INSTANCE = (JSCDataModel*)JSObjectGetPrivate(object); - std::map<std::string, IOProcessor> ioProcessors = INSTANCE->_interpreter->getIOProcessors(); + std::map<std::string, IOProcessor> ioProcessors = INSTANCE->_callbacks->getIOProcessors(); size_t maxSize = JSStringGetMaximumUTF8CStringSize(propertyName); char buffer[maxSize]; @@ -853,7 +810,7 @@ JSValueRef JSCDataModel::jsIOProcessorGetProp(JSContextRef ctx, JSObjectRef obje void JSCDataModel::jsIOProcessorListProps(JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames) { JSCDataModel* INSTANCE = (JSCDataModel*)JSObjectGetPrivate(object); - std::map<std::string, IOProcessor> ioProcessors = INSTANCE->_interpreter->getIOProcessors(); + std::map<std::string, IOProcessor> ioProcessors = INSTANCE->_callbacks->getIOProcessors(); std::map<std::string, IOProcessor>::const_iterator ioProcIter = ioProcessors.begin(); while(ioProcIter != ioProcessors.end()) { @@ -866,7 +823,7 @@ void JSCDataModel::jsIOProcessorListProps(JSContextRef ctx, JSObjectRef object, bool JSCDataModel::jsInvokerHasProp(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName) { JSCDataModel* INSTANCE = (JSCDataModel*)JSObjectGetPrivate(object); - std::map<std::string, Invoker> invokers = INSTANCE->_interpreter->getInvokers(); + std::map<std::string, Invoker> invokers = INSTANCE->_callbacks->getInvokers(); size_t maxSize = JSStringGetMaximumUTF8CStringSize(propertyName); char buffer[maxSize]; @@ -878,7 +835,7 @@ bool JSCDataModel::jsInvokerHasProp(JSContextRef ctx, JSObjectRef object, JSStri JSValueRef JSCDataModel::jsInvokerGetProp(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { JSCDataModel* INSTANCE = (JSCDataModel*)JSObjectGetPrivate(object); - std::map<std::string, Invoker> invokers = INSTANCE->_interpreter->getInvokers(); + std::map<std::string, Invoker> invokers = INSTANCE->_callbacks->getInvokers(); size_t maxSize = JSStringGetMaximumUTF8CStringSize(propertyName); char buffer[maxSize]; @@ -893,7 +850,7 @@ JSValueRef JSCDataModel::jsInvokerGetProp(JSContextRef ctx, JSObjectRef object, void JSCDataModel::jsInvokerListProps(JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames) { JSCDataModel* INSTANCE = (JSCDataModel*)JSObjectGetPrivate(object); - std::map<std::string, Invoker> invokers = INSTANCE->_interpreter->getInvokers(); + std::map<std::string, Invoker> invokers = INSTANCE->_callbacks->getInvokers(); std::map<std::string, Invoker>::const_iterator invokerIter = invokers.begin(); while(invokerIter != invokers.end()) { diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h index ccadc79..55e5c1f 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h @@ -20,11 +20,10 @@ #ifndef JSCDATAMODEL_H_KN8TWG0V #define JSCDATAMODEL_H_KN8TWG0V -#include "uscxml/InterpreterInfo.h" #include "uscxml/plugins/DataModel.h" #include <list> +#include <set> #include <JavaScriptCore/JavaScriptCore.h> -#include "JSCDOM.h" #ifdef BUILD_AS_PLUGINS #include "uscxml/plugins/Plugins.h" @@ -41,7 +40,7 @@ class JSCDataModel : public DataModelImpl { public: JSCDataModel(); virtual ~JSCDataModel(); - virtual boost::shared_ptr<DataModelImpl> create(InterpreterInfo* interpreter); + virtual std::shared_ptr<DataModelImpl> create(DataModelCallbacks* callbacks); virtual void addExtension(DataModelExtension* ext); @@ -51,12 +50,9 @@ public: return names; } - virtual bool validate(const std::string& location, const std::string& schema); - virtual bool isLocation(const std::string& expr); virtual bool isValidSyntax(const std::string& expr); virtual void setEvent(const Event& event); - virtual Data getStringAsData(const std::string& content); // foreach virtual uint32_t getLength(const std::string& expr); @@ -64,31 +60,19 @@ public: const std::string& array, const std::string& index, uint32_t iteration); - virtual void pushContext(); - virtual void popContext(); - virtual void eval(const Arabica::DOM::Element<std::string>& scriptElem, - const std::string& expr); - virtual std::string evalAsString(const std::string& expr); - - virtual bool evalAsBool(const Arabica::DOM::Element<std::string>& node, const std::string& expr); + virtual Data getAsData(const std::string& content); + virtual Data evalAsData(const std::string& expr); + virtual bool evalAsBool(const std::string& expr); virtual bool isDeclared(const std::string& expr); - virtual void assign(const Arabica::DOM::Element<std::string>& assignElem, - const Arabica::DOM::Node<std::string>& node, - const std::string& content); virtual void assign(const std::string& location, const Data& data); - - virtual void init(const Arabica::DOM::Element<std::string>& dataElem, - const Arabica::DOM::Node<std::string>& node, - const std::string& content); virtual void init(const std::string& location, const Data& data); virtual std::string andExpressions(std::list<std::string>); protected: - Arabica::DOM::JSCDOM* _dom; static JSClassDefinition jsInClassDef; static JSValueRef jsIn(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); @@ -107,7 +91,7 @@ protected: static JSValueRef jsInvokerGetProp(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception); static void jsInvokerListProps(JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames); - JSValueRef getNodeAsValue(const Arabica::DOM::Node<std::string>& node); + JSValueRef getNodeAsValue(const xercesc::DOMNode* node); JSValueRef getDataAsValue(const Data& data); Data getValueAsData(const JSValueRef value); JSValueRef evalAsValue(const std::string& expr, bool dontThrow = false); @@ -122,6 +106,8 @@ protected: Event _event; JSGlobalContextRef _ctx; + static std::mutex _initMutex; + }; #ifdef BUILD_AS_PLUGINS diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/bindings.i b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/bindings.i new file mode 100644 index 0000000..bf8a0fa --- /dev/null +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/bindings.i @@ -0,0 +1,46 @@ +#define XERCES_HAS_CPP_NAMESPACE 1 + +%include <std_string.i> + +/* + +swig -I/Users/sradomski/Documents/TK/Code/uscxml2/build/cli/deps/xerces-c/include/ -javascript -jsc -c++ uscxml.i +gcc -I/Users/sradomski/Documents/TK/Code/uscxml2/build/cli/deps/xerces-c/include/ ./uscxml_wrap.cxx + +*/ + +%module JSCDOM + +%import "uscxml/config.h" +%import "uscxml/Common.h" + +%import "xercesc/util/XercesDefs.hpp" +%import "xercesc/util/Xerces_autoconf_config.hpp" + +%include "../../common/bindings/dom/ignore.i" +%include "../../common/bindings/dom/defines.i" +%include "../../common/bindings/dom/typemaps-general.i" + +// in typemap +%typemap(in) XMLCh * %{ + $1 = JS2XMLString($input, context); +%} + +%typemap(freearg) XMLCh * %{ + delete[] $1; +%} + +// out typemap +%typemap(out) XMLCh * %{ + $result = XMLString2JS($1, context); +%} + + +%include "../../common/bindings/dom/dom.i" + +// Operators we do want +// %rename(operator_assignment) operator=; +%rename(operator_equal_to) operator==; +%rename(operator_not_equal_to) operator!=; + +%include "../../common/bindings/event.i" diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBuffer.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBuffer.cpp deleted file mode 100644 index b6a262d..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBuffer.cpp +++ /dev/null @@ -1,209 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCArrayBuffer.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCArrayBuffer::Tmpl; - -JSStaticValue JSCArrayBuffer::staticValues[] = { - { "byteLength", byteLengthAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "mimeType", mimeTypeAttrGetter, mimeTypeAttrSetter, kJSPropertyAttributeDontDelete }, - - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCArrayBuffer::staticFunctions[] = { - { "md5", md5Callback, kJSPropertyAttributeDontDelete }, - { "base64", base64Callback, kJSPropertyAttributeDontDelete }, - { "slice", sliceCallback, kJSPropertyAttributeDontDelete }, - { "isView", isViewCallback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSObjectRef JSCArrayBuffer::jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - uscxml::ArrayBuffer* localInstance = NULL; - - if (false) { - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - - unsigned long localLength = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - localInstance = new uscxml::ArrayBuffer(localLength); - - } - if (!localInstance) { - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling constructor for ArrayBuffer"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return (JSObjectRef)JSValueMakeNull(ctx); - } - - JSClassRef retClass = JSCArrayBuffer::getTmpl(); - - struct JSCArrayBuffer::JSCArrayBufferPrivate* retPrivData = new JSCArrayBuffer::JSCArrayBufferPrivate(); - retPrivData->nativeObj = localInstance; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - return retObj; -} - -JSValueRef JSCArrayBuffer::byteLengthAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCArrayBufferPrivate* privData = (struct JSCArrayBufferPrivate*)JSObjectGetPrivate(object); - - return JSValueMakeNumber(ctx, privData->nativeObj->getByteLength()); -} - - -JSValueRef JSCArrayBuffer::mimeTypeAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCArrayBufferPrivate* privData = (struct JSCArrayBufferPrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getMimeType().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -bool JSCArrayBuffer::mimeTypeAttrSetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) { - struct JSCArrayBufferPrivate* privData = (struct JSCArrayBufferPrivate*)JSObjectGetPrivate(thisObj); - - JSStringRef stringReflocalMimeType = JSValueToStringCopy(ctx, value, exception); - size_t localMimeTypeMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalMimeType); - char* localMimeTypeBuffer = new char[localMimeTypeMaxSize]; - JSStringGetUTF8CString(stringReflocalMimeType, localMimeTypeBuffer, localMimeTypeMaxSize); - std::string localMimeType(localMimeTypeBuffer); - JSStringRelease(stringReflocalMimeType); - free(localMimeTypeBuffer); - - privData->nativeObj->setMimeType(localMimeType); - return true; -} - -JSValueRef JSCArrayBuffer::md5Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCArrayBufferPrivate* privData = (struct JSCArrayBufferPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 0) { - - std::string retVal = privData->nativeObj->md5(); - - JSStringRef jscString = JSStringCreateWithUTF8CString(retVal.c_str()); - JSValueRef jscRetVal = JSValueMakeString(ctx, jscString); - JSStringRelease(jscString); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling md5"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCArrayBuffer::base64Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCArrayBufferPrivate* privData = (struct JSCArrayBufferPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 0) { - - std::string retVal = privData->nativeObj->base64(); - - JSStringRef jscString = JSStringCreateWithUTF8CString(retVal.c_str()); - JSValueRef jscRetVal = JSValueMakeString(ctx, jscString); - JSStringRelease(jscString); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling base64"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCArrayBuffer::sliceCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCArrayBufferPrivate* privData = (struct JSCArrayBufferPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - long localBegin = (long)JSValueToNumber(ctx, arguments[0], exception); - long localEnd = (long)JSValueToNumber(ctx, arguments[1], exception); - - uscxml::ArrayBuffer* retVal = new uscxml::ArrayBuffer(privData->nativeObj->slice(localBegin, localEnd)); - JSClassRef retClass = JSCArrayBuffer::getTmpl(); - - struct JSCArrayBuffer::JSCArrayBufferPrivate* retPrivData = new JSCArrayBuffer::JSCArrayBufferPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - long localBegin = (long)JSValueToNumber(ctx, arguments[0], exception); - - uscxml::ArrayBuffer* retVal = new uscxml::ArrayBuffer(privData->nativeObj->slice(localBegin)); - JSClassRef retClass = JSCArrayBuffer::getTmpl(); - - struct JSCArrayBuffer::JSCArrayBufferPrivate* retPrivData = new JSCArrayBuffer::JSCArrayBufferPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling slice"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCArrayBuffer::isViewCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCArrayBufferPrivate* privData = (struct JSCArrayBufferPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - true) { - void* localValue = JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)); - - bool retVal = privData->nativeObj->isView(localValue); - - JSValueRef jscRetVal = JSValueMakeBoolean(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling isView"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBuffer.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBuffer.h deleted file mode 100644 index cd2147f..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBuffer.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCArrayBuffer_h -#define JSCArrayBuffer_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCArrayBuffer { -public: - struct JSCArrayBufferPrivate { - JSCDOM* dom; - uscxml::ArrayBuffer* nativeObj; - }; - - JSC_DESTRUCTOR(JSCArrayBufferPrivate); - - static JSValueRef md5Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef base64Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef sliceCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef isViewCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - static JSObjectRef jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - static JSValueRef byteLengthAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef mimeTypeAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static bool mimeTypeAttrSetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef value, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "ArrayBuffer"; - classDef.callAsConstructor = jsConstructor; - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCArrayBuffer_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBufferView.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBufferView.cpp deleted file mode 100644 index ad567e8..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBufferView.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCArrayBuffer.h" -#include "JSCArrayBufferView.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCArrayBufferView::Tmpl; - -JSStaticValue JSCArrayBufferView::staticValues[] = { - { "buffer", bufferAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "byteOffset", byteOffsetAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "byteLength", byteLengthAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCArrayBufferView::staticFunctions[] = { - { 0, 0, 0 } -}; - -JSValueRef JSCArrayBufferView::bufferAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCArrayBufferViewPrivate* privData = (struct JSCArrayBufferViewPrivate*)JSObjectGetPrivate(object); - - if (!privData->nativeObj->getBuffer()) return JSValueMakeUndefined(ctx); - uscxml::ArrayBuffer* arabicaRet = new uscxml::ArrayBuffer(privData->nativeObj->getBuffer()); - - JSClassRef arbaicaRetClass = JSCArrayBuffer::getTmpl(); - - struct JSCArrayBuffer::JSCArrayBufferPrivate* retPrivData = new JSCArrayBuffer::JSCArrayBufferPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arabicaRet; - - JSObjectRef arbaicaRetObj = JSObjectMake(ctx, arbaicaRetClass, retPrivData); - return arbaicaRetObj; -} - - -JSValueRef JSCArrayBufferView::byteOffsetAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCArrayBufferViewPrivate* privData = (struct JSCArrayBufferViewPrivate*)JSObjectGetPrivate(object); - - return JSValueMakeNumber(ctx, privData->nativeObj->getByteOffset()); -} - - -JSValueRef JSCArrayBufferView::byteLengthAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCArrayBufferViewPrivate* privData = (struct JSCArrayBufferViewPrivate*)JSObjectGetPrivate(object); - - return JSValueMakeNumber(ctx, privData->nativeObj->getByteLength()); -} - - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBufferView.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBufferView.h deleted file mode 100644 index a6910a1..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCArrayBufferView.h +++ /dev/null @@ -1,71 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCArrayBufferView_h -#define JSCArrayBufferView_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCArrayBufferView { -public: - struct JSCArrayBufferViewPrivate { - JSCDOM* dom; - uscxml::ArrayBufferView* nativeObj; - }; - - JSC_DESTRUCTOR(JSCArrayBufferViewPrivate); - - - static JSValueRef bufferAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef byteOffsetAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef byteLengthAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "ArrayBufferView"; - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCArrayBufferView_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCAttr.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCAttr.cpp deleted file mode 100644 index 31349cb..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCAttr.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCAttr.h" -#include "JSCElement.h" -#include "JSCNode.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCAttr::Tmpl; - -JSStaticValue JSCAttr::staticValues[] = { - { "name", nameAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "specified", specifiedAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "value", valueAttrGetter, valueAttrSetter, kJSPropertyAttributeDontDelete }, - { "ownerElement", ownerElementAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCAttr::staticFunctions[] = { - { 0, 0, 0 } -}; - -JSValueRef JSCAttr::nameAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCAttrPrivate* privData = (struct JSCAttrPrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getName().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -JSValueRef JSCAttr::specifiedAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCAttrPrivate* privData = (struct JSCAttrPrivate*)JSObjectGetPrivate(object); - - return JSValueMakeBoolean(ctx, privData->nativeObj->getSpecified()); -} - - -JSValueRef JSCAttr::valueAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCAttrPrivate* privData = (struct JSCAttrPrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getValue().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -bool JSCAttr::valueAttrSetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) { - struct JSCAttrPrivate* privData = (struct JSCAttrPrivate*)JSObjectGetPrivate(thisObj); - - JSStringRef stringReflocalValue = JSValueToStringCopy(ctx, value, exception); - size_t localValueMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalValue); - char* localValueBuffer = new char[localValueMaxSize]; - JSStringGetUTF8CString(stringReflocalValue, localValueBuffer, localValueMaxSize); - std::string localValue(localValueBuffer); - JSStringRelease(stringReflocalValue); - free(localValueBuffer); - - privData->nativeObj->setValue(localValue); - return true; -} - -JSValueRef JSCAttr::ownerElementAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCAttrPrivate* privData = (struct JSCAttrPrivate*)JSObjectGetPrivate(object); - - if (!privData->nativeObj->getOwnerElement()) return JSValueMakeUndefined(ctx); - Arabica::DOM::Element<std::string>* arabicaRet = new Arabica::DOM::Element<std::string>(privData->nativeObj->getOwnerElement()); - - JSClassRef arbaicaRetClass = JSCElement::getTmpl(); - - struct JSCElement::JSCElementPrivate* retPrivData = new JSCElement::JSCElementPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arabicaRet; - - JSObjectRef arbaicaRetObj = JSObjectMake(ctx, arbaicaRetClass, retPrivData); - return arbaicaRetObj; -} - - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCAttr.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCAttr.h deleted file mode 100644 index adcb6bc..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCAttr.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCAttr_h -#define JSCAttr_h - -#include <string> -#include "DOM/Node.hpp" -#include "JSCNode.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCAttr { -public: - struct JSCAttrPrivate { - JSCDOM* dom; - Arabica::DOM::Attr<std::string>* nativeObj; - }; - - JSC_DESTRUCTOR(JSCAttrPrivate); - - - static JSValueRef nameAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef specifiedAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef valueAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static bool valueAttrSetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef value, JSValueRef* exception); - static JSValueRef ownerElementAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "Attr"; - classDef.parentClass = JSCNode::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCAttr_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCDATASection.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCDATASection.cpp deleted file mode 100644 index 3969a92..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCDATASection.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCCDATASection.h" -#include "JSCText.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCCDATASection::Tmpl; - -JSStaticValue JSCCDATASection::staticValues[] = { - - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCCDATASection::staticFunctions[] = { - { 0, 0, 0 } -}; - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCDATASection.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCDATASection.h deleted file mode 100644 index 32ef4bc..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCDATASection.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCCDATASection_h -#define JSCCDATASection_h - -#include <string> -#include "DOM/Node.hpp" -#include "JSCText.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCCDATASection { -public: - struct JSCCDATASectionPrivate { - JSCDOM* dom; - Arabica::DOM::CDATASection<std::string>* nativeObj; - }; - - JSC_DESTRUCTOR(JSCCDATASectionPrivate); - - - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "CDATASection"; - classDef.parentClass = JSCText::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCCDATASection_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCharacterData.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCharacterData.cpp deleted file mode 100644 index cfb1720..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCharacterData.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCCharacterData.h" -#include "JSCNode.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCCharacterData::Tmpl; - -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 object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCCharacterDataPrivate* privData = (struct JSCCharacterDataPrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getData().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -bool JSCCharacterData::dataAttrSetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) { - struct JSCCharacterDataPrivate* privData = (struct JSCCharacterDataPrivate*)JSObjectGetPrivate(thisObj); - - JSStringRef stringReflocalData = JSValueToStringCopy(ctx, value, exception); - size_t localDataMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalData); - char* localDataBuffer = new char[localDataMaxSize]; - JSStringGetUTF8CString(stringReflocalData, localDataBuffer, localDataMaxSize); - std::string localData(localDataBuffer); - JSStringRelease(stringReflocalData); - free(localDataBuffer); - - privData->nativeObj->setData(localData); - return true; -} - -JSValueRef JSCCharacterData::lengthAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCCharacterDataPrivate* privData = (struct JSCCharacterDataPrivate*)JSObjectGetPrivate(object); - - return JSValueMakeNumber(ctx, privData->nativeObj->getLength()); -} - - -JSValueRef JSCCharacterData::substringDataCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCCharacterDataPrivate* privData = (struct JSCCharacterDataPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - unsigned long localCount = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - std::string retVal = privData->nativeObj->substringData(localOffset, localCount); - - JSStringRef jscString = JSStringCreateWithUTF8CString(retVal.c_str()); - JSValueRef jscRetVal = JSValueMakeString(ctx, jscString); - JSStringRelease(jscString); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling substringData"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCCharacterData::appendDataCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCCharacterDataPrivate* privData = (struct JSCCharacterDataPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsString(ctx, arguments[0])) { - JSStringRef stringReflocalArg = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localArgMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalArg); - char* localArgBuffer = new char[localArgMaxSize]; - JSStringGetUTF8CString(stringReflocalArg, localArgBuffer, localArgMaxSize); - std::string localArg(localArgBuffer); - JSStringRelease(stringReflocalArg); - free(localArgBuffer); - - - privData->nativeObj->appendData(localArg); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling appendData"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCCharacterData::insertDataCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCCharacterDataPrivate* privData = (struct JSCCharacterDataPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1])) { - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - JSStringRef stringReflocalArg = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localArgMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalArg); - char* localArgBuffer = new char[localArgMaxSize]; - JSStringGetUTF8CString(stringReflocalArg, localArgBuffer, localArgMaxSize); - std::string localArg(localArgBuffer); - JSStringRelease(stringReflocalArg); - free(localArgBuffer); - - - privData->nativeObj->insertData(localOffset, localArg); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling insertData"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCCharacterData::deleteDataCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCCharacterDataPrivate* privData = (struct JSCCharacterDataPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - unsigned long localCount = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->deleteData(localOffset, localCount); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling deleteData"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCCharacterData::replaceDataCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCCharacterDataPrivate* privData = (struct JSCCharacterDataPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 3 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1]) && - JSValueIsString(ctx, arguments[2])) { - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - unsigned long localCount = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - JSStringRef stringReflocalArg = JSValueToStringCopy(ctx, arguments[2], exception); - size_t localArgMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalArg); - char* localArgBuffer = new char[localArgMaxSize]; - JSStringGetUTF8CString(stringReflocalArg, localArgBuffer, localArgMaxSize); - std::string localArg(localArgBuffer); - JSStringRelease(stringReflocalArg); - free(localArgBuffer); - - - privData->nativeObj->replaceData(localOffset, localCount, localArg); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling replaceData"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCharacterData.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCharacterData.h deleted file mode 100644 index b351fa2..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCCharacterData.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCCharacterData_h -#define JSCCharacterData_h - -#include <string> -#include "DOM/Node.hpp" -#include "JSCNode.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCCharacterData { -public: - struct JSCCharacterDataPrivate { - JSCDOM* dom; - Arabica::DOM::CharacterData<std::string>* nativeObj; - }; - - JSC_DESTRUCTOR(JSCCharacterDataPrivate); - - static JSValueRef substringDataCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef appendDataCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef insertDataCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef deleteDataCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef replaceDataCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - static JSValueRef dataAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static bool dataAttrSetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef value, JSValueRef* exception); - static JSValueRef lengthAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "CharacterData"; - classDef.parentClass = JSCNode::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCCharacterData_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCComment.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCComment.cpp deleted file mode 100644 index c8ae170..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCComment.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCCharacterData.h" -#include "JSCComment.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCComment::Tmpl; - -JSStaticValue JSCComment::staticValues[] = { - - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCComment::staticFunctions[] = { - { 0, 0, 0 } -}; - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCComment.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCComment.h deleted file mode 100644 index 38a7822..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCComment.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCComment_h -#define JSCComment_h - -#include <string> -#include "DOM/Node.hpp" -#include "JSCCharacterData.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCComment { -public: - struct JSCCommentPrivate { - JSCDOM* dom; - Arabica::DOM::Comment<std::string>* nativeObj; - }; - - JSC_DESTRUCTOR(JSCCommentPrivate); - - - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "Comment"; - classDef.parentClass = JSCCharacterData::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCComment_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDOMImplementation.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDOMImplementation.cpp deleted file mode 100644 index 7bdca82..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDOMImplementation.cpp +++ /dev/null @@ -1,177 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCDOMImplementation.h" -#include "JSCDocument.h" -#include "JSCDocumentType.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCDOMImplementation::Tmpl; - -JSStaticValue JSCDOMImplementation::staticValues[] = { - - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCDOMImplementation::staticFunctions[] = { - { "hasFeature", hasFeatureCallback, kJSPropertyAttributeDontDelete }, - { "createDocumentType", createDocumentTypeCallback, kJSPropertyAttributeDontDelete }, - { "createDocument", createDocumentCallback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSValueRef JSCDOMImplementation::hasFeatureCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDOMImplementationPrivate* privData = (struct JSCDOMImplementationPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsString(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1])) { - JSStringRef stringReflocalFeature = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localFeatureMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalFeature); - char* localFeatureBuffer = new char[localFeatureMaxSize]; - JSStringGetUTF8CString(stringReflocalFeature, localFeatureBuffer, localFeatureMaxSize); - std::string localFeature(localFeatureBuffer); - JSStringRelease(stringReflocalFeature); - free(localFeatureBuffer); - - JSStringRef stringReflocalVersion = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localVersionMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalVersion); - char* localVersionBuffer = new char[localVersionMaxSize]; - JSStringGetUTF8CString(stringReflocalVersion, localVersionBuffer, localVersionMaxSize); - std::string localVersion(localVersionBuffer); - JSStringRelease(stringReflocalVersion); - free(localVersionBuffer); - - - bool retVal = privData->nativeObj->hasFeature(localFeature, localVersion); - - JSValueRef jscRetVal = JSValueMakeBoolean(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling hasFeature"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDOMImplementation::createDocumentTypeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDOMImplementationPrivate* privData = (struct JSCDOMImplementationPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 3 && - JSValueIsString(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1]) && - JSValueIsString(ctx, arguments[2])) { - JSStringRef stringReflocalQualifiedName = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localQualifiedNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalQualifiedName); - char* localQualifiedNameBuffer = new char[localQualifiedNameMaxSize]; - JSStringGetUTF8CString(stringReflocalQualifiedName, localQualifiedNameBuffer, localQualifiedNameMaxSize); - std::string localQualifiedName(localQualifiedNameBuffer); - JSStringRelease(stringReflocalQualifiedName); - free(localQualifiedNameBuffer); - - JSStringRef stringReflocalPublicId = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localPublicIdMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalPublicId); - char* localPublicIdBuffer = new char[localPublicIdMaxSize]; - JSStringGetUTF8CString(stringReflocalPublicId, localPublicIdBuffer, localPublicIdMaxSize); - std::string localPublicId(localPublicIdBuffer); - JSStringRelease(stringReflocalPublicId); - free(localPublicIdBuffer); - - JSStringRef stringReflocalSystemId = JSValueToStringCopy(ctx, arguments[2], exception); - size_t localSystemIdMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalSystemId); - char* localSystemIdBuffer = new char[localSystemIdMaxSize]; - JSStringGetUTF8CString(stringReflocalSystemId, localSystemIdBuffer, localSystemIdMaxSize); - std::string localSystemId(localSystemIdBuffer); - JSStringRelease(stringReflocalSystemId); - free(localSystemIdBuffer); - - - Arabica::DOM::DocumentType<std::string>* retVal = new Arabica::DOM::DocumentType<std::string>(privData->nativeObj->createDocumentType(localQualifiedName, localPublicId, localSystemId)); - JSClassRef retClass = JSCDocumentType::getTmpl(); - - struct JSCDocumentType::JSCDocumentTypePrivate* retPrivData = new JSCDocumentType::JSCDocumentTypePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling createDocumentType"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDOMImplementation::createDocumentCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDOMImplementationPrivate* privData = (struct JSCDOMImplementationPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 3 && - JSValueIsString(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1]) && - JSValueIsObject(ctx, arguments[2]) && JSValueIsObjectOfClass(ctx, arguments[2], JSCDocumentType::getTmpl())) { - JSStringRef stringReflocalNamespaceURI = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNamespaceURIMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalNamespaceURI); - char* localNamespaceURIBuffer = new char[localNamespaceURIMaxSize]; - JSStringGetUTF8CString(stringReflocalNamespaceURI, localNamespaceURIBuffer, localNamespaceURIMaxSize); - std::string localNamespaceURI(localNamespaceURIBuffer); - JSStringRelease(stringReflocalNamespaceURI); - free(localNamespaceURIBuffer); - - JSStringRef stringReflocalQualifiedName = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localQualifiedNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalQualifiedName); - char* localQualifiedNameBuffer = new char[localQualifiedNameMaxSize]; - JSStringGetUTF8CString(stringReflocalQualifiedName, localQualifiedNameBuffer, localQualifiedNameMaxSize); - std::string localQualifiedName(localQualifiedNameBuffer); - JSStringRelease(stringReflocalQualifiedName); - free(localQualifiedNameBuffer); - - Arabica::DOM::DocumentType<std::string>* localDoctype = ((struct JSCDocumentType::JSCDocumentTypePrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[2], exception)))->nativeObj; - - Arabica::DOM::Document<std::string>* retVal = new Arabica::DOM::Document<std::string>(privData->nativeObj->createDocument(localNamespaceURI, localQualifiedName, *localDoctype)); - JSClassRef retClass = JSCDocument::getTmpl(); - - struct JSCDocument::JSCDocumentPrivate* retPrivData = new JSCDocument::JSCDocumentPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling createDocument"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDOMImplementation.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDOMImplementation.h deleted file mode 100644 index 4c39d93..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDOMImplementation.h +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCDOMImplementation_h -#define JSCDOMImplementation_h - -#include <string> -#include "DOM/Node.hpp" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCDOMImplementation { -public: - struct JSCDOMImplementationPrivate { - JSCDOM* dom; - Arabica::DOM::DOMImplementation<std::string>* nativeObj; - }; - - JSC_DESTRUCTOR(JSCDOMImplementationPrivate); - - static JSValueRef hasFeatureCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef createDocumentTypeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef createDocumentCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "DOMImplementation"; - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCDOMImplementation_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDataView.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDataView.cpp deleted file mode 100644 index 958a2fe..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDataView.cpp +++ /dev/null @@ -1,583 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCArrayBuffer.h" -#include "JSCArrayBufferView.h" -#include "JSCDataView.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCDataView::Tmpl; - -JSStaticValue JSCDataView::staticValues[] = { - - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCDataView::staticFunctions[] = { - { "getInt8", getInt8Callback, kJSPropertyAttributeDontDelete }, - { "getUint8", getUint8Callback, kJSPropertyAttributeDontDelete }, - { "getInt16", getInt16Callback, kJSPropertyAttributeDontDelete }, - { "getUint16", getUint16Callback, kJSPropertyAttributeDontDelete }, - { "getInt32", getInt32Callback, kJSPropertyAttributeDontDelete }, - { "getUint32", getUint32Callback, kJSPropertyAttributeDontDelete }, - { "getFloat32", getFloat32Callback, kJSPropertyAttributeDontDelete }, - { "getFloat64", getFloat64Callback, kJSPropertyAttributeDontDelete }, - { "setInt8", setInt8Callback, kJSPropertyAttributeDontDelete }, - { "setUint8", setUint8Callback, kJSPropertyAttributeDontDelete }, - { "setInt16", setInt16Callback, kJSPropertyAttributeDontDelete }, - { "setUint16", setUint16Callback, kJSPropertyAttributeDontDelete }, - { "setInt32", setInt32Callback, kJSPropertyAttributeDontDelete }, - { "setUint32", setUint32Callback, kJSPropertyAttributeDontDelete }, - { "setFloat32", setFloat32Callback, kJSPropertyAttributeDontDelete }, - { "setFloat64", setFloat64Callback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSObjectRef JSCDataView::jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - uscxml::DataView* localInstance = NULL; - - if (false) { - } else if (argumentCount == 3 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl()) && - JSValueIsNumber(ctx, arguments[1]) && - JSValueIsNumber(ctx, arguments[2])) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - unsigned long localByteLength = (unsigned long)JSValueToNumber(ctx, arguments[2], exception); - localInstance = new uscxml::DataView(localBuffer, localByteOffset, localByteLength); - - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl()) && - JSValueIsNumber(ctx, arguments[1])) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - localInstance = new uscxml::DataView(localBuffer, localByteOffset); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl())) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - localInstance = new uscxml::DataView(localBuffer); - - } - if (!localInstance) { - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling constructor for DataView"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return (JSObjectRef)JSValueMakeNull(ctx); - } - - JSClassRef retClass = JSCDataView::getTmpl(); - - struct JSCDataView::JSCDataViewPrivate* retPrivData = new JSCDataView::JSCDataViewPrivate(); - retPrivData->nativeObj = localInstance; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - return retObj; -} - -JSValueRef JSCDataView::getInt8Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDataViewPrivate* privData = (struct JSCDataViewPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - char retVal = privData->nativeObj->getInt8(localByteOffset); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling getInt8"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDataView::getUint8Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDataViewPrivate* privData = (struct JSCDataViewPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - unsigned char retVal = privData->nativeObj->getUint8(localByteOffset); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling getUint8"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDataView::getInt16Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDataViewPrivate* privData = (struct JSCDataViewPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsBoolean(ctx, arguments[1])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - bool localLittleEndian = JSValueToBoolean(ctx, arguments[1]); - - short retVal = privData->nativeObj->getInt16(localByteOffset, localLittleEndian); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - short retVal = privData->nativeObj->getInt16(localByteOffset); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling getInt16"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDataView::getUint16Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDataViewPrivate* privData = (struct JSCDataViewPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsBoolean(ctx, arguments[1])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - bool localLittleEndian = JSValueToBoolean(ctx, arguments[1]); - - unsigned short retVal = privData->nativeObj->getUint16(localByteOffset, localLittleEndian); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - unsigned short retVal = privData->nativeObj->getUint16(localByteOffset); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling getUint16"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDataView::getInt32Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDataViewPrivate* privData = (struct JSCDataViewPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsBoolean(ctx, arguments[1])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - bool localLittleEndian = JSValueToBoolean(ctx, arguments[1]); - - long retVal = privData->nativeObj->getInt32(localByteOffset, localLittleEndian); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - long retVal = privData->nativeObj->getInt32(localByteOffset); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling getInt32"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDataView::getUint32Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDataViewPrivate* privData = (struct JSCDataViewPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsBoolean(ctx, arguments[1])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - bool localLittleEndian = JSValueToBoolean(ctx, arguments[1]); - - unsigned long retVal = privData->nativeObj->getUint32(localByteOffset, localLittleEndian); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - unsigned long retVal = privData->nativeObj->getUint32(localByteOffset); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling getUint32"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDataView::getFloat32Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDataViewPrivate* privData = (struct JSCDataViewPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsBoolean(ctx, arguments[1])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - bool localLittleEndian = JSValueToBoolean(ctx, arguments[1]); - - float retVal = privData->nativeObj->getFloat32(localByteOffset, localLittleEndian); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - float retVal = privData->nativeObj->getFloat32(localByteOffset); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling getFloat32"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDataView::getFloat64Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDataViewPrivate* privData = (struct JSCDataViewPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsBoolean(ctx, arguments[1])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - bool localLittleEndian = JSValueToBoolean(ctx, arguments[1]); - - double retVal = privData->nativeObj->getFloat64(localByteOffset, localLittleEndian); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - double retVal = privData->nativeObj->getFloat64(localByteOffset); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling getFloat64"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDataView::setInt8Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDataViewPrivate* privData = (struct JSCDataViewPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - char localValue = (char)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->setInt8(localByteOffset, localValue); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling setInt8"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDataView::setUint8Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDataViewPrivate* privData = (struct JSCDataViewPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - unsigned char localValue = (unsigned char)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->setUint8(localByteOffset, localValue); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling setUint8"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDataView::setInt16Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDataViewPrivate* privData = (struct JSCDataViewPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 3 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1]) && - JSValueIsBoolean(ctx, arguments[2])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - short localValue = (short)JSValueToNumber(ctx, arguments[1], exception); - bool localLittleEndian = JSValueToBoolean(ctx, arguments[2]); - - privData->nativeObj->setInt16(localByteOffset, localValue, localLittleEndian); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - short localValue = (short)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->setInt16(localByteOffset, localValue); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling setInt16"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDataView::setUint16Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDataViewPrivate* privData = (struct JSCDataViewPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 3 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1]) && - JSValueIsBoolean(ctx, arguments[2])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - unsigned short localValue = (unsigned short)JSValueToNumber(ctx, arguments[1], exception); - bool localLittleEndian = JSValueToBoolean(ctx, arguments[2]); - - privData->nativeObj->setUint16(localByteOffset, localValue, localLittleEndian); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - unsigned short localValue = (unsigned short)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->setUint16(localByteOffset, localValue); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling setUint16"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDataView::setInt32Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDataViewPrivate* privData = (struct JSCDataViewPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 3 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1]) && - JSValueIsBoolean(ctx, arguments[2])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - long localValue = (long)JSValueToNumber(ctx, arguments[1], exception); - bool localLittleEndian = JSValueToBoolean(ctx, arguments[2]); - - privData->nativeObj->setInt32(localByteOffset, localValue, localLittleEndian); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - long localValue = (long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->setInt32(localByteOffset, localValue); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling setInt32"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDataView::setUint32Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDataViewPrivate* privData = (struct JSCDataViewPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 3 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1]) && - JSValueIsBoolean(ctx, arguments[2])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - unsigned long localValue = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - bool localLittleEndian = JSValueToBoolean(ctx, arguments[2]); - - privData->nativeObj->setUint32(localByteOffset, localValue, localLittleEndian); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - unsigned long localValue = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->setUint32(localByteOffset, localValue); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling setUint32"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDataView::setFloat32Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDataViewPrivate* privData = (struct JSCDataViewPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 3 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1]) && - JSValueIsBoolean(ctx, arguments[2])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - float localValue = (float)JSValueToNumber(ctx, arguments[1], exception); - bool localLittleEndian = JSValueToBoolean(ctx, arguments[2]); - - privData->nativeObj->setFloat32(localByteOffset, localValue, localLittleEndian); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - float localValue = (float)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->setFloat32(localByteOffset, localValue); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling setFloat32"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDataView::setFloat64Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDataViewPrivate* privData = (struct JSCDataViewPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 3 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1]) && - JSValueIsBoolean(ctx, arguments[2])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - double localValue = (double)JSValueToNumber(ctx, arguments[1], exception); - bool localLittleEndian = JSValueToBoolean(ctx, arguments[2]); - - privData->nativeObj->setFloat64(localByteOffset, localValue, localLittleEndian); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - double localValue = (double)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->setFloat64(localByteOffset, localValue); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling setFloat64"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDataView.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDataView.h deleted file mode 100644 index 6593068..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDataView.h +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCDataView_h -#define JSCDataView_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "JSCArrayBufferView.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCDataView { -public: - struct JSCDataViewPrivate { - JSCDOM* dom; - uscxml::DataView* nativeObj; - }; - - JSC_DESTRUCTOR(JSCDataViewPrivate); - - static JSValueRef getInt8Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef getUint8Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef getInt16Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef getUint16Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef getInt32Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef getUint32Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef getFloat32Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef getFloat64Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setInt8Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setUint8Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setInt16Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setUint16Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setInt32Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setUint32Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setFloat32Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setFloat64Callback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - static JSObjectRef jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "DataView"; - classDef.callAsConstructor = jsConstructor; - classDef.parentClass = JSCArrayBufferView::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCDataView_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.cpp deleted file mode 100644 index 795ad70..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.cpp +++ /dev/null @@ -1,542 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCAttr.h" -#include "JSCCDATASection.h" -#include "JSCComment.h" -#include "JSCDOMImplementation.h" -#include "JSCDocument.h" -#include "JSCDocumentFragment.h" -#include "JSCDocumentType.h" -#include "JSCElement.h" -#include "JSCEntityReference.h" -#include "JSCNode.h" -#include "JSCNodeList.h" -#include "JSCProcessingInstruction.h" -#include "JSCText.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCDocument::Tmpl; - -JSStaticValue JSCDocument::staticValues[] = { - { "doctype", doctypeAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "implementation", implementationAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "documentElement", documentElementAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "localStorage", localStorageCustomAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCDocument::staticFunctions[] = { - { "createElement", createElementCallback, kJSPropertyAttributeDontDelete }, - { "createDocumentFragment", createDocumentFragmentCallback, kJSPropertyAttributeDontDelete }, - { "createTextNode", createTextNodeCallback, kJSPropertyAttributeDontDelete }, - { "createComment", createCommentCallback, kJSPropertyAttributeDontDelete }, - { "createCDATASection", createCDATASectionCallback, kJSPropertyAttributeDontDelete }, - { "createProcessingInstruction", createProcessingInstructionCallback, kJSPropertyAttributeDontDelete }, - { "createAttribute", createAttributeCallback, kJSPropertyAttributeDontDelete }, - { "createEntityReference", createEntityReferenceCallback, kJSPropertyAttributeDontDelete }, - { "getElementsByTagName", getElementsByTagNameCallback, kJSPropertyAttributeDontDelete }, - { "importNode", importNodeCallback, kJSPropertyAttributeDontDelete }, - { "createElementNS", createElementNSCustomCallback, kJSPropertyAttributeDontDelete }, - { "createAttributeNS", createAttributeNSCustomCallback, kJSPropertyAttributeDontDelete }, - { "getElementsByTagNameNS", getElementsByTagNameNSCallback, kJSPropertyAttributeDontDelete }, - { "getElementById", getElementByIdCallback, kJSPropertyAttributeDontDelete }, - { "evaluate", evaluateCustomCallback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSValueRef JSCDocument::doctypeAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(object); - - if (!privData->nativeObj->getDoctype()) return JSValueMakeUndefined(ctx); - Arabica::DOM::DocumentType<std::string>* arabicaRet = new Arabica::DOM::DocumentType<std::string>(privData->nativeObj->getDoctype()); - - JSClassRef arbaicaRetClass = JSCDocumentType::getTmpl(); - - struct JSCDocumentType::JSCDocumentTypePrivate* retPrivData = new JSCDocumentType::JSCDocumentTypePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arabicaRet; - - JSObjectRef arbaicaRetObj = JSObjectMake(ctx, arbaicaRetClass, retPrivData); - return arbaicaRetObj; -} - - -JSValueRef JSCDocument::implementationAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(object); - - if (!privData->nativeObj->getImplementation()) return JSValueMakeUndefined(ctx); - Arabica::DOM::DOMImplementation<std::string>* arabicaRet = new Arabica::DOM::DOMImplementation<std::string>(privData->nativeObj->getImplementation()); - - JSClassRef arbaicaRetClass = JSCDOMImplementation::getTmpl(); - - struct JSCDOMImplementation::JSCDOMImplementationPrivate* retPrivData = new JSCDOMImplementation::JSCDOMImplementationPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arabicaRet; - - JSObjectRef arbaicaRetObj = JSObjectMake(ctx, arbaicaRetClass, retPrivData); - return arbaicaRetObj; -} - - -JSValueRef JSCDocument::documentElementAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(object); - - if (!privData->nativeObj->getDocumentElement()) return JSValueMakeUndefined(ctx); - Arabica::DOM::Element<std::string>* arabicaRet = new Arabica::DOM::Element<std::string>(privData->nativeObj->getDocumentElement()); - - JSClassRef arbaicaRetClass = JSCElement::getTmpl(); - - struct JSCElement::JSCElementPrivate* retPrivData = new JSCElement::JSCElementPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arabicaRet; - - JSObjectRef arbaicaRetObj = JSObjectMake(ctx, arbaicaRetClass, retPrivData); - return arbaicaRetObj; -} - - -JSValueRef JSCDocument::createElementCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsString(ctx, arguments[0])) { - JSStringRef stringReflocalTagName = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localTagNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalTagName); - char* localTagNameBuffer = new char[localTagNameMaxSize]; - JSStringGetUTF8CString(stringReflocalTagName, localTagNameBuffer, localTagNameMaxSize); - std::string localTagName(localTagNameBuffer); - JSStringRelease(stringReflocalTagName); - free(localTagNameBuffer); - - - Arabica::DOM::Element<std::string>* retVal = new Arabica::DOM::Element<std::string>(privData->nativeObj->createElement(localTagName)); - JSClassRef retClass = JSCElement::getTmpl(); - - struct JSCElement::JSCElementPrivate* retPrivData = new JSCElement::JSCElementPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling createElement"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDocument::createDocumentFragmentCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 0) { - - Arabica::DOM::DocumentFragment<std::string>* retVal = new Arabica::DOM::DocumentFragment<std::string>(privData->nativeObj->createDocumentFragment()); - JSClassRef retClass = JSCDocumentFragment::getTmpl(); - - struct JSCDocumentFragment::JSCDocumentFragmentPrivate* retPrivData = new JSCDocumentFragment::JSCDocumentFragmentPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling createDocumentFragment"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDocument::createTextNodeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsString(ctx, arguments[0])) { - JSStringRef stringReflocalData = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localDataMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalData); - char* localDataBuffer = new char[localDataMaxSize]; - JSStringGetUTF8CString(stringReflocalData, localDataBuffer, localDataMaxSize); - std::string localData(localDataBuffer); - JSStringRelease(stringReflocalData); - free(localDataBuffer); - - - Arabica::DOM::Text<std::string>* retVal = new Arabica::DOM::Text<std::string>(privData->nativeObj->createTextNode(localData)); - JSClassRef retClass = JSCText::getTmpl(); - - struct JSCText::JSCTextPrivate* retPrivData = new JSCText::JSCTextPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling createTextNode"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDocument::createCommentCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsString(ctx, arguments[0])) { - JSStringRef stringReflocalData = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localDataMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalData); - char* localDataBuffer = new char[localDataMaxSize]; - JSStringGetUTF8CString(stringReflocalData, localDataBuffer, localDataMaxSize); - std::string localData(localDataBuffer); - JSStringRelease(stringReflocalData); - free(localDataBuffer); - - - Arabica::DOM::Comment<std::string>* retVal = new Arabica::DOM::Comment<std::string>(privData->nativeObj->createComment(localData)); - JSClassRef retClass = JSCComment::getTmpl(); - - struct JSCComment::JSCCommentPrivate* retPrivData = new JSCComment::JSCCommentPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling createComment"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDocument::createCDATASectionCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsString(ctx, arguments[0])) { - JSStringRef stringReflocalData = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localDataMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalData); - char* localDataBuffer = new char[localDataMaxSize]; - JSStringGetUTF8CString(stringReflocalData, localDataBuffer, localDataMaxSize); - std::string localData(localDataBuffer); - JSStringRelease(stringReflocalData); - free(localDataBuffer); - - - Arabica::DOM::CDATASection<std::string>* retVal = new Arabica::DOM::CDATASection<std::string>(privData->nativeObj->createCDATASection(localData)); - JSClassRef retClass = JSCCDATASection::getTmpl(); - - struct JSCCDATASection::JSCCDATASectionPrivate* retPrivData = new JSCCDATASection::JSCCDATASectionPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling createCDATASection"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDocument::createProcessingInstructionCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsString(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1])) { - JSStringRef stringReflocalTarget = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localTargetMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalTarget); - char* localTargetBuffer = new char[localTargetMaxSize]; - JSStringGetUTF8CString(stringReflocalTarget, localTargetBuffer, localTargetMaxSize); - std::string localTarget(localTargetBuffer); - JSStringRelease(stringReflocalTarget); - free(localTargetBuffer); - - JSStringRef stringReflocalData = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localDataMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalData); - char* localDataBuffer = new char[localDataMaxSize]; - JSStringGetUTF8CString(stringReflocalData, localDataBuffer, localDataMaxSize); - std::string localData(localDataBuffer); - JSStringRelease(stringReflocalData); - free(localDataBuffer); - - - Arabica::DOM::ProcessingInstruction<std::string>* retVal = new Arabica::DOM::ProcessingInstruction<std::string>(privData->nativeObj->createProcessingInstruction(localTarget, localData)); - JSClassRef retClass = JSCProcessingInstruction::getTmpl(); - - struct JSCProcessingInstruction::JSCProcessingInstructionPrivate* retPrivData = new JSCProcessingInstruction::JSCProcessingInstructionPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling createProcessingInstruction"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDocument::createAttributeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsString(ctx, arguments[0])) { - JSStringRef stringReflocalName = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalName); - char* localNameBuffer = new char[localNameMaxSize]; - JSStringGetUTF8CString(stringReflocalName, localNameBuffer, localNameMaxSize); - std::string localName(localNameBuffer); - JSStringRelease(stringReflocalName); - free(localNameBuffer); - - - Arabica::DOM::Attr<std::string>* retVal = new Arabica::DOM::Attr<std::string>(privData->nativeObj->createAttribute(localName)); - JSClassRef retClass = JSCAttr::getTmpl(); - - struct JSCAttr::JSCAttrPrivate* retPrivData = new JSCAttr::JSCAttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling createAttribute"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDocument::createEntityReferenceCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsString(ctx, arguments[0])) { - JSStringRef stringReflocalName = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalName); - char* localNameBuffer = new char[localNameMaxSize]; - JSStringGetUTF8CString(stringReflocalName, localNameBuffer, localNameMaxSize); - std::string localName(localNameBuffer); - JSStringRelease(stringReflocalName); - free(localNameBuffer); - - - Arabica::DOM::EntityReference<std::string>* retVal = new Arabica::DOM::EntityReference<std::string>(privData->nativeObj->createEntityReference(localName)); - JSClassRef retClass = JSCEntityReference::getTmpl(); - - struct JSCEntityReference::JSCEntityReferencePrivate* retPrivData = new JSCEntityReference::JSCEntityReferencePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling createEntityReference"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDocument::getElementsByTagNameCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsString(ctx, arguments[0])) { - JSStringRef stringReflocalTagname = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localTagnameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalTagname); - char* localTagnameBuffer = new char[localTagnameMaxSize]; - JSStringGetUTF8CString(stringReflocalTagname, localTagnameBuffer, localTagnameMaxSize); - std::string localTagname(localTagnameBuffer); - JSStringRelease(stringReflocalTagname); - free(localTagnameBuffer); - - - Arabica::DOM::NodeList<std::string>* retVal = new Arabica::DOM::NodeList<std::string>(privData->nativeObj->getElementsByTagName(localTagname)); - JSClassRef retClass = JSCNodeList::getTmpl(); - - struct JSCNodeList::JSCNodeListPrivate* retPrivData = new JSCNodeList::JSCNodeListPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling getElementsByTagName"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDocument::importNodeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCNode::getTmpl()) && - JSValueIsBoolean(ctx, arguments[1])) { - Arabica::DOM::Node<std::string>* localImportedNode = ((struct JSCNode::JSCNodePrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - bool localDeep = JSValueToBoolean(ctx, arguments[1]); - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->importNode(*localImportedNode, localDeep)); - JSClassRef retClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling importNode"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDocument::getElementsByTagNameNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsString(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1])) { - JSStringRef stringReflocalNamespaceURI = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNamespaceURIMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalNamespaceURI); - char* localNamespaceURIBuffer = new char[localNamespaceURIMaxSize]; - JSStringGetUTF8CString(stringReflocalNamespaceURI, localNamespaceURIBuffer, localNamespaceURIMaxSize); - std::string localNamespaceURI(localNamespaceURIBuffer); - JSStringRelease(stringReflocalNamespaceURI); - free(localNamespaceURIBuffer); - - JSStringRef stringReflocalLocalName = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localLocalNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalLocalName); - char* localLocalNameBuffer = new char[localLocalNameMaxSize]; - JSStringGetUTF8CString(stringReflocalLocalName, localLocalNameBuffer, localLocalNameMaxSize); - std::string localLocalName(localLocalNameBuffer); - JSStringRelease(stringReflocalLocalName); - free(localLocalNameBuffer); - - - Arabica::DOM::NodeList<std::string>* retVal = new Arabica::DOM::NodeList<std::string>(privData->nativeObj->getElementsByTagNameNS(localNamespaceURI, localLocalName)); - JSClassRef retClass = JSCNodeList::getTmpl(); - - struct JSCNodeList::JSCNodeListPrivate* retPrivData = new JSCNodeList::JSCNodeListPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling getElementsByTagNameNS"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDocument::getElementByIdCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsString(ctx, arguments[0])) { - JSStringRef stringReflocalElementId = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localElementIdMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalElementId); - char* localElementIdBuffer = new char[localElementIdMaxSize]; - JSStringGetUTF8CString(stringReflocalElementId, localElementIdBuffer, localElementIdMaxSize); - std::string localElementId(localElementIdBuffer); - JSStringRelease(stringReflocalElementId); - free(localElementIdBuffer); - - - Arabica::DOM::Element<std::string>* retVal = new Arabica::DOM::Element<std::string>(privData->nativeObj->getElementById(localElementId)); - JSClassRef retClass = JSCElement::getTmpl(); - - struct JSCElement::JSCElementPrivate* retPrivData = new JSCElement::JSCElementPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling getElementById"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.h deleted file mode 100644 index 1b300fb..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocument.h +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCDocument_h -#define JSCDocument_h - -#include <string> -#include "DOM/Node.hpp" -#include "JSCNode.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCDocument { -public: - struct JSCDocumentPrivate { - JSCDOM* dom; - Arabica::DOM::Document<std::string>* nativeObj; - }; - - JSC_DESTRUCTOR(JSCDocumentPrivate); - - static JSValueRef createElementCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef createDocumentFragmentCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef createTextNodeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef createCommentCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef createCDATASectionCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef createProcessingInstructionCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef createAttributeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef createEntityReferenceCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef getElementsByTagNameCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef importNodeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef createElementNSCustomCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef createAttributeNSCustomCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef getElementsByTagNameNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef getElementByIdCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef evaluateCustomCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - static JSValueRef doctypeAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef implementationAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef documentElementAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef localStorageCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "Document"; - classDef.parentClass = JSCNode::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCDocument_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentCustom.cpp deleted file mode 100644 index a6d194f..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentCustom.cpp +++ /dev/null @@ -1,248 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "JSCDocument.h" -#include "JSCElement.h" -#include "JSCAttr.h" -#include "JSCStorage.h" -#include "JSCXPathResult.h" -#include "JSCNode.h" -#include <XPath/XPath.hpp> -#include <DOM/io/Stream.hpp> - -namespace Arabica { -namespace DOM { - -JSValueRef JSCDocument::localStorageCustomAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(object); - - if (!privData->dom->storage) { - return JSValueMakeUndefined(ctx); - } - - JSClassRef retClass = JSCStorage::getTmpl(); - struct JSCStorage::JSCStoragePrivate* retPrivData = new JSCStorage::JSCStoragePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retPrivData->dom->storage; - - JSObjectRef arbaicaRetObj = JSObjectMake(ctx, retClass, retPrivData); - return arbaicaRetObj; - -} - - -JSValueRef JSCDocument::evaluateCustomCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef object, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(object); - - if (!privData->dom || !privData->dom->xpath) return JSValueMakeUndefined(ctx); - if (argumentCount < 1) { - std::string errorMsg = "Wrong number of arguments in evaluate"; - JSStringRef string = JSStringCreateWithUTF8CString(errorMsg.c_str()); - JSValueRef exceptionString = JSValueMakeString(ctx, string); - JSStringRelease(string); - *exception = JSValueToObject(ctx, exceptionString, NULL); - return JSValueMakeUndefined(ctx); - } - - // make sure first argument is a string - if (!JSValueIsString(ctx, arguments[0])) { - std::string errorMsg = "Expected xpath expression as first argument"; - JSStringRef string = JSStringCreateWithUTF8CString(errorMsg.c_str()); - JSValueRef exceptionString = JSValueMakeString(ctx, string); - JSStringRelease(string); - *exception = JSValueToObject(ctx, exceptionString, NULL); - return JSValueMakeUndefined(ctx); - } - - JSStringRef stringReflocalXPath = JSValueToStringCopy(ctx, arguments[0], NULL); - size_t localXPathMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalXPath); - char* localXPathBuffer = new char[localXPathMaxSize]; - JSStringGetUTF8CString(stringReflocalXPath, localXPathBuffer, localXPathMaxSize); - std::string localXPath(localXPathBuffer); - JSStringRelease(stringReflocalXPath); - free(localXPathBuffer); - - JSClassRef arbaicaRetClass = JSCXPathResult::getTmpl(); - - XPath::XPathValue<std::string>* retVal; - - try { - if (argumentCount > 1) { - // make sure second argument is a node - if (!JSValueIsObject(ctx, arguments[1])) { - std::string errorMsg = "Second argument is not of type node"; - JSStringRef string = JSStringCreateWithUTF8CString(errorMsg.c_str()); - JSValueRef exceptionString = JSValueMakeString(ctx, string); - JSStringRelease(string); - *exception = JSValueToObject(ctx, exceptionString, NULL); - return JSValueMakeUndefined(ctx); - } - -// Arabica::DOM::Node<std::string>* localContextNode = (Arabica::DOM::Node<std::string>*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[1], NULL)); - JSCNode::JSCNodePrivate* otherNodePrivate = (JSCNode::JSCNodePrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[1], NULL)); - Arabica::DOM::Node<std::string>* localContextNode = otherNodePrivate->nativeObj; - -// std::cout << *localContextNode << std::endl; -// std::cout << ">>" << privData->dom->xpath->evaluate("//note/@importance", *localContextNode).asString() << "<<" << std::endl; - - retVal = new XPath::XPathValue<std::string>(privData->dom->xpath->evaluate(localXPath, *localContextNode)); - } else { - retVal = new XPath::XPathValue<std::string>(privData->dom->xpath->evaluate(localXPath, *privData->nativeObj)); - } - } catch (std::runtime_error e) { - std::cout << e.what() << std::endl; - return JSValueMakeUndefined(ctx); - } - - struct JSCXPathResult::JSCXPathResultPrivate* retPrivData = new JSCXPathResult::JSCXPathResultPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef arbaicaRetObj = JSObjectMake(ctx, arbaicaRetClass, retPrivData); - return arbaicaRetObj; - -#if 0 - if (args.Length() < 1) - throw V8Exception("Wrong number of arguments in evaluate"); -// if (!((V8Node::hasInstance(args[1])) && (V8XPathResult::hasInstance(args[3])))) -// throw V8Exception("Parameter mismatch while calling evaluate"); - - v8::Local<v8::Object> self = args.Holder(); - V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - - v8::String::AsciiValue localExpression(args[0]); - - XPath::XPathValue<std::string>* retVal; - if (args.Length() > 1) { - Arabica::DOM::Node<std::string>* localContextNode = V8DOM::toClassPtr<Arabica::DOM::Node<std::string> >(args[1]->ToObject()->GetInternalField(0)); - retVal = new XPath::XPathValue<std::string>(privData->dom->xpath->evaluate(*localExpression, *localContextNode)); - } else { - retVal = new XPath::XPathValue<std::string>(privData->dom->xpath->evaluate(*localExpression, *privData->nativeObj)); - } - - v8::Handle<v8::Function> retCtor = V8XPathResult::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - V8XPathResult::V8XPathResultPrivate* retPrivData = new V8XPathResult::V8XPathResultPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8XPathResult::jsDestructor); - return retObj; -#endif -} - -JSValueRef JSCDocument::createElementNSCustomCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsString(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1])) { - JSStringRef stringReflocalNamespaceURI = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNamespaceURIMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalNamespaceURI); - char* localNamespaceURIBuffer = new char[localNamespaceURIMaxSize]; - JSStringGetUTF8CString(stringReflocalNamespaceURI, localNamespaceURIBuffer, localNamespaceURIMaxSize); - std::string localNamespaceURI(localNamespaceURIBuffer); - JSStringRelease(stringReflocalNamespaceURI); - free(localNamespaceURIBuffer); - - JSStringRef stringReflocalQualifiedName = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localQualifiedNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalQualifiedName); - char* localQualifiedNameBuffer = new char[localQualifiedNameMaxSize]; - JSStringGetUTF8CString(stringReflocalQualifiedName, localQualifiedNameBuffer, localQualifiedNameMaxSize); - std::string localQualifiedName(localQualifiedNameBuffer); - JSStringRelease(stringReflocalQualifiedName); - free(localQualifiedNameBuffer); - - - Arabica::DOM::Element<std::string>* retVal = new Arabica::DOM::Element<std::string>(privData->nativeObj->createElementNS(localNamespaceURI, localQualifiedName)); - if (privData->dom->nsInfo->nsToPrefix.find(localNamespaceURI) != privData->dom->nsInfo->nsToPrefix.end()) - retVal->setPrefix(privData->dom->nsInfo->nsToPrefix[localNamespaceURI]); - - JSClassRef retClass = JSCElement::getTmpl(); - - struct JSCElement::JSCElementPrivate* retPrivData = new JSCElement::JSCElementPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling createElementNS"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCDocument::createAttributeNSCustomCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsString(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1])) { - JSStringRef stringReflocalNamespaceURI = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNamespaceURIMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalNamespaceURI); - char* localNamespaceURIBuffer = new char[localNamespaceURIMaxSize]; - JSStringGetUTF8CString(stringReflocalNamespaceURI, localNamespaceURIBuffer, localNamespaceURIMaxSize); - std::string localNamespaceURI(localNamespaceURIBuffer); - JSStringRelease(stringReflocalNamespaceURI); - free(localNamespaceURIBuffer); - - JSStringRef stringReflocalQualifiedName = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localQualifiedNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalQualifiedName); - char* localQualifiedNameBuffer = new char[localQualifiedNameMaxSize]; - JSStringGetUTF8CString(stringReflocalQualifiedName, localQualifiedNameBuffer, localQualifiedNameMaxSize); - std::string localQualifiedName(localQualifiedNameBuffer); - JSStringRelease(stringReflocalQualifiedName); - free(localQualifiedNameBuffer); - - - Arabica::DOM::Attr<std::string>* retVal = new Arabica::DOM::Attr<std::string>(privData->nativeObj->createAttributeNS(localNamespaceURI, localQualifiedName)); - if (privData->dom->nsInfo->nsToPrefix.find(localNamespaceURI) != privData->dom->nsInfo->nsToPrefix.end()) - retVal->setPrefix(privData->dom->nsInfo->nsToPrefix[localNamespaceURI]); - - JSClassRef retClass = JSCAttr::getTmpl(); - - struct JSCAttr::JSCAttrPrivate* retPrivData = new JSCAttr::JSCAttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling createAttributeNS"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -}
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentFragment.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentFragment.cpp deleted file mode 100644 index d52c923..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentFragment.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCDocumentFragment.h" -#include "JSCNode.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCDocumentFragment::Tmpl; - -JSStaticValue JSCDocumentFragment::staticValues[] = { - - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCDocumentFragment::staticFunctions[] = { - { 0, 0, 0 } -}; - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentFragment.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentFragment.h deleted file mode 100644 index 6beed81..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentFragment.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCDocumentFragment_h -#define JSCDocumentFragment_h - -#include <string> -#include "DOM/Node.hpp" -#include "JSCNode.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCDocumentFragment { -public: - struct JSCDocumentFragmentPrivate { - JSCDOM* dom; - Arabica::DOM::DocumentFragment<std::string>* nativeObj; - }; - - JSC_DESTRUCTOR(JSCDocumentFragmentPrivate); - - - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "DocumentFragment"; - classDef.parentClass = JSCNode::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCDocumentFragment_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentType.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentType.cpp deleted file mode 100644 index 1c75dcd..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentType.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCDocumentType.h" -#include "JSCNamedNodeMap.h" -#include "JSCNode.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCDocumentType::Tmpl; - -JSStaticValue JSCDocumentType::staticValues[] = { - { "name", nameAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "entities", entitiesAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "notations", notationsAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "publicId", publicIdAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "systemId", systemIdAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "internalSubset", internalSubsetAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCDocumentType::staticFunctions[] = { - { 0, 0, 0 } -}; - -JSValueRef JSCDocumentType::nameAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCDocumentTypePrivate* privData = (struct JSCDocumentTypePrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getName().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -JSValueRef JSCDocumentType::entitiesAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCDocumentTypePrivate* privData = (struct JSCDocumentTypePrivate*)JSObjectGetPrivate(object); - - - Arabica::DOM::NamedNodeMap<std::string>* arabicaRet = new Arabica::DOM::NamedNodeMap<std::string>(privData->nativeObj->getEntities()); - - JSClassRef arbaicaRetClass = JSCNamedNodeMap::getTmpl(); - - struct JSCNamedNodeMap::JSCNamedNodeMapPrivate* retPrivData = new JSCNamedNodeMap::JSCNamedNodeMapPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arabicaRet; - - JSObjectRef arbaicaRetObj = JSObjectMake(ctx, arbaicaRetClass, retPrivData); - return arbaicaRetObj; -} - - -JSValueRef JSCDocumentType::notationsAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCDocumentTypePrivate* privData = (struct JSCDocumentTypePrivate*)JSObjectGetPrivate(object); - - - Arabica::DOM::NamedNodeMap<std::string>* arabicaRet = new Arabica::DOM::NamedNodeMap<std::string>(privData->nativeObj->getNotations()); - - JSClassRef arbaicaRetClass = JSCNamedNodeMap::getTmpl(); - - struct JSCNamedNodeMap::JSCNamedNodeMapPrivate* retPrivData = new JSCNamedNodeMap::JSCNamedNodeMapPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arabicaRet; - - JSObjectRef arbaicaRetObj = JSObjectMake(ctx, arbaicaRetClass, retPrivData); - return arbaicaRetObj; -} - - -JSValueRef JSCDocumentType::publicIdAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCDocumentTypePrivate* privData = (struct JSCDocumentTypePrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getPublicId().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -JSValueRef JSCDocumentType::systemIdAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCDocumentTypePrivate* privData = (struct JSCDocumentTypePrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getSystemId().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -JSValueRef JSCDocumentType::internalSubsetAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCDocumentTypePrivate* privData = (struct JSCDocumentTypePrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getInternalSubset().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentType.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentType.h deleted file mode 100644 index d2077cf..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentType.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCDocumentType_h -#define JSCDocumentType_h - -#include <string> -#include "DOM/Node.hpp" -#include "JSCNode.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCDocumentType { -public: - struct JSCDocumentTypePrivate { - JSCDOM* dom; - Arabica::DOM::DocumentType<std::string>* nativeObj; - }; - - JSC_DESTRUCTOR(JSCDocumentTypePrivate); - - - static JSValueRef nameAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef entitiesAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef notationsAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef publicIdAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef systemIdAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef internalSubsetAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "DocumentType"; - classDef.parentClass = JSCNode::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCDocumentType_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCElement.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCElement.cpp deleted file mode 100644 index 33f6f70..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCElement.cpp +++ /dev/null @@ -1,589 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCAttr.h" -#include "JSCElement.h" -#include "JSCNode.h" -#include "JSCNodeList.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCElement::Tmpl; - -JSStaticValue JSCElement::staticValues[] = { - { "tagName", tagNameAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCElement::staticFunctions[] = { - { "getAttribute", getAttributeCallback, kJSPropertyAttributeDontDelete }, - { "setAttribute", setAttributeCallback, kJSPropertyAttributeDontDelete }, - { "removeAttribute", removeAttributeCallback, kJSPropertyAttributeDontDelete }, - { "getAttributeNode", getAttributeNodeCallback, kJSPropertyAttributeDontDelete }, - { "setAttributeNode", setAttributeNodeCallback, kJSPropertyAttributeDontDelete }, - { "removeAttributeNode", removeAttributeNodeCallback, kJSPropertyAttributeDontDelete }, - { "getElementsByTagName", getElementsByTagNameCallback, kJSPropertyAttributeDontDelete }, - { "getAttributeNS", getAttributeNSCallback, kJSPropertyAttributeDontDelete }, - { "setAttributeNS", setAttributeNSCallback, kJSPropertyAttributeDontDelete }, - { "removeAttributeNS", removeAttributeNSCallback, kJSPropertyAttributeDontDelete }, - { "getAttributeNodeNS", getAttributeNodeNSCallback, kJSPropertyAttributeDontDelete }, - { "setAttributeNodeNS", setAttributeNodeNSCallback, kJSPropertyAttributeDontDelete }, - { "getElementsByTagNameNS", getElementsByTagNameNSCallback, kJSPropertyAttributeDontDelete }, - { "hasAttribute", hasAttributeCallback, kJSPropertyAttributeDontDelete }, - { "hasAttributeNS", hasAttributeNSCallback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSValueRef JSCElement::tagNameAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCElementPrivate* privData = (struct JSCElementPrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getTagName().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -JSValueRef JSCElement::getAttributeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCElementPrivate* privData = (struct JSCElementPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsString(ctx, arguments[0])) { - JSStringRef stringReflocalName = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalName); - char* localNameBuffer = new char[localNameMaxSize]; - JSStringGetUTF8CString(stringReflocalName, localNameBuffer, localNameMaxSize); - std::string localName(localNameBuffer); - JSStringRelease(stringReflocalName); - free(localNameBuffer); - - - std::string retVal = privData->nativeObj->getAttribute(localName); - - JSStringRef jscString = JSStringCreateWithUTF8CString(retVal.c_str()); - JSValueRef jscRetVal = JSValueMakeString(ctx, jscString); - JSStringRelease(jscString); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling getAttribute"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCElement::setAttributeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCElementPrivate* privData = (struct JSCElementPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsString(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1])) { - JSStringRef stringReflocalName = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalName); - char* localNameBuffer = new char[localNameMaxSize]; - JSStringGetUTF8CString(stringReflocalName, localNameBuffer, localNameMaxSize); - std::string localName(localNameBuffer); - JSStringRelease(stringReflocalName); - free(localNameBuffer); - - JSStringRef stringReflocalValue = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localValueMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalValue); - char* localValueBuffer = new char[localValueMaxSize]; - JSStringGetUTF8CString(stringReflocalValue, localValueBuffer, localValueMaxSize); - std::string localValue(localValueBuffer); - JSStringRelease(stringReflocalValue); - free(localValueBuffer); - - - privData->nativeObj->setAttribute(localName, localValue); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling setAttribute"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCElement::removeAttributeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCElementPrivate* privData = (struct JSCElementPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsString(ctx, arguments[0])) { - JSStringRef stringReflocalName = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalName); - char* localNameBuffer = new char[localNameMaxSize]; - JSStringGetUTF8CString(stringReflocalName, localNameBuffer, localNameMaxSize); - std::string localName(localNameBuffer); - JSStringRelease(stringReflocalName); - free(localNameBuffer); - - - privData->nativeObj->removeAttribute(localName); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling removeAttribute"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCElement::getAttributeNodeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCElementPrivate* privData = (struct JSCElementPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsString(ctx, arguments[0])) { - JSStringRef stringReflocalName = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalName); - char* localNameBuffer = new char[localNameMaxSize]; - JSStringGetUTF8CString(stringReflocalName, localNameBuffer, localNameMaxSize); - std::string localName(localNameBuffer); - JSStringRelease(stringReflocalName); - free(localNameBuffer); - - - Arabica::DOM::Attr<std::string>* retVal = new Arabica::DOM::Attr<std::string>(privData->nativeObj->getAttributeNode(localName)); - JSClassRef retClass = JSCAttr::getTmpl(); - - struct JSCAttr::JSCAttrPrivate* retPrivData = new JSCAttr::JSCAttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling getAttributeNode"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCElement::setAttributeNodeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCElementPrivate* privData = (struct JSCElementPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCAttr::getTmpl())) { - Arabica::DOM::Attr<std::string>* localNewAttr = ((struct JSCAttr::JSCAttrPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - - Arabica::DOM::Attr<std::string>* retVal = new Arabica::DOM::Attr<std::string>(privData->nativeObj->setAttributeNode(*localNewAttr)); - JSClassRef retClass = JSCAttr::getTmpl(); - - struct JSCAttr::JSCAttrPrivate* retPrivData = new JSCAttr::JSCAttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling setAttributeNode"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCElement::removeAttributeNodeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCElementPrivate* privData = (struct JSCElementPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCAttr::getTmpl())) { - Arabica::DOM::Attr<std::string>* localOldAttr = ((struct JSCAttr::JSCAttrPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - - Arabica::DOM::Attr<std::string>* retVal = new Arabica::DOM::Attr<std::string>(privData->nativeObj->removeAttributeNode(*localOldAttr)); - JSClassRef retClass = JSCAttr::getTmpl(); - - struct JSCAttr::JSCAttrPrivate* retPrivData = new JSCAttr::JSCAttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling removeAttributeNode"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCElement::getElementsByTagNameCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCElementPrivate* privData = (struct JSCElementPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsString(ctx, arguments[0])) { - JSStringRef stringReflocalName = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalName); - char* localNameBuffer = new char[localNameMaxSize]; - JSStringGetUTF8CString(stringReflocalName, localNameBuffer, localNameMaxSize); - std::string localName(localNameBuffer); - JSStringRelease(stringReflocalName); - free(localNameBuffer); - - - Arabica::DOM::NodeList<std::string>* retVal = new Arabica::DOM::NodeList<std::string>(privData->nativeObj->getElementsByTagName(localName)); - JSClassRef retClass = JSCNodeList::getTmpl(); - - struct JSCNodeList::JSCNodeListPrivate* retPrivData = new JSCNodeList::JSCNodeListPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling getElementsByTagName"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCElement::getAttributeNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCElementPrivate* privData = (struct JSCElementPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsString(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1])) { - JSStringRef stringReflocalNamespaceURI = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNamespaceURIMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalNamespaceURI); - char* localNamespaceURIBuffer = new char[localNamespaceURIMaxSize]; - JSStringGetUTF8CString(stringReflocalNamespaceURI, localNamespaceURIBuffer, localNamespaceURIMaxSize); - std::string localNamespaceURI(localNamespaceURIBuffer); - JSStringRelease(stringReflocalNamespaceURI); - free(localNamespaceURIBuffer); - - JSStringRef stringReflocalLocalName = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localLocalNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalLocalName); - char* localLocalNameBuffer = new char[localLocalNameMaxSize]; - JSStringGetUTF8CString(stringReflocalLocalName, localLocalNameBuffer, localLocalNameMaxSize); - std::string localLocalName(localLocalNameBuffer); - JSStringRelease(stringReflocalLocalName); - free(localLocalNameBuffer); - - - std::string retVal = privData->nativeObj->getAttributeNS(localNamespaceURI, localLocalName); - - JSStringRef jscString = JSStringCreateWithUTF8CString(retVal.c_str()); - JSValueRef jscRetVal = JSValueMakeString(ctx, jscString); - JSStringRelease(jscString); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling getAttributeNS"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCElement::setAttributeNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCElementPrivate* privData = (struct JSCElementPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 3 && - JSValueIsString(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1]) && - JSValueIsString(ctx, arguments[2])) { - JSStringRef stringReflocalNamespaceURI = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNamespaceURIMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalNamespaceURI); - char* localNamespaceURIBuffer = new char[localNamespaceURIMaxSize]; - JSStringGetUTF8CString(stringReflocalNamespaceURI, localNamespaceURIBuffer, localNamespaceURIMaxSize); - std::string localNamespaceURI(localNamespaceURIBuffer); - JSStringRelease(stringReflocalNamespaceURI); - free(localNamespaceURIBuffer); - - JSStringRef stringReflocalQualifiedName = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localQualifiedNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalQualifiedName); - char* localQualifiedNameBuffer = new char[localQualifiedNameMaxSize]; - JSStringGetUTF8CString(stringReflocalQualifiedName, localQualifiedNameBuffer, localQualifiedNameMaxSize); - std::string localQualifiedName(localQualifiedNameBuffer); - JSStringRelease(stringReflocalQualifiedName); - free(localQualifiedNameBuffer); - - JSStringRef stringReflocalValue = JSValueToStringCopy(ctx, arguments[2], exception); - size_t localValueMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalValue); - char* localValueBuffer = new char[localValueMaxSize]; - JSStringGetUTF8CString(stringReflocalValue, localValueBuffer, localValueMaxSize); - std::string localValue(localValueBuffer); - JSStringRelease(stringReflocalValue); - free(localValueBuffer); - - - privData->nativeObj->setAttributeNS(localNamespaceURI, localQualifiedName, localValue); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling setAttributeNS"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCElement::removeAttributeNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCElementPrivate* privData = (struct JSCElementPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsString(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1])) { - JSStringRef stringReflocalNamespaceURI = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNamespaceURIMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalNamespaceURI); - char* localNamespaceURIBuffer = new char[localNamespaceURIMaxSize]; - JSStringGetUTF8CString(stringReflocalNamespaceURI, localNamespaceURIBuffer, localNamespaceURIMaxSize); - std::string localNamespaceURI(localNamespaceURIBuffer); - JSStringRelease(stringReflocalNamespaceURI); - free(localNamespaceURIBuffer); - - JSStringRef stringReflocalLocalName = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localLocalNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalLocalName); - char* localLocalNameBuffer = new char[localLocalNameMaxSize]; - JSStringGetUTF8CString(stringReflocalLocalName, localLocalNameBuffer, localLocalNameMaxSize); - std::string localLocalName(localLocalNameBuffer); - JSStringRelease(stringReflocalLocalName); - free(localLocalNameBuffer); - - - privData->nativeObj->removeAttributeNS(localNamespaceURI, localLocalName); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling removeAttributeNS"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCElement::getAttributeNodeNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCElementPrivate* privData = (struct JSCElementPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsString(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1])) { - JSStringRef stringReflocalNamespaceURI = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNamespaceURIMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalNamespaceURI); - char* localNamespaceURIBuffer = new char[localNamespaceURIMaxSize]; - JSStringGetUTF8CString(stringReflocalNamespaceURI, localNamespaceURIBuffer, localNamespaceURIMaxSize); - std::string localNamespaceURI(localNamespaceURIBuffer); - JSStringRelease(stringReflocalNamespaceURI); - free(localNamespaceURIBuffer); - - JSStringRef stringReflocalLocalName = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localLocalNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalLocalName); - char* localLocalNameBuffer = new char[localLocalNameMaxSize]; - JSStringGetUTF8CString(stringReflocalLocalName, localLocalNameBuffer, localLocalNameMaxSize); - std::string localLocalName(localLocalNameBuffer); - JSStringRelease(stringReflocalLocalName); - free(localLocalNameBuffer); - - - Arabica::DOM::Attr<std::string>* retVal = new Arabica::DOM::Attr<std::string>(privData->nativeObj->getAttributeNodeNS(localNamespaceURI, localLocalName)); - JSClassRef retClass = JSCAttr::getTmpl(); - - struct JSCAttr::JSCAttrPrivate* retPrivData = new JSCAttr::JSCAttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling getAttributeNodeNS"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCElement::setAttributeNodeNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCElementPrivate* privData = (struct JSCElementPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCAttr::getTmpl())) { - Arabica::DOM::Attr<std::string>* localNewAttr = ((struct JSCAttr::JSCAttrPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - - Arabica::DOM::Attr<std::string>* retVal = new Arabica::DOM::Attr<std::string>(privData->nativeObj->setAttributeNodeNS(*localNewAttr)); - JSClassRef retClass = JSCAttr::getTmpl(); - - struct JSCAttr::JSCAttrPrivate* retPrivData = new JSCAttr::JSCAttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling setAttributeNodeNS"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCElement::getElementsByTagNameNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCElementPrivate* privData = (struct JSCElementPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsString(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1])) { - JSStringRef stringReflocalNamespaceURI = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNamespaceURIMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalNamespaceURI); - char* localNamespaceURIBuffer = new char[localNamespaceURIMaxSize]; - JSStringGetUTF8CString(stringReflocalNamespaceURI, localNamespaceURIBuffer, localNamespaceURIMaxSize); - std::string localNamespaceURI(localNamespaceURIBuffer); - JSStringRelease(stringReflocalNamespaceURI); - free(localNamespaceURIBuffer); - - JSStringRef stringReflocalLocalName = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localLocalNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalLocalName); - char* localLocalNameBuffer = new char[localLocalNameMaxSize]; - JSStringGetUTF8CString(stringReflocalLocalName, localLocalNameBuffer, localLocalNameMaxSize); - std::string localLocalName(localLocalNameBuffer); - JSStringRelease(stringReflocalLocalName); - free(localLocalNameBuffer); - - - Arabica::DOM::NodeList<std::string>* retVal = new Arabica::DOM::NodeList<std::string>(privData->nativeObj->getElementsByTagNameNS(localNamespaceURI, localLocalName)); - JSClassRef retClass = JSCNodeList::getTmpl(); - - struct JSCNodeList::JSCNodeListPrivate* retPrivData = new JSCNodeList::JSCNodeListPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling getElementsByTagNameNS"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCElement::hasAttributeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCElementPrivate* privData = (struct JSCElementPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsString(ctx, arguments[0])) { - JSStringRef stringReflocalName = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalName); - char* localNameBuffer = new char[localNameMaxSize]; - JSStringGetUTF8CString(stringReflocalName, localNameBuffer, localNameMaxSize); - std::string localName(localNameBuffer); - JSStringRelease(stringReflocalName); - free(localNameBuffer); - - - bool retVal = privData->nativeObj->hasAttribute(localName); - - JSValueRef jscRetVal = JSValueMakeBoolean(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling hasAttribute"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCElement::hasAttributeNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCElementPrivate* privData = (struct JSCElementPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsString(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1])) { - JSStringRef stringReflocalNamespaceURI = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNamespaceURIMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalNamespaceURI); - char* localNamespaceURIBuffer = new char[localNamespaceURIMaxSize]; - JSStringGetUTF8CString(stringReflocalNamespaceURI, localNamespaceURIBuffer, localNamespaceURIMaxSize); - std::string localNamespaceURI(localNamespaceURIBuffer); - JSStringRelease(stringReflocalNamespaceURI); - free(localNamespaceURIBuffer); - - JSStringRef stringReflocalLocalName = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localLocalNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalLocalName); - char* localLocalNameBuffer = new char[localLocalNameMaxSize]; - JSStringGetUTF8CString(stringReflocalLocalName, localLocalNameBuffer, localLocalNameMaxSize); - std::string localLocalName(localLocalNameBuffer); - JSStringRelease(stringReflocalLocalName); - free(localLocalNameBuffer); - - - bool retVal = privData->nativeObj->hasAttributeNS(localNamespaceURI, localLocalName); - - JSValueRef jscRetVal = JSValueMakeBoolean(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling hasAttributeNS"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCElement.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCElement.h deleted file mode 100644 index eab3696..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCElement.h +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCElement_h -#define JSCElement_h - -#include <string> -#include "DOM/Node.hpp" -#include "JSCNode.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCElement { -public: - struct JSCElementPrivate { - JSCDOM* dom; - Arabica::DOM::Element<std::string>* nativeObj; - }; - - JSC_DESTRUCTOR(JSCElementPrivate); - - static JSValueRef getAttributeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setAttributeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef removeAttributeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef getAttributeNodeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setAttributeNodeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef removeAttributeNodeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef getElementsByTagNameCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef getAttributeNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setAttributeNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef removeAttributeNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef getAttributeNodeNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setAttributeNodeNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef getElementsByTagNameNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef hasAttributeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef hasAttributeNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - static JSValueRef tagNameAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "Element"; - classDef.parentClass = JSCNode::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCElement_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntity.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntity.cpp deleted file mode 100644 index 4dec699..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntity.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCEntity.h" -#include "JSCNode.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCEntity::Tmpl; - -JSStaticValue JSCEntity::staticValues[] = { - { "publicId", publicIdAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "systemId", systemIdAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "notationName", notationNameAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCEntity::staticFunctions[] = { - { 0, 0, 0 } -}; - -JSValueRef JSCEntity::publicIdAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCEntityPrivate* privData = (struct JSCEntityPrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getPublicId().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -JSValueRef JSCEntity::systemIdAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCEntityPrivate* privData = (struct JSCEntityPrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getSystemId().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -JSValueRef JSCEntity::notationNameAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCEntityPrivate* privData = (struct JSCEntityPrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getNotationName().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntity.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntity.h deleted file mode 100644 index c61510f..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntity.h +++ /dev/null @@ -1,72 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCEntity_h -#define JSCEntity_h - -#include <string> -#include "DOM/Node.hpp" -#include "JSCNode.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCEntity { -public: - struct JSCEntityPrivate { - JSCDOM* dom; - Arabica::DOM::Entity<std::string>* nativeObj; - }; - - JSC_DESTRUCTOR(JSCEntityPrivate); - - - static JSValueRef publicIdAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef systemIdAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef notationNameAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "Entity"; - classDef.parentClass = JSCNode::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCEntity_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntityReference.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntityReference.cpp deleted file mode 100644 index fe67b5d..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntityReference.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCEntityReference.h" -#include "JSCNode.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCEntityReference::Tmpl; - -JSStaticValue JSCEntityReference::staticValues[] = { - - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCEntityReference::staticFunctions[] = { - { 0, 0, 0 } -}; - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntityReference.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntityReference.h deleted file mode 100644 index 9ed8980..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCEntityReference.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCEntityReference_h -#define JSCEntityReference_h - -#include <string> -#include "DOM/Node.hpp" -#include "JSCNode.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCEntityReference { -public: - struct JSCEntityReferencePrivate { - JSCDOM* dom; - Arabica::DOM::EntityReference<std::string>* nativeObj; - }; - - JSC_DESTRUCTOR(JSCEntityReferencePrivate); - - - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "EntityReference"; - classDef.parentClass = JSCNode::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCEntityReference_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat32Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat32Array.cpp deleted file mode 100644 index 924f40f..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat32Array.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCArrayBuffer.h" -#include "JSCArrayBufferView.h" -#include "JSCFloat32Array.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCFloat32Array::Tmpl; - -JSStaticValue JSCFloat32Array::staticValues[] = { - { "length", lengthAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { "BYTES_PER_ELEMENT", BYTES_PER_ELEMENTConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCFloat32Array::staticFunctions[] = { - { "get", getCallback, kJSPropertyAttributeDontDelete }, - { "set", setCallback, kJSPropertyAttributeDontDelete }, - { "subarray", subarrayCallback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSObjectRef JSCFloat32Array::jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - uscxml::Float32Array* localInstance = NULL; - - if (false) { - } else if (argumentCount == 3 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl()) && - JSValueIsNumber(ctx, arguments[1]) && - JSValueIsNumber(ctx, arguments[2])) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - unsigned long localLength = (unsigned long)JSValueToNumber(ctx, arguments[2], exception); - localInstance = new uscxml::Float32Array(localBuffer, localByteOffset, localLength); - - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl()) && - JSValueIsNumber(ctx, arguments[1])) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - localInstance = new uscxml::Float32Array(localBuffer, localByteOffset); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCFloat32Array::getTmpl())) { - - uscxml::Float32Array* localArray = ((struct JSCFloat32Array::JSCFloat32ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - localInstance = new uscxml::Float32Array(localArray); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl())) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - localInstance = new uscxml::Float32Array(localBuffer); - - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - - unsigned long localLength = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - localInstance = new uscxml::Float32Array(localLength); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0])) { - - - std::vector<float> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - localInstance = new uscxml::Float32Array(localArray); - - } - if (!localInstance) { - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling constructor for Float32Array"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return (JSObjectRef)JSValueMakeNull(ctx); - } - - JSClassRef retClass = JSCFloat32Array::getTmpl(); - - struct JSCFloat32Array::JSCFloat32ArrayPrivate* retPrivData = new JSCFloat32Array::JSCFloat32ArrayPrivate(); - retPrivData->nativeObj = localInstance; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - return retObj; -} - -JSValueRef JSCFloat32Array::lengthAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCFloat32ArrayPrivate* privData = (struct JSCFloat32ArrayPrivate*)JSObjectGetPrivate(object); - - return JSValueMakeNumber(ctx, privData->nativeObj->getLength()); -} - -JSValueRef JSCFloat32Array::BYTES_PER_ELEMENTConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 4); -} - - -JSValueRef JSCFloat32Array::getCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCFloat32ArrayPrivate* privData = (struct JSCFloat32ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - float retVal = privData->nativeObj->get(localIndex); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling get"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCFloat32Array::setCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCFloat32ArrayPrivate* privData = (struct JSCFloat32ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCFloat32Array::getTmpl()) && - JSValueIsNumber(ctx, arguments[1])) { - uscxml::Float32Array* localArray = ((struct JSCFloat32Array::JSCFloat32ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localArray, localOffset); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - float localValue = (float)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localIndex, localValue); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - - std::vector<float> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localArray, localOffset); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCFloat32Array::getTmpl())) { - uscxml::Float32Array* localArray = ((struct JSCFloat32Array::JSCFloat32ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - - privData->nativeObj->set(localArray); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0])) { - - std::vector<float> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - - privData->nativeObj->set(localArray); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling set"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCFloat32Array::subarrayCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCFloat32ArrayPrivate* privData = (struct JSCFloat32ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - long localStart = (long)JSValueToNumber(ctx, arguments[0], exception); - long localEnd = (long)JSValueToNumber(ctx, arguments[1], exception); - - uscxml::Float32Array* retVal = new uscxml::Float32Array(privData->nativeObj->subarray(localStart, localEnd)); - JSClassRef retClass = JSCFloat32Array::getTmpl(); - - struct JSCFloat32Array::JSCFloat32ArrayPrivate* retPrivData = new JSCFloat32Array::JSCFloat32ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - long localStart = (long)JSValueToNumber(ctx, arguments[0], exception); - - uscxml::Float32Array* retVal = new uscxml::Float32Array(privData->nativeObj->subarray(localStart)); - JSClassRef retClass = JSCFloat32Array::getTmpl(); - - struct JSCFloat32Array::JSCFloat32ArrayPrivate* retPrivData = new JSCFloat32Array::JSCFloat32ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling subarray"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat32Array.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat32Array.h deleted file mode 100644 index 0e7bbf9..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat32Array.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCFloat32Array_h -#define JSCFloat32Array_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "JSCArrayBufferView.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCFloat32Array { -public: - struct JSCFloat32ArrayPrivate { - JSCDOM* dom; - uscxml::Float32Array* nativeObj; - }; - - JSC_DESTRUCTOR(JSCFloat32ArrayPrivate); - - static JSValueRef getCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef subarrayCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - static JSObjectRef jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - static JSValueRef lengthAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef BYTES_PER_ELEMENTConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static bool hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName); - static JSValueRef getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception); - static bool setPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "Float32Array"; - classDef.hasProperty = hasPropertyCustomCallback; - classDef.getProperty = getPropertyCustomCallback; - classDef.setProperty = setPropertyCustomCallback; - classDef.callAsConstructor = jsConstructor; - classDef.parentClass = JSCArrayBufferView::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCFloat32Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat64Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat64Array.cpp deleted file mode 100644 index a58bce9..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat64Array.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCArrayBuffer.h" -#include "JSCArrayBufferView.h" -#include "JSCFloat64Array.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCFloat64Array::Tmpl; - -JSStaticValue JSCFloat64Array::staticValues[] = { - { "length", lengthAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { "BYTES_PER_ELEMENT", BYTES_PER_ELEMENTConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCFloat64Array::staticFunctions[] = { - { "get", getCallback, kJSPropertyAttributeDontDelete }, - { "set", setCallback, kJSPropertyAttributeDontDelete }, - { "subarray", subarrayCallback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSObjectRef JSCFloat64Array::jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - uscxml::Float64Array* localInstance = NULL; - - if (false) { - } else if (argumentCount == 3 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl()) && - JSValueIsNumber(ctx, arguments[1]) && - JSValueIsNumber(ctx, arguments[2])) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - unsigned long localLength = (unsigned long)JSValueToNumber(ctx, arguments[2], exception); - localInstance = new uscxml::Float64Array(localBuffer, localByteOffset, localLength); - - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl()) && - JSValueIsNumber(ctx, arguments[1])) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - localInstance = new uscxml::Float64Array(localBuffer, localByteOffset); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCFloat64Array::getTmpl())) { - - uscxml::Float64Array* localArray = ((struct JSCFloat64Array::JSCFloat64ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - localInstance = new uscxml::Float64Array(localArray); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl())) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - localInstance = new uscxml::Float64Array(localBuffer); - - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - - unsigned long localLength = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - localInstance = new uscxml::Float64Array(localLength); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0])) { - - - std::vector<double> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - localInstance = new uscxml::Float64Array(localArray); - - } - if (!localInstance) { - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling constructor for Float64Array"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return (JSObjectRef)JSValueMakeNull(ctx); - } - - JSClassRef retClass = JSCFloat64Array::getTmpl(); - - struct JSCFloat64Array::JSCFloat64ArrayPrivate* retPrivData = new JSCFloat64Array::JSCFloat64ArrayPrivate(); - retPrivData->nativeObj = localInstance; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - return retObj; -} - -JSValueRef JSCFloat64Array::lengthAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCFloat64ArrayPrivate* privData = (struct JSCFloat64ArrayPrivate*)JSObjectGetPrivate(object); - - return JSValueMakeNumber(ctx, privData->nativeObj->getLength()); -} - -JSValueRef JSCFloat64Array::BYTES_PER_ELEMENTConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 8); -} - - -JSValueRef JSCFloat64Array::getCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCFloat64ArrayPrivate* privData = (struct JSCFloat64ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - double retVal = privData->nativeObj->get(localIndex); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling get"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCFloat64Array::setCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCFloat64ArrayPrivate* privData = (struct JSCFloat64ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCFloat64Array::getTmpl()) && - JSValueIsNumber(ctx, arguments[1])) { - uscxml::Float64Array* localArray = ((struct JSCFloat64Array::JSCFloat64ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localArray, localOffset); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - double localValue = (double)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localIndex, localValue); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - - std::vector<double> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localArray, localOffset); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCFloat64Array::getTmpl())) { - uscxml::Float64Array* localArray = ((struct JSCFloat64Array::JSCFloat64ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - - privData->nativeObj->set(localArray); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0])) { - - std::vector<double> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - - privData->nativeObj->set(localArray); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling set"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCFloat64Array::subarrayCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCFloat64ArrayPrivate* privData = (struct JSCFloat64ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - long localStart = (long)JSValueToNumber(ctx, arguments[0], exception); - long localEnd = (long)JSValueToNumber(ctx, arguments[1], exception); - - uscxml::Float64Array* retVal = new uscxml::Float64Array(privData->nativeObj->subarray(localStart, localEnd)); - JSClassRef retClass = JSCFloat64Array::getTmpl(); - - struct JSCFloat64Array::JSCFloat64ArrayPrivate* retPrivData = new JSCFloat64Array::JSCFloat64ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - long localStart = (long)JSValueToNumber(ctx, arguments[0], exception); - - uscxml::Float64Array* retVal = new uscxml::Float64Array(privData->nativeObj->subarray(localStart)); - JSClassRef retClass = JSCFloat64Array::getTmpl(); - - struct JSCFloat64Array::JSCFloat64ArrayPrivate* retPrivData = new JSCFloat64Array::JSCFloat64ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling subarray"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat64Array.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat64Array.h deleted file mode 100644 index 82f1f72..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCFloat64Array.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCFloat64Array_h -#define JSCFloat64Array_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "JSCArrayBufferView.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCFloat64Array { -public: - struct JSCFloat64ArrayPrivate { - JSCDOM* dom; - uscxml::Float64Array* nativeObj; - }; - - JSC_DESTRUCTOR(JSCFloat64ArrayPrivate); - - static JSValueRef getCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef subarrayCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - static JSObjectRef jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - static JSValueRef lengthAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef BYTES_PER_ELEMENTConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static bool hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName); - static JSValueRef getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception); - static bool setPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "Float64Array"; - classDef.hasProperty = hasPropertyCustomCallback; - classDef.getProperty = getPropertyCustomCallback; - classDef.setProperty = setPropertyCustomCallback; - classDef.callAsConstructor = jsConstructor; - classDef.parentClass = JSCArrayBufferView::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCFloat64Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt16Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt16Array.cpp deleted file mode 100644 index e887378..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt16Array.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCArrayBuffer.h" -#include "JSCArrayBufferView.h" -#include "JSCInt16Array.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCInt16Array::Tmpl; - -JSStaticValue JSCInt16Array::staticValues[] = { - { "length", lengthAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { "BYTES_PER_ELEMENT", BYTES_PER_ELEMENTConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCInt16Array::staticFunctions[] = { - { "get", getCallback, kJSPropertyAttributeDontDelete }, - { "set", setCallback, kJSPropertyAttributeDontDelete }, - { "subarray", subarrayCallback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSObjectRef JSCInt16Array::jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - uscxml::Int16Array* localInstance = NULL; - - if (false) { - } else if (argumentCount == 3 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl()) && - JSValueIsNumber(ctx, arguments[1]) && - JSValueIsNumber(ctx, arguments[2])) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - unsigned long localLength = (unsigned long)JSValueToNumber(ctx, arguments[2], exception); - localInstance = new uscxml::Int16Array(localBuffer, localByteOffset, localLength); - - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl()) && - JSValueIsNumber(ctx, arguments[1])) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - localInstance = new uscxml::Int16Array(localBuffer, localByteOffset); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCInt16Array::getTmpl())) { - - uscxml::Int16Array* localArray = ((struct JSCInt16Array::JSCInt16ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - localInstance = new uscxml::Int16Array(localArray); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl())) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - localInstance = new uscxml::Int16Array(localBuffer); - - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - - unsigned long localLength = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - localInstance = new uscxml::Int16Array(localLength); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0])) { - - - std::vector<short> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - localInstance = new uscxml::Int16Array(localArray); - - } - if (!localInstance) { - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling constructor for Int16Array"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return (JSObjectRef)JSValueMakeNull(ctx); - } - - JSClassRef retClass = JSCInt16Array::getTmpl(); - - struct JSCInt16Array::JSCInt16ArrayPrivate* retPrivData = new JSCInt16Array::JSCInt16ArrayPrivate(); - retPrivData->nativeObj = localInstance; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - return retObj; -} - -JSValueRef JSCInt16Array::lengthAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCInt16ArrayPrivate* privData = (struct JSCInt16ArrayPrivate*)JSObjectGetPrivate(object); - - return JSValueMakeNumber(ctx, privData->nativeObj->getLength()); -} - -JSValueRef JSCInt16Array::BYTES_PER_ELEMENTConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 2); -} - - -JSValueRef JSCInt16Array::getCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCInt16ArrayPrivate* privData = (struct JSCInt16ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - short retVal = privData->nativeObj->get(localIndex); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling get"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCInt16Array::setCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCInt16ArrayPrivate* privData = (struct JSCInt16ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCInt16Array::getTmpl()) && - JSValueIsNumber(ctx, arguments[1])) { - uscxml::Int16Array* localArray = ((struct JSCInt16Array::JSCInt16ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localArray, localOffset); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - short localValue = (short)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localIndex, localValue); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - - std::vector<short> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localArray, localOffset); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCInt16Array::getTmpl())) { - uscxml::Int16Array* localArray = ((struct JSCInt16Array::JSCInt16ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - - privData->nativeObj->set(localArray); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0])) { - - std::vector<short> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - - privData->nativeObj->set(localArray); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling set"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCInt16Array::subarrayCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCInt16ArrayPrivate* privData = (struct JSCInt16ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - long localStart = (long)JSValueToNumber(ctx, arguments[0], exception); - long localEnd = (long)JSValueToNumber(ctx, arguments[1], exception); - - uscxml::Int16Array* retVal = new uscxml::Int16Array(privData->nativeObj->subarray(localStart, localEnd)); - JSClassRef retClass = JSCInt16Array::getTmpl(); - - struct JSCInt16Array::JSCInt16ArrayPrivate* retPrivData = new JSCInt16Array::JSCInt16ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - long localStart = (long)JSValueToNumber(ctx, arguments[0], exception); - - uscxml::Int16Array* retVal = new uscxml::Int16Array(privData->nativeObj->subarray(localStart)); - JSClassRef retClass = JSCInt16Array::getTmpl(); - - struct JSCInt16Array::JSCInt16ArrayPrivate* retPrivData = new JSCInt16Array::JSCInt16ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling subarray"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt16Array.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt16Array.h deleted file mode 100644 index f56c7b9..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt16Array.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCInt16Array_h -#define JSCInt16Array_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "JSCArrayBufferView.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCInt16Array { -public: - struct JSCInt16ArrayPrivate { - JSCDOM* dom; - uscxml::Int16Array* nativeObj; - }; - - JSC_DESTRUCTOR(JSCInt16ArrayPrivate); - - static JSValueRef getCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef subarrayCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - static JSObjectRef jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - static JSValueRef lengthAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef BYTES_PER_ELEMENTConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static bool hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName); - static JSValueRef getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception); - static bool setPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "Int16Array"; - classDef.hasProperty = hasPropertyCustomCallback; - classDef.getProperty = getPropertyCustomCallback; - classDef.setProperty = setPropertyCustomCallback; - classDef.callAsConstructor = jsConstructor; - classDef.parentClass = JSCArrayBufferView::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCInt16Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt32Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt32Array.cpp deleted file mode 100644 index b868e9b..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt32Array.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCArrayBuffer.h" -#include "JSCArrayBufferView.h" -#include "JSCInt32Array.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCInt32Array::Tmpl; - -JSStaticValue JSCInt32Array::staticValues[] = { - { "length", lengthAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { "BYTES_PER_ELEMENT", BYTES_PER_ELEMENTConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCInt32Array::staticFunctions[] = { - { "get", getCallback, kJSPropertyAttributeDontDelete }, - { "set", setCallback, kJSPropertyAttributeDontDelete }, - { "subarray", subarrayCallback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSObjectRef JSCInt32Array::jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - uscxml::Int32Array* localInstance = NULL; - - if (false) { - } else if (argumentCount == 3 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl()) && - JSValueIsNumber(ctx, arguments[1]) && - JSValueIsNumber(ctx, arguments[2])) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - unsigned long localLength = (unsigned long)JSValueToNumber(ctx, arguments[2], exception); - localInstance = new uscxml::Int32Array(localBuffer, localByteOffset, localLength); - - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl()) && - JSValueIsNumber(ctx, arguments[1])) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - localInstance = new uscxml::Int32Array(localBuffer, localByteOffset); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCInt32Array::getTmpl())) { - - uscxml::Int32Array* localArray = ((struct JSCInt32Array::JSCInt32ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - localInstance = new uscxml::Int32Array(localArray); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl())) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - localInstance = new uscxml::Int32Array(localBuffer); - - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - - unsigned long localLength = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - localInstance = new uscxml::Int32Array(localLength); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0])) { - - - std::vector<long> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - localInstance = new uscxml::Int32Array(localArray); - - } - if (!localInstance) { - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling constructor for Int32Array"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return (JSObjectRef)JSValueMakeNull(ctx); - } - - JSClassRef retClass = JSCInt32Array::getTmpl(); - - struct JSCInt32Array::JSCInt32ArrayPrivate* retPrivData = new JSCInt32Array::JSCInt32ArrayPrivate(); - retPrivData->nativeObj = localInstance; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - return retObj; -} - -JSValueRef JSCInt32Array::lengthAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCInt32ArrayPrivate* privData = (struct JSCInt32ArrayPrivate*)JSObjectGetPrivate(object); - - return JSValueMakeNumber(ctx, privData->nativeObj->getLength()); -} - -JSValueRef JSCInt32Array::BYTES_PER_ELEMENTConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 4); -} - - -JSValueRef JSCInt32Array::getCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCInt32ArrayPrivate* privData = (struct JSCInt32ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - long retVal = privData->nativeObj->get(localIndex); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling get"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCInt32Array::setCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCInt32ArrayPrivate* privData = (struct JSCInt32ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCInt32Array::getTmpl()) && - JSValueIsNumber(ctx, arguments[1])) { - uscxml::Int32Array* localArray = ((struct JSCInt32Array::JSCInt32ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localArray, localOffset); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - long localValue = (long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localIndex, localValue); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - - std::vector<long> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localArray, localOffset); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCInt32Array::getTmpl())) { - uscxml::Int32Array* localArray = ((struct JSCInt32Array::JSCInt32ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - - privData->nativeObj->set(localArray); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0])) { - - std::vector<long> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - - privData->nativeObj->set(localArray); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling set"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCInt32Array::subarrayCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCInt32ArrayPrivate* privData = (struct JSCInt32ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - long localStart = (long)JSValueToNumber(ctx, arguments[0], exception); - long localEnd = (long)JSValueToNumber(ctx, arguments[1], exception); - - uscxml::Int32Array* retVal = new uscxml::Int32Array(privData->nativeObj->subarray(localStart, localEnd)); - JSClassRef retClass = JSCInt32Array::getTmpl(); - - struct JSCInt32Array::JSCInt32ArrayPrivate* retPrivData = new JSCInt32Array::JSCInt32ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - long localStart = (long)JSValueToNumber(ctx, arguments[0], exception); - - uscxml::Int32Array* retVal = new uscxml::Int32Array(privData->nativeObj->subarray(localStart)); - JSClassRef retClass = JSCInt32Array::getTmpl(); - - struct JSCInt32Array::JSCInt32ArrayPrivate* retPrivData = new JSCInt32Array::JSCInt32ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling subarray"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt32Array.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt32Array.h deleted file mode 100644 index 76bda20..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt32Array.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCInt32Array_h -#define JSCInt32Array_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "JSCArrayBufferView.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCInt32Array { -public: - struct JSCInt32ArrayPrivate { - JSCDOM* dom; - uscxml::Int32Array* nativeObj; - }; - - JSC_DESTRUCTOR(JSCInt32ArrayPrivate); - - static JSValueRef getCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef subarrayCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - static JSObjectRef jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - static JSValueRef lengthAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef BYTES_PER_ELEMENTConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static bool hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName); - static JSValueRef getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception); - static bool setPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "Int32Array"; - classDef.hasProperty = hasPropertyCustomCallback; - classDef.getProperty = getPropertyCustomCallback; - classDef.setProperty = setPropertyCustomCallback; - classDef.callAsConstructor = jsConstructor; - classDef.parentClass = JSCArrayBufferView::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCInt32Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt8Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt8Array.cpp deleted file mode 100644 index 28bb6b4..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt8Array.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCArrayBuffer.h" -#include "JSCArrayBufferView.h" -#include "JSCInt8Array.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCInt8Array::Tmpl; - -JSStaticValue JSCInt8Array::staticValues[] = { - { "length", lengthAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { "BYTES_PER_ELEMENT", BYTES_PER_ELEMENTConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCInt8Array::staticFunctions[] = { - { "get", getCallback, kJSPropertyAttributeDontDelete }, - { "set", setCallback, kJSPropertyAttributeDontDelete }, - { "subarray", subarrayCallback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSObjectRef JSCInt8Array::jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - uscxml::Int8Array* localInstance = NULL; - - if (false) { - } else if (argumentCount == 3 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl()) && - JSValueIsNumber(ctx, arguments[1]) && - JSValueIsNumber(ctx, arguments[2])) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - unsigned long localLength = (unsigned long)JSValueToNumber(ctx, arguments[2], exception); - localInstance = new uscxml::Int8Array(localBuffer, localByteOffset, localLength); - - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl()) && - JSValueIsNumber(ctx, arguments[1])) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - localInstance = new uscxml::Int8Array(localBuffer, localByteOffset); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCInt8Array::getTmpl())) { - - uscxml::Int8Array* localArray = ((struct JSCInt8Array::JSCInt8ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - localInstance = new uscxml::Int8Array(localArray); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl())) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - localInstance = new uscxml::Int8Array(localBuffer); - - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - - unsigned long localLength = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - localInstance = new uscxml::Int8Array(localLength); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0])) { - - - std::vector<char> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - localInstance = new uscxml::Int8Array(localArray); - - } - if (!localInstance) { - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling constructor for Int8Array"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return (JSObjectRef)JSValueMakeNull(ctx); - } - - JSClassRef retClass = JSCInt8Array::getTmpl(); - - struct JSCInt8Array::JSCInt8ArrayPrivate* retPrivData = new JSCInt8Array::JSCInt8ArrayPrivate(); - retPrivData->nativeObj = localInstance; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - return retObj; -} - -JSValueRef JSCInt8Array::lengthAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCInt8ArrayPrivate* privData = (struct JSCInt8ArrayPrivate*)JSObjectGetPrivate(object); - - return JSValueMakeNumber(ctx, privData->nativeObj->getLength()); -} - -JSValueRef JSCInt8Array::BYTES_PER_ELEMENTConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 1); -} - - -JSValueRef JSCInt8Array::getCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCInt8ArrayPrivate* privData = (struct JSCInt8ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - char retVal = privData->nativeObj->get(localIndex); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling get"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCInt8Array::setCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCInt8ArrayPrivate* privData = (struct JSCInt8ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCInt8Array::getTmpl()) && - JSValueIsNumber(ctx, arguments[1])) { - uscxml::Int8Array* localArray = ((struct JSCInt8Array::JSCInt8ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localArray, localOffset); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - char localValue = (char)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localIndex, localValue); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - - std::vector<char> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localArray, localOffset); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCInt8Array::getTmpl())) { - uscxml::Int8Array* localArray = ((struct JSCInt8Array::JSCInt8ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - - privData->nativeObj->set(localArray); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0])) { - - std::vector<char> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - - privData->nativeObj->set(localArray); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling set"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCInt8Array::subarrayCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCInt8ArrayPrivate* privData = (struct JSCInt8ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - long localStart = (long)JSValueToNumber(ctx, arguments[0], exception); - long localEnd = (long)JSValueToNumber(ctx, arguments[1], exception); - - uscxml::Int8Array* retVal = new uscxml::Int8Array(privData->nativeObj->subarray(localStart, localEnd)); - JSClassRef retClass = JSCInt8Array::getTmpl(); - - struct JSCInt8Array::JSCInt8ArrayPrivate* retPrivData = new JSCInt8Array::JSCInt8ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - long localStart = (long)JSValueToNumber(ctx, arguments[0], exception); - - uscxml::Int8Array* retVal = new uscxml::Int8Array(privData->nativeObj->subarray(localStart)); - JSClassRef retClass = JSCInt8Array::getTmpl(); - - struct JSCInt8Array::JSCInt8ArrayPrivate* retPrivData = new JSCInt8Array::JSCInt8ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling subarray"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt8Array.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt8Array.h deleted file mode 100644 index b46d4cb..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCInt8Array.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCInt8Array_h -#define JSCInt8Array_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "JSCArrayBufferView.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCInt8Array { -public: - struct JSCInt8ArrayPrivate { - JSCDOM* dom; - uscxml::Int8Array* nativeObj; - }; - - JSC_DESTRUCTOR(JSCInt8ArrayPrivate); - - static JSValueRef getCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef subarrayCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - static JSObjectRef jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - static JSValueRef lengthAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef BYTES_PER_ELEMENTConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static bool hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName); - static JSValueRef getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception); - static bool setPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "Int8Array"; - classDef.hasProperty = hasPropertyCustomCallback; - classDef.getProperty = getPropertyCustomCallback; - classDef.setProperty = setPropertyCustomCallback; - classDef.callAsConstructor = jsConstructor; - classDef.parentClass = JSCArrayBufferView::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCInt8Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNamedNodeMap.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNamedNodeMap.cpp deleted file mode 100644 index c0e53bf..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNamedNodeMap.cpp +++ /dev/null @@ -1,294 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCNamedNodeMap.h" -#include "JSCNode.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCNamedNodeMap::Tmpl; - -JSStaticValue JSCNamedNodeMap::staticValues[] = { - { "length", lengthAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCNamedNodeMap::staticFunctions[] = { - { "getNamedItem", getNamedItemCallback, kJSPropertyAttributeDontDelete }, - { "setNamedItem", setNamedItemCallback, kJSPropertyAttributeDontDelete }, - { "removeNamedItem", removeNamedItemCallback, kJSPropertyAttributeDontDelete }, - { "item", itemCallback, kJSPropertyAttributeDontDelete }, - { "getNamedItemNS", getNamedItemNSCallback, kJSPropertyAttributeDontDelete }, - { "setNamedItemNS", setNamedItemNSCallback, kJSPropertyAttributeDontDelete }, - { "removeNamedItemNS", removeNamedItemNSCallback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSValueRef JSCNamedNodeMap::lengthAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCNamedNodeMapPrivate* privData = (struct JSCNamedNodeMapPrivate*)JSObjectGetPrivate(object); - - return JSValueMakeNumber(ctx, privData->nativeObj->getLength()); -} - - -JSValueRef JSCNamedNodeMap::getNamedItemCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCNamedNodeMapPrivate* privData = (struct JSCNamedNodeMapPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsString(ctx, arguments[0])) { - JSStringRef stringReflocalName = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalName); - char* localNameBuffer = new char[localNameMaxSize]; - JSStringGetUTF8CString(stringReflocalName, localNameBuffer, localNameMaxSize); - std::string localName(localNameBuffer); - JSStringRelease(stringReflocalName); - free(localNameBuffer); - - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->getNamedItem(localName)); - JSClassRef retClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling getNamedItem"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCNamedNodeMap::setNamedItemCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCNamedNodeMapPrivate* privData = (struct JSCNamedNodeMapPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCNode::getTmpl())) { - Arabica::DOM::Node<std::string>* localArg = ((struct JSCNode::JSCNodePrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->setNamedItem(*localArg)); - JSClassRef retClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling setNamedItem"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCNamedNodeMap::removeNamedItemCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCNamedNodeMapPrivate* privData = (struct JSCNamedNodeMapPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsString(ctx, arguments[0])) { - JSStringRef stringReflocalName = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalName); - char* localNameBuffer = new char[localNameMaxSize]; - JSStringGetUTF8CString(stringReflocalName, localNameBuffer, localNameMaxSize); - std::string localName(localNameBuffer); - JSStringRelease(stringReflocalName); - free(localNameBuffer); - - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->removeNamedItem(localName)); - JSClassRef retClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling removeNamedItem"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCNamedNodeMap::itemCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCNamedNodeMapPrivate* privData = (struct JSCNamedNodeMapPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->item(localIndex)); - JSClassRef retClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling item"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCNamedNodeMap::getNamedItemNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCNamedNodeMapPrivate* privData = (struct JSCNamedNodeMapPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsString(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1])) { - JSStringRef stringReflocalNamespaceURI = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNamespaceURIMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalNamespaceURI); - char* localNamespaceURIBuffer = new char[localNamespaceURIMaxSize]; - JSStringGetUTF8CString(stringReflocalNamespaceURI, localNamespaceURIBuffer, localNamespaceURIMaxSize); - std::string localNamespaceURI(localNamespaceURIBuffer); - JSStringRelease(stringReflocalNamespaceURI); - free(localNamespaceURIBuffer); - - JSStringRef stringReflocalLocalName = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localLocalNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalLocalName); - char* localLocalNameBuffer = new char[localLocalNameMaxSize]; - JSStringGetUTF8CString(stringReflocalLocalName, localLocalNameBuffer, localLocalNameMaxSize); - std::string localLocalName(localLocalNameBuffer); - JSStringRelease(stringReflocalLocalName); - free(localLocalNameBuffer); - - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->getNamedItemNS(localNamespaceURI, localLocalName)); - JSClassRef retClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling getNamedItemNS"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCNamedNodeMap::setNamedItemNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCNamedNodeMapPrivate* privData = (struct JSCNamedNodeMapPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCNode::getTmpl())) { - Arabica::DOM::Node<std::string>* localArg = ((struct JSCNode::JSCNodePrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->setNamedItemNS(*localArg)); - JSClassRef retClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling setNamedItemNS"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCNamedNodeMap::removeNamedItemNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCNamedNodeMapPrivate* privData = (struct JSCNamedNodeMapPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsString(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1])) { - JSStringRef stringReflocalNamespaceURI = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localNamespaceURIMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalNamespaceURI); - char* localNamespaceURIBuffer = new char[localNamespaceURIMaxSize]; - JSStringGetUTF8CString(stringReflocalNamespaceURI, localNamespaceURIBuffer, localNamespaceURIMaxSize); - std::string localNamespaceURI(localNamespaceURIBuffer); - JSStringRelease(stringReflocalNamespaceURI); - free(localNamespaceURIBuffer); - - JSStringRef stringReflocalLocalName = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localLocalNameMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalLocalName); - char* localLocalNameBuffer = new char[localLocalNameMaxSize]; - JSStringGetUTF8CString(stringReflocalLocalName, localLocalNameBuffer, localLocalNameMaxSize); - std::string localLocalName(localLocalNameBuffer); - JSStringRelease(stringReflocalLocalName); - free(localLocalNameBuffer); - - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->removeNamedItemNS(localNamespaceURI, localLocalName)); - JSClassRef retClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling removeNamedItemNS"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNamedNodeMap.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNamedNodeMap.h deleted file mode 100644 index 5b2f6d9..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNamedNodeMap.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCNamedNodeMap_h -#define JSCNamedNodeMap_h - -#include <string> -#include "DOM/Node.hpp" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCNamedNodeMap { -public: - struct JSCNamedNodeMapPrivate { - JSCDOM* dom; - Arabica::DOM::NamedNodeMap<std::string>* nativeObj; - }; - - JSC_DESTRUCTOR(JSCNamedNodeMapPrivate); - - static JSValueRef getNamedItemCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setNamedItemCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef removeNamedItemCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef itemCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef getNamedItemNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setNamedItemNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef removeNamedItemNSCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - static JSValueRef lengthAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "NamedNodeMap"; - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCNamedNodeMap_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNode.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNode.cpp deleted file mode 100644 index 7f9ddb0..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNode.cpp +++ /dev/null @@ -1,565 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCDocument.h" -#include "JSCNode.h" -#include "JSCNodeList.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCNode::Tmpl; - -JSStaticValue JSCNode::staticValues[] = { - { "nodeName", nodeNameAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "nodeValue", nodeValueAttrGetter, nodeValueAttrSetter, kJSPropertyAttributeDontDelete }, - { "nodeType", nodeTypeAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "parentNode", parentNodeAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "childNodes", childNodesAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "firstChild", firstChildAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "lastChild", lastChildAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "previousSibling", previousSiblingAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "nextSibling", nextSiblingAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "attributes", attributesCustomAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "ownerDocument", ownerDocumentAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "namespaceURI", namespaceURIAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "prefix", prefixAttrGetter, prefixAttrSetter, kJSPropertyAttributeDontDelete }, - { "localName", localNameAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { "ELEMENT_NODE", ELEMENT_NODEConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "ATTRIBUTE_NODE", ATTRIBUTE_NODEConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "TEXT_NODE", TEXT_NODEConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "CDATA_SECTION_NODE", CDATA_SECTION_NODEConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "ENTITY_REFERENCE_NODE", ENTITY_REFERENCE_NODEConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "ENTITY_NODE", ENTITY_NODEConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "PROCESSING_INSTRUCTION_NODE", PROCESSING_INSTRUCTION_NODEConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "COMMENT_NODE", COMMENT_NODEConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "DOCUMENT_NODE", DOCUMENT_NODEConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "DOCUMENT_TYPE_NODE", DOCUMENT_TYPE_NODEConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "DOCUMENT_FRAGMENT_NODE", DOCUMENT_FRAGMENT_NODEConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "NOTATION_NODE", NOTATION_NODEConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCNode::staticFunctions[] = { - { "insertBefore", insertBeforeCallback, kJSPropertyAttributeDontDelete }, - { "replaceChild", replaceChildCallback, kJSPropertyAttributeDontDelete }, - { "removeChild", removeChildCallback, kJSPropertyAttributeDontDelete }, - { "appendChild", appendChildCallback, kJSPropertyAttributeDontDelete }, - { "hasChildNodes", hasChildNodesCallback, kJSPropertyAttributeDontDelete }, - { "cloneNode", cloneNodeCallback, kJSPropertyAttributeDontDelete }, - { "normalize", normalizeCallback, kJSPropertyAttributeDontDelete }, - { "isSupported", isSupportedCallback, kJSPropertyAttributeDontDelete }, - { "hasAttributes", hasAttributesCallback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSValueRef JSCNode::nodeNameAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getNodeName().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -JSValueRef JSCNode::nodeValueAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getNodeValue().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -bool JSCNode::nodeValueAttrSetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) { - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(thisObj); - - JSStringRef stringReflocalNodeValue = JSValueToStringCopy(ctx, value, exception); - size_t localNodeValueMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalNodeValue); - char* localNodeValueBuffer = new char[localNodeValueMaxSize]; - JSStringGetUTF8CString(stringReflocalNodeValue, localNodeValueBuffer, localNodeValueMaxSize); - std::string localNodeValue(localNodeValueBuffer); - JSStringRelease(stringReflocalNodeValue); - free(localNodeValueBuffer); - - privData->nativeObj->setNodeValue(localNodeValue); - return true; -} - -JSValueRef JSCNode::nodeTypeAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(object); - - return JSValueMakeNumber(ctx, privData->nativeObj->getNodeType()); -} - - -JSValueRef JSCNode::parentNodeAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(object); - - if (!privData->nativeObj->getParentNode()) return JSValueMakeUndefined(ctx); - Arabica::DOM::Node<std::string>* arabicaRet = new Arabica::DOM::Node<std::string>(privData->nativeObj->getParentNode()); - - JSClassRef arbaicaRetClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arabicaRet; - - JSObjectRef arbaicaRetObj = JSObjectMake(ctx, arbaicaRetClass, retPrivData); - return arbaicaRetObj; -} - - -JSValueRef JSCNode::childNodesAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(object); - - - Arabica::DOM::NodeList<std::string>* arabicaRet = new Arabica::DOM::NodeList<std::string>(privData->nativeObj->getChildNodes()); - - JSClassRef arbaicaRetClass = JSCNodeList::getTmpl(); - - struct JSCNodeList::JSCNodeListPrivate* retPrivData = new JSCNodeList::JSCNodeListPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arabicaRet; - - JSObjectRef arbaicaRetObj = JSObjectMake(ctx, arbaicaRetClass, retPrivData); - return arbaicaRetObj; -} - - -JSValueRef JSCNode::firstChildAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(object); - - if (!privData->nativeObj->getFirstChild()) return JSValueMakeUndefined(ctx); - Arabica::DOM::Node<std::string>* arabicaRet = new Arabica::DOM::Node<std::string>(privData->nativeObj->getFirstChild()); - - JSClassRef arbaicaRetClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arabicaRet; - - JSObjectRef arbaicaRetObj = JSObjectMake(ctx, arbaicaRetClass, retPrivData); - return arbaicaRetObj; -} - - -JSValueRef JSCNode::lastChildAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(object); - - if (!privData->nativeObj->getLastChild()) return JSValueMakeUndefined(ctx); - Arabica::DOM::Node<std::string>* arabicaRet = new Arabica::DOM::Node<std::string>(privData->nativeObj->getLastChild()); - - JSClassRef arbaicaRetClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arabicaRet; - - JSObjectRef arbaicaRetObj = JSObjectMake(ctx, arbaicaRetClass, retPrivData); - return arbaicaRetObj; -} - - -JSValueRef JSCNode::previousSiblingAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(object); - - if (!privData->nativeObj->getPreviousSibling()) return JSValueMakeUndefined(ctx); - Arabica::DOM::Node<std::string>* arabicaRet = new Arabica::DOM::Node<std::string>(privData->nativeObj->getPreviousSibling()); - - JSClassRef arbaicaRetClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arabicaRet; - - JSObjectRef arbaicaRetObj = JSObjectMake(ctx, arbaicaRetClass, retPrivData); - return arbaicaRetObj; -} - - -JSValueRef JSCNode::nextSiblingAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(object); - - if (!privData->nativeObj->getNextSibling()) return JSValueMakeUndefined(ctx); - Arabica::DOM::Node<std::string>* arabicaRet = new Arabica::DOM::Node<std::string>(privData->nativeObj->getNextSibling()); - - JSClassRef arbaicaRetClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arabicaRet; - - JSObjectRef arbaicaRetObj = JSObjectMake(ctx, arbaicaRetClass, retPrivData); - return arbaicaRetObj; -} - - -JSValueRef JSCNode::ownerDocumentAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(object); - - if (!privData->nativeObj->getOwnerDocument()) return JSValueMakeUndefined(ctx); - Arabica::DOM::Document<std::string>* arabicaRet = new Arabica::DOM::Document<std::string>(privData->nativeObj->getOwnerDocument()); - - JSClassRef arbaicaRetClass = JSCDocument::getTmpl(); - - struct JSCDocument::JSCDocumentPrivate* retPrivData = new JSCDocument::JSCDocumentPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arabicaRet; - - JSObjectRef arbaicaRetObj = JSObjectMake(ctx, arbaicaRetClass, retPrivData); - return arbaicaRetObj; -} - - -JSValueRef JSCNode::namespaceURIAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getNamespaceURI().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -JSValueRef JSCNode::prefixAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getPrefix().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -bool JSCNode::prefixAttrSetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) { - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(thisObj); - - JSStringRef stringReflocalPrefix = JSValueToStringCopy(ctx, value, exception); - size_t localPrefixMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalPrefix); - char* localPrefixBuffer = new char[localPrefixMaxSize]; - JSStringGetUTF8CString(stringReflocalPrefix, localPrefixBuffer, localPrefixMaxSize); - std::string localPrefix(localPrefixBuffer); - JSStringRelease(stringReflocalPrefix); - free(localPrefixBuffer); - - privData->nativeObj->setPrefix(localPrefix); - return true; -} - -JSValueRef JSCNode::localNameAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getLocalName().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - -JSValueRef JSCNode::ELEMENT_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 1); -} - -JSValueRef JSCNode::ATTRIBUTE_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 2); -} - -JSValueRef JSCNode::TEXT_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 3); -} - -JSValueRef JSCNode::CDATA_SECTION_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 4); -} - -JSValueRef JSCNode::ENTITY_REFERENCE_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 5); -} - -JSValueRef JSCNode::ENTITY_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 6); -} - -JSValueRef JSCNode::PROCESSING_INSTRUCTION_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 7); -} - -JSValueRef JSCNode::COMMENT_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 8); -} - -JSValueRef JSCNode::DOCUMENT_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 9); -} - -JSValueRef JSCNode::DOCUMENT_TYPE_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 10); -} - -JSValueRef JSCNode::DOCUMENT_FRAGMENT_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 11); -} - -JSValueRef JSCNode::NOTATION_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 12); -} - - -JSValueRef JSCNode::insertBeforeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCNode::getTmpl()) && - JSValueIsObject(ctx, arguments[1]) && JSValueIsObjectOfClass(ctx, arguments[1], JSCNode::getTmpl())) { - Arabica::DOM::Node<std::string>* localNewChild = ((struct JSCNode::JSCNodePrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - Arabica::DOM::Node<std::string>* localRefChild = ((struct JSCNode::JSCNodePrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[1], exception)))->nativeObj; - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->insertBefore(*localNewChild, *localRefChild)); - JSClassRef retClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling insertBefore"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCNode::replaceChildCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCNode::getTmpl()) && - JSValueIsObject(ctx, arguments[1]) && JSValueIsObjectOfClass(ctx, arguments[1], JSCNode::getTmpl())) { - Arabica::DOM::Node<std::string>* localNewChild = ((struct JSCNode::JSCNodePrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - Arabica::DOM::Node<std::string>* localOldChild = ((struct JSCNode::JSCNodePrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[1], exception)))->nativeObj; - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->replaceChild(*localNewChild, *localOldChild)); - JSClassRef retClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling replaceChild"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCNode::removeChildCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCNode::getTmpl())) { - Arabica::DOM::Node<std::string>* localOldChild = ((struct JSCNode::JSCNodePrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->removeChild(*localOldChild)); - JSClassRef retClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling removeChild"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCNode::appendChildCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCNode::getTmpl())) { - Arabica::DOM::Node<std::string>* localNewChild = ((struct JSCNode::JSCNodePrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->appendChild(*localNewChild)); - JSClassRef retClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling appendChild"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCNode::hasChildNodesCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 0) { - - bool retVal = privData->nativeObj->hasChildNodes(); - - JSValueRef jscRetVal = JSValueMakeBoolean(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling hasChildNodes"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCNode::cloneNodeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsBoolean(ctx, arguments[0])) { - bool localDeep = JSValueToBoolean(ctx, arguments[0]); - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->cloneNode(localDeep)); - JSClassRef retClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling cloneNode"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCNode::normalizeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 0) { - - privData->nativeObj->normalize(); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling normalize"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCNode::isSupportedCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsString(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1])) { - JSStringRef stringReflocalFeature = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localFeatureMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalFeature); - char* localFeatureBuffer = new char[localFeatureMaxSize]; - JSStringGetUTF8CString(stringReflocalFeature, localFeatureBuffer, localFeatureMaxSize); - std::string localFeature(localFeatureBuffer); - JSStringRelease(stringReflocalFeature); - free(localFeatureBuffer); - - JSStringRef stringReflocalVersion = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localVersionMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalVersion); - char* localVersionBuffer = new char[localVersionMaxSize]; - JSStringGetUTF8CString(stringReflocalVersion, localVersionBuffer, localVersionMaxSize); - std::string localVersion(localVersionBuffer); - JSStringRelease(stringReflocalVersion); - free(localVersionBuffer); - - - bool retVal = privData->nativeObj->isSupported(localFeature, localVersion); - - JSValueRef jscRetVal = JSValueMakeBoolean(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling isSupported"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCNode::hasAttributesCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 0) { - - bool retVal = privData->nativeObj->hasAttributes(); - - JSValueRef jscRetVal = JSValueMakeBoolean(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling hasAttributes"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNode.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNode.h deleted file mode 100644 index 91daa79..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNode.h +++ /dev/null @@ -1,104 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCNode_h -#define JSCNode_h - -#include <string> -#include "DOM/Node.hpp" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCNode { -public: - struct JSCNodePrivate { - JSCDOM* dom; - Arabica::DOM::Node<std::string>* nativeObj; - }; - - JSC_DESTRUCTOR(JSCNodePrivate); - - static JSValueRef insertBeforeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef replaceChildCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef removeChildCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef appendChildCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef hasChildNodesCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef cloneNodeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef normalizeCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef isSupportedCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef hasAttributesCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - static JSValueRef nodeNameAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef nodeValueAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static bool nodeValueAttrSetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef value, JSValueRef* exception); - static JSValueRef nodeTypeAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef parentNodeAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef childNodesAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef firstChildAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef lastChildAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef previousSiblingAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef nextSiblingAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef attributesCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef ownerDocumentAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef namespaceURIAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef prefixAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static bool prefixAttrSetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef value, JSValueRef* exception); - static JSValueRef localNameAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef ELEMENT_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef ATTRIBUTE_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef TEXT_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef CDATA_SECTION_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef ENTITY_REFERENCE_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef ENTITY_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef PROCESSING_INSTRUCTION_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef COMMENT_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef DOCUMENT_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef DOCUMENT_TYPE_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef DOCUMENT_FRAGMENT_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef NOTATION_NODEConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "Node"; - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCNode_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeCustom.cpp deleted file mode 100644 index b135044..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeCustom.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "JSCNode.h" -#include "JSCNamedNodeMap.h" - -namespace Arabica { -namespace DOM { - -JSValueRef JSCNode::attributesCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception) { - - struct JSCNodePrivate* privData = (struct JSCNodePrivate*)JSObjectGetPrivate(thisObj); - - if (!privData->nativeObj->hasAttributes()) { - return JSValueMakeUndefined(ctx); - } - - Arabica::DOM::NamedNodeMap<std::string>* retVal = new Arabica::DOM::NamedNodeMap<std::string>(privData->nativeObj->getAttributes()); - JSClassRef retClass = JSCNamedNodeMap::getTmpl(); - - struct JSCNamedNodeMap::JSCNamedNodeMapPrivate* retPrivData = new JSCNamedNodeMap::JSCNamedNodeMapPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; -} - - -} -}
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeList.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeList.cpp deleted file mode 100644 index 6a3acfb..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeList.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCNode.h" -#include "JSCNodeList.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCNodeList::Tmpl; - -JSStaticValue JSCNodeList::staticValues[] = { - { "length", lengthAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCNodeList::staticFunctions[] = { - { "item", itemCallback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSValueRef JSCNodeList::lengthAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCNodeListPrivate* privData = (struct JSCNodeListPrivate*)JSObjectGetPrivate(object); - - return JSValueMakeNumber(ctx, privData->nativeObj->getLength()); -} - - -JSValueRef JSCNodeList::itemCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCNodeListPrivate* privData = (struct JSCNodeListPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->item(localIndex)); - JSClassRef retClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling item"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeList.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeList.h deleted file mode 100644 index 2b5b3bc..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeList.h +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCNodeList_h -#define JSCNodeList_h - -#include <string> -#include "DOM/Node.hpp" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCNodeList { -public: - struct JSCNodeListPrivate { - JSCDOM* dom; - Arabica::DOM::NodeList<std::string>* nativeObj; - }; - - JSC_DESTRUCTOR(JSCNodeListPrivate); - - static JSValueRef itemCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - static JSValueRef lengthAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static bool hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName); - static JSValueRef getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "NodeList"; - classDef.hasProperty = hasPropertyCustomCallback; - classDef.getProperty = getPropertyCustomCallback; - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCNodeList_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeListCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeListCustom.cpp deleted file mode 100644 index 91c18e5..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeListCustom.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "JSCNodeList.h" -#include "JSCElement.h" -#include "JSCNode.h" - -namespace Arabica { -namespace DOM { - -bool JSCNodeList::hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName) { - size_t propMaxSize = JSStringGetMaximumUTF8CStringSize(propertyName); - char* propBuffer = new char[propMaxSize]; - JSStringGetUTF8CString(propertyName, propBuffer, propMaxSize); - std::string propName(propBuffer); - free(propBuffer); - - std::string base = "0123456789"; - if (propName.find_first_not_of(base) != std::string::npos) { - return false; - } - - int index = boost::lexical_cast<int>(propName); - struct JSCNodeListPrivate* privData = (struct JSCNodeListPrivate*)JSObjectGetPrivate(object); - - if (privData->nativeObj->getLength() < index) { - return false; - } - - return true; -} - -JSValueRef JSCNodeList::getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { - size_t propMaxSize = JSStringGetMaximumUTF8CStringSize(propertyName); - char* propBuffer = new char[propMaxSize]; - JSStringGetUTF8CString(propertyName, propBuffer, propMaxSize); - std::string propName(propBuffer); - free(propBuffer); - - std::string base = "0123456789"; - if (propName.find_first_not_of(base) != std::string::npos) { - return JSValueMakeUndefined(ctx); - } - - int index = boost::lexical_cast<int>(propName); - struct JSCNodeListPrivate* privData = (struct JSCNodeListPrivate*)JSObjectGetPrivate(object); - if (privData->nativeObj->getLength() < index) { - return JSValueMakeUndefined(ctx); - } - - switch(privData->nativeObj->item(index).getNodeType()) { - case Node_base::ELEMENT_NODE: { - Arabica::DOM::Element<std::string>* retVal = new Arabica::DOM::Element<std::string>(privData->nativeObj->item(index)); - JSClassRef retClass = JSCElement::getTmpl(); - - struct JSCElement::JSCElementPrivate* retPrivData = new JSCElement::JSCElementPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - break; - } - default: { - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->item(index)); - JSClassRef retClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - } - } - - return JSValueMakeUndefined(ctx); -} - -} -}
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSet.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSet.cpp deleted file mode 100644 index cf4a8de..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSet.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCNodeSet.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCNodeSet::Tmpl; - -JSStaticValue JSCNodeSet::staticValues[] = { - { "size", sizeAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "empty", emptyAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCNodeSet::staticFunctions[] = { - { "toDocumentOrder", toDocumentOrderCallback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSValueRef JSCNodeSet::sizeAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCNodeSetPrivate* privData = (struct JSCNodeSetPrivate*)JSObjectGetPrivate(object); - - return JSValueMakeNumber(ctx, privData->nativeObj->size()); -} - - -JSValueRef JSCNodeSet::emptyAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCNodeSetPrivate* privData = (struct JSCNodeSetPrivate*)JSObjectGetPrivate(object); - - return JSValueMakeBoolean(ctx, privData->nativeObj->empty()); -} - - -JSValueRef JSCNodeSet::toDocumentOrderCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCNodeSetPrivate* privData = (struct JSCNodeSetPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 0) { - - privData->nativeObj->to_document_order(); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling toDocumentOrder"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSet.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSet.h deleted file mode 100644 index a384ade..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSet.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCNodeSet_h -#define JSCNodeSet_h - -#include <string> -#include "DOM/Node.hpp" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCNodeSet { -public: - struct JSCNodeSetPrivate { - JSCDOM* dom; - Arabica::XPath::NodeSet<std::string>* nativeObj; - }; - - JSC_DESTRUCTOR(JSCNodeSetPrivate); - - static JSValueRef toDocumentOrderCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - static JSValueRef sizeAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef emptyAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static bool hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName); - static JSValueRef getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "NodeSet"; - classDef.hasProperty = hasPropertyCustomCallback; - classDef.getProperty = getPropertyCustomCallback; - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCNodeSet_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSetCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSetCustom.cpp deleted file mode 100644 index 6de5793..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNodeSetCustom.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "JSCNodeSet.h" -#include "JSCElement.h" -#include "JSCNode.h" - -namespace Arabica { -namespace DOM { - - -bool JSCNodeSet::hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName) { - size_t propMaxSize = JSStringGetMaximumUTF8CStringSize(propertyName); - char* propBuffer = new char[propMaxSize]; - JSStringGetUTF8CString(propertyName, propBuffer, propMaxSize); - std::string propName(propBuffer); - free(propBuffer); - - std::string base = "0123456789"; - if (propName.find_first_not_of(base) != std::string::npos) { - return false; - } - - int index = boost::lexical_cast<int>(propName); - struct JSCNodeSetPrivate* privData = (struct JSCNodeSetPrivate*)JSObjectGetPrivate(object); - - if (privData->nativeObj->size() < index) { - return false; - } - - return true; -} - -JSValueRef JSCNodeSet::getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { - size_t propMaxSize = JSStringGetMaximumUTF8CStringSize(propertyName); - char* propBuffer = new char[propMaxSize]; - JSStringGetUTF8CString(propertyName, propBuffer, propMaxSize); - std::string propName(propBuffer); - free(propBuffer); - - std::string base = "0123456789"; - if (propName.find_first_not_of(base) != std::string::npos) { - return JSValueMakeUndefined(ctx); - } - - int index = boost::lexical_cast<int>(propName); - struct JSCNodeSetPrivate* privData = (struct JSCNodeSetPrivate*)JSObjectGetPrivate(object); - if (privData->nativeObj->size() <= index) { - return JSValueMakeUndefined(ctx); - } - - switch((*privData->nativeObj)[index].getNodeType()) { - case Node_base::ELEMENT_NODE: { - Arabica::DOM::Element<std::string>* retVal = new Arabica::DOM::Element<std::string>((*privData->nativeObj)[index]); - JSClassRef retClass = JSCElement::getTmpl(); - - struct JSCElement::JSCElementPrivate* retPrivData = new JSCElement::JSCElementPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - break; - } - default: { - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>((*privData->nativeObj)[index]); - JSClassRef retClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - } - } - - return JSValueMakeUndefined(ctx); -} - -} -}
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNotation.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNotation.cpp deleted file mode 100644 index 6ff9079..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNotation.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCNode.h" -#include "JSCNotation.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCNotation::Tmpl; - -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 object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCNotationPrivate* privData = (struct JSCNotationPrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getPublicId().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -JSValueRef JSCNotation::systemIdAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCNotationPrivate* privData = (struct JSCNotationPrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getSystemId().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNotation.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNotation.h deleted file mode 100644 index 5238bbc..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCNotation.h +++ /dev/null @@ -1,71 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCNotation_h -#define JSCNotation_h - -#include <string> -#include "DOM/Node.hpp" -#include "JSCNode.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCNotation { -public: - struct JSCNotationPrivate { - JSCDOM* dom; - Arabica::DOM::Notation<std::string>* nativeObj; - }; - - JSC_DESTRUCTOR(JSCNotationPrivate); - - - static JSValueRef publicIdAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef systemIdAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "Notation"; - classDef.parentClass = JSCNode::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCNotation_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCProcessingInstruction.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCProcessingInstruction.cpp deleted file mode 100644 index c712c60..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCProcessingInstruction.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCNode.h" -#include "JSCProcessingInstruction.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCProcessingInstruction::Tmpl; - -JSStaticValue JSCProcessingInstruction::staticValues[] = { - { "target", targetAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "data", dataAttrGetter, dataAttrSetter, kJSPropertyAttributeDontDelete }, - - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCProcessingInstruction::staticFunctions[] = { - { 0, 0, 0 } -}; - -JSValueRef JSCProcessingInstruction::targetAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCProcessingInstructionPrivate* privData = (struct JSCProcessingInstructionPrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getTarget().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -JSValueRef JSCProcessingInstruction::dataAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCProcessingInstructionPrivate* privData = (struct JSCProcessingInstructionPrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->getData().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -bool JSCProcessingInstruction::dataAttrSetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) { - struct JSCProcessingInstructionPrivate* privData = (struct JSCProcessingInstructionPrivate*)JSObjectGetPrivate(thisObj); - - JSStringRef stringReflocalData = JSValueToStringCopy(ctx, value, exception); - size_t localDataMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalData); - char* localDataBuffer = new char[localDataMaxSize]; - JSStringGetUTF8CString(stringReflocalData, localDataBuffer, localDataMaxSize); - std::string localData(localDataBuffer); - JSStringRelease(stringReflocalData); - free(localDataBuffer); - - privData->nativeObj->setData(localData); - return true; -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCProcessingInstruction.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCProcessingInstruction.h deleted file mode 100644 index fbee5fd..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCProcessingInstruction.h +++ /dev/null @@ -1,72 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCProcessingInstruction_h -#define JSCProcessingInstruction_h - -#include <string> -#include "DOM/Node.hpp" -#include "JSCNode.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCProcessingInstruction { -public: - struct JSCProcessingInstructionPrivate { - JSCDOM* dom; - Arabica::DOM::ProcessingInstruction<std::string>* nativeObj; - }; - - JSC_DESTRUCTOR(JSCProcessingInstructionPrivate); - - - static JSValueRef targetAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef dataAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static bool dataAttrSetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef value, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "ProcessingInstruction"; - classDef.parentClass = JSCNode::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCProcessingInstruction_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp deleted file mode 100644 index 174b704..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCNode.h" -#include "JSCSCXMLEvent.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCSCXMLEvent::Tmpl; - -JSStaticValue JSCSCXMLEvent::staticValues[] = { - { "type", typeCustomAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "name", nameAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "origin", originAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "origintype", origintypeAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "raw", rawAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "dom", domAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "sendid", sendidCustomAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "invokeid", invokeidAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { "INTERNAL", INTERNALConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "EXTERNAL", EXTERNALConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "PLATFORM", PLATFORMConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCSCXMLEvent::staticFunctions[] = { - { 0, 0, 0 } -}; - -JSValueRef JSCSCXMLEvent::nameAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCSCXMLEventPrivate* privData = (struct JSCSCXMLEventPrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->name.c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -JSValueRef JSCSCXMLEvent::originAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCSCXMLEventPrivate* privData = (struct JSCSCXMLEventPrivate*)JSObjectGetPrivate(object); - - if (privData->nativeObj->origin.length() == 0) - return JSValueMakeUndefined(ctx); - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->origin.c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -JSValueRef JSCSCXMLEvent::origintypeAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCSCXMLEventPrivate* privData = (struct JSCSCXMLEventPrivate*)JSObjectGetPrivate(object); - - if (privData->nativeObj->origintype.length() == 0) - return JSValueMakeUndefined(ctx); - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->origintype.c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -JSValueRef JSCSCXMLEvent::rawAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCSCXMLEventPrivate* privData = (struct JSCSCXMLEventPrivate*)JSObjectGetPrivate(object); - - if (privData->nativeObj->raw.length() == 0) - return JSValueMakeUndefined(ctx); - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->raw.c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -JSValueRef JSCSCXMLEvent::domAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCSCXMLEventPrivate* privData = (struct JSCSCXMLEventPrivate*)JSObjectGetPrivate(object); - - if (!privData->nativeObj->dom) return JSValueMakeUndefined(ctx); - Arabica::DOM::Node<std::string>* arabicaRet = new Arabica::DOM::Node<std::string>(privData->nativeObj->dom); - - JSClassRef arbaicaRetClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arabicaRet; - - JSObjectRef arbaicaRetObj = JSObjectMake(ctx, arbaicaRetClass, retPrivData); - return arbaicaRetObj; -} - - -JSValueRef JSCSCXMLEvent::invokeidAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCSCXMLEventPrivate* privData = (struct JSCSCXMLEventPrivate*)JSObjectGetPrivate(object); - - if (privData->nativeObj->invokeid.length() == 0) - return JSValueMakeUndefined(ctx); - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->invokeid.c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - -JSValueRef JSCSCXMLEvent::INTERNALConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 1); -} - -JSValueRef JSCSCXMLEvent::EXTERNALConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 2); -} - -JSValueRef JSCSCXMLEvent::PLATFORMConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 3); -} - - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.h deleted file mode 100644 index 1d8021d..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.h +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCSCXMLEvent_h -#define JSCSCXMLEvent_h - -#include <string> -#include "DOM/Node.hpp" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCSCXMLEvent { -public: - struct JSCSCXMLEventPrivate { - JSCDOM* dom; - uscxml::Event* nativeObj; - }; - - JSC_DESTRUCTOR(JSCSCXMLEventPrivate); - - - static JSValueRef typeCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef nameAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef originAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef origintypeAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef rawAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef domAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef sendidCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef invokeidAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef INTERNALConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef EXTERNALConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef PLATFORMConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "SCXMLEvent"; - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCSCXMLEvent_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp deleted file mode 100644 index 9d128b6..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "JSCSCXMLEvent.h" - -namespace Arabica { -namespace DOM { - -JSValueRef JSCSCXMLEvent::typeCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception) { - struct JSCSCXMLEventPrivate* privData = (struct JSCSCXMLEventPrivate*)JSObjectGetPrivate(thisObj); - JSStringRef stringRef; - - switch (privData->nativeObj->eventType) { - case uscxml::Event::INTERNAL: - stringRef = JSStringCreateWithUTF8CString("internal"); - break; - case uscxml::Event::EXTERNAL: - stringRef = JSStringCreateWithUTF8CString("external"); - break; - case uscxml::Event::PLATFORM: - stringRef = JSStringCreateWithUTF8CString("platform"); - break; - default: - stringRef = JSStringCreateWithUTF8CString("undefined"); - break; - } - - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - -JSValueRef JSCSCXMLEvent::sendidCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception) { - struct JSCSCXMLEventPrivate* privData = (struct JSCSCXMLEventPrivate*)JSObjectGetPrivate(thisObj); - JSStringRef stringRef; - - if (privData->nativeObj->sendid.length() == 0 || privData->nativeObj->hideSendId) { - return JSValueMakeUndefined(ctx); - } else { - stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->sendid.c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; - } -} - -} -}
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCStorage.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCStorage.cpp deleted file mode 100644 index 9bd3d73..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCStorage.cpp +++ /dev/null @@ -1,186 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCStorage.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCStorage::Tmpl; - -JSStaticValue JSCStorage::staticValues[] = { - { "length", lengthAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCStorage::staticFunctions[] = { - { "key", keyCallback, kJSPropertyAttributeDontDelete }, - { "getItem", getItemCallback, kJSPropertyAttributeDontDelete }, - { "setItem", setItemCallback, kJSPropertyAttributeDontDelete }, - { "removeItem", removeItemCallback, kJSPropertyAttributeDontDelete }, - { "clear", clearCallback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSValueRef JSCStorage::lengthAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCStoragePrivate* privData = (struct JSCStoragePrivate*)JSObjectGetPrivate(object); - - return JSValueMakeNumber(ctx, privData->nativeObj->getLength()); -} - - -JSValueRef JSCStorage::keyCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCStoragePrivate* privData = (struct JSCStoragePrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - std::string retVal = privData->nativeObj->key(localIndex); - - JSStringRef jscString = JSStringCreateWithUTF8CString(retVal.c_str()); - JSValueRef jscRetVal = JSValueMakeString(ctx, jscString); - JSStringRelease(jscString); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling key"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCStorage::getItemCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCStoragePrivate* privData = (struct JSCStoragePrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsString(ctx, arguments[0])) { - JSStringRef stringReflocalKey = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localKeyMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalKey); - char* localKeyBuffer = new char[localKeyMaxSize]; - JSStringGetUTF8CString(stringReflocalKey, localKeyBuffer, localKeyMaxSize); - std::string localKey(localKeyBuffer); - JSStringRelease(stringReflocalKey); - free(localKeyBuffer); - - - std::string retVal = privData->nativeObj->getItem(localKey); - - JSStringRef jscString = JSStringCreateWithUTF8CString(retVal.c_str()); - JSValueRef jscRetVal = JSValueMakeString(ctx, jscString); - JSStringRelease(jscString); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling getItem"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCStorage::setItemCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCStoragePrivate* privData = (struct JSCStoragePrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsString(ctx, arguments[0]) && - JSValueIsString(ctx, arguments[1])) { - JSStringRef stringReflocalKey = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localKeyMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalKey); - char* localKeyBuffer = new char[localKeyMaxSize]; - JSStringGetUTF8CString(stringReflocalKey, localKeyBuffer, localKeyMaxSize); - std::string localKey(localKeyBuffer); - JSStringRelease(stringReflocalKey); - free(localKeyBuffer); - - JSStringRef stringReflocalValue = JSValueToStringCopy(ctx, arguments[1], exception); - size_t localValueMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalValue); - char* localValueBuffer = new char[localValueMaxSize]; - JSStringGetUTF8CString(stringReflocalValue, localValueBuffer, localValueMaxSize); - std::string localValue(localValueBuffer); - JSStringRelease(stringReflocalValue); - free(localValueBuffer); - - - privData->nativeObj->setItem(localKey, localValue); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling setItem"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCStorage::removeItemCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCStoragePrivate* privData = (struct JSCStoragePrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsString(ctx, arguments[0])) { - JSStringRef stringReflocalKey = JSValueToStringCopy(ctx, arguments[0], exception); - size_t localKeyMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalKey); - char* localKeyBuffer = new char[localKeyMaxSize]; - JSStringGetUTF8CString(stringReflocalKey, localKeyBuffer, localKeyMaxSize); - std::string localKey(localKeyBuffer); - JSStringRelease(stringReflocalKey); - free(localKeyBuffer); - - - privData->nativeObj->removeItem(localKey); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling removeItem"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCStorage::clearCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCStoragePrivate* privData = (struct JSCStoragePrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 0) { - - privData->nativeObj->clear(); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling clear"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCStorage.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCStorage.h deleted file mode 100644 index dfb66b8..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCStorage.h +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCStorage_h -#define JSCStorage_h - -#include <string> -#include "DOM/Node.hpp" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCStorage { -public: - struct JSCStoragePrivate { - JSCDOM* dom; - uscxml::Storage* nativeObj; - }; - - JSC_DESTRUCTOR_KEEP_WRAPPED(JSCStoragePrivate); - - static JSValueRef keyCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef getItemCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setItemCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef removeItemCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef clearCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - static JSValueRef lengthAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "Storage"; - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCStorage_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCText.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCText.cpp deleted file mode 100644 index be25753..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCText.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCCharacterData.h" -#include "JSCText.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCText::Tmpl; - -JSStaticValue JSCText::staticValues[] = { - - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCText::staticFunctions[] = { - { "splitText", splitTextCallback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSValueRef JSCText::splitTextCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCTextPrivate* privData = (struct JSCTextPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - Arabica::DOM::Text<std::string>* retVal = new Arabica::DOM::Text<std::string>(privData->nativeObj->splitText(localOffset)); - JSClassRef retClass = JSCText::getTmpl(); - - struct JSCText::JSCTextPrivate* retPrivData = new JSCText::JSCTextPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling splitText"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCText.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCText.h deleted file mode 100644 index 7ca23cb..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCText.h +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCText_h -#define JSCText_h - -#include <string> -#include "DOM/Node.hpp" -#include "JSCCharacterData.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCText { -public: - struct JSCTextPrivate { - JSCDOM* dom; - Arabica::DOM::Text<std::string>* nativeObj; - }; - - JSC_DESTRUCTOR(JSCTextPrivate); - - static JSValueRef splitTextCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "Text"; - classDef.parentClass = JSCCharacterData::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCText_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCTypedArrayCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCTypedArrayCustom.cpp deleted file mode 100644 index b5122e8..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCTypedArrayCustom.cpp +++ /dev/null @@ -1,250 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "../../TypedArray.h" -#include "JSCArrayBuffer.h" -#include "JSCInt8Array.h" -#include "JSCUint8Array.h" -#include "JSCUint8ClampedArray.h" -#include "JSCInt16Array.h" -#include "JSCUint16Array.h" -#include "JSCInt32Array.h" -#include "JSCUint32Array.h" -#include "JSCFloat32Array.h" -#include "JSCFloat64Array.h" -#include "JSCDataView.h" - -#define JSC_VALUE_TO_STRING(name, stringName)\ -size_t name##MaxSize = JSStringGetMaximumUTF8CStringSize(name);\ -char* name##Buffer = new char[name##MaxSize];\ -JSStringGetUTF8CString(name, name##Buffer, name##MaxSize);\ -std::string stringName(name##Buffer);\ -free(name##Buffer);\ - - -#define JSC_TYPED_ARRAY_GET_PROP_RETURN(type)\ -size_t propMaxSize = JSStringGetMaximumUTF8CStringSize(propertyName);\ -char* propBuffer = new char[propMaxSize];\ -JSStringGetUTF8CString(propertyName, propBuffer, propMaxSize);\ -std::string propName(propBuffer);\ -free(propBuffer);\ -if (strcmp(propName.c_str(), "prototype") == 0) {\ - JSStringRef prototypeName = JSStringCreateWithUTF8CString(#type);\ - JSValueRef prototype = JSObjectGetProperty(ctx, JSContextGetGlobalObject(ctx), prototypeName, exception);\ - assert(!JSValueIsUndefined(ctx, prototype) && !JSValueIsNull(ctx, prototype));\ - JSStringRelease(prototypeName);\ - return prototype;\ -}\ -JSStaticValue* prop = JSC##type::staticValues;\ -while(prop->name) {\ - if (strcmp(propName.c_str(), prop->name) == 0) {\ - return (prop->getProperty)(ctx, object, propertyName, exception);\ - }\ - prop++;\ -}\ -\ -JSC##type::JSC##type##Private* privObj = (JSC##type::JSC##type##Private*)JSObjectGetPrivate(object);\ -if (!privObj)\ - return JSValueMakeUndefined(ctx);\ -\ -uscxml::type* array = ((JSC##type::JSC##type##Private*)JSObjectGetPrivate(object))->nativeObj;\ -std::string base = "0123456789";\ -if (propName.find_first_not_of(base) != std::string::npos) {\ - return JSValueMakeUndefined(ctx);\ -}\ -unsigned long index = boost::lexical_cast<unsigned long>(propName);\ -return JSValueMakeNumber(ctx, array->get(index)); - - - -#define JSC_TYPED_ARRAY_SET_PROP_RETURN(type)\ -if (!JSValueIsNumber(ctx, value)) {\ - return false;\ -}\ -size_t propMaxSize = JSStringGetMaximumUTF8CStringSize(propertyName);\ -char* propBuffer = new char[propMaxSize];\ -JSStringGetUTF8CString(propertyName, propBuffer, propMaxSize);\ -std::string propName(propBuffer);\ -free(propBuffer);\ -uscxml::type* array = ((JSC##type::JSC##type##Private*)JSObjectGetPrivate(object))->nativeObj;\ -std::string base = "0123456789";\ -if (propName.find_first_not_of(base) != std::string::npos) {\ - return JSValueMakeUndefined(ctx);\ -}\ -unsigned long index = boost::lexical_cast<unsigned long>(propName);\ -if (index >= array->getLength()) {\ - return false;\ -}\ -array->set(index, JSValueToNumber(ctx, value, exception));\ -return true; - - -#define JSC_TYPED_ARRAY_HAS_PROP_RETURN(type)\ -size_t propertyNameMaxSize = JSStringGetMaximumUTF8CStringSize(propertyName);\ -char* propertyNameBuffer = new char[propertyNameMaxSize];\ -JSStringGetUTF8CString(propertyName, propertyNameBuffer, propertyNameMaxSize);\ -std::string propName(propertyNameBuffer);\ -free(propertyNameBuffer);\ -\ -if (strcmp(propName.c_str(), "prototype") == 0)\ - return true;\ -\ -if (strcmp(propName.c_str(), "length") == 0)\ - return true;\ -\ -JSStaticValue* prop = JSC##type::staticValues;\ -while(prop->name) {\ - if (strcmp(propName.c_str(), prop->name) == 0) {\ - return true;\ - }\ - prop++;\ -}\ -\ -JSC##type::JSC##type##Private* privObj = (JSC##type::JSC##type##Private*)JSObjectGetPrivate(object);\ -if (!privObj)\ - return false;\ -\ -uscxml::type* array = ((JSC##type::JSC##type##Private*)JSObjectGetPrivate(object))->nativeObj;\ -std::string base = "0123456789";\ -if (propName.find_first_not_of(base) != std::string::npos) {\ - return false;\ -}\ -unsigned long index = boost::lexical_cast<unsigned long>(propName);\ -if (array->getLength() > index)\ - return true;\ -return false;\ - -namespace Arabica { -namespace DOM { - -bool JSCInt8Array::hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName) { - JSC_TYPED_ARRAY_HAS_PROP_RETURN(Int8Array); -} - -bool JSCInt16Array::hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName) { - JSC_TYPED_ARRAY_HAS_PROP_RETURN(Int16Array); -} - -bool JSCInt32Array::hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName) { - JSC_TYPED_ARRAY_HAS_PROP_RETURN(Int32Array); -} - -bool JSCUint8Array::hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName) { - JSC_TYPED_ARRAY_HAS_PROP_RETURN(Uint8Array); -} - -bool JSCUint16Array::hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName) { - JSC_TYPED_ARRAY_HAS_PROP_RETURN(Uint16Array); -} - -bool JSCUint32Array::hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName) { - JSC_TYPED_ARRAY_HAS_PROP_RETURN(Uint32Array); -} - -bool JSCFloat32Array::hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName) { - JSC_TYPED_ARRAY_HAS_PROP_RETURN(Float32Array); -} - -bool JSCFloat64Array::hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName) { - JSC_TYPED_ARRAY_HAS_PROP_RETURN(Float64Array); -} - -bool JSCUint8ClampedArray::hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName) { - JSC_TYPED_ARRAY_HAS_PROP_RETURN(Uint8ClampedArray); -} - -// ----------------- - -JSValueRef JSCInt8Array::getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { - JSC_TYPED_ARRAY_GET_PROP_RETURN(Int8Array); -} - -JSValueRef JSCInt16Array::getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { - JSC_TYPED_ARRAY_GET_PROP_RETURN(Int16Array); -} - -JSValueRef JSCInt32Array::getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { - JSC_TYPED_ARRAY_GET_PROP_RETURN(Int32Array); -} - -JSValueRef JSCUint8Array::getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { - JSC_TYPED_ARRAY_GET_PROP_RETURN(Uint8Array); -} - -JSValueRef JSCUint16Array::getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { - JSC_TYPED_ARRAY_GET_PROP_RETURN(Uint16Array); -} - -JSValueRef JSCUint32Array::getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { - JSC_TYPED_ARRAY_GET_PROP_RETURN(Uint32Array); -} - -JSValueRef JSCFloat32Array::getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { - JSC_TYPED_ARRAY_GET_PROP_RETURN(Float32Array); -} - -JSValueRef JSCFloat64Array::getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { - JSC_TYPED_ARRAY_GET_PROP_RETURN(Float64Array); -} - -JSValueRef JSCUint8ClampedArray::getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { - JSC_TYPED_ARRAY_GET_PROP_RETURN(Uint8ClampedArray); -} - -// ---------------- - -bool JSCInt8Array::setPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) { - JSC_TYPED_ARRAY_SET_PROP_RETURN(Int8Array); -} - -bool JSCInt16Array::setPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) { - JSC_TYPED_ARRAY_SET_PROP_RETURN(Int16Array); -} - -bool JSCInt32Array::setPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) { - JSC_TYPED_ARRAY_SET_PROP_RETURN(Int32Array); -} - -bool JSCUint8Array::setPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) { - JSC_TYPED_ARRAY_SET_PROP_RETURN(Uint8Array); -} - -bool JSCUint16Array::setPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) { - JSC_TYPED_ARRAY_SET_PROP_RETURN(Uint16Array); -} - -bool JSCUint32Array::setPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) { - JSC_TYPED_ARRAY_SET_PROP_RETURN(Uint32Array); -} - -bool JSCFloat32Array::setPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) { - JSC_TYPED_ARRAY_SET_PROP_RETURN(Float32Array); -} - -bool JSCFloat64Array::setPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) { - JSC_TYPED_ARRAY_SET_PROP_RETURN(Float64Array); -} - -bool JSCUint8ClampedArray::setPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) { - JSC_TYPED_ARRAY_SET_PROP_RETURN(Uint8ClampedArray); -} - - -} -}
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint16Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint16Array.cpp deleted file mode 100644 index d869d1e..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint16Array.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCArrayBuffer.h" -#include "JSCArrayBufferView.h" -#include "JSCUint16Array.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCUint16Array::Tmpl; - -JSStaticValue JSCUint16Array::staticValues[] = { - { "length", lengthAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { "BYTES_PER_ELEMENT", BYTES_PER_ELEMENTConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCUint16Array::staticFunctions[] = { - { "get", getCallback, kJSPropertyAttributeDontDelete }, - { "set", setCallback, kJSPropertyAttributeDontDelete }, - { "subarray", subarrayCallback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSObjectRef JSCUint16Array::jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - uscxml::Uint16Array* localInstance = NULL; - - if (false) { - } else if (argumentCount == 3 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl()) && - JSValueIsNumber(ctx, arguments[1]) && - JSValueIsNumber(ctx, arguments[2])) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - unsigned long localLength = (unsigned long)JSValueToNumber(ctx, arguments[2], exception); - localInstance = new uscxml::Uint16Array(localBuffer, localByteOffset, localLength); - - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl()) && - JSValueIsNumber(ctx, arguments[1])) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - localInstance = new uscxml::Uint16Array(localBuffer, localByteOffset); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCUint16Array::getTmpl())) { - - uscxml::Uint16Array* localArray = ((struct JSCUint16Array::JSCUint16ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - localInstance = new uscxml::Uint16Array(localArray); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl())) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - localInstance = new uscxml::Uint16Array(localBuffer); - - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - - unsigned long localLength = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - localInstance = new uscxml::Uint16Array(localLength); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0])) { - - - std::vector<unsigned short> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - localInstance = new uscxml::Uint16Array(localArray); - - } - if (!localInstance) { - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling constructor for Uint16Array"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return (JSObjectRef)JSValueMakeNull(ctx); - } - - JSClassRef retClass = JSCUint16Array::getTmpl(); - - struct JSCUint16Array::JSCUint16ArrayPrivate* retPrivData = new JSCUint16Array::JSCUint16ArrayPrivate(); - retPrivData->nativeObj = localInstance; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - return retObj; -} - -JSValueRef JSCUint16Array::lengthAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCUint16ArrayPrivate* privData = (struct JSCUint16ArrayPrivate*)JSObjectGetPrivate(object); - - return JSValueMakeNumber(ctx, privData->nativeObj->getLength()); -} - -JSValueRef JSCUint16Array::BYTES_PER_ELEMENTConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 2); -} - - -JSValueRef JSCUint16Array::getCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCUint16ArrayPrivate* privData = (struct JSCUint16ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - unsigned short retVal = privData->nativeObj->get(localIndex); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling get"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCUint16Array::setCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCUint16ArrayPrivate* privData = (struct JSCUint16ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCUint16Array::getTmpl()) && - JSValueIsNumber(ctx, arguments[1])) { - uscxml::Uint16Array* localArray = ((struct JSCUint16Array::JSCUint16ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localArray, localOffset); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - unsigned short localValue = (unsigned short)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localIndex, localValue); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - - std::vector<unsigned short> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localArray, localOffset); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCUint16Array::getTmpl())) { - uscxml::Uint16Array* localArray = ((struct JSCUint16Array::JSCUint16ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - - privData->nativeObj->set(localArray); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0])) { - - std::vector<unsigned short> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - - privData->nativeObj->set(localArray); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling set"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCUint16Array::subarrayCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCUint16ArrayPrivate* privData = (struct JSCUint16ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - long localStart = (long)JSValueToNumber(ctx, arguments[0], exception); - long localEnd = (long)JSValueToNumber(ctx, arguments[1], exception); - - uscxml::Uint16Array* retVal = new uscxml::Uint16Array(privData->nativeObj->subarray(localStart, localEnd)); - JSClassRef retClass = JSCUint16Array::getTmpl(); - - struct JSCUint16Array::JSCUint16ArrayPrivate* retPrivData = new JSCUint16Array::JSCUint16ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - long localStart = (long)JSValueToNumber(ctx, arguments[0], exception); - - uscxml::Uint16Array* retVal = new uscxml::Uint16Array(privData->nativeObj->subarray(localStart)); - JSClassRef retClass = JSCUint16Array::getTmpl(); - - struct JSCUint16Array::JSCUint16ArrayPrivate* retPrivData = new JSCUint16Array::JSCUint16ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling subarray"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint16Array.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint16Array.h deleted file mode 100644 index 19ff639..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint16Array.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCUint16Array_h -#define JSCUint16Array_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "JSCArrayBufferView.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCUint16Array { -public: - struct JSCUint16ArrayPrivate { - JSCDOM* dom; - uscxml::Uint16Array* nativeObj; - }; - - JSC_DESTRUCTOR(JSCUint16ArrayPrivate); - - static JSValueRef getCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef subarrayCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - static JSObjectRef jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - static JSValueRef lengthAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef BYTES_PER_ELEMENTConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static bool hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName); - static JSValueRef getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception); - static bool setPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "Uint16Array"; - classDef.hasProperty = hasPropertyCustomCallback; - classDef.getProperty = getPropertyCustomCallback; - classDef.setProperty = setPropertyCustomCallback; - classDef.callAsConstructor = jsConstructor; - classDef.parentClass = JSCArrayBufferView::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCUint16Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint32Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint32Array.cpp deleted file mode 100644 index 8fbefb3..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint32Array.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCArrayBuffer.h" -#include "JSCArrayBufferView.h" -#include "JSCUint32Array.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCUint32Array::Tmpl; - -JSStaticValue JSCUint32Array::staticValues[] = { - { "length", lengthAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { "BYTES_PER_ELEMENT", BYTES_PER_ELEMENTConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCUint32Array::staticFunctions[] = { - { "get", getCallback, kJSPropertyAttributeDontDelete }, - { "set", setCallback, kJSPropertyAttributeDontDelete }, - { "subarray", subarrayCallback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSObjectRef JSCUint32Array::jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - uscxml::Uint32Array* localInstance = NULL; - - if (false) { - } else if (argumentCount == 3 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl()) && - JSValueIsNumber(ctx, arguments[1]) && - JSValueIsNumber(ctx, arguments[2])) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - unsigned long localLength = (unsigned long)JSValueToNumber(ctx, arguments[2], exception); - localInstance = new uscxml::Uint32Array(localBuffer, localByteOffset, localLength); - - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl()) && - JSValueIsNumber(ctx, arguments[1])) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - localInstance = new uscxml::Uint32Array(localBuffer, localByteOffset); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCUint32Array::getTmpl())) { - - uscxml::Uint32Array* localArray = ((struct JSCUint32Array::JSCUint32ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - localInstance = new uscxml::Uint32Array(localArray); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl())) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - localInstance = new uscxml::Uint32Array(localBuffer); - - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - - unsigned long localLength = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - localInstance = new uscxml::Uint32Array(localLength); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0])) { - - - std::vector<unsigned long> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - localInstance = new uscxml::Uint32Array(localArray); - - } - if (!localInstance) { - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling constructor for Uint32Array"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return (JSObjectRef)JSValueMakeNull(ctx); - } - - JSClassRef retClass = JSCUint32Array::getTmpl(); - - struct JSCUint32Array::JSCUint32ArrayPrivate* retPrivData = new JSCUint32Array::JSCUint32ArrayPrivate(); - retPrivData->nativeObj = localInstance; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - return retObj; -} - -JSValueRef JSCUint32Array::lengthAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCUint32ArrayPrivate* privData = (struct JSCUint32ArrayPrivate*)JSObjectGetPrivate(object); - - return JSValueMakeNumber(ctx, privData->nativeObj->getLength()); -} - -JSValueRef JSCUint32Array::BYTES_PER_ELEMENTConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 4); -} - - -JSValueRef JSCUint32Array::getCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCUint32ArrayPrivate* privData = (struct JSCUint32ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - unsigned long retVal = privData->nativeObj->get(localIndex); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling get"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCUint32Array::setCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCUint32ArrayPrivate* privData = (struct JSCUint32ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCUint32Array::getTmpl()) && - JSValueIsNumber(ctx, arguments[1])) { - uscxml::Uint32Array* localArray = ((struct JSCUint32Array::JSCUint32ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localArray, localOffset); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - unsigned long localValue = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localIndex, localValue); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - - std::vector<unsigned long> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localArray, localOffset); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCUint32Array::getTmpl())) { - uscxml::Uint32Array* localArray = ((struct JSCUint32Array::JSCUint32ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - - privData->nativeObj->set(localArray); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0])) { - - std::vector<unsigned long> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - - privData->nativeObj->set(localArray); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling set"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCUint32Array::subarrayCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCUint32ArrayPrivate* privData = (struct JSCUint32ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - long localStart = (long)JSValueToNumber(ctx, arguments[0], exception); - long localEnd = (long)JSValueToNumber(ctx, arguments[1], exception); - - uscxml::Uint32Array* retVal = new uscxml::Uint32Array(privData->nativeObj->subarray(localStart, localEnd)); - JSClassRef retClass = JSCUint32Array::getTmpl(); - - struct JSCUint32Array::JSCUint32ArrayPrivate* retPrivData = new JSCUint32Array::JSCUint32ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - long localStart = (long)JSValueToNumber(ctx, arguments[0], exception); - - uscxml::Uint32Array* retVal = new uscxml::Uint32Array(privData->nativeObj->subarray(localStart)); - JSClassRef retClass = JSCUint32Array::getTmpl(); - - struct JSCUint32Array::JSCUint32ArrayPrivate* retPrivData = new JSCUint32Array::JSCUint32ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling subarray"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint32Array.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint32Array.h deleted file mode 100644 index 5d6e371..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint32Array.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCUint32Array_h -#define JSCUint32Array_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "JSCArrayBufferView.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCUint32Array { -public: - struct JSCUint32ArrayPrivate { - JSCDOM* dom; - uscxml::Uint32Array* nativeObj; - }; - - JSC_DESTRUCTOR(JSCUint32ArrayPrivate); - - static JSValueRef getCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef subarrayCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - static JSObjectRef jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - static JSValueRef lengthAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef BYTES_PER_ELEMENTConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static bool hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName); - static JSValueRef getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception); - static bool setPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "Uint32Array"; - classDef.hasProperty = hasPropertyCustomCallback; - classDef.getProperty = getPropertyCustomCallback; - classDef.setProperty = setPropertyCustomCallback; - classDef.callAsConstructor = jsConstructor; - classDef.parentClass = JSCArrayBufferView::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCUint32Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8Array.cpp deleted file mode 100644 index fbdbb14..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8Array.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCArrayBuffer.h" -#include "JSCArrayBufferView.h" -#include "JSCUint8Array.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCUint8Array::Tmpl; - -JSStaticValue JSCUint8Array::staticValues[] = { - { "length", lengthAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { "BYTES_PER_ELEMENT", BYTES_PER_ELEMENTConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCUint8Array::staticFunctions[] = { - { "get", getCallback, kJSPropertyAttributeDontDelete }, - { "set", setCallback, kJSPropertyAttributeDontDelete }, - { "subarray", subarrayCallback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSObjectRef JSCUint8Array::jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - uscxml::Uint8Array* localInstance = NULL; - - if (false) { - } else if (argumentCount == 3 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl()) && - JSValueIsNumber(ctx, arguments[1]) && - JSValueIsNumber(ctx, arguments[2])) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - unsigned long localLength = (unsigned long)JSValueToNumber(ctx, arguments[2], exception); - localInstance = new uscxml::Uint8Array(localBuffer, localByteOffset, localLength); - - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl()) && - JSValueIsNumber(ctx, arguments[1])) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - localInstance = new uscxml::Uint8Array(localBuffer, localByteOffset); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCUint8Array::getTmpl())) { - - uscxml::Uint8Array* localArray = ((struct JSCUint8Array::JSCUint8ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - localInstance = new uscxml::Uint8Array(localArray); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl())) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - localInstance = new uscxml::Uint8Array(localBuffer); - - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - - unsigned long localLength = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - localInstance = new uscxml::Uint8Array(localLength); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0])) { - - - std::vector<unsigned char> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - localInstance = new uscxml::Uint8Array(localArray); - - } - if (!localInstance) { - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling constructor for Uint8Array"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return (JSObjectRef)JSValueMakeNull(ctx); - } - - JSClassRef retClass = JSCUint8Array::getTmpl(); - - struct JSCUint8Array::JSCUint8ArrayPrivate* retPrivData = new JSCUint8Array::JSCUint8ArrayPrivate(); - retPrivData->nativeObj = localInstance; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - return retObj; -} - -JSValueRef JSCUint8Array::lengthAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCUint8ArrayPrivate* privData = (struct JSCUint8ArrayPrivate*)JSObjectGetPrivate(object); - - return JSValueMakeNumber(ctx, privData->nativeObj->getLength()); -} - -JSValueRef JSCUint8Array::BYTES_PER_ELEMENTConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 1); -} - - -JSValueRef JSCUint8Array::getCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCUint8ArrayPrivate* privData = (struct JSCUint8ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - unsigned char retVal = privData->nativeObj->get(localIndex); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling get"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCUint8Array::setCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCUint8ArrayPrivate* privData = (struct JSCUint8ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCUint8Array::getTmpl()) && - JSValueIsNumber(ctx, arguments[1])) { - uscxml::Uint8Array* localArray = ((struct JSCUint8Array::JSCUint8ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localArray, localOffset); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - unsigned char localValue = (unsigned char)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localIndex, localValue); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - - std::vector<unsigned char> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localArray, localOffset); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCUint8Array::getTmpl())) { - uscxml::Uint8Array* localArray = ((struct JSCUint8Array::JSCUint8ArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - - privData->nativeObj->set(localArray); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0])) { - - std::vector<unsigned char> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - - privData->nativeObj->set(localArray); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling set"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCUint8Array::subarrayCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCUint8ArrayPrivate* privData = (struct JSCUint8ArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - long localStart = (long)JSValueToNumber(ctx, arguments[0], exception); - long localEnd = (long)JSValueToNumber(ctx, arguments[1], exception); - - uscxml::Uint8Array* retVal = new uscxml::Uint8Array(privData->nativeObj->subarray(localStart, localEnd)); - JSClassRef retClass = JSCUint8Array::getTmpl(); - - struct JSCUint8Array::JSCUint8ArrayPrivate* retPrivData = new JSCUint8Array::JSCUint8ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - long localStart = (long)JSValueToNumber(ctx, arguments[0], exception); - - uscxml::Uint8Array* retVal = new uscxml::Uint8Array(privData->nativeObj->subarray(localStart)); - JSClassRef retClass = JSCUint8Array::getTmpl(); - - struct JSCUint8Array::JSCUint8ArrayPrivate* retPrivData = new JSCUint8Array::JSCUint8ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling subarray"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8Array.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8Array.h deleted file mode 100644 index af9e79f..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8Array.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCUint8Array_h -#define JSCUint8Array_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "JSCArrayBufferView.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCUint8Array { -public: - struct JSCUint8ArrayPrivate { - JSCDOM* dom; - uscxml::Uint8Array* nativeObj; - }; - - JSC_DESTRUCTOR(JSCUint8ArrayPrivate); - - static JSValueRef getCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef subarrayCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - static JSObjectRef jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - static JSValueRef lengthAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef BYTES_PER_ELEMENTConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static bool hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName); - static JSValueRef getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception); - static bool setPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "Uint8Array"; - classDef.hasProperty = hasPropertyCustomCallback; - classDef.getProperty = getPropertyCustomCallback; - classDef.setProperty = setPropertyCustomCallback; - classDef.callAsConstructor = jsConstructor; - classDef.parentClass = JSCArrayBufferView::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCUint8Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8ClampedArray.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8ClampedArray.cpp deleted file mode 100644 index 848a507..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8ClampedArray.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCArrayBuffer.h" -#include "JSCArrayBufferView.h" -#include "JSCUint8ClampedArray.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCUint8ClampedArray::Tmpl; - -JSStaticValue JSCUint8ClampedArray::staticValues[] = { - { "length", lengthAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { "BYTES_PER_ELEMENT", BYTES_PER_ELEMENTConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCUint8ClampedArray::staticFunctions[] = { - { "get", getCallback, kJSPropertyAttributeDontDelete }, - { "set", setCallback, kJSPropertyAttributeDontDelete }, - { "subarray", subarrayCallback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSObjectRef JSCUint8ClampedArray::jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - uscxml::Uint8ClampedArray* localInstance = NULL; - - if (false) { - } else if (argumentCount == 3 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl()) && - JSValueIsNumber(ctx, arguments[1]) && - JSValueIsNumber(ctx, arguments[2])) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - unsigned long localLength = (unsigned long)JSValueToNumber(ctx, arguments[2], exception); - localInstance = new uscxml::Uint8ClampedArray(localBuffer, localByteOffset, localLength); - - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl()) && - JSValueIsNumber(ctx, arguments[1])) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localByteOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - localInstance = new uscxml::Uint8ClampedArray(localBuffer, localByteOffset); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCUint8ClampedArray::getTmpl())) { - - uscxml::Uint8ClampedArray* localArray = ((struct JSCUint8ClampedArray::JSCUint8ClampedArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - localInstance = new uscxml::Uint8ClampedArray(localArray); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCArrayBuffer::getTmpl())) { - - uscxml::ArrayBuffer* localBuffer = ((struct JSCArrayBuffer::JSCArrayBufferPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - localInstance = new uscxml::Uint8ClampedArray(localBuffer); - - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - - unsigned long localLength = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - localInstance = new uscxml::Uint8ClampedArray(localLength); - - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0])) { - - - std::vector<unsigned char> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - localInstance = new uscxml::Uint8ClampedArray(localArray); - - } - if (!localInstance) { - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling constructor for Uint8ClampedArray"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return (JSObjectRef)JSValueMakeNull(ctx); - } - - JSClassRef retClass = JSCUint8ClampedArray::getTmpl(); - - struct JSCUint8ClampedArray::JSCUint8ClampedArrayPrivate* retPrivData = new JSCUint8ClampedArray::JSCUint8ClampedArrayPrivate(); - retPrivData->nativeObj = localInstance; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - return retObj; -} - -JSValueRef JSCUint8ClampedArray::lengthAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCUint8ClampedArrayPrivate* privData = (struct JSCUint8ClampedArrayPrivate*)JSObjectGetPrivate(object); - - return JSValueMakeNumber(ctx, privData->nativeObj->getLength()); -} - -JSValueRef JSCUint8ClampedArray::BYTES_PER_ELEMENTConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef *exception) { - return JSValueMakeNumber(ctx, 1); -} - - -JSValueRef JSCUint8ClampedArray::getCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCUint8ClampedArrayPrivate* privData = (struct JSCUint8ClampedArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - - unsigned char retVal = privData->nativeObj->get(localIndex); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling get"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCUint8ClampedArray::setCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCUint8ClampedArrayPrivate* privData = (struct JSCUint8ClampedArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCUint8ClampedArray::getTmpl()) && - JSValueIsNumber(ctx, arguments[1])) { - uscxml::Uint8ClampedArray* localArray = ((struct JSCUint8ClampedArray::JSCUint8ClampedArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localArray, localOffset); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - unsigned long localIndex = (unsigned long)JSValueToNumber(ctx, arguments[0], exception); - unsigned char localValue = (unsigned char)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localIndex, localValue); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 2 && - JSValueIsObject(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - - std::vector<unsigned char> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - unsigned long localOffset = (unsigned long)JSValueToNumber(ctx, arguments[1], exception); - - privData->nativeObj->set(localArray, localOffset); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0]) && JSValueIsObjectOfClass(ctx, arguments[0], JSCUint8ClampedArray::getTmpl())) { - uscxml::Uint8ClampedArray* localArray = ((struct JSCUint8ClampedArray::JSCUint8ClampedArrayPrivate*)JSObjectGetPrivate(JSValueToObject(ctx, arguments[0], exception)))->nativeObj; - - privData->nativeObj->set(localArray); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } else if (argumentCount == 1 && - JSValueIsObject(ctx, arguments[0])) { - - std::vector<unsigned char> localArray; - - JSValueRef localArrayItem; - unsigned int localArrayIndex = 0; - while((localArrayItem = JSObjectGetPropertyAtIndex(ctx, JSValueToObject(ctx, arguments[0], exception), localArrayIndex, exception))) { - if (JSValueIsUndefined(ctx, localArrayItem)) - break; - if (JSValueIsNumber(ctx,localArrayItem)) - localArray.push_back(JSValueToNumber(ctx, localArrayItem, exception)); - localArrayIndex++; - } - - privData->nativeObj->set(localArray); - - JSValueRef jscRetVal = JSValueMakeUndefined(ctx); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling set"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCUint8ClampedArray::subarrayCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCUint8ClampedArrayPrivate* privData = (struct JSCUint8ClampedArrayPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 2 && - JSValueIsNumber(ctx, arguments[0]) && - JSValueIsNumber(ctx, arguments[1])) { - long localStart = (long)JSValueToNumber(ctx, arguments[0], exception); - long localEnd = (long)JSValueToNumber(ctx, arguments[1], exception); - - uscxml::Uint8ClampedArray* retVal = new uscxml::Uint8ClampedArray(privData->nativeObj->subarray(localStart, localEnd)); - JSClassRef retClass = JSCUint8ClampedArray::getTmpl(); - - struct JSCUint8ClampedArray::JSCUint8ClampedArrayPrivate* retPrivData = new JSCUint8ClampedArray::JSCUint8ClampedArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } else if (argumentCount == 1 && - JSValueIsNumber(ctx, arguments[0])) { - long localStart = (long)JSValueToNumber(ctx, arguments[0], exception); - - uscxml::Uint8ClampedArray* retVal = new uscxml::Uint8ClampedArray(privData->nativeObj->subarray(localStart)); - JSClassRef retClass = JSCUint8ClampedArray::getTmpl(); - - struct JSCUint8ClampedArray::JSCUint8ClampedArrayPrivate* retPrivData = new JSCUint8ClampedArray::JSCUint8ClampedArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling subarray"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8ClampedArray.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8ClampedArray.h deleted file mode 100644 index 1558e48..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCUint8ClampedArray.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCUint8ClampedArray_h -#define JSCUint8ClampedArray_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "JSCArrayBufferView.h" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCUint8ClampedArray { -public: - struct JSCUint8ClampedArrayPrivate { - JSCDOM* dom; - uscxml::Uint8ClampedArray* nativeObj; - }; - - JSC_DESTRUCTOR(JSCUint8ClampedArrayPrivate); - - static JSValueRef getCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef setCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef subarrayCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - static JSObjectRef jsConstructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); - static JSValueRef lengthAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef BYTES_PER_ELEMENTConstGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static bool hasPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName); - static JSValueRef getPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception); - static bool setPropertyCustomCallback(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "Uint8ClampedArray"; - classDef.hasProperty = hasPropertyCustomCallback; - classDef.getProperty = getPropertyCustomCallback; - classDef.setProperty = setPropertyCustomCallback; - classDef.callAsConstructor = jsConstructor; - classDef.parentClass = JSCArrayBufferView::getTmpl(); - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCUint8ClampedArray_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResult.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResult.cpp deleted file mode 100644 index eb443f6..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResult.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ -#include "JSCNodeSet.h" -#include "JSCXPathResult.h" - -namespace Arabica { -namespace DOM { - -JSClassRef JSCXPathResult::Tmpl; - -JSStaticValue JSCXPathResult::staticValues[] = { - { "numberValue", numberValueAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "stringValue", stringValueAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "booleanValue", booleanValueAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "singleNodeValue", singleNodeValueCustomAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - - { 0, 0, 0, 0 } -}; - -JSStaticFunction JSCXPathResult::staticFunctions[] = { - { "asNodeSet", asNodeSetCallback, kJSPropertyAttributeDontDelete }, - { "asBool", asBoolCallback, kJSPropertyAttributeDontDelete }, - { "asString", asStringCallback, kJSPropertyAttributeDontDelete }, - { "asNumber", asNumberCallback, kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } -}; - -JSValueRef JSCXPathResult::numberValueAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCXPathResultPrivate* privData = (struct JSCXPathResultPrivate*)JSObjectGetPrivate(object); - - return JSValueMakeNumber(ctx, privData->nativeObj->asNumber()); -} - - -JSValueRef JSCXPathResult::stringValueAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCXPathResultPrivate* privData = (struct JSCXPathResultPrivate*)JSObjectGetPrivate(object); - - JSStringRef stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->asString().c_str()); - JSValueRef retVal = JSValueMakeString(ctx, stringRef); - JSStringRelease(stringRef); - return retVal; -} - - -JSValueRef JSCXPathResult::booleanValueAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception) { - struct JSCXPathResultPrivate* privData = (struct JSCXPathResultPrivate*)JSObjectGetPrivate(object); - - return JSValueMakeBoolean(ctx, privData->nativeObj->asBool()); -} - - -JSValueRef JSCXPathResult::asNodeSetCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCXPathResultPrivate* privData = (struct JSCXPathResultPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 0) { - - Arabica::XPath::NodeSet<std::string>* retVal = new Arabica::XPath::NodeSet<std::string>(privData->nativeObj->asNodeSet()); - JSClassRef retClass = JSCNodeSet::getTmpl(); - - struct JSCNodeSet::JSCNodeSetPrivate* retPrivData = new JSCNodeSet::JSCNodeSetPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; - - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling asNodeSet"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCXPathResult::asBoolCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCXPathResultPrivate* privData = (struct JSCXPathResultPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 0) { - - bool retVal = privData->nativeObj->asBool(); - - JSValueRef jscRetVal = JSValueMakeBoolean(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling asBool"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCXPathResult::asStringCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCXPathResultPrivate* privData = (struct JSCXPathResultPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 0) { - - std::string retVal = privData->nativeObj->asString(); - - JSStringRef jscString = JSStringCreateWithUTF8CString(retVal.c_str()); - JSValueRef jscRetVal = JSValueMakeString(ctx, jscString); - JSStringRelease(jscString); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling asString"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -JSValueRef JSCXPathResult::asNumberCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { - - struct JSCXPathResultPrivate* privData = (struct JSCXPathResultPrivate*)JSObjectGetPrivate(thisObj); - - if (false) { - } else if (argumentCount == 0) { - - double retVal = privData->nativeObj->asNumber(); - - JSValueRef jscRetVal = JSValueMakeNumber(ctx, retVal); - return jscRetVal; - } - - JSStringRef exceptionString = JSStringCreateWithUTF8CString("Parameter mismatch while calling asNumber"); - *exception = JSValueMakeString(ctx, exceptionString); - JSStringRelease(exceptionString); - return JSValueMakeUndefined(ctx); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResult.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResult.h deleted file mode 100644 index e145dc1..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResult.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef JSCXPathResult_h -#define JSCXPathResult_h - -#include <string> -#include "DOM/Node.hpp" -#include <JavaScriptCore/JavaScriptCore.h> -#include "uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDOM.h" - -namespace Arabica { -namespace DOM { - -class JSCXPathResult { -public: - struct JSCXPathResultPrivate { - JSCDOM* dom; - Arabica::XPath::XPathValue<std::string>* nativeObj; - }; - - JSC_DESTRUCTOR(JSCXPathResultPrivate); - - static JSValueRef asNodeSetCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef asBoolCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef asStringCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - static JSValueRef asNumberCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObj, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception); - - static JSValueRef numberValueAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef stringValueAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef booleanValueAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - static JSValueRef singleNodeValueCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception); - - - static JSStaticValue staticValues[]; - static JSStaticFunction staticFunctions[]; - - static JSClassRef Tmpl; - static JSClassRef getTmpl() { - if (Tmpl == NULL) { - JSClassDefinition classDef = kJSClassDefinitionEmpty; - classDef.staticValues = staticValues; - classDef.staticFunctions = staticFunctions; - classDef.finalize = jsDestructor; - classDef.className = "XPathResult"; - - Tmpl = JSClassCreate(&classDef); - JSClassRetain(Tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // JSCXPathResult_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResultCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResultCustom.cpp deleted file mode 100644 index 42b4ea1..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCXPathResultCustom.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "JSCXPathResult.h" -#include "JSCNode.h" - -namespace Arabica { -namespace DOM { - -JSValueRef JSCXPathResult::singleNodeValueCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception) { - struct JSCXPathResultPrivate* privData = (struct JSCXPathResultPrivate*)JSObjectGetPrivate(thisObj); - - Arabica::XPath::NodeSet<std::string> nodeSet = privData->nativeObj->asNodeSet(); - if (nodeSet.size() == 0) - return JSValueMakeUndefined(ctx); - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(nodeSet[0]); - JSClassRef retClass = JSCNode::getTmpl(); - - struct JSCNode::JSCNodePrivate* retPrivData = new JSCNode::JSCNodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - JSObjectRef retObj = JSObjectMake(ctx, retClass, retPrivData); - - return retObj; -} - -} -}
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/ecmascript/SpiderMonkey/SpiderMonkeyDataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/SpiderMonkey/SpiderMonkeyDataModel.cpp deleted file mode 100644 index c16bece..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/SpiderMonkey/SpiderMonkeyDataModel.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/** - * @file - * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "uscxml/Common.h" -#include "uscxml/config.h" -#include "SpiderMonkeyDataModel.h" - -#include "uscxml/Message.h" -#include "uscxml/dom/DOMUtils.h" -#include <glog/logging.h> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -namespace uscxml { - -using namespace Arabica::XPath; -using namespace Arabica::DOM; - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new SpiderMonkeyDataModelProvider() ); - return true; -} -#endif - -static JSClass global_class = { "global", - JSCLASS_NEW_RESOLVE | JSCLASS_GLOBAL_FLAGS, - JS_PropertyStub, - JS_PropertyStub, - JS_PropertyStub, - JS_PropertyStub, - JS_EnumerateStub, - JS_ResolveStub, - JS_ConvertStub, - nullptr, - JSCLASS_NO_OPTIONAL_MEMBERS - }; - - -JSRuntime* SpiderMonkeyDataModel::_jsRuntime = NULL; - -SpiderMonkeyDataModel::SpiderMonkeyDataModel() { - _jsCtx = NULL; -} - -SpiderMonkeyDataModel::~SpiderMonkeyDataModel() { - if (_jsCtx) - JS_DestroyContext(_jsCtx); -} - -void SpiderMonkeyDataModel::reportError(JSContext *cx, const char *message, JSErrorReport *report) { -#if 0 - struct JSErrorReport { - const char *filename; /* source file name, URL, etc., or null */ - uintN lineno; /* source line number */ - const char *linebuf; /* offending source line without final \n */ - const char *tokenptr; /* pointer to error token in linebuf */ - const jschar *uclinebuf; /* unicode (original) line buffer */ - const jschar *uctokenptr; /* unicode (original) token pointer */ - uintN flags; /* error/warning, etc. */ - uintN errorNumber; /* the error number, e.g. see js.msg */ - const jschar *ucmessage; /* the (default) error message */ - const jschar **messageArgs; /* arguments for the error message */ - }; - exceptionEvent.data.compound["stacktrace"] = Data(stackTrace, Data::VERBATIM); -#endif - - Event exceptionEvent; - exceptionEvent.name = "error.execution"; - exceptionEvent.eventType = Event::PLATFORM; - - exceptionEvent.data.compound["cause"] = Data(message, Data::VERBATIM);; - exceptionEvent.data.compound["filename"] = Data(report->filename, Data::VERBATIM); - exceptionEvent.data.compound["sourceline"] = Data(report->linebuf, Data::VERBATIM); - exceptionEvent.data.compound["linenumber"] = Data(report->lineno, Data::INTERPRETED); - - std::stringstream ssUnderline; - for (int i = 0; i < (report->tokenptr - report->linebuf); i++) - ssUnderline << " "; - ssUnderline << "^"; - - exceptionEvent.data.compound["sourcemark"] = Data(ssUnderline.str(), Data::VERBATIM); - throw exceptionEvent; -} - -boost::shared_ptr<DataModelImpl> SpiderMonkeyDataModel::create(InterpreterImpl* interpreter) { - if (_jsRuntime == NULL) { - JSRuntime *rt = JS_NewRuntime(8L * 1024L * 1024L); - if (!rt) { - throw std::bad_alloc(); - } - } - - boost::shared_ptr<SpiderMonkeyDataModel> dm = boost::shared_ptr<SpiderMonkeyDataModel>(new SpiderMonkeyDataModel()); - dm->_interpreter = interpreter; - dm->_jsCtx = JS_NewContext(_jsRuntime, 8192); - if (!dm->_jsCtx) { - throw std::bad_alloc(); - } - JS_SetOptions(dm->_jsCtx, JSOPTION_VAROBJFIX); - JS_SetErrorReporter(dm->_jsCtx, reportError); - - dm->_global = JS_NewObject(dm->_jsCtx, &global_class, nullptr, nullptr); - if (!JS_InitStandardClasses(dm->_jsCtx, dm->_global)) { - throw std::bad_alloc(); - } - - return dm; -} - -void SpiderMonkeyDataModel::pushContext() { -} - -void SpiderMonkeyDataModel::popContext() { -} - -void SpiderMonkeyDataModel::initialize() { -} - -void SpiderMonkeyDataModel::setEvent(const Event& event) { -} - -Data SpiderMonkeyDataModel::getStringAsData(const std::string& content) { - Data data; - return data; -} - - -bool SpiderMonkeyDataModel::validate(const std::string& location, const std::string& schema) { - return true; -} - -bool SpiderMonkeyDataModel::isLocation(const std::string& expr) { - return true; -} - -uint32_t SpiderMonkeyDataModel::getLength(const std::string& expr) { - return 0; -} - -void SpiderMonkeyDataModel::setForeach(const std::string& item, - const std::string& array, - const std::string& index, - uint32_t iteration) { -} - -void SpiderMonkeyDataModel::eval(const Element<std::string>& scriptElem, - const std::string& expr) { -} - -bool SpiderMonkeyDataModel::isDeclared(const std::string& expr) { - return true; -} - -bool SpiderMonkeyDataModel::evalAsBool(const std::string& expr) { - return evalAsBool(Arabica::DOM::Element<std::string>(), expr); -} - -bool SpiderMonkeyDataModel::evalAsBool(const Arabica::DOM::Element<std::string>& node, const std::string& expr) { -} - -std::string SpiderMonkeyDataModel::evalAsString(const std::string& expr) { - return ""; -} - -double SpiderMonkeyDataModel::evalAsNumber(const std::string& expr) { - return 0; -} - -void SpiderMonkeyDataModel::assign(const Element<std::string>& assignElem, - const Node<std::string>& node, - const std::string& content) { -} - -void SpiderMonkeyDataModel::assign(const std::string& location, - const Data& data) { -} - -void SpiderMonkeyDataModel::init(const Element<std::string>& dataElem, - const Node<std::string>& doc, - const std::string& content) { -}; - -void SpiderMonkeyDataModel::init(const std::string& location, - const Data& data) { -} - -std::string SpiderMonkeyDataModel::andExpressions(std::list<std::string> expressions) { - if (expressions.size() == 0) - return ""; - - if (expressions.size() == 1) - return *(expressions.begin()); - - std::ostringstream exprSS; - exprSS << "("; - std::string conjunction = ""; - for (std::list<std::string>::const_iterator exprIter = expressions.begin(); - exprIter != expressions.end(); - exprIter++) { - exprSS << conjunction << "(" << *exprIter << ")"; - conjunction = " && "; - } - exprSS << ")"; - return exprSS.str(); -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/ecmascript/SpiderMonkey/SpiderMonkeyDataModel.h b/src/uscxml/plugins/datamodel/ecmascript/SpiderMonkey/SpiderMonkeyDataModel.h deleted file mode 100644 index d9a5e5e..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/SpiderMonkey/SpiderMonkeyDataModel.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @file - * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef SPIDERMONKEYDATAMODEL_H_88841EE2 -#define SPIDERMONKEYDATAMODEL_H_88841EE2 - -#include "uscxml/Interpreter.h" -#include <list> -#include "jsapi.h" - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { -class Event; -class Data; -} - -namespace uscxml { - -class SpiderMonkeyDataModel : public DataModelImpl { -public: - SpiderMonkeyDataModel(); - virtual ~SpiderMonkeyDataModel(); - virtual boost::shared_ptr<DataModelImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("ecmascript"); - return names; - } - - virtual void initialize(); - virtual void setEvent(const Event& event); - - virtual bool validate(const std::string& location, const std::string& schema); - virtual bool isLocation(const std::string& expr); - - virtual uint32_t getLength(const std::string& expr); - virtual void setForeach(const std::string& item, - const std::string& array, - const std::string& index, - uint32_t iteration); - virtual void pushContext(); - virtual void popContext(); - - virtual void eval(const Arabica::DOM::Element<std::string>& scriptElem, - const std::string& expr); - virtual void assign(const Arabica::DOM::Element<std::string>& assignElem, - const Arabica::DOM::Node<std::string>& node, - const std::string& content); - virtual void assign(const std::string& location, - const Data& data); - - virtual void init(const Arabica::DOM::Element<std::string>& dataElem, - const Arabica::DOM::Node<std::string>& node, - const std::string& content); - virtual void init(const std::string& location, - const Data& data); - - virtual std::string andExpressions(std::list<std::string>); - - virtual Data getStringAsData(const std::string& content); - - virtual bool isDeclared(const std::string& expr); - - virtual std::string evalAsString(const std::string& expr); - virtual bool evalAsBool(const Arabica::DOM::Element<std::string>& node, const std::string& expr); - virtual bool evalAsBool(const std::string& expr); - virtual double evalAsNumber(const std::string& expr); - - static void reportError(JSContext *cx, const char *message, JSErrorReport *report); - -protected: - - JSObject* _global; - - JSContext* _jsCtx; - static JSRuntime* _jsRuntime; -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(SpiderMonkeyDataModel, DataModelImpl); -#endif - -} - -#endif /* end of include guard: SPIDERMONKEYDATAMODEL_H_88841EE2 */ diff --git a/src/uscxml/plugins/datamodel/ecmascript/Storage.cpp b/src/uscxml/plugins/datamodel/ecmascript/Storage.cpp deleted file mode 100644 index 980fc5d..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/Storage.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "Storage.h" -#include <iostream> -#include <fstream> -#include <istream> - -namespace uscxml { - -Storage::Storage(const std::string& filename) { - _filename = filename; -// std::cout << _filename << std::endl; - std::fstream file; - file.open(_filename.c_str(), std::ios_base::in); - // read content into data - std::string key; - std::string value; - - while(std::getline(file, key, '\0')) { - if(std::getline(file, value, '\0')) { - _data[key] = value; - } - } - file.close(); -} - -Storage::~Storage() { - std::fstream file; - file.open(_filename.c_str(), std::ios_base::out); -// file.clear(); - - std::map<std::string, std::string>::iterator dataIter = _data.begin(); - while(dataIter != _data.end()) { - // include trailing \0 - file.write(dataIter->first.c_str(), dataIter->first.length() + 1); - file.write(dataIter->second.c_str(), dataIter->second.length() + 1); - dataIter++; - } -// file.flush(); - file.close(); -} - -unsigned long Storage::getLength() { - return _data.size(); -} - -std::string Storage::key(unsigned long index) { - if (index > getLength()) - return ""; - - std::map<std::string, std::string>::iterator dataIter = _data.begin(); - for (unsigned int i = 0; i < index; i++) { - dataIter++; - } - return dataIter->first; -} - -std::string Storage::getItem(const std::string& key) { - if (_data.find(key) == _data.end()) - return ""; - return _data[key]; -} - -void Storage::setItem(const std::string& key, const std::string& value) { - _data[key] = value; -} - -void Storage::removeItem(const std::string& key) { - if (_data.find(key) == _data.end()) - return; - _data.erase(key); -} - -void Storage::clear() { - _data.clear(); -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/ecmascript/Storage.h b/src/uscxml/plugins/datamodel/ecmascript/Storage.h deleted file mode 100644 index 35bde86..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/Storage.h +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef STORAGE_H_L672TNX -#define STORAGE_H_L672TNX - -#include <string> -#include <map> - -namespace uscxml { - -class Storage { -public: - Storage(const std::string& filename); - ~Storage(); - - unsigned long getLength(); - std::string key(unsigned long index); - std::string getItem(const std::string& key); - void setItem(const std::string& key, const std::string& value); - void removeItem(const std::string& key); - void clear(); - -protected: - std::map<std::string, std::string> _data; - std::string _filename; -}; - -} - -#endif /* end of include guard: STORAGE_H_L672TNX */ diff --git a/src/uscxml/plugins/datamodel/ecmascript/TypedArray.cpp b/src/uscxml/plugins/datamodel/ecmascript/TypedArray.cpp deleted file mode 100644 index c8b73cf..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/TypedArray.cpp +++ /dev/null @@ -1,283 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "TypedArray.h" -#include "uscxml/Convenience.h" -#include <iostream> - -#define DATAVIEW_TYPED_GET(type) \ -type retVal;\ -if (index + _start + sizeof(type) > _blob._impl->size)\ - return 0;\ -memcpy(&retVal, _blob._impl->data + (_start + index), sizeof(type)); - -#define DATAVIEW_TYPED_SET(type) \ -if (index + _start + sizeof(type) > _blob._impl->size)\ - return;\ -memcpy(_blob._impl->data + (_start + index), &value, sizeof(type)); - -namespace uscxml { - -ArrayBuffer::ArrayBuffer(unsigned long length) { - _blob = Blob(length); -} - -ArrayBuffer::ArrayBuffer(const Blob& blob) : _blob(blob) { -} - -ArrayBuffer::ArrayBuffer(void* data, unsigned int size) { - _blob = Blob((const char*)data, size, "application/octet-stream"); -} - -unsigned long ArrayBuffer::getByteLength() { - if (!_blob) - return 0; - return _blob._impl->size; -} - -ArrayBuffer ArrayBuffer::slice(long begin, long end) { - if (!_blob) { - return ArrayBuffer(0); - } - unsigned int realBegin = (begin + _blob._impl->size) % _blob._impl->size; - unsigned int realEnd = (end + _blob._impl->size) % _blob._impl->size; - if (realEnd < realBegin) { - return ArrayBuffer(0); - } - - ArrayBuffer arrBuffer(realEnd - realBegin); - memcpy(arrBuffer._blob._impl->data, _blob._impl->data + realBegin, realEnd - realBegin); - return arrBuffer; -} - -ArrayBuffer ArrayBuffer::slice(long begin) { - return slice(begin, _blob._impl->size); -} - -bool ArrayBuffer::isView(void*) { - return true; -} - -ArrayBuffer::operator bool() { - return !!_blob; -} - -ArrayBuffer ArrayBufferView::getBuffer() { - return ArrayBuffer(_blob); -} - -DataView::DataView(ArrayBuffer* buffer, unsigned long byteOffset, unsigned long byteLength) { - _start = byteOffset; - if (_start > buffer->_blob._impl->size) - return; - _end = _start + byteLength; - if (_end > buffer->_blob._impl->size) - return; - _blob = buffer->_blob; -} - -DataView::DataView(ArrayBuffer* buffer , unsigned long byteOffset) { - _start = byteOffset; - _end = buffer->_blob._impl->size; - if (_start > buffer->_blob._impl->size) - return; - _blob = buffer->_blob; -} - -DataView::DataView(ArrayBuffer* buffer) { - _start = 0; - _end = (buffer->_blob._impl->size); - _blob = buffer->_blob; -} - -unsigned long DataView::getByteOffset() { - return _start; -} - -unsigned long DataView::getByteLength() { - return _end - _start; -} - -unsigned long DataView::getLength() { - return _end - _start; -} - -int8_t DataView::getInt8(unsigned long index) { - DATAVIEW_TYPED_GET(int8_t); - return retVal; -} - -uint8_t DataView::getUint8(unsigned long index) { - DATAVIEW_TYPED_GET(uint8_t); - return retVal; -} - -int16_t DataView::getInt16(unsigned long index, bool littleEndian) { - DATAVIEW_TYPED_GET(int16_t); -#ifdef BOOST_LITTLE_ENDIAN - if (littleEndian) - return retVal; - return byte_swap<little_endian, big_endian>(retVal); -#else - if (littleEndian) - return byte_swap<big_endian, little_endian>(retVal); - return retVal; -#endif -} - -uint16_t DataView::getUint16(unsigned long index, bool littleEndian) { - DATAVIEW_TYPED_GET(uint16_t); -#ifdef BOOST_LITTLE_ENDIAN - if (littleEndian) - return retVal; - return byte_swap<little_endian, big_endian>(retVal); -#else - if (littleEndian) - return byte_swap<big_endian, little_endian>(retVal); - return retVal; -#endif -} - -int32_t DataView::getInt32(unsigned long index, bool littleEndian) { - DATAVIEW_TYPED_GET(int32_t); -#ifdef BOOST_LITTLE_ENDIAN - if (littleEndian) - return retVal; - return byte_swap<little_endian, big_endian>(retVal); -#else - if (littleEndian) - return byte_swap<big_endian, little_endian>(retVal); - return retVal; -#endif -} - -uint32_t DataView::getUint32(unsigned long index, bool littleEndian) { - DATAVIEW_TYPED_GET(uint32_t); -#ifdef BOOST_LITTLE_ENDIAN - if (littleEndian) - return retVal; - return byte_swap<little_endian, big_endian>(retVal); -#else - if (littleEndian) - return byte_swap<big_endian, little_endian>(retVal); - return retVal; -#endif -} - -float DataView::getFloat32(unsigned long index, bool littleEndian) { - DATAVIEW_TYPED_GET(float); -#ifdef BOOST_LITTLE_ENDIAN - if (littleEndian) - return retVal; - return byte_swap<little_endian, big_endian>(retVal); -#else - if (littleEndian) - return byte_swap<big_endian, little_endian>(retVal); - return retVal; -#endif -} - -double DataView::getFloat64(unsigned long index, bool littleEndian) { - DATAVIEW_TYPED_GET(double); -#ifdef BOOST_LITTLE_ENDIAN - if (littleEndian) - return retVal; - return byte_swap<little_endian, big_endian>(retVal); -#else - if (littleEndian) - return byte_swap<big_endian, little_endian>(retVal); - return retVal; -#endif -} - -void DataView::setInt8(long index, int8_t value) { - DATAVIEW_TYPED_SET(int8_t); -} - -void DataView::setUint8(long index, uint8_t value) { - DATAVIEW_TYPED_SET(uint8_t); -} - -void DataView::setInt16(long index, int16_t value, bool littleEndian) { -#ifdef BOOST_LITTLE_ENDIAN - if (!littleEndian) - value = byte_swap<little_endian, big_endian>(value); -#else - if (littleEndian) - value = byte_swap<big_endian, little_endian>(value); -#endif - DATAVIEW_TYPED_SET(int16_t); -} - -void DataView::setUint16(long index, uint16_t value, bool littleEndian) { -#ifdef BOOST_LITTLE_ENDIAN - if (!littleEndian) - value = byte_swap<little_endian, big_endian>(value); -#else - if (littleEndian) - value = byte_swap<big_endian, little_endian>(value); -#endif - DATAVIEW_TYPED_SET(uint16_t); -} - -void DataView::setInt32(long index, int32_t value, bool littleEndian) { -#ifdef BOOST_LITTLE_ENDIAN - if (!littleEndian) - value = byte_swap<little_endian, big_endian>(value); -#else - if (littleEndian) - value = byte_swap<big_endian, little_endian>(value); -#endif - DATAVIEW_TYPED_SET(int32_t); -} - -void DataView::setUint32(long index, uint32_t value, bool littleEndian) { -#ifdef BOOST_LITTLE_ENDIAN - if (!littleEndian) - value = byte_swap<little_endian, big_endian>(value); -#else - if (littleEndian) - value = byte_swap<big_endian, little_endian>(value); -#endif - DATAVIEW_TYPED_SET(uint32_t); -} - -void DataView::setFloat32(long index, float value, bool littleEndian) { -#ifdef BOOST_LITTLE_ENDIAN - if (!littleEndian) - value = byte_swap<little_endian, big_endian>(value); -#else - if (littleEndian) - value = byte_swap<big_endian, little_endian>(value); -#endif - DATAVIEW_TYPED_SET(float); -} - -void DataView::setFloat64(long index, double value, bool littleEndian) { -#ifdef BOOST_LITTLE_ENDIAN - if (!littleEndian) - value = byte_swap<little_endian, big_endian>(value); -#else - if (littleEndian) - value = byte_swap<big_endian, little_endian>(value); -#endif - DATAVIEW_TYPED_SET(double); -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/ecmascript/TypedArray.h b/src/uscxml/plugins/datamodel/ecmascript/TypedArray.h deleted file mode 100644 index a49410c..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/TypedArray.h +++ /dev/null @@ -1,463 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef TYPEDARRAY_H_99815BLY -#define TYPEDARRAY_H_99815BLY - -#include "uscxml/Common.h" -#include "uscxml/messages/Blob.h" - -#include <string> -#include <vector> -#include <boost/shared_ptr.hpp> -#include <string.h> -#include <inttypes.h> - -#include <boost/type_traits.hpp> -#include <boost/static_assert.hpp> -#include <stdexcept> - - -namespace uscxml { - -/** - * https://www.khronos.org/registry/typedarray/specs/latest/ - */ - -class ArrayBuffer { -public: - - ArrayBuffer(void* data, unsigned int size); - - /** - * Creates a new ArrayBuffer of the given length in bytes. The contents of the - * ArrayBuffer are initialized to 0. If the requested number of bytes could not - * be allocated an exception is raised. - */ - ArrayBuffer(unsigned long length); - ArrayBuffer(const Blob&); - - /** - * The length of the ArrayBuffer in bytes, as fixed at construction time. - * Reading this property returns 0 if this ArrayBuffer has been neutered. - */ - unsigned long getByteLength(); - - /** - * Returns a new ArrayBuffer whose contents are a copy of this ArrayBuffer's - * bytes from begin, inclusive, up to end, exclusive. If either begin or end - * is negative, it refers to an index from the end of the array, as opposed - * to from the beginning. - * If end is unspecified, the new ArrayBuffer contains all bytes from begin - * to the end of this ArrayBuffer. - * The range specified by the begin and end values is clamped to the valid - * index range for the current array. If the computed length of the new - * ArrayBuffer would be negative, it is clamped to zero. - */ - ArrayBuffer slice(long begin, long end); - ArrayBuffer slice(long begin); - static bool isView(void*); - unsigned long getLength() { - return getByteLength(); - } - operator bool(); - bool operator== (const ArrayBuffer& other) { - return other._blob == _blob; - } -// unsigned char get(unsigned long index) { -// if (index >= getLength()) -// return 0; -// unsigned char retVal; -// memcpy(&retVal, _blob->_data + index * sizeof(unsigned char), sizeof(unsigned char)); -// return retVal; -// } -// -// void set(unsigned long index, unsigned char value) { -// memcpy(_blob->_data + index * sizeof(unsigned char), &value, sizeof(unsigned char)); -// } - - // non-standard extension - std::string md5() const { - return _blob.md5(); - } - - // non-standard extension - std::string base64() const { - return _blob.base64(); - } - - std::string getMimeType() const { - if (_blob) - return _blob.getMimeType(); - return ""; - } - - void setMimeType(const std::string& mimeType) { - if (_blob) - _blob.setMimeType(mimeType); - } - - Blob _blob; -}; - -class ArrayBufferView { -public: - virtual ~ArrayBufferView() {} - /** - * The ArrayBuffer that this ArrayBufferView references. - */ - ArrayBuffer getBuffer(); - - /** - * The offset of this ArrayBufferView from the start of its ArrayBuffer, in - * bytes, as fixed at construction time. Reading this property returns 0 if - * the referenced ArrayBuffer has been neutered. - */ - virtual unsigned long getByteOffset() = 0; - - /** - * The length of the ArrayBufferView in bytes, as fixed at construction time. - * Reading this property returns 0 if the referenced ArrayBuffer has been - * neutered. - */ - virtual unsigned long getByteLength() = 0; - virtual unsigned long getLength() = 0; -protected: - Blob _blob; - unsigned long _start; - unsigned long _end; -}; - - -class DataView : ArrayBufferView { -public: - /** - * Create a new DataView object using the passed ArrayBuffer for its storage. - * Optional byteOffset and byteLength can be used to limit the section of the - * buffer referenced. The byteOffset indicates the offset in bytes from the - * start of the ArrayBuffer, and the byteLength is the number of bytes from the - * offset that this DataView will reference. If both byteOffset and byteLength - * are omitted, the DataView spans the entire ArrayBuffer range. If the - * byteLength is omitted, the DataView extends from the given byteOffset until - * the end of the ArrayBuffer. - * If the given byteOffset and byteLength references an area beyond the end of - * the ArrayBuffer an exception is raised. - */ - - DataView(ArrayBuffer*, unsigned long, unsigned long); - DataView(ArrayBuffer*, unsigned long); - DataView(ArrayBuffer*); - - unsigned long getByteOffset(); - unsigned long getByteLength(); - unsigned long getLength(); - - /** - * Gets the value of the given type at the specified byte offset - * from the start of the view. There is no alignment constraint; - * multi-byte values may be fetched from any offset. - * For multi-byte values, the optional littleEndian argument - * indicates whether a big-endian or little-endian value should be - * read. If false or undefined, a big-endian value is read. - * These methods raise an exception if they would read - * beyond the end of the view. - */ - - int8_t getInt8(unsigned long); - uint8_t getUint8(unsigned long); - int16_t getInt16(unsigned long, bool = false); - uint16_t getUint16(unsigned long, bool = false); - int32_t getInt32(unsigned long, bool = false); - uint32_t getUint32(unsigned long, bool = false); - float getFloat32(unsigned long, bool = false); - double getFloat64(unsigned long, bool = false); - - /** - * Stores a value of the given type at the specified byte offset - * from the start of the view. There is no alignment constraint; - * multi-byte values may be stored at any offset. - * For multi-byte values, the optional littleEndian argument - * indicates whether the value should be stored in big-endian or - * little-endian byte order. If false or undefined, the value is - * stored in big-endian byte order. - * These methods raise an exception if they would write - * beyond the end of the view. - */ - - void setInt8(long, int8_t); - void setUint8(long, uint8_t); - void setInt16(long, int16_t, bool = false); - void setUint16(long, uint16_t, bool = false); - void setInt32(long, int32_t, bool = false); - void setUint32(long, uint32_t, bool = false); - void setFloat32(long, float, bool = false); - void setFloat64(long, double, bool = false); - -}; - -template<class T, class S> class TypedArray : public ArrayBufferView { -public: - virtual ~TypedArray() {} - - /** - * Create a new TypedArray object using the passed ArrayBuffer for its storage. - * Optional byteOffset and length can be used to limit the section of the buffer - * referenced. The byteOffset indicates the offset in bytes from the start of - * the ArrayBuffer, and the length is the count of elements from the offset - * that this TypedArray will reference. If both byteOffset and length are - * omitted, the TypedArray spans the entire ArrayBuffer range. If the length - * is omitted, the TypedArray extends from the given byteOffset until the end - * of the ArrayBuffer. - * The given byteOffset must be a multiple of the element size of the specific - * type, otherwise an exception is raised. - * If a given byteOffset and length references an area beyond the end of the - * ArrayBuffer an exception is raised. - * If length is not explicitly specified, the length of the ArrayBuffer minus - * the byteOffset must be a multiple of the element size of the specific type, - * or an exception is raised. - */ - TypedArray(uscxml::ArrayBuffer* buffer, unsigned long byteOffset, unsigned long length) { - if (byteOffset % sizeof(S)) - return; - - _start = byteOffset / sizeof(S); - _end = _start + length; - - if (_end > buffer->_blob._impl->size / sizeof(S)) - return; - - _blob = buffer->_blob; - } - TypedArray(uscxml::ArrayBuffer* buffer, unsigned long byteOffset) { - if (byteOffset % sizeof(S)) - return; - - _start = byteOffset / sizeof(S); - _end = buffer->_blob._impl->size / sizeof(S); - _blob = buffer->_blob; - } - TypedArray(uscxml::ArrayBuffer* buffer) { - _start = 0; - _end = (buffer->_blob._impl->size) / sizeof(S); - _blob = buffer->_blob; - } - - TypedArray(Blob blob, unsigned long byteOffset, unsigned long length) { - if (byteOffset % sizeof(S)) - return; - - _start = byteOffset / sizeof(S); - _end = _start + length; - - if (_end > blob._impl->size / sizeof(S)) - return; - - _blob = blob; - } - - /** - * Create a new ArrayBuffer with enough bytes to hold length elements of this - * typed array, then creates a typed array view referring to the full buffer. - * As with a directly constructed ArrayBuffer, the contents are initialized - * to 0. If the requested number of bytes could not be allocated an exception - * is raised. - */ - TypedArray(unsigned long length) { - _start = 0; - _end = length; - _blob = Blob(length * sizeof(S)); - } - - /** - * Create a new ArrayBuffer with enough bytes to hold array.length elements of - * this typed array, then creates a typed array view referring to the full - * buffer. The contents of the new view are initialized to the contents of the - * given array or typed array, with each element converted to the appropriate - * typed array type. - */ - TypedArray(std::vector<T> data) { - _start = 0; - _end = data.size(); - _blob = Blob(data.size() * sizeof(S)); - set(data, 0); - } - TypedArray(TypedArray* other) { - _start = other->_start; - _end = other->_end; - _blob = other->_blob; - } - - /** - * This is an index getter. - * Returns the element at the given numeric index. - */ - T get(unsigned long index) { - if (index >= getLength()) - return static_cast<T>(0); - S retVal; - memcpy(&retVal, _blob._impl->data + (_start + index) * sizeof(S), sizeof(S)); - return retVal; - } - - /** - * This is an index setter. - * Sets the element at the given numeric index to the given value. - */ - void set(unsigned long index, T value) { - memcpy(_blob._impl->data + (_start + index) * sizeof(S), &value, sizeof(S)); - } - - /** - * Set multiple values, reading input values from the array. - * The optional offset value indicates the index in the current array where - * values are written. If omitted, it is assumed to be 0. - * If the input array is a TypedArray, the two arrays may use the same - * underlying ArrayBuffer. In this situation, setting the values takes place - * as if all the data is first copied into a temporary buffer that does not - * overlap either of the arrays, and then the data from the temporary buffer - * is copied into the current array. - * If the offset plus the length of the given array is out of range for the - * current TypedArray, an exception is raised. - */ - void set(TypedArray<T, S>* value, unsigned long offset) { - if (!_blob) - return; - if (offset * sizeof(S) + value->getByteLength() > _blob._impl->size) - return; - - unsigned long otherOffset = value->_start * sizeof(S); - - // will this work if we use the same buffer? - memcpy(_blob._impl->data + (_start + offset) * sizeof(S), value->_blob._impl->data + otherOffset, value->getByteLength()); - } - - void set(TypedArray<T, S>* value) { - set(value, 0); - } - - /** - * Set multiple values, reading input values from the array. - * The optional offset value indicates the index in the current array where - * values are written. If omitted, it is assumed to be 0. - * If the input array is a TypedArray, the two arrays may use the same - * underlying ArrayBuffer. In this situation, setting the values takes place - * as if all the data is first copied into a temporary buffer that does not - * overlap either of the arrays, and then the data from the temporary buffer - * is copied into the current array. - * If the offset plus the length of the given array is out of range for the - * current TypedArray, an exception is raised. - */ - void set(std::vector<T> data, unsigned long offset) { - if (!_blob) - return; - if (data.size() + offset > _end) - return; - - if (sizeof(T) == sizeof(S)) { - memcpy(_blob._impl->data + offset, (void*)&data[0], data.size() * sizeof(S)); - } else { - S* buffer = (S*)malloc(data.size() * sizeof(S)); - typename std::vector<T>::const_iterator dataIter = data.begin(); - unsigned long i = 0; - while(dataIter != data.end()) { - buffer[i] = *dataIter; - dataIter++; - i++; - } - memcpy(_blob._impl->data + offset, buffer, data.size() * sizeof(S)); - free (buffer); - } - } - - void set(std::vector<T> data) { - set(data, 0); - } - - /** - * Returns a new TypedArray view of the ArrayBuffer store for this TypedArray, - * referencing the elements at begin, inclusive, up to end, exclusive. If - * either begin or end is negative, it refers to an index from the end of the - * array, as opposed to from the beginning. - * If end is unspecified, the subarray contains all elements from begin to the - * end of the TypedArray. - * The range specified by the begin and end values is clamped to the valid - * index range for the current array. If the computed length of the new - * TypedArray would be negative, it is clamped to zero. - * The returned TypedArray will be of the same type as the array on which this - * method is invoked. - */ - TypedArray* subarray(long begin, long end) { - if (!_blob) - return NULL; - unsigned int length = getLength(); - unsigned int realBegin = (begin + length) % length; - unsigned int realEnd = (end + length) % length; - if (realEnd == 0) - realEnd = length; - - if (realEnd < realBegin) - return NULL; - - return new TypedArray<T, S>(_blob, realBegin * sizeof(S), realEnd - realBegin); - } - - TypedArray* subarray(long begin) { - if (!_blob) - return NULL; - return subarray(begin, getLength()); - } - - unsigned long getLength() { - if (!_blob) - return 0; - return _end - _start; - } - - unsigned long getByteLength() { - if (!_blob) - return 0; - return (_end - _start) * sizeof(S); - } - - unsigned long getByteOffset() { - if (!_blob) - return 0; - return _start * sizeof(S); - } - -}; - -/** - * Define actual types as template instances. - * First argument is representation from JavaScript, second type maybe smaller to - * exactly specify the byte width ot the TypedArray. - */ -typedef TypedArray<unsigned char, uint8_t> Uint8Array; -typedef TypedArray<unsigned char, uint8_t> Uint8ClampedArray; -typedef TypedArray<char, int8_t> Int8Array; -typedef TypedArray<short, int16_t> Int16Array; -typedef TypedArray<unsigned short, uint16_t> Uint16Array; -typedef TypedArray<long, int32_t> Int32Array; -typedef TypedArray<unsigned long, uint32_t> Uint32Array; -typedef TypedArray<float, float> Float32Array; -typedef TypedArray<double, double> Float64Array; - -} - -#endif /* end of include guard: TYPEDARRAY_H_99815BLY */ diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.cpp deleted file mode 100644 index 87e7966..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8DOM.h" - -namespace Arabica { -namespace DOM { - -V8DOM::V8DOM() { - nsInfo = NULL; - xpath = NULL; - storage = NULL; -} - -V8DOM::~V8DOM() { - if (nsInfo) - delete(nsInfo); - if (xpath) - delete(xpath); - if (storage) - delete(storage); -} - -} -}
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.cpp.inc b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.cpp.inc new file mode 100644 index 0000000..a0d8ae6 --- /dev/null +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.cpp.inc @@ -0,0 +1,9365 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 3.0.8 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ +template<typename T> class SwigValueWrapper { + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs); + SwigValueWrapper(const SwigValueWrapper<T>& rhs); +public: + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } +}; + +template <typename T> T SwigValueInit() { + return T(); +} +#endif + +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + +/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ +#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) +# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#endif + +/* Intel's compiler complains if a variable which was never initialised is + * cast to void, which is a common idiom which we use to indicate that we + * are aware a variable isn't used. So we just silence that warning. + * See: https://github.com/swig/swig/issues/192 for more discussion. + */ +#ifdef __INTEL_COMPILER +# pragma warning disable 592 +#endif + + + +#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) + +#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else + + + +#ifndef SWIG_V8_VERSION +#define SWIG_V8_VERSION 0x031110 +#endif + + +#include <v8.h> + +#include <errno.h> +#include <limits.h> +#include <stdlib.h> + +/* ----------------------------------------------------------------------------- + * swigrun.swg + * + * This file contains generic C API SWIG runtime support for pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +/* This should only be incremented when either the layout of swig_type_info changes, + or for whatever reason, the runtime changes incompatibly */ +#define SWIG_RUNTIME_VERSION "4" + +/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ +#ifdef SWIG_TYPE_TABLE +# define SWIG_QUOTE_STRING(x) #x +# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) +# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) +#else +# define SWIG_TYPE_TABLE_NAME +#endif + +/* + You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. + + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. +*/ + +#ifndef SWIGRUNTIME +# define SWIGRUNTIME SWIGINTERN +#endif + +#ifndef SWIGRUNTIMEINLINE +# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE +#endif + +/* Generic buffer size */ +#ifndef SWIG_BUFFER_SIZE +# define SWIG_BUFFER_SIZE 1024 +#endif + +/* Flags for pointer conversions */ +#define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 + +/* Flags for new pointer objects */ +#define SWIG_POINTER_OWN 0x1 + + +/* + Flags/methods for returning states. + + The SWIG conversion methods, as ConvertPtr, return an integer + that tells if the conversion was successful or not. And if not, + an error code can be returned (see swigerrors.swg for the codes). + + Use the following macros/flags to set or process the returning + states. + + In old versions of SWIG, code such as the following was usually written: + + if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { + // success code + } else { + //fail code + } + + Now you can be more explicit: + + int res = SWIG_ConvertPtr(obj,vptr,ty.flags); + if (SWIG_IsOK(res)) { + // success code + } else { + // fail code + } + + which is the same really, but now you can also do + + Type *ptr; + int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); + if (SWIG_IsOK(res)) { + // success code + if (SWIG_IsNewObj(res) { + ... + delete *ptr; + } else { + ... + } + } else { + // fail code + } + + I.e., now SWIG_ConvertPtr can return new objects and you can + identify the case and take care of the deallocation. Of course that + also requires SWIG_ConvertPtr to return new result values, such as + + int SWIG_ConvertPtr(obj, ptr,...) { + if (<obj is ok>) { + if (<need new object>) { + *ptr = <ptr to new allocated object>; + return SWIG_NEWOBJ; + } else { + *ptr = <ptr to old object>; + return SWIG_OLDOBJ; + } + } else { + return SWIG_BADOBJ; + } + } + + Of course, returning the plain '0(success)/-1(fail)' still works, but you can be + more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the + SWIG errors code. + + Finally, if the SWIG_CASTRANK_MODE is enabled, the result code + allows to return the 'cast rank', for example, if you have this + + int food(double) + int fooi(int); + + and you call + + food(1) // cast rank '1' (1 -> 1.0) + fooi(1) // cast rank '0' + + just use the SWIG_AddCast()/SWIG_CheckState() +*/ + +#define SWIG_OK (0) +#define SWIG_ERROR (-1) +#define SWIG_IsOK(r) (r >= 0) +#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) + +/* The CastRankLimit says how many bits are used for the cast rank */ +#define SWIG_CASTRANKLIMIT (1 << 8) +/* The NewMask denotes the object was created (using new/malloc) */ +#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) +/* The TmpMask is for in/out typemaps that use temporal objects */ +#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) +/* Simple returning values */ +#define SWIG_BADOBJ (SWIG_ERROR) +#define SWIG_OLDOBJ (SWIG_OK) +#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) +#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) +/* Check, add and del mask methods */ +#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) +#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) +#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) +#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) +#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) +#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) + +/* Cast-Rank Mode */ +#if defined(SWIG_CASTRANK_MODE) +# ifndef SWIG_TypeRank +# define SWIG_TypeRank unsigned long +# endif +# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ +# define SWIG_MAXCASTRANK (2) +# endif +# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) +# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) +SWIGINTERNINLINE int SWIG_AddCast(int r) { + return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; +} +SWIGINTERNINLINE int SWIG_CheckState(int r) { + return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; +} +#else /* no cast-rank mode */ +# define SWIG_AddCast(r) (r) +# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) +#endif + + +#include <string.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *(*swig_converter_func)(void *, int *); +typedef struct swig_type_info *(*swig_dycast_func)(void **); + +/* Structure to store information on one type */ +typedef struct swig_type_info { + const char *name; /* mangled name of this type */ + const char *str; /* human readable name of this type */ + swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ + struct swig_cast_info *cast; /* linked list of types that can cast into this type */ + void *clientdata; /* language specific type data */ + int owndata; /* flag if the structure owns the clientdata */ +} swig_type_info; + +/* Structure to store a type and conversion function used for casting */ +typedef struct swig_cast_info { + swig_type_info *type; /* pointer to type that is equivalent to this type */ + swig_converter_func converter; /* function to cast the void pointers */ + struct swig_cast_info *next; /* pointer to next cast in linked list */ + struct swig_cast_info *prev; /* pointer to the previous cast */ +} swig_cast_info; + +/* Structure used to store module information + * Each module generates one structure like this, and the runtime collects + * all of these structures and stores them in a circularly linked list.*/ +typedef struct swig_module_info { + swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ + size_t size; /* Number of types in this module */ + struct swig_module_info *next; /* Pointer to next element in circularly linked list */ + swig_type_info **type_initial; /* Array of initially generated type structures */ + swig_cast_info **cast_initial; /* Array of initially generated casting structures */ + void *clientdata; /* Language specific module data */ +} swig_module_info; + +/* + Compare two type names skipping the space characters, therefore + "char*" == "char *" and "Class<int>" == "Class<int >", etc. + + Return 0 when the two name types are equivalent, as in + strncmp, but skipping ' '. +*/ +SWIGRUNTIME int +SWIG_TypeNameComp(const char *f1, const char *l1, + const char *f2, const char *l2) { + for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { + while ((*f1 == ' ') && (f1 != l1)) ++f1; + while ((*f2 == ' ') && (f2 != l2)) ++f2; + if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; + } + return (int)((l1 - f1) - (l2 - f2)); +} + +/* + Check type equivalence in a name list like <name1>|<name2>|... + Return 0 if equal, -1 if nb < tb, 1 if nb > tb +*/ +SWIGRUNTIME int +SWIG_TypeCmp(const char *nb, const char *tb) { + int equiv = 1; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (equiv != 0 && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = SWIG_TypeNameComp(nb, ne, tb, te); + if (*ne) ++ne; + } + return equiv; +} + +/* + Check type equivalence in a name list like <name1>|<name2>|... + Return 0 if not equal, 1 if equal +*/ +SWIGRUNTIME int +SWIG_TypeEquiv(const char *nb, const char *tb) { + return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; +} + +/* + Check the typename +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheck(const char *c, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Cast a pointer up an inheritance hierarchy +*/ +SWIGRUNTIMEINLINE void * +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); +} + +/* + Dynamic pointer casting. Down an inheritance hierarchy +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { + swig_type_info *lastty = ty; + if (!ty || !ty->dcast) return ty; + while (ty && (ty->dcast)) { + ty = (*ty->dcast)(ptr); + if (ty) lastty = ty; + } + return lastty; +} + +/* + Return the name associated with this type +*/ +SWIGRUNTIMEINLINE const char * +SWIG_TypeName(const swig_type_info *ty) { + return ty->name; +} + +/* + Return the pretty name associated with this type, + that is an unmangled type name in a form presentable to the user. +*/ +SWIGRUNTIME const char * +SWIG_TypePrettyName(const swig_type_info *type) { + /* The "str" field contains the equivalent pretty names of the + type, separated by vertical-bar characters. We choose + to print the last name, as it is often (?) the most + specific. */ + if (!type) return NULL; + if (type->str != NULL) { + const char *last_name = type->str; + const char *s; + for (s = type->str; *s; s++) + if (*s == '|') last_name = s+1; + return last_name; + } + else + return type->name; +} + +/* + Set the clientdata field for a type +*/ +SWIGRUNTIME void +SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { + swig_cast_info *cast = ti->cast; + /* if (ti->clientdata == clientdata) return; */ + ti->clientdata = clientdata; + + while (cast) { + if (!cast->converter) { + swig_type_info *tc = cast->type; + if (!tc->clientdata) { + SWIG_TypeClientData(tc, clientdata); + } + } + cast = cast->next; + } +} +SWIGRUNTIME void +SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { + SWIG_TypeClientData(ti, clientdata); + ti->owndata = 1; +} + +/* + Search for a swig_type_info structure only by mangled name + Search is a O(log #types) + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_MangledTypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + swig_module_info *iter = start; + do { + if (iter->size) { + size_t l = 0; + size_t r = iter->size - 1; + do { + /* since l+r >= 0, we can (>> 1) instead (/ 2) */ + size_t i = (l + r) >> 1; + const char *iname = iter->types[i]->name; + if (iname) { + int compare = strcmp(name, iname); + if (compare == 0) { + return iter->types[i]; + } else if (compare < 0) { + if (i) { + r = i - 1; + } else { + break; + } + } else if (compare > 0) { + l = i + 1; + } + } else { + break; /* should never happen */ + } + } while (l <= r); + } + iter = iter->next; + } while (iter != end); + return 0; +} + +/* + Search for a swig_type_info structure for either a mangled name or a human readable name. + It first searches the mangled names of the types, which is a O(log #types) + If a type is not found it then searches the human readable names, which is O(#types). + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + /* STEP 1: Search the name field using binary search */ + swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); + if (ret) { + return ret; + } else { + /* STEP 2: If the type hasn't been found, do a complete search + of the str field (the human readable name) */ + swig_module_info *iter = start; + do { + size_t i = 0; + for (; i < iter->size; ++i) { + if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) + return iter->types[i]; + } + iter = iter->next; + } while (iter != end); + } + + /* neither found a match */ + return 0; +} + +/* + Pack binary data into a string +*/ +SWIGRUNTIME char * +SWIG_PackData(char *c, void *ptr, size_t sz) { + static const char hex[17] = "0123456789abcdef"; + const unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + unsigned char uu = *u; + *(c++) = hex[(uu & 0xf0) >> 4]; + *(c++) = hex[uu & 0xf]; + } + return c; +} + +/* + Unpack binary data from a string +*/ +SWIGRUNTIME const char * +SWIG_UnpackData(const char *c, void *ptr, size_t sz) { + unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + char d = *(c++); + unsigned char uu; + if ((d >= '0') && (d <= '9')) + uu = ((d - '0') << 4); + else if ((d >= 'a') && (d <= 'f')) + uu = ((d - ('a'-10)) << 4); + else + return (char *) 0; + d = *(c++); + if ((d >= '0') && (d <= '9')) + uu |= (d - '0'); + else if ((d >= 'a') && (d <= 'f')) + uu |= (d - ('a'-10)); + else + return (char *) 0; + *u = uu; + } + return c; +} + +/* + Pack 'void *' into a string buffer. +*/ +SWIGRUNTIME char * +SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { + char *r = buff; + if ((2*sizeof(void *) + 2) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,&ptr,sizeof(void *)); + if (strlen(name) + 1 > (bsz - (r - buff))) return 0; + strcpy(r,name); + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + *ptr = (void *) 0; + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sizeof(void *)); +} + +SWIGRUNTIME char * +SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { + char *r = buff; + size_t lname = (name ? strlen(name) : 0); + if ((2*sz + 2 + lname) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + if (lname) { + strncpy(r,name,lname+1); + } else { + *r = 0; + } + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + memset(ptr,0,sz); + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sz); +} + +#ifdef __cplusplus +} +#endif + +/* Errors in SWIG */ +#define SWIG_UnknownError -1 +#define SWIG_IOError -2 +#define SWIG_RuntimeError -3 +#define SWIG_IndexError -4 +#define SWIG_TypeError -5 +#define SWIG_DivisionByZero -6 +#define SWIG_OverflowError -7 +#define SWIG_SyntaxError -8 +#define SWIG_ValueError -9 +#define SWIG_SystemError -10 +#define SWIG_AttributeError -11 +#define SWIG_MemoryError -12 +#define SWIG_NullReferenceError -13 + + + +/* --------------------------------------------------------------------------- + * These typedefs and defines are used to deal with v8 API changes + * + * ---------------------------------------------------------------------------*/ + +// First v8 version that uses "SetWeak" and not "MakeWeak" + +#define SWIGV8_SETWEAK_VERSION 0x032224 + +#if (SWIG_V8_VERSION < 0x031803) +#define SWIGV8_STRING_NEW2(cstr, len) v8::String::New(cstr, len) +#else +#define SWIGV8_STRING_NEW2(cstr, len) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), cstr, v8::String::kNormalString, len) +#endif + +#if (SWIG_V8_VERSION < 0x031903) +typedef v8::Handle<v8::Value> SwigV8ReturnValue; +typedef v8::Arguments SwigV8Arguments; +typedef v8::AccessorInfo SwigV8PropertyCallbackInfo; +#define SWIGV8_RETURN(val) return scope.Close(val) +#define SWIGV8_RETURN_INFO(val, info) return scope.Close(val) +#else +typedef void SwigV8ReturnValue; +typedef v8::FunctionCallbackInfo<v8::Value> SwigV8Arguments; +typedef v8::PropertyCallbackInfo<v8::Value> SwigV8PropertyCallbackInfo; +#define SWIGV8_RETURN(val) args.GetReturnValue().Set(val); return +#define SWIGV8_RETURN_INFO(val, info) info.GetReturnValue().Set(val); return +#endif + +#if (SWIG_V8_VERSION < 0x032117) +#define SWIGV8_HANDLESCOPE() v8::HandleScope scope +#define SWIGV8_HANDLESCOPE_ESC() v8::HandleScope scope +#define SWIGV8_ESCAPE(val) return scope.Close(val) +#elif (SWIG_V8_VERSION < 0x032224) +#define SWIGV8_HANDLESCOPE() v8::HandleScope scope(v8::Isolate::GetCurrent()); +#define SWIGV8_HANDLESCOPE_ESC() v8::HandleScope scope(v8::Isolate::GetCurrent()); +#define SWIGV8_ESCAPE(val) return scope.Close(val) +#else +#define SWIGV8_HANDLESCOPE() v8::HandleScope scope(v8::Isolate::GetCurrent()); +#define SWIGV8_HANDLESCOPE_ESC() v8::EscapableHandleScope scope(v8::Isolate::GetCurrent()); +#define SWIGV8_ESCAPE(val) return scope.Escape(val) +#endif + +#if (SWIG_V8_VERSION < 0x032224) +#define SWIGV8_ADJUST_MEMORY(size) v8::V8::AdjustAmountOfExternalAllocatedMemory(size) +#define SWIGV8_CURRENT_CONTEXT() v8::Context::GetCurrent() +#define SWIGV8_THROW_EXCEPTION(err) v8::ThrowException(err) +#define SWIGV8_STRING_NEW(str) v8::String::New(str) +#define SWIGV8_SYMBOL_NEW(sym) v8::String::NewSymbol(sym) +#else +#define SWIGV8_ADJUST_MEMORY(size) v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(size) +#define SWIGV8_CURRENT_CONTEXT() v8::Isolate::GetCurrent()->GetCurrentContext() +#define SWIGV8_THROW_EXCEPTION(err) v8::Isolate::GetCurrent()->ThrowException(err) +#define SWIGV8_STRING_NEW(str) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), str) +#define SWIGV8_SYMBOL_NEW(sym) v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), sym) +#endif + +#if (SWIG_V8_VERSION < 0x032318) +#define SWIGV8_ARRAY_NEW() v8::Array::New() +#define SWIGV8_BOOLEAN_NEW(bool) v8::Boolean::New(bool) +#define SWIGV8_EXTERNAL_NEW(val) v8::External::New(val) +#define SWIGV8_FUNCTEMPLATE_NEW(func) v8::FunctionTemplate::New(func) +#define SWIGV8_FUNCTEMPLATE_NEW_VOID() v8::FunctionTemplate::New() +#define SWIGV8_INT32_NEW(num) v8::Int32::New(num) +#define SWIGV8_INTEGER_NEW(num) v8::Integer::New(num) +#define SWIGV8_INTEGER_NEW_UNS(num) v8::Integer::NewFromUnsigned(num) +#define SWIGV8_NUMBER_NEW(num) v8::Number::New(num) +#define SWIGV8_OBJECT_NEW() v8::Object::New() +#define SWIGV8_UNDEFINED() v8::Undefined() +#define SWIGV8_NULL() v8::Null() +#else +#define SWIGV8_ARRAY_NEW() v8::Array::New(v8::Isolate::GetCurrent()) +#define SWIGV8_BOOLEAN_NEW(bool) v8::Boolean::New(v8::Isolate::GetCurrent(), bool) +#define SWIGV8_EXTERNAL_NEW(val) v8::External::New(v8::Isolate::GetCurrent(), val) +#define SWIGV8_FUNCTEMPLATE_NEW(func) v8::FunctionTemplate::New(v8::Isolate::GetCurrent(), func) +#define SWIGV8_FUNCTEMPLATE_NEW_VOID() v8::FunctionTemplate::New(v8::Isolate::GetCurrent()) +#define SWIGV8_INT32_NEW(num) v8::Int32::New(v8::Isolate::GetCurrent(), num) +#define SWIGV8_INTEGER_NEW(num) v8::Integer::New(v8::Isolate::GetCurrent(), num) +#define SWIGV8_INTEGER_NEW_UNS(num) v8::Integer::NewFromUnsigned(v8::Isolate::GetCurrent(), num) +#define SWIGV8_NUMBER_NEW(num) v8::Number::New(v8::Isolate::GetCurrent(), num) +#define SWIGV8_OBJECT_NEW() v8::Object::New(v8::Isolate::GetCurrent()) +#define SWIGV8_UNDEFINED() v8::Undefined(v8::Isolate::GetCurrent()) +#define SWIGV8_NULL() v8::Null(v8::Isolate::GetCurrent()) +#endif + +#if (SWIG_V8_VERSION < 0x031710) +#define SWIGV8_SET_CLASS_TEMPL(class_templ, class) class_templ = v8::Persistent<v8::FunctionTemplate>::New(class); +#elif (SWIG_V8_VERSION < 0x031900) +#define SWIGV8_SET_CLASS_TEMPL(class_templ, class) class_templ = v8::Persistent<v8::FunctionTemplate>::New(v8::Isolate::GetCurrent(), class); +#else +#define SWIGV8_SET_CLASS_TEMPL(class_templ, class) class_templ.Reset(v8::Isolate::GetCurrent(), class); +#endif + +/* --------------------------------------------------------------------------- + * Error handling + * + * ---------------------------------------------------------------------------*/ + +#define SWIG_Error(code, msg) SWIGV8_ErrorHandler.error(code, msg) +#define SWIG_exception(code, msg) SWIGV8_ErrorHandler.error(code, msg) +#define SWIG_fail goto fail +#define SWIGV8_OVERLOAD false + +SWIGINTERN void SWIG_V8_Raise(const char *msg) { + SWIGV8_THROW_EXCEPTION(v8::Exception::Error(SWIGV8_STRING_NEW(msg))); +} + +/* + Note: There are two contexts for handling errors. + A static V8ErrorHandler is used in not overloaded methods. + For overloaded methods the throwing type checking mechanism is used + during dispatching. As V8 exceptions can not be resetted properly + the trick is to use a dynamic ErrorHandler with same local name as the global + one. + + - See defintion of SWIG_Error above. + - See code templates 'JS_function_dispatcher', 'JS_functionwrapper_overload', + and 'JS_function_dispatch_case' in javascriptcode.swg + +*/ +class V8ErrorHandler { +public: + virtual ~V8ErrorHandler() {} + virtual void error(int code, const char *msg) { + SWIG_V8_Raise(msg); + } +}; +// this is used in usually +SWIGRUNTIME V8ErrorHandler SWIGV8_ErrorHandler; + +// instances of this are used in overloaded functions +class OverloadErrorHandler: public V8ErrorHandler { +public: + virtual void error(int code, const char *msg) { + err = v8::Exception::Error(SWIGV8_STRING_NEW(msg)); + if(code != SWIG_TypeError) { + SWIGV8_THROW_EXCEPTION(err); + } + } + v8::Handle<v8::Value> err; +}; + +/* --------------------------------------------------------------------------- + * Basic Proxy object + * + * ---------------------------------------------------------------------------*/ + +// Note: to trigger the v8 gc more often one can tell v8 about the memory consumption +// TODO: we could add a v8 specific parameter to control this value +#define SWIGV8_AVG_OBJ_SIZE 1000 + +class SWIGV8_Proxy { +public: + SWIGV8_Proxy(): swigCMemOwn(false), swigCObject(0), info(0) { + SWIGV8_ADJUST_MEMORY(SWIGV8_AVG_OBJ_SIZE); + }; + + ~SWIGV8_Proxy() { +#if (SWIG_V8_VERSION < 0x031710) + handle.ClearWeak(); + handle.Dispose(); +#elif (SWIG_V8_VERSION < 0x032100) + handle.ClearWeak(v8::Isolate::GetCurrent()); + handle.Dispose(v8::Isolate::GetCurrent()); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + handle.ClearWeak(); + handle.Dispose(); +#else + handle.ClearWeak(); + handle.Reset(); +#endif + +#if (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + handle.Clear(); +#endif + + SWIGV8_ADJUST_MEMORY(-SWIGV8_AVG_OBJ_SIZE); + } + + bool swigCMemOwn; + void *swigCObject; + swig_type_info *info; + v8::Persistent<v8::Object> handle; +}; + +class SWIGV8_ClientData { +public: + v8::Persistent<v8::FunctionTemplate> class_templ; + +#if (SWIG_V8_VERSION < 0x031710) + void (*dtor) (v8::Persistent< v8::Value> object, void *parameter); +#elif (SWIG_V8_VERSION < 0x031900) + void (*dtor) (v8::Isolate *isolate, v8::Persistent< v8::Value> object, void *parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + void (*dtor) (v8::Isolate *isolate, v8::Persistent< v8::Object > *object, SWIGV8_Proxy *proxy); +#else + void (*dtor) (const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data); +#endif +}; + +SWIGRUNTIME v8::Persistent<v8::FunctionTemplate> SWIGV8_SWIGTYPE_Proxy_class_templ; + +SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(v8::Handle<v8::Object> objRef, void **ptr, swig_type_info *info, int flags) { + SWIGV8_HANDLESCOPE(); + + if(objRef->InternalFieldCount() < 1) return SWIG_ERROR; + +#if (SWIG_V8_VERSION < 0x031511) + v8::Handle<v8::Value> cdataRef = objRef->GetInternalField(0); + SWIGV8_Proxy *cdata = static_cast<SWIGV8_Proxy *>(v8::External::Unwrap(cdataRef)); +#else + SWIGV8_Proxy *cdata = static_cast<SWIGV8_Proxy *>(objRef->GetAlignedPointerFromInternalField(0)); +#endif + + if(cdata == NULL) { + return SWIG_ERROR; + } + if(cdata->info != info) { + swig_cast_info *tc = SWIG_TypeCheckStruct(cdata->info, info); + if (!tc && cdata->info->name) { + tc = SWIG_TypeCheck(cdata->info->name, info); + } + bool type_valid = tc != 0; + if(!type_valid) { + return SWIG_TypeError; + } + } + *ptr = cdata->swigCObject; + if(flags & SWIG_POINTER_DISOWN) { + cdata->swigCMemOwn = false; + } + return SWIG_OK; +} + + +#if (SWIG_V8_VERSION < 0x031710) +SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(v8::Persistent< v8::Value > object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < 0x031900) +SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(v8::Isolate *, v8::Persistent< v8::Value > object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(v8::Isolate *, v8::Persistent< v8::Object > *object, SWIGV8_Proxy *proxy) { +#else +SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) { + SWIGV8_Proxy *proxy = data.GetParameter(); +#endif + + delete proxy; +} + +SWIGRUNTIME int SWIG_V8_GetInstancePtr(v8::Handle<v8::Value> valRef, void **ptr) { + if(!valRef->IsObject()) { + return SWIG_TypeError; + } + v8::Handle<v8::Object> objRef = valRef->ToObject(); + + if(objRef->InternalFieldCount() < 1) return SWIG_ERROR; + +#if (SWIG_V8_VERSION < 0x031511) + v8::Handle<v8::Value> cdataRef = objRef->GetInternalField(0); + SWIGV8_Proxy *cdata = static_cast<SWIGV8_Proxy *>(v8::External::Unwrap(cdataRef)); +#else + SWIGV8_Proxy *cdata = static_cast<SWIGV8_Proxy *>(objRef->GetAlignedPointerFromInternalField(0)); +#endif + + if(cdata == NULL) { + return SWIG_ERROR; + } + + *ptr = cdata->swigCObject; + + return SWIG_OK; +} + +SWIGRUNTIME void SWIGV8_SetPrivateData(v8::Handle<v8::Object> obj, void *ptr, swig_type_info *info, int flags) { + SWIGV8_Proxy *cdata = new SWIGV8_Proxy(); + cdata->swigCObject = ptr; + cdata->swigCMemOwn = (flags & SWIG_POINTER_OWN) ? 1 : 0; + cdata->info = info; + +#if (SWIG_V8_VERSION < 0x031511) + obj->SetPointerInInternalField(0, cdata); +#else + obj->SetAlignedPointerInInternalField(0, cdata); +#endif + +#if (SWIG_V8_VERSION < 0x031710) + cdata->handle = v8::Persistent<v8::Object>::New(obj); +#elif (SWIG_V8_VERSION < 0x031900) + cdata->handle = v8::Persistent<v8::Object>::New(v8::Isolate::GetCurrent(), obj); +#else + cdata->handle.Reset(v8::Isolate::GetCurrent(), obj); +#endif + +#if (SWIG_V8_VERSION < 0x031710) + // clientdata must be set for owned data as we need to register the dtor + if(cdata->swigCMemOwn && (SWIGV8_ClientData*)info->clientdata) { + cdata->handle.MakeWeak(cdata, ((SWIGV8_ClientData*)info->clientdata)->dtor); + } else { + cdata->handle.MakeWeak(cdata, SWIGV8_Proxy_DefaultDtor); + } +#elif (SWIG_V8_VERSION < 0x031918) + if(cdata->swigCMemOwn && (SWIGV8_ClientData*)info->clientdata) { + cdata->handle.MakeWeak(v8::Isolate::GetCurrent(), cdata, ((SWIGV8_ClientData*)info->clientdata)->dtor); + } else { + cdata->handle.MakeWeak(v8::Isolate::GetCurrent(), cdata, SWIGV8_Proxy_DefaultDtor); + } +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + if(cdata->swigCMemOwn && (SWIGV8_ClientData*)info->clientdata) { + cdata->handle.MakeWeak(cdata, ((SWIGV8_ClientData*)info->clientdata)->dtor); + } else { + cdata->handle.MakeWeak(cdata, SWIGV8_Proxy_DefaultDtor); + } +#else + if(cdata->swigCMemOwn && (SWIGV8_ClientData*)info->clientdata) { + cdata->handle.SetWeak(cdata, ((SWIGV8_ClientData*)info->clientdata)->dtor); + } else { + cdata->handle.SetWeak(cdata, SWIGV8_Proxy_DefaultDtor); + } +#endif + +#if (SWIG_V8_VERSION < 0x031710) + cdata->handle.MarkIndependent(); +#elif (SWIG_V8_VERSION < 0x032100) + cdata->handle.MarkIndependent(v8::Isolate::GetCurrent()); +#else + cdata->handle.MarkIndependent(); +#endif + +} + +SWIGRUNTIME int SWIG_V8_ConvertPtr(v8::Handle<v8::Value> valRef, void **ptr, swig_type_info *info, int flags) { + SWIGV8_HANDLESCOPE(); + + /* special case: JavaScript null => C NULL pointer */ + if(valRef->IsNull()) { + *ptr=0; + return SWIG_OK; + } + if(!valRef->IsObject()) { + return SWIG_TypeError; + } + v8::Handle<v8::Object> objRef = valRef->ToObject(); + return SWIG_V8_ConvertInstancePtr(objRef, ptr, info, flags); +} + +SWIGRUNTIME v8::Handle<v8::Value> SWIG_V8_NewPointerObj(void *ptr, swig_type_info *info, int flags) { + SWIGV8_HANDLESCOPE_ESC(); + + v8::Handle<v8::FunctionTemplate> class_templ; + + if (ptr == NULL) { +#if (SWIG_V8_VERSION < 0x031903) + SWIGV8_ESCAPE(SWIGV8_NULL()); +#else + v8::Local<v8::Primitive> result = SWIGV8_NULL(); + SWIGV8_ESCAPE(result); +#endif + } + +#if (SWIG_V8_VERSION < 0x031903) + if(info->clientdata != 0) { + class_templ = ((SWIGV8_ClientData*) info->clientdata)->class_templ; + } else { + class_templ = SWIGV8_SWIGTYPE_Proxy_class_templ; + } +#else + v8::Isolate *isolate = v8::Isolate::GetCurrent(); + + if(info->clientdata != 0) { + class_templ = v8::Local<v8::FunctionTemplate>::New(isolate, ((SWIGV8_ClientData*) info->clientdata)->class_templ); + } else { + class_templ = v8::Local<v8::FunctionTemplate>::New(isolate, SWIGV8_SWIGTYPE_Proxy_class_templ); + } +#endif + +// v8::Handle<v8::Object> result = class_templ->InstanceTemplate()->NewInstance(); + v8::Local<v8::Object> result = class_templ->InstanceTemplate()->NewInstance(); + SWIGV8_SetPrivateData(result, ptr, info, flags); + + SWIGV8_ESCAPE(result); +} + +#define SWIG_ConvertPtr(obj, ptr, info, flags) SWIG_V8_ConvertPtr(obj, ptr, info, flags) +#define SWIG_NewPointerObj(ptr, info, flags) SWIG_V8_NewPointerObj(ptr, info, flags) + +#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_V8_ConvertInstancePtr(obj, pptr, type, flags) +#define SWIG_NewInstanceObj(thisvalue, type, flags) SWIG_V8_NewPointerObj(thisvalue, type, flags) + +#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_V8_ConvertPtr(obj, pptr, type, 0) +#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_V8_NewPointerObj(ptr, type, 0) + +#define SWIG_GetInstancePtr(obj, ptr) SWIG_V8_GetInstancePtr(obj, ptr) + +SWIGRUNTIME SwigV8ReturnValue _SWIGV8_wrap_equals(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + void *arg1 = (void *) 0 ; + void *arg2 = (void *) 0 ; + bool result; + int res1; + int res2; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for equals."); + + res1 = SWIG_GetInstancePtr(args.Holder(), &arg1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ERROR, "Could not get pointer from 'this' object for equals."); + } + res2 = SWIG_GetInstancePtr(args[0], &arg2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "equals" "', argument " "1"" of type '" "void *""'"); + } + + result = (bool)(arg1 == arg2); + jsresult = SWIGV8_BOOLEAN_NEW(result); + + SWIGV8_RETURN(jsresult); + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + +SWIGRUNTIME SwigV8ReturnValue _wrap_getCPtr(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + void *arg1 = (void *) 0 ; + long result; + int res1; + + res1 = SWIG_GetInstancePtr(args.Holder(), &arg1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "getCPtr" "', argument " "1"" of type '" "void *""'"); + } + + result = (long)arg1; + jsresult = SWIGV8_NUMBER_NEW(result); + + SWIGV8_RETURN(jsresult); + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + +/* --------------------------------------------------------------------------- + * PackedData object + * + * ---------------------------------------------------------------------------*/ + +class SwigV8PackedData { +public: + SwigV8PackedData(void *data, size_t size, swig_type_info *type): data(data), size(size), type(type) {}; + + ~SwigV8PackedData() { + }; + + void *data; + size_t size; + swig_type_info *type; + + v8::Persistent<v8::Object> handle; +}; + +SWIGRUNTIMEINLINE +int SwigV8Packed_Check(v8::Handle<v8::Value> valRef) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Object> objRef = valRef->ToObject(); + if(objRef->InternalFieldCount() < 1) return false; + v8::Handle<v8::Value> flag = objRef->GetHiddenValue(SWIGV8_STRING_NEW("__swig__packed_data__")); + return (flag->IsBoolean() && flag->BooleanValue()); +} + +SWIGRUNTIME +swig_type_info *SwigV8Packed_UnpackData(v8::Handle<v8::Value> valRef, void *ptr, size_t size) { + if (SwigV8Packed_Check(valRef)) { + SWIGV8_HANDLESCOPE(); + + SwigV8PackedData *sobj; + + v8::Handle<v8::Object> objRef = valRef->ToObject(); + +#if (SWIG_V8_VERSION < 0x031511) + v8::Handle<v8::Value> cdataRef = objRef->GetInternalField(0); + sobj = static_cast<SwigV8PackedData*>(v8::External::Unwrap(cdataRef)); +#else + sobj = static_cast<SwigV8PackedData*>(objRef->GetAlignedPointerFromInternalField(0)); +#endif + if (sobj == NULL || sobj->size != size) return 0; + memcpy(ptr, sobj->data, size); + return sobj->type; + } else { + return 0; + } +} + +SWIGRUNTIME +int SWIGV8_ConvertPacked(v8::Handle<v8::Value> valRef, void *ptr, size_t sz, swig_type_info *ty) { + swig_type_info *to = SwigV8Packed_UnpackData(valRef, ptr, sz); + if (!to) return SWIG_ERROR; + if (ty) { + if (to != ty) { + /* check type cast? */ + swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); + if (!tc) return SWIG_ERROR; + } + } + return SWIG_OK; +} + +#if (SWIG_V8_VERSION < 0x031710) +SWIGRUNTIME void _wrap_SwigV8PackedData_delete(v8::Persistent< v8::Value > object, void *parameter) { + SwigV8PackedData *cdata = static_cast<SwigV8PackedData *>(parameter); +#elif (SWIG_V8_VERSION < 0x031900) +SWIGRUNTIME void _wrap_SwigV8PackedData_delete(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) { + SwigV8PackedData *cdata = static_cast<SwigV8PackedData *>(parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) +SWIGRUNTIME void _wrap_SwigV8PackedData_delete(v8::Isolate *isolate, v8::Persistent<v8::Object> *object, SwigV8PackedData *cdata) { +#else +SWIGRUNTIME void _wrap_SwigV8PackedData_delete(const v8::WeakCallbackData<v8::Object, SwigV8PackedData> &data) { + v8::Local<v8::Object> object = data.GetValue(); + SwigV8PackedData *cdata = data.GetParameter(); +#endif + + delete cdata; + +#if (SWIG_V8_VERSION < 0x031710) + object.Clear(); + object.Dispose(); +#elif (SWIG_V8_VERSION < 0x031900) + object.Clear(); + object.Dispose(isolate); +#elif (SWIG_V8_VERSION < 0x032100) + object->Dispose(isolate); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + object->Dispose(); +#else + object.Clear(); +#endif +} + +SWIGRUNTIME +v8::Handle<v8::Value> SWIGV8_NewPackedObj(void *data, size_t size, swig_type_info *type) { + SWIGV8_HANDLESCOPE_ESC(); + + SwigV8PackedData *cdata = new SwigV8PackedData(data, size, type); +// v8::Handle<v8::Object> obj = SWIGV8_OBJECT_NEW(); + v8::Local<v8::Object> obj = SWIGV8_OBJECT_NEW(); + + obj->SetHiddenValue(SWIGV8_STRING_NEW("__swig__packed_data__"), SWIGV8_BOOLEAN_NEW(true)); + +#if (SWIG_V8_VERSION < 0x031511) + obj->SetPointerInInternalField(0, cdata); +#else + obj->SetAlignedPointerInInternalField(0, cdata); +#endif + +#if (SWIG_V8_VERSION < 0x031710) + cdata->handle = v8::Persistent<v8::Object>::New(obj); +#elif (SWIG_V8_VERSION < 0x031900) + cdata->handle = v8::Persistent<v8::Object>::New(v8::Isolate::GetCurrent(), obj); +#else + cdata->handle.Reset(v8::Isolate::GetCurrent(), obj); +#endif + + +#if (SWIG_V8_VERSION < 0x031710) + cdata->handle.MakeWeak(cdata, _wrap_SwigV8PackedData_delete); +#elif (SWIG_V8_VERSION < 0x031918) + cdata->handle.MakeWeak(v8::Isolate::GetCurrent(), cdata, _wrap_SwigV8PackedData_delete); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + cdata->handle.MakeWeak(cdata, _wrap_SwigV8PackedData_delete); +#else + cdata->handle.SetWeak(cdata, _wrap_SwigV8PackedData_delete); +// v8::V8::SetWeak(&cdata->handle, cdata, _wrap_SwigV8PackedData_delete); +#endif + +#if (SWIG_V8_VERSION < 0x031710) + cdata->handle.MarkIndependent(); +#elif (SWIG_V8_VERSION < 0x032100) + cdata->handle.MarkIndependent(v8::Isolate::GetCurrent()); +#else + cdata->handle.MarkIndependent(); +#endif + + SWIGV8_ESCAPE(obj); +} + +#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIGV8_ConvertPacked(obj, ptr, sz, ty) +#define SWIG_NewMemberObj(ptr, sz, type) SWIGV8_NewPackedObj(ptr, sz, type) + + +/* --------------------------------------------------------------------------- + * Support for IN/OUTPUT typemaps (see Lib/typemaps/inoutlist.swg) + * + * ---------------------------------------------------------------------------*/ + +SWIGRUNTIME + +#if (SWIG_V8_VERSION < 0x031903) +v8::Handle<v8::Value> SWIGV8_AppendOutput(v8::Handle<v8::Value> result, v8::Handle<v8::Value> obj) { +#else +v8::Handle<v8::Value> SWIGV8_AppendOutput(v8::Local<v8::Value> result, v8::Handle<v8::Value> obj) { +#endif + SWIGV8_HANDLESCOPE_ESC(); + + if (result->IsUndefined()) { + result = SWIGV8_ARRAY_NEW(); + } +#if (SWIG_V8_VERSION < 0x031903) + v8::Handle<v8::Array> arr = v8::Handle<v8::Array>::Cast(result); +#else + v8::Local<v8::Array> arr = v8::Local<v8::Array>::Cast(result); +#endif + arr->Set(arr->Length(), obj); + + SWIGV8_ESCAPE(arr); +} + + + +// Note: since 3.19 there are new CallBack types, since 03.21.9 the old ones have been removed +#if (SWIG_V8_VERSION < 0x031903) +typedef v8::InvocationCallback SwigV8FunctionCallback; +typedef v8::AccessorGetter SwigV8AccessorGetterCallback; +typedef v8::AccessorSetter SwigV8AccessorSetterCallback; +typedef v8::AccessorInfo SwigV8PropertyCallbackInfoVoid; +#else +typedef v8::FunctionCallback SwigV8FunctionCallback; +typedef v8::AccessorGetterCallback SwigV8AccessorGetterCallback; +typedef v8::AccessorSetterCallback SwigV8AccessorSetterCallback; +typedef v8::PropertyCallbackInfo<void> SwigV8PropertyCallbackInfoVoid; +#endif + +/** + * Creates a class template for a class with specified initialization function. + */ +SWIGRUNTIME v8::Handle<v8::FunctionTemplate> SWIGV8_CreateClassTemplate(const char* symbol) { + SWIGV8_HANDLESCOPE_ESC(); + + v8::Local<v8::FunctionTemplate> class_templ = SWIGV8_FUNCTEMPLATE_NEW_VOID(); + class_templ->SetClassName(SWIGV8_SYMBOL_NEW(symbol)); + + v8::Handle<v8::ObjectTemplate> inst_templ = class_templ->InstanceTemplate(); + inst_templ->SetInternalFieldCount(1); + + v8::Handle<v8::ObjectTemplate> equals_templ = class_templ->PrototypeTemplate(); + equals_templ->Set(SWIGV8_SYMBOL_NEW("equals"), SWIGV8_FUNCTEMPLATE_NEW(_SWIGV8_wrap_equals)); + + v8::Handle<v8::ObjectTemplate> cptr_templ = class_templ->PrototypeTemplate(); + cptr_templ->Set(SWIGV8_SYMBOL_NEW("getCPtr"), SWIGV8_FUNCTEMPLATE_NEW(_wrap_getCPtr)); + + SWIGV8_ESCAPE(class_templ); +} + +/** + * Registers a class method with given name for a given class template. + */ +SWIGRUNTIME void SWIGV8_AddMemberFunction(v8::Handle<v8::FunctionTemplate> class_templ, const char* symbol, + SwigV8FunctionCallback _func) { + v8::Handle<v8::ObjectTemplate> proto_templ = class_templ->PrototypeTemplate(); + proto_templ->Set(SWIGV8_SYMBOL_NEW(symbol), SWIGV8_FUNCTEMPLATE_NEW(_func)); +} + +/** + * Registers a class property with given name for a given class template. + */ +SWIGRUNTIME void SWIGV8_AddMemberVariable(v8::Handle<v8::FunctionTemplate> class_templ, const char* symbol, + SwigV8AccessorGetterCallback getter, SwigV8AccessorSetterCallback setter) { + v8::Handle<v8::ObjectTemplate> proto_templ = class_templ->InstanceTemplate(); + proto_templ->SetAccessor(SWIGV8_SYMBOL_NEW(symbol), getter, setter); +} + +/** + * Registers a class method with given name for a given object. + */ +SWIGRUNTIME void SWIGV8_AddStaticFunction(v8::Handle<v8::Object> obj, const char* symbol, + const SwigV8FunctionCallback& _func) { + obj->Set(SWIGV8_SYMBOL_NEW(symbol), SWIGV8_FUNCTEMPLATE_NEW(_func)->GetFunction()); +} + +/** + * Registers a class method with given name for a given object. + */ +SWIGRUNTIME void SWIGV8_AddStaticVariable(v8::Handle<v8::Object> obj, const char* symbol, + SwigV8AccessorGetterCallback getter, SwigV8AccessorSetterCallback setter) { + obj->SetAccessor(SWIGV8_SYMBOL_NEW(symbol), getter, setter); +} + +SWIGRUNTIME void JS_veto_set_variable(v8::Local<v8::String> property, v8::Local<v8::Value> value, + const SwigV8PropertyCallbackInfoVoid& info) +{ + char buffer[256]; + char msg[512]; + int res; + + property->WriteUtf8(buffer, 256); + res = sprintf(msg, "Tried to write read-only variable: %s.", buffer); + + if(res<0) { + SWIG_exception(SWIG_ERROR, "Tried to write read-only variable."); + } else { + SWIG_exception(SWIG_ERROR, msg); + } +} + + + +/* -------- TYPES TABLE (BEGIN) -------- */ + +#define SWIGTYPE_p_Data swig_types[0] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr swig_types[1] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCDATASection swig_types[2] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData swig_types[3] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMComment swig_types[4] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocument swig_types[5] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentFragment swig_types[6] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType swig_types[7] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement swig_types[8] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity swig_types[9] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntityReference swig_types[10] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException swig_types[11] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap swig_types[12] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode swig_types[13] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList swig_types[14] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNotation swig_types[15] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction swig_types[16] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText swig_types[17] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMTypeInfo swig_types[18] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMUserDataHandler swig_types[19] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__MemoryManager swig_types[20] +#define SWIGTYPE_p_bool swig_types[21] +#define SWIGTYPE_p_char swig_types[22] +#define SWIGTYPE_p_int16_t swig_types[23] +#define SWIGTYPE_p_int32_t swig_types[24] +#define SWIGTYPE_p_int64_t swig_types[25] +#define SWIGTYPE_p_namelist_t swig_types[26] +#define SWIGTYPE_p_params_t swig_types[27] +#define SWIGTYPE_p_size_t swig_types[28] +#define SWIGTYPE_p_ssize_t swig_types[29] +#define SWIGTYPE_p_std__listT_Data_t swig_types[30] +#define SWIGTYPE_p_std__multimapT_std__string_Data_t swig_types[31] +#define SWIGTYPE_p_uint16_t swig_types[32] +#define SWIGTYPE_p_uint32_t swig_types[33] +#define SWIGTYPE_p_uint64_t swig_types[34] +#define SWIGTYPE_p_unsigned_char swig_types[35] +#define SWIGTYPE_p_uscxml__ErrorEvent swig_types[36] +#define SWIGTYPE_p_uscxml__Event swig_types[37] +#define SWIGTYPE_p_void swig_types[38] +static swig_type_info *swig_types[40]; +static swig_module_info swig_module = {swig_types, 39, 0, 0, 0, 0}; +#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) +#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) + +/* -------- TYPES TABLE (END) -------- */ + + + +#define SWIGVERSION 0x030008 +#define SWIG_VERSION SWIGVERSION + + +#define SWIG_as_voidptr(a) (void *)((const void *)(a)) +#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) + + +#include <stdexcept> + + +SWIGINTERNINLINE +v8::Handle<v8::Value> SWIG_From_int (int value) +{ + return SWIGV8_INT32_NEW(value); +} + + +#include <string> + + +#include "xercesc/sax/InputSource.hpp" +#include "xercesc/sax/SAXException.hpp" +#include "xercesc/sax/SAXParseException.hpp" +#include "xercesc/sax/Locator.hpp" +#include "xercesc/sax/HandlerBase.hpp" +#include "xercesc/sax2/Attributes.hpp" +#include "xercesc/sax2/ContentHandler.hpp" +#include "xercesc/sax2/LexicalHandler.hpp" +#include "xercesc/sax2/DefaultHandler.hpp" +#include "xercesc/sax2/SAX2XMLReader.hpp" +#include "xercesc/sax2/XMLReaderFactory.hpp" +#include "xercesc/util/PlatformUtils.hpp" +#include "xercesc/util/TransService.hpp" +#include "xercesc/util/XMLString.hpp" +#include "xercesc/util/XMLUri.hpp" +#include "xercesc/util/QName.hpp" +#include "xercesc/util/HexBin.hpp" +#include "xercesc/util/Base64.hpp" +#include "xercesc/parsers/AbstractDOMParser.hpp" +#include "xercesc/parsers/XercesDOMParser.hpp" +#include "xercesc/parsers/SAXParser.hpp" +#include "xercesc/dom/DOM.hpp" +#include "xercesc/framework/LocalFileInputSource.hpp" +#include "xercesc/framework/MemBufInputSource.hpp" +#include "xercesc/framework/StdInInputSource.hpp" +#include "xercesc/framework/URLInputSource.hpp" +#include "xercesc/framework/XMLGrammarDescription.hpp" +#include "xercesc/framework/XMLDTDDescription.hpp" +#include "xercesc/framework/XMLSchemaDescription.hpp" +#include "xercesc/util/NameIdPool.hpp" +#include "xercesc/util/XMLEnumerator.hpp" +#include "xercesc/framework/XMLValidator.hpp" +#include "xercesc/validators/common/Grammar.hpp" +#include "xercesc/validators/DTD/DTDAttDef.hpp" +#include "xercesc/validators/DTD/DTDAttDefList.hpp" +#include "xercesc/validators/DTD/DTDGrammar.hpp" +#include "xercesc/validators/DTD/DTDValidator.hpp" +#include "xercesc/validators/schema/SchemaGrammar.hpp" +#include "xercesc/validators/schema/SchemaValidator.hpp" +#include "xercesc/validators/schema/SchemaAttDefList.hpp" +#include "xercesc/validators/schema/SchemaAttDef.hpp" +#include "xercesc/framework/XMLFormatter.hpp" +#include "xercesc/framework/MemBufFormatTarget.hpp" +#include "xercesc/framework/LocalFileFormatTarget.hpp" +#include "xercesc/framework/StdOutFormatTarget.hpp" +#include "xercesc/framework/Wrapper4InputSource.hpp" +#include "xercesc/framework/psvi/PSVIHandler.hpp" + +// for resolving XMLExceptions +#include "xercesc/util/ArrayIndexOutOfBoundsException.hpp" +#include "xercesc/util/EmptyStackException.hpp" +#include "xercesc/util/IllegalArgumentException.hpp" +#include "xercesc/util/InvalidCastException.hpp" +#include "xercesc/util/IOException.hpp" +#include "xercesc/util/NoSuchElementException.hpp" +#include "xercesc/util/NullPointerException.hpp" +#include "xercesc/util/NumberFormatException.hpp" +#include "xercesc/util/ParseException.hpp" +#include "xercesc/util/RuntimeException.hpp" +#include "xercesc/util/SchemaDateTimeException.hpp" +#include "xercesc/util/TranscodingException.hpp" +#include "xercesc/util/UnexpectedEOFException.hpp" +#include "xercesc/util/UnsupportedEncodingException.hpp" +#include "xercesc/util/UTFDataFormatException.hpp" +#include "xercesc/util/XMLNetAccessor.hpp" +#include "xercesc/internal/XSerializationException.hpp" +#include "xercesc/validators/datatype/InvalidDatatypeFacetException.hpp" +#include "xercesc/validators/datatype/InvalidDatatypeValueException.hpp" +#include "xercesc/validators/schema/identity/XPathException.hpp" + +XERCES_CPP_NAMESPACE_USE + +// we initialize the static UTF-8 transcoding info +// these are used by the typemaps to convert between +// Xerces internal UTF-16 and Perl's internal UTF-8 +static XMLCh* UTF8_ENCODING = NULL; +static XMLTranscoder* UTF8_TRANSCODER = NULL; + +static bool DEBUG_UTF8_OUT = 0; +static bool DEBUG_UTF8_IN = 0; + + + +SWIGINTERN +int SWIG_AsVal_double (v8::Handle<v8::Value> obj, double *val) +{ + if(!obj->IsNumber()) { + return SWIG_TypeError; + } + if(val) *val = obj->NumberValue(); + + return SWIG_OK; +} + + +#include <float.h> + + +#include <math.h> + + +SWIGINTERNINLINE int +SWIG_CanCastAsInteger(double *d, double min, double max) { + double x = *d; + if ((min <= x && x <= max)) { + double fx = floor(x); + double cx = ceil(x); + double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ + if ((errno == EDOM) || (errno == ERANGE)) { + errno = 0; + } else { + double summ, reps, diff; + if (rd < x) { + diff = x - rd; + } else if (rd > x) { + diff = rd - x; + } else { + return 1; + } + summ = rd + x; + reps = diff/summ; + if (reps < 8*DBL_EPSILON) { + *d = rd; + return 1; + } + } + } + return 0; +} + + +SWIGINTERN +int SWIG_AsVal_long (v8::Handle<v8::Value> obj, long* val) +{ + if (!obj->IsNumber()) { + return SWIG_TypeError; + } + if(val) *val = (long) obj->IntegerValue(); + + return SWIG_OK; +} + + +SWIGINTERN +int SWIG_AsVal_bool (v8::Handle<v8::Value> obj, bool *val) +{ + if(!obj->IsBoolean()) { + return SWIG_ERROR; + } + + if (val) *val = obj->BooleanValue(); + return SWIG_OK; +} + + +SWIGINTERNINLINE +v8::Handle<v8::Value> +SWIG_From_bool (bool value) +{ + return SWIGV8_BOOLEAN_NEW(value); +} + + +static swig_type_info * +DOMNode_dynamic_cast(void **ptr) { + DOMNode **nptr = (DOMNode **) ptr; + if (*nptr == NULL) { + return NULL; + } + short int type = (*nptr)->getNodeType(); + if (type == DOMNode::TEXT_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText; + } + if (type == DOMNode::PROCESSING_INSTRUCTION_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction; + } + if (type == DOMNode::DOCUMENT_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocument; + } + if (type == DOMNode::ELEMENT_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement; + } + if (type == DOMNode::ENTITY_REFERENCE_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntityReference; + } + if (type == DOMNode::CDATA_SECTION_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCDATASection; + } + if (type == DOMNode::CDATA_SECTION_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCDATASection; + } + if (type == DOMNode::COMMENT_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMComment; + } + if (type == DOMNode::DOCUMENT_TYPE_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType; + } + if (type == DOMNode::ENTITY_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity; + } + if (type == DOMNode::ATTRIBUTE_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr; + } + if (type == DOMNode::NOTATION_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNotation; + } + return NULL; +} + + +#include <limits.h> +#if !defined(SWIG_NO_LLONG_MAX) +# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) +# define LLONG_MAX __LONG_LONG_MAX__ +# define LLONG_MIN (-LLONG_MAX - 1LL) +# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) +# endif +#endif + + +SWIGINTERN int +SWIG_AsVal_short (v8::Handle<v8::Value> obj, short *val) +{ + long v; + int res = SWIG_AsVal_long (obj, &v); + if (SWIG_IsOK(res)) { + if ((v < SHRT_MIN || v > SHRT_MAX)) { + return SWIG_OverflowError; + } else { + if (val) *val = (short)(v); + } + } + return res; +} + + +SWIGINTERNINLINE +v8::Handle<v8::Value> SWIG_From_long (long value) +{ + return SWIGV8_NUMBER_NEW(value); +} + + +SWIGINTERNINLINE v8::Handle<v8::Value> +SWIG_From_short (short value) +{ + return SWIG_From_long (value); +} + + +SWIGINTERNINLINE +v8::Handle<v8::Value> SWIG_From_unsigned_SS_long (unsigned long value) +{ + return (value > LONG_MAX) ? + SWIGV8_INTEGER_NEW_UNS(value) : SWIGV8_INTEGER_NEW((long)(value)); +} + + +SWIGINTERNINLINE v8::Handle<v8::Value> +SWIG_From_size_t (size_t value) +{ + return SWIG_From_unsigned_SS_long ((unsigned long)(value)); +} + + +SWIGINTERN +int SWIG_AsVal_unsigned_SS_long (v8::Handle<v8::Value> obj, unsigned long *val) +{ + if(!obj->IsNumber()) { + return SWIG_TypeError; + } + + long longVal = (long) obj->NumberValue(); + + if(longVal < 0) { + return SWIG_OverflowError; + } + + if(val) *val = longVal; + + return SWIG_OK; +} + + +SWIGINTERNINLINE int +SWIG_AsVal_size_t (v8::Handle<v8::Value> obj, size_t *val) +{ + unsigned long v; + int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) *val = (size_t)(v); + return res; +} + + +using uscxml::Data; + + +SWIGINTERN swig_type_info* +SWIG_pchar_descriptor(void) +{ + static int init = 0; + static swig_type_info* info = 0; + if (!init) { + info = SWIG_TypeQuery("_p_char"); + init = 1; + } + return info; +} + + +SWIGINTERN int +SWIG_AsCharPtrAndSize(v8::Handle<v8::Value> valRef, char** cptr, size_t* psize, int *alloc) +{ + if(valRef->IsString()) { + v8::Handle<v8::String> js_str = valRef->ToString(); + + size_t len = js_str->Utf8Length() + 1; + char* cstr = new char[len]; + js_str->WriteUtf8(cstr, len); + + if(alloc) *alloc = SWIG_NEWOBJ; + if(psize) *psize = len; + if(cptr) *cptr = cstr; + + return SWIG_OK; + } else { + if(valRef->IsObject()) { + v8::Handle<v8::Object> obj = valRef->ToObject(); + // try if the object is a wrapped char[] + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + if (pchar_descriptor) { + void* vptr = 0; + if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { + if (cptr) *cptr = (char *) vptr; + if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; + if (alloc) *alloc = SWIG_OLDOBJ; + return SWIG_OK; + } + } + return SWIG_TypeError; + } else { + return SWIG_TypeError; + } + } +} + + +SWIGINTERN int +SWIG_AsPtr_std_string (v8::Handle<v8::Value> obj, std::string **val) +{ + char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ; + if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) { + if (buf) { + if (val) *val = new std::string(buf, size - 1); + if (alloc == SWIG_NEWOBJ) delete[] buf; + return SWIG_NEWOBJ; + } else { + if (val) *val = 0; + return SWIG_OLDOBJ; + } + } else { + static int init = 0; + static swig_type_info* descriptor = 0; + if (!init) { + descriptor = SWIG_TypeQuery("std::string" " *"); + init = 1; + } + if (descriptor) { + std::string *vptr; + int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0); + if (SWIG_IsOK(res) && val) *val = vptr; + return res; + } + } + return SWIG_ERROR; +} + + +SWIGINTERN +int SWIG_AsVal_int (v8::Handle<v8::Value> valRef, int* val) +{ + if (!valRef->IsNumber()) { + return SWIG_TypeError; + } + if(val) *val = valRef->IntegerValue(); + + return SWIG_OK; +} + + +SWIGINTERNINLINE v8::Handle<v8::Value> +SWIG_FromCharPtrAndSize(const char* carray, size_t size) +{ + if (carray) { + if (size > INT_MAX) { + // TODO: handle extra long strings + return SWIGV8_UNDEFINED(); + } else { + v8::Handle<v8::String> js_str = SWIGV8_STRING_NEW2(carray, size); + return js_str; + } + } else { + return SWIGV8_UNDEFINED(); + } +} + + +SWIGINTERNINLINE v8::Handle<v8::Value> +SWIG_From_std_string (const std::string& s) +{ + return SWIG_FromCharPtrAndSize(s.data(), s.size()); +} + + +#define SWIGV8_INIT V8DOM_initialize + + +SWIGV8_ClientData _exports_DOMException_clientData; +SWIGV8_ClientData _exports_DOMNode_clientData; +SWIGV8_ClientData _exports_DOMAttr_clientData; +SWIGV8_ClientData _exports_DOMElement_clientData; +SWIGV8_ClientData _exports_DOMEntity_clientData; +SWIGV8_ClientData _exports_DOMDocumentType_clientData; +SWIGV8_ClientData _exports_DOMCharacterData_clientData; +SWIGV8_ClientData _exports_DOMComment_clientData; +SWIGV8_ClientData _exports_DOMText_clientData; +SWIGV8_ClientData _exports_DOMCDATASection_clientData; +SWIGV8_ClientData _exports_DOMNodeList_clientData; +SWIGV8_ClientData _exports_DOMNamedNodeMap_clientData; +SWIGV8_ClientData _exports_DOMDocumentFragment_clientData; +SWIGV8_ClientData _exports_DOMEntityReference_clientData; +SWIGV8_ClientData _exports_DOMNotation_clientData; +SWIGV8_ClientData _exports_DOMProcessingInstruction_clientData; +SWIGV8_ClientData _exports_Event_clientData; +SWIGV8_ClientData _exports_ErrorEvent_clientData; + + +static SwigV8ReturnValue _wrap_XERCES_HAS_CPP_NAMESPACE(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(1)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static void _wrap_DEBUG_UTF8_OUT_set(v8::Local<v8::String> property, v8::Local<v8::Value> value, + const SwigV8PropertyCallbackInfoVoid &info) { + SWIGV8_HANDLESCOPE(); + + bool arg1 ; + bool val1 ; + int ecode1 = 0 ; + + ecode1 = SWIG_AsVal_bool(value, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "DEBUG_UTF8_OUT_set" "', argument " "1"" of type '" "bool""'"); + } + arg1 = (bool)(val1); + DEBUG_UTF8_OUT = arg1; + + + goto fail; +fail: + return; +} + + +static SwigV8ReturnValue _wrap_DEBUG_UTF8_OUT_get(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + bool result; + + result = (bool)DEBUG_UTF8_OUT; + jsresult = SWIG_From_bool((bool)(result)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static void _wrap_DEBUG_UTF8_IN_set(v8::Local<v8::String> property, v8::Local<v8::Value> value, + const SwigV8PropertyCallbackInfoVoid &info) { + SWIGV8_HANDLESCOPE(); + + bool arg1 ; + bool val1 ; + int ecode1 = 0 ; + + ecode1 = SWIG_AsVal_bool(value, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "DEBUG_UTF8_IN_set" "', argument " "1"" of type '" "bool""'"); + } + arg1 = (bool)(val1); + DEBUG_UTF8_IN = arg1; + + + goto fail; +fail: + return; +} + + +static SwigV8ReturnValue _wrap_DEBUG_UTF8_IN_get(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + bool result; + + result = (bool)DEBUG_UTF8_IN; + jsresult = SWIG_From_bool((bool)(result)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMException_INDEX_SIZE_ERR(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMException::INDEX_SIZE_ERR)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMException_DOMSTRING_SIZE_ERR(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMException::DOMSTRING_SIZE_ERR)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMException_HIERARCHY_REQUEST_ERR(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMException::HIERARCHY_REQUEST_ERR)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMException_WRONG_DOCUMENT_ERR(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMException::WRONG_DOCUMENT_ERR)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMException_INVALID_CHARACTER_ERR(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMException::INVALID_CHARACTER_ERR)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMException_NO_DATA_ALLOWED_ERR(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMException::NO_DATA_ALLOWED_ERR)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMException_NO_MODIFICATION_ALLOWED_ERR(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMException::NO_MODIFICATION_ALLOWED_ERR)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMException_NOT_FOUND_ERR(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMException::NOT_FOUND_ERR)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMException_NOT_SUPPORTED_ERR(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMException::NOT_SUPPORTED_ERR)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMException_INUSE_ATTRIBUTE_ERR(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMException::INUSE_ATTRIBUTE_ERR)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMException_INVALID_STATE_ERR(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMException::INVALID_STATE_ERR)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMException_SYNTAX_ERR(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMException::SYNTAX_ERR)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMException_INVALID_MODIFICATION_ERR(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMException::INVALID_MODIFICATION_ERR)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMException_NAMESPACE_ERR(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMException::NAMESPACE_ERR)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMException_INVALID_ACCESS_ERR(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMException::INVALID_ACCESS_ERR)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMException_VALIDATION_ERR(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMException::VALIDATION_ERR)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMException_TYPE_MISMATCH_ERR(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMException::TYPE_MISMATCH_ERR)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_new_DOMException__SWIG_0(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Object> self = args.Holder(); + short arg1 ; + short arg2 ; + XERCES_CPP_NAMESPACE::MemoryManager *arg3 = (XERCES_CPP_NAMESPACE::MemoryManager *) (XERCES_CPP_NAMESPACE::MemoryManager *)0 ; + short val1 ; + int ecode1 = 0 ; + short val2 ; + int ecode2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + XERCES_CPP_NAMESPACE::DOMException *result; + if(args.Length() != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_new_DOMException__SWIG_0."); + ecode1 = SWIG_AsVal_short(args[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_DOMException" "', argument " "1"" of type '" "short""'"); + } + arg1 = (short)(val1); + ecode2 = SWIG_AsVal_short(args[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_DOMException" "', argument " "2"" of type '" "short""'"); + } + arg2 = (short)(val2); + res3 = SWIG_ConvertPtr(args[2], &argp3,SWIGTYPE_p_XERCES_CPP_NAMESPACE__MemoryManager, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_DOMException" "', argument " "3"" of type '" "XERCES_CPP_NAMESPACE::MemoryManager *const""'"); + } + arg3 = (XERCES_CPP_NAMESPACE::MemoryManager *)(argp3); + result = (XERCES_CPP_NAMESPACE::DOMException *)new XERCES_CPP_NAMESPACE::DOMException(arg1,arg2,arg3); + + + + + + + SWIGV8_SetPrivateData(self, result, SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException, SWIG_POINTER_OWN); + SWIGV8_RETURN(self); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_new_DOMException__SWIG_1(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Object> self = args.Holder(); + short arg1 ; + short arg2 ; + short val1 ; + int ecode1 = 0 ; + short val2 ; + int ecode2 = 0 ; + XERCES_CPP_NAMESPACE::DOMException *result; + if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_new_DOMException__SWIG_1."); + ecode1 = SWIG_AsVal_short(args[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_DOMException" "', argument " "1"" of type '" "short""'"); + } + arg1 = (short)(val1); + ecode2 = SWIG_AsVal_short(args[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_DOMException" "', argument " "2"" of type '" "short""'"); + } + arg2 = (short)(val2); + result = (XERCES_CPP_NAMESPACE::DOMException *)new XERCES_CPP_NAMESPACE::DOMException(arg1,arg2); + + + + + + SWIGV8_SetPrivateData(self, result, SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException, SWIG_POINTER_OWN); + SWIGV8_RETURN(self); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_new_DOMException__SWIG_2(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Object> self = args.Holder(); + short arg1 ; + short val1 ; + int ecode1 = 0 ; + XERCES_CPP_NAMESPACE::DOMException *result; + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_new_DOMException__SWIG_2."); + ecode1 = SWIG_AsVal_short(args[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_DOMException" "', argument " "1"" of type '" "short""'"); + } + arg1 = (short)(val1); + result = (XERCES_CPP_NAMESPACE::DOMException *)new XERCES_CPP_NAMESPACE::DOMException(arg1); + + + + + SWIGV8_SetPrivateData(self, result, SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException, SWIG_POINTER_OWN); + SWIGV8_RETURN(self); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_new_DOMException(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + OverloadErrorHandler errorHandler; + v8::Handle<v8::Value> self; + + // switch all cases by means of series of if-returns. + + if(args.Length() == 3) { + errorHandler.err.Clear(); +#if (SWIG_V8_VERSION < 0x031903) + self = _wrap_new_DOMException__SWIG_0(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + SWIGV8_ESCAPE(self); + } +#else + _wrap_new_DOMException__SWIG_0(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + return; + } +#endif + } + + if(args.Length() == 2) { + errorHandler.err.Clear(); +#if (SWIG_V8_VERSION < 0x031903) + self = _wrap_new_DOMException__SWIG_1(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + SWIGV8_ESCAPE(self); + } +#else + _wrap_new_DOMException__SWIG_1(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + return; + } +#endif + } + + if(args.Length() == 1) { + errorHandler.err.Clear(); +#if (SWIG_V8_VERSION < 0x031903) + self = _wrap_new_DOMException__SWIG_2(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + SWIGV8_ESCAPE(self); + } +#else + _wrap_new_DOMException__SWIG_2(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + return; + } +#endif + } + + + // default: + SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for construction of _exports_DOMException"); + +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +#if (SWIG_V8_VERSION < 0x031710) +static void _wrap_delete_DOMException(v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < 0x031900) + static void _wrap_delete_DOMException(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + static void _wrap_delete_DOMException(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { +#else + static void _wrap_delete_DOMException(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) { + v8::Local<v8::Object> object = data.GetValue(); + SWIGV8_Proxy *proxy = data.GetParameter(); +#endif + + if(proxy->swigCMemOwn && proxy->swigCObject) { + XERCES_CPP_NAMESPACE::DOMException * arg1 = (XERCES_CPP_NAMESPACE::DOMException *)proxy->swigCObject; + delete arg1; + } + delete proxy; + +#if (SWIG_V8_VERSION < 0x031710) + object.Dispose(); +#elif (SWIG_V8_VERSION < 0x031900) + object.Dispose(isolate); +#elif (SWIG_V8_VERSION < 0x032100) + object->Dispose(isolate); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + object->Dispose(); +#else + object.Clear(); +#endif + } + + +static SwigV8ReturnValue _wrap_DOMException_getMessage(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMException *arg1 = (XERCES_CPP_NAMESPACE::DOMException *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMException_getMessage."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMException_getMessage" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMException const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMException *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMException const *)arg1)->getMessage(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static void _wrap_DOMException_code_set(v8::Local<v8::String> property, v8::Local<v8::Value> value, + const SwigV8PropertyCallbackInfoVoid &info) { + SWIGV8_HANDLESCOPE(); + + XERCES_CPP_NAMESPACE::DOMException *arg1 = (XERCES_CPP_NAMESPACE::DOMException *) 0 ; + short arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + short val2 ; + int ecode2 = 0 ; + + res1 = SWIG_ConvertPtr(info.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMException_code_set" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMException *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMException *)(argp1); + ecode2 = SWIG_AsVal_short(value, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DOMException_code_set" "', argument " "2"" of type '" "short""'"); + } + arg2 = (short)(val2); + if (arg1) (arg1)->code = arg2; + + + + goto fail; +fail: + return; +} + + +static SwigV8ReturnValue _wrap_DOMException_code_get(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMException *arg1 = (XERCES_CPP_NAMESPACE::DOMException *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + short result; + + res1 = SWIG_ConvertPtr(info.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMException_code_get" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMException *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMException *)(argp1); + result = (short) ((arg1)->code); + jsresult = SWIG_From_short((short)(result)); + + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static void _wrap_DOMException_msg_set(v8::Local<v8::String> property, v8::Local<v8::Value> value, + const SwigV8PropertyCallbackInfoVoid &info) { + SWIGV8_HANDLESCOPE(); + + XERCES_CPP_NAMESPACE::DOMException *arg1 = (XERCES_CPP_NAMESPACE::DOMException *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + res1 = SWIG_ConvertPtr(info.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMException_msg_set" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMException *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMException *)(argp1); + + arg2 = JS2XMLString(value); + + if (arg1) (arg1)->msg = (XMLCh const *)arg2; + + + delete[] arg2; + + + goto fail; +fail: + return; +} + + +static SwigV8ReturnValue _wrap_DOMException_msg_get(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMException *arg1 = (XERCES_CPP_NAMESPACE::DOMException *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + res1 = SWIG_ConvertPtr(info.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMException_msg_get" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMException *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMException *)(argp1); + result = (XMLCh *) ((arg1)->msg); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +#if (SWIG_V8_VERSION < 0x031710) +static void _wrap_delete_DOMNode(v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < 0x031900) + static void _wrap_delete_DOMNode(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + static void _wrap_delete_DOMNode(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { +#else + static void _wrap_delete_DOMNode(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) { + v8::Local<v8::Object> object = data.GetValue(); + SWIGV8_Proxy *proxy = data.GetParameter(); +#endif + + if(proxy->swigCMemOwn && proxy->swigCObject) { + XERCES_CPP_NAMESPACE::DOMNode * arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)proxy->swigCObject; + delete arg1; + } + delete proxy; + +#if (SWIG_V8_VERSION < 0x031710) + object.Dispose(); +#elif (SWIG_V8_VERSION < 0x031900) + object.Dispose(isolate); +#elif (SWIG_V8_VERSION < 0x032100) + object->Dispose(isolate); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + object->Dispose(); +#else + object.Clear(); +#endif + } + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMNode_ELEMENT_NODE(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMNode::ELEMENT_NODE)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMNode_ATTRIBUTE_NODE(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMNode::ATTRIBUTE_NODE)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMNode_TEXT_NODE(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMNode::TEXT_NODE)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMNode_CDATA_SECTION_NODE(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMNode::CDATA_SECTION_NODE)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMNode_ENTITY_REFERENCE_NODE(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMNode::ENTITY_REFERENCE_NODE)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMNode_ENTITY_NODE(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMNode::ENTITY_NODE)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMNode_PROCESSING_INSTRUCTION_NODE(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMNode::PROCESSING_INSTRUCTION_NODE)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMNode_COMMENT_NODE(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMNode::COMMENT_NODE)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_NODE(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_NODE)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_TYPE_NODE(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_TYPE_NODE)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_FRAGMENT_NODE(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_FRAGMENT_NODE)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMNode_NOTATION_NODE(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMNode::NOTATION_NODE)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_DISCONNECTED(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_DISCONNECTED)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_PRECEDING(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_PRECEDING)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_FOLLOWING(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_FOLLOWING)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_CONTAINS(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_CONTAINS)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_CONTAINED_BY(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_CONTAINED_BY)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_DOMNode_getNodeName(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getNodeName."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getNodeName" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getNodeName(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_getNodeValue(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getNodeValue."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getNodeValue" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getNodeValue(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_getNodeType(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode::NodeType result; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getNodeType."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getNodeType" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMNode::NodeType)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getNodeType(); + jsresult = SWIG_From_int((int)(result)); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_getParentNode(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getParentNode."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getParentNode" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getParentNode(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_getChildNodes(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNodeList *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getChildNodes."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getChildNodes" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMNodeList *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getChildNodes(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList, 0 | 0 ); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_getFirstChild(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getFirstChild."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getFirstChild" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getFirstChild(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_getLastChild(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getLastChild."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getLastChild" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getLastChild(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_getPreviousSibling(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getPreviousSibling."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getPreviousSibling" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getPreviousSibling(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_getNextSibling(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getNextSibling."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getNextSibling" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getNextSibling(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_getAttributes(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getAttributes."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getAttributes" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getAttributes(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_getOwnerDocument(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMDocument *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getOwnerDocument."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getOwnerDocument" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMDocument *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getOwnerDocument(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocument, 0 | 0 ); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_cloneNode(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + bool arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool val2 ; + int ecode2 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_cloneNode."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_cloneNode" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + ecode2 = SWIG_AsVal_bool(args[0], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DOMNode_cloneNode" "', argument " "2"" of type '" "bool""'"); + } + arg2 = (bool)(val2); + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->cloneNode(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_insertBefore(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg3 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_insertBefore."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_insertBefore" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + res2 = SWIG_ConvertPtr(args[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMNode_insertBefore" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp2); + res3 = SWIG_ConvertPtr(args[1], &argp3,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DOMNode_insertBefore" "', argument " "3"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg3 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp3); + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->insertBefore(arg2,arg3); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_replaceChild(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg3 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_replaceChild."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_replaceChild" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + res2 = SWIG_ConvertPtr(args[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMNode_replaceChild" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp2); + res3 = SWIG_ConvertPtr(args[1], &argp3,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DOMNode_replaceChild" "', argument " "3"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg3 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp3); + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->replaceChild(arg2,arg3); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_removeChild(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_removeChild."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_removeChild" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + res2 = SWIG_ConvertPtr(args[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMNode_removeChild" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp2); + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->removeChild(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_appendChild(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_appendChild."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_appendChild" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + res2 = SWIG_ConvertPtr(args[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMNode_appendChild" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp2); + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->appendChild(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_hasChildNodes(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool result; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_hasChildNodes."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_hasChildNodes" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (bool)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->hasChildNodes(); + jsresult = SWIG_From_bool((bool)(result)); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_setNodeValue(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_setNodeValue."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_setNodeValue" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + + arg2 = JS2XMLString(args[0]); + + (arg1)->setNodeValue((XMLCh const *)arg2); + jsresult = SWIGV8_UNDEFINED(); + + + delete[] arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_normalize(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_normalize."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_normalize" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + (arg1)->normalize(); + jsresult = SWIGV8_UNDEFINED(); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_isSupported(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool result; + + if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_isSupported."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_isSupported" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + + arg2 = JS2XMLString(args[0]); + + + arg3 = JS2XMLString(args[1]); + + result = (bool)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->isSupported((XMLCh const *)arg2,(XMLCh const *)arg3); + jsresult = SWIG_From_bool((bool)(result)); + + + delete[] arg2; + + + delete[] arg3; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_getNamespaceURI(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getNamespaceURI."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getNamespaceURI" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getNamespaceURI(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_getLocalName(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getLocalName."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getLocalName" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getLocalName(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_setPrefix(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_setPrefix."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_setPrefix" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + + arg2 = JS2XMLString(args[0]); + + (arg1)->setPrefix((XMLCh const *)arg2); + jsresult = SWIGV8_UNDEFINED(); + + + delete[] arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_hasAttributes(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool result; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_hasAttributes."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_hasAttributes" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (bool)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->hasAttributes(); + jsresult = SWIG_From_bool((bool)(result)); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_isSameNode(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + bool result; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_isSameNode."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_isSameNode" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + res2 = SWIG_ConvertPtr(args[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMNode_isSameNode" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp2); + result = (bool)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->isSameNode((XERCES_CPP_NAMESPACE::DOMNode const *)arg2); + jsresult = SWIG_From_bool((bool)(result)); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_isEqualNode(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + bool result; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_isEqualNode."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_isEqualNode" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + res2 = SWIG_ConvertPtr(args[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMNode_isEqualNode" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp2); + result = (bool)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->isEqualNode((XERCES_CPP_NAMESPACE::DOMNode const *)arg2); + jsresult = SWIG_From_bool((bool)(result)); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_setUserData(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *arg3 = (void *) 0 ; + XERCES_CPP_NAMESPACE::DOMUserDataHandler *arg4 = (XERCES_CPP_NAMESPACE::DOMUserDataHandler *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res3 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *result = 0 ; + + if(args.Length() != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_setUserData."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_setUserData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + + arg2 = JS2XMLString(args[0]); + + res3 = SWIG_ConvertPtr(args[1],SWIG_as_voidptrptr(&arg3), 0, 0); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DOMNode_setUserData" "', argument " "3"" of type '" "void *""'"); + } + res4 = SWIG_ConvertPtr(args[2], &argp4,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMUserDataHandler, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "DOMNode_setUserData" "', argument " "4"" of type '" "XERCES_CPP_NAMESPACE::DOMUserDataHandler *""'"); + } + arg4 = (XERCES_CPP_NAMESPACE::DOMUserDataHandler *)(argp4); + result = (void *)(arg1)->setUserData((XMLCh const *)arg2,arg3,arg4); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); + + + delete[] arg2; + + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_getUserData(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *result = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getUserData."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getUserData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + + arg2 = JS2XMLString(args[0]); + + result = (void *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getUserData((XMLCh const *)arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); + + + delete[] arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_getBaseURI(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getBaseURI."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getBaseURI" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getBaseURI(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_compareDocumentPosition(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + short result; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_compareDocumentPosition."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_compareDocumentPosition" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + res2 = SWIG_ConvertPtr(args[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMNode_compareDocumentPosition" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp2); + result = (short)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->compareDocumentPosition((XERCES_CPP_NAMESPACE::DOMNode const *)arg2); + jsresult = SWIG_From_short((short)(result)); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_getTextContent(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getTextContent."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getTextContent" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getTextContent(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_setTextContent(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_setTextContent."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_setTextContent" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + + arg2 = JS2XMLString(args[0]); + + (arg1)->setTextContent((XMLCh const *)arg2); + jsresult = SWIGV8_UNDEFINED(); + + + delete[] arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_lookupPrefix(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_lookupPrefix."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_lookupPrefix" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + + arg2 = JS2XMLString(args[0]); + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->lookupPrefix((XMLCh const *)arg2); + + jsresult = XMLString2JS(result); + + + + delete[] arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_isDefaultNamespace(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool result; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_isDefaultNamespace."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_isDefaultNamespace" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + + arg2 = JS2XMLString(args[0]); + + result = (bool)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->isDefaultNamespace((XMLCh const *)arg2); + jsresult = SWIG_From_bool((bool)(result)); + + + delete[] arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_lookupNamespaceURI(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_lookupNamespaceURI."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_lookupNamespaceURI" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + + arg2 = JS2XMLString(args[0]); + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->lookupNamespaceURI((XMLCh const *)arg2); + + jsresult = XMLString2JS(result); + + + + delete[] arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_getFeature(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *result = 0 ; + + if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_getFeature."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_getFeature" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + + arg2 = JS2XMLString(args[0]); + + + arg3 = JS2XMLString(args[1]); + + result = (void *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getFeature((XMLCh const *)arg2,(XMLCh const *)arg3); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); + + + delete[] arg2; + + + delete[] arg3; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNode_release(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNode_release."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNode_release" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp1); + (arg1)->release(); + jsresult = SWIGV8_UNDEFINED(); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_new_veto_DOMNode(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + SWIG_exception(SWIG_ERROR, "Class DOMNode can not be instantiated"); + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +#if (SWIG_V8_VERSION < 0x031710) +static void _wrap_delete_DOMAttr(v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < 0x031900) + static void _wrap_delete_DOMAttr(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + static void _wrap_delete_DOMAttr(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { +#else + static void _wrap_delete_DOMAttr(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) { + v8::Local<v8::Object> object = data.GetValue(); + SWIGV8_Proxy *proxy = data.GetParameter(); +#endif + + if(proxy->swigCMemOwn && proxy->swigCObject) { + XERCES_CPP_NAMESPACE::DOMAttr * arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *)proxy->swigCObject; + delete arg1; + } + delete proxy; + +#if (SWIG_V8_VERSION < 0x031710) + object.Dispose(); +#elif (SWIG_V8_VERSION < 0x031900) + object.Dispose(isolate); +#elif (SWIG_V8_VERSION < 0x032100) + object->Dispose(isolate); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + object->Dispose(); +#else + object.Clear(); +#endif + } + + +static SwigV8ReturnValue _wrap_DOMAttr_getName(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMAttr_getName."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMAttr_getName" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMAttr const *)arg1)->getName(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMAttr_getSpecified(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool result; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMAttr_getSpecified."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMAttr_getSpecified" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp1); + result = (bool)((XERCES_CPP_NAMESPACE::DOMAttr const *)arg1)->getSpecified(); + jsresult = SWIG_From_bool((bool)(result)); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMAttr_getValue(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMAttr_getValue."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMAttr_getValue" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMAttr const *)arg1)->getValue(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMAttr_setValue(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMAttr_setValue."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMAttr_setValue" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp1); + + arg2 = JS2XMLString(args[0]); + + (arg1)->setValue((XMLCh const *)arg2); + jsresult = SWIGV8_UNDEFINED(); + + + delete[] arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMAttr_getOwnerElement(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMElement *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMAttr_getOwnerElement."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMAttr_getOwnerElement" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMElement *)((XERCES_CPP_NAMESPACE::DOMAttr const *)arg1)->getOwnerElement(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMAttr_isId(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool result; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMAttr_isId."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMAttr_isId" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp1); + result = (bool)((XERCES_CPP_NAMESPACE::DOMAttr const *)arg1)->isId(); + jsresult = SWIG_From_bool((bool)(result)); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMAttr_getSchemaTypeInfo(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMTypeInfo *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMAttr_getSchemaTypeInfo."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMAttr_getSchemaTypeInfo" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMTypeInfo *)((XERCES_CPP_NAMESPACE::DOMAttr const *)arg1)->getSchemaTypeInfo(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMTypeInfo, 0 | 0 ); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_new_veto_DOMAttr(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + SWIG_exception(SWIG_ERROR, "Class DOMAttr can not be instantiated"); + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +#if (SWIG_V8_VERSION < 0x031710) +static void _wrap_delete_DOMElement(v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < 0x031900) + static void _wrap_delete_DOMElement(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + static void _wrap_delete_DOMElement(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { +#else + static void _wrap_delete_DOMElement(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) { + v8::Local<v8::Object> object = data.GetValue(); + SWIGV8_Proxy *proxy = data.GetParameter(); +#endif + + if(proxy->swigCMemOwn && proxy->swigCObject) { + XERCES_CPP_NAMESPACE::DOMElement * arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)proxy->swigCObject; + delete arg1; + } + delete proxy; + +#if (SWIG_V8_VERSION < 0x031710) + object.Dispose(); +#elif (SWIG_V8_VERSION < 0x031900) + object.Dispose(isolate); +#elif (SWIG_V8_VERSION < 0x032100) + object->Dispose(isolate); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + object->Dispose(); +#else + object.Clear(); +#endif + } + + +static SwigV8ReturnValue _wrap_DOMElement_getTagName(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getTagName."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getTagName" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getTagName(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_getAttribute(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getAttribute."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getAttribute" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(args[0]); + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getAttribute((XMLCh const *)arg2); + + jsresult = XMLString2JS(result); + + + + delete[] arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_getAttributeNode(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *result = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getAttributeNode."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getAttributeNode" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(args[0]); + + result = (XERCES_CPP_NAMESPACE::DOMAttr *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getAttributeNode((XMLCh const *)arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + + + delete[] arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_getElementsByTagName(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNodeList *result = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getElementsByTagName."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getElementsByTagName" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(args[0]); + + result = (XERCES_CPP_NAMESPACE::DOMNodeList *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getElementsByTagName((XMLCh const *)arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList, 0 | 0 ); + + + delete[] arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_setAttribute(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_setAttribute."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_setAttribute" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(args[0]); + + + arg3 = JS2XMLString(args[1]); + + (arg1)->setAttribute((XMLCh const *)arg2,(XMLCh const *)arg3); + jsresult = SWIGV8_UNDEFINED(); + + + delete[] arg2; + + + delete[] arg3; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_setAttributeNode(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *arg2 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *result = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_setAttributeNode."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_setAttributeNode" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + res2 = SWIG_ConvertPtr(args[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMElement_setAttributeNode" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp2); + result = (XERCES_CPP_NAMESPACE::DOMAttr *)(arg1)->setAttributeNode(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_removeAttributeNode(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *arg2 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *result = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_removeAttributeNode."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_removeAttributeNode" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + res2 = SWIG_ConvertPtr(args[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMElement_removeAttributeNode" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp2); + result = (XERCES_CPP_NAMESPACE::DOMAttr *)(arg1)->removeAttributeNode(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_removeAttribute(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_removeAttribute."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_removeAttribute" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(args[0]); + + (arg1)->removeAttribute((XMLCh const *)arg2); + jsresult = SWIGV8_UNDEFINED(); + + + delete[] arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_getAttributeNS(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getAttributeNS."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getAttributeNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(args[0]); + + + arg3 = JS2XMLString(args[1]); + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getAttributeNS((XMLCh const *)arg2,(XMLCh const *)arg3); + + jsresult = XMLString2JS(result); + + + + delete[] arg2; + + + delete[] arg3; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_setAttributeNS(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + XMLCh *arg4 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + if(args.Length() != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_setAttributeNS."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_setAttributeNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(args[0]); + + + arg3 = JS2XMLString(args[1]); + + + arg4 = JS2XMLString(args[2]); + + (arg1)->setAttributeNS((XMLCh const *)arg2,(XMLCh const *)arg3,(XMLCh const *)arg4); + jsresult = SWIGV8_UNDEFINED(); + + + delete[] arg2; + + + delete[] arg3; + + + delete[] arg4; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_removeAttributeNS(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_removeAttributeNS."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_removeAttributeNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(args[0]); + + + arg3 = JS2XMLString(args[1]); + + (arg1)->removeAttributeNS((XMLCh const *)arg2,(XMLCh const *)arg3); + jsresult = SWIGV8_UNDEFINED(); + + + delete[] arg2; + + + delete[] arg3; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_getAttributeNodeNS(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *result = 0 ; + + if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getAttributeNodeNS."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getAttributeNodeNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(args[0]); + + + arg3 = JS2XMLString(args[1]); + + result = (XERCES_CPP_NAMESPACE::DOMAttr *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getAttributeNodeNS((XMLCh const *)arg2,(XMLCh const *)arg3); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + + + delete[] arg2; + + + delete[] arg3; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_setAttributeNodeNS(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *arg2 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *result = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_setAttributeNodeNS."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_setAttributeNodeNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + res2 = SWIG_ConvertPtr(args[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMElement_setAttributeNodeNS" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp2); + result = (XERCES_CPP_NAMESPACE::DOMAttr *)(arg1)->setAttributeNodeNS(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_getElementsByTagNameNS(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNodeList *result = 0 ; + + if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getElementsByTagNameNS."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getElementsByTagNameNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(args[0]); + + + arg3 = JS2XMLString(args[1]); + + result = (XERCES_CPP_NAMESPACE::DOMNodeList *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getElementsByTagNameNS((XMLCh const *)arg2,(XMLCh const *)arg3); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList, 0 | 0 ); + + + delete[] arg2; + + + delete[] arg3; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_hasAttribute(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool result; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_hasAttribute."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_hasAttribute" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(args[0]); + + result = (bool)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->hasAttribute((XMLCh const *)arg2); + jsresult = SWIG_From_bool((bool)(result)); + + + delete[] arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_hasAttributeNS(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool result; + + if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_hasAttributeNS."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_hasAttributeNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(args[0]); + + + arg3 = JS2XMLString(args[1]); + + result = (bool)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->hasAttributeNS((XMLCh const *)arg2,(XMLCh const *)arg3); + jsresult = SWIG_From_bool((bool)(result)); + + + delete[] arg2; + + + delete[] arg3; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_setIdAttribute(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + bool arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool val3 ; + int ecode3 = 0 ; + + if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_setIdAttribute."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_setIdAttribute" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(args[0]); + + ecode3 = SWIG_AsVal_bool(args[1], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DOMElement_setIdAttribute" "', argument " "3"" of type '" "bool""'"); + } + arg3 = (bool)(val3); + (arg1)->setIdAttribute((XMLCh const *)arg2,arg3); + jsresult = SWIGV8_UNDEFINED(); + + + delete[] arg2; + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_setIdAttributeNS(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + bool arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool val4 ; + int ecode4 = 0 ; + + if(args.Length() != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_setIdAttributeNS."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_setIdAttributeNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + + arg2 = JS2XMLString(args[0]); + + + arg3 = JS2XMLString(args[1]); + + ecode4 = SWIG_AsVal_bool(args[2], &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "DOMElement_setIdAttributeNS" "', argument " "4"" of type '" "bool""'"); + } + arg4 = (bool)(val4); + (arg1)->setIdAttributeNS((XMLCh const *)arg2,(XMLCh const *)arg3,arg4); + jsresult = SWIGV8_UNDEFINED(); + + + delete[] arg2; + + + delete[] arg3; + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_setIdAttributeNode(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *arg2 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + bool arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + bool val3 ; + int ecode3 = 0 ; + + if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_setIdAttributeNode."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_setIdAttributeNode" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + res2 = SWIG_ConvertPtr(args[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMElement_setIdAttributeNode" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMAttr const *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMAttr *)(argp2); + ecode3 = SWIG_AsVal_bool(args[1], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DOMElement_setIdAttributeNode" "', argument " "3"" of type '" "bool""'"); + } + arg3 = (bool)(val3); + (arg1)->setIdAttributeNode((XERCES_CPP_NAMESPACE::DOMAttr const *)arg2,arg3); + jsresult = SWIGV8_UNDEFINED(); + + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_getSchemaTypeInfo(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMTypeInfo *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getSchemaTypeInfo."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getSchemaTypeInfo" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMTypeInfo *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getSchemaTypeInfo(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMTypeInfo, 0 | 0 ); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_getFirstElementChild(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMElement *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getFirstElementChild."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getFirstElementChild" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMElement *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getFirstElementChild(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_getLastElementChild(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMElement *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getLastElementChild."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getLastElementChild" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMElement *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getLastElementChild(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_getPreviousElementSibling(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMElement *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getPreviousElementSibling."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getPreviousElementSibling" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMElement *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getPreviousElementSibling(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_getNextElementSibling(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMElement *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getNextElementSibling."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getNextElementSibling" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMElement *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getNextElementSibling(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMElement_getChildElementCount(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLSize_t result; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMElement_getChildElementCount."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMElement_getChildElementCount" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMElement const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMElement *)(argp1); + result = ((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getChildElementCount(); + jsresult = SWIG_From_size_t((size_t)(result)); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_new_veto_DOMElement(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + SWIG_exception(SWIG_ERROR, "Class DOMElement can not be instantiated"); + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +#if (SWIG_V8_VERSION < 0x031710) +static void _wrap_delete_DOMEntity(v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < 0x031900) + static void _wrap_delete_DOMEntity(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + static void _wrap_delete_DOMEntity(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { +#else + static void _wrap_delete_DOMEntity(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) { + v8::Local<v8::Object> object = data.GetValue(); + SWIGV8_Proxy *proxy = data.GetParameter(); +#endif + + if(proxy->swigCMemOwn && proxy->swigCObject) { + XERCES_CPP_NAMESPACE::DOMEntity * arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *)proxy->swigCObject; + delete arg1; + } + delete proxy; + +#if (SWIG_V8_VERSION < 0x031710) + object.Dispose(); +#elif (SWIG_V8_VERSION < 0x031900) + object.Dispose(isolate); +#elif (SWIG_V8_VERSION < 0x032100) + object->Dispose(isolate); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + object->Dispose(); +#else + object.Clear(); +#endif + } + + +static SwigV8ReturnValue _wrap_DOMEntity_getPublicId(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMEntity *arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMEntity_getPublicId."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMEntity_getPublicId" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMEntity const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getPublicId(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMEntity_getSystemId(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMEntity *arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMEntity_getSystemId."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMEntity_getSystemId" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMEntity const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getSystemId(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMEntity_getNotationName(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMEntity *arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMEntity_getNotationName."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMEntity_getNotationName" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMEntity const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getNotationName(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMEntity_getInputEncoding(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMEntity *arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMEntity_getInputEncoding."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMEntity_getInputEncoding" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMEntity const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getInputEncoding(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMEntity_getXmlEncoding(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMEntity *arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMEntity_getXmlEncoding."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMEntity_getXmlEncoding" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMEntity const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getXmlEncoding(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMEntity_getXmlVersion(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMEntity *arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMEntity_getXmlVersion."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMEntity_getXmlVersion" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMEntity const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getXmlVersion(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_new_veto_DOMEntity(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + SWIG_exception(SWIG_ERROR, "Class DOMEntity can not be instantiated"); + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +#if (SWIG_V8_VERSION < 0x031710) +static void _wrap_delete_DOMDocumentType(v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < 0x031900) + static void _wrap_delete_DOMDocumentType(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + static void _wrap_delete_DOMDocumentType(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { +#else + static void _wrap_delete_DOMDocumentType(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) { + v8::Local<v8::Object> object = data.GetValue(); + SWIGV8_Proxy *proxy = data.GetParameter(); +#endif + + if(proxy->swigCMemOwn && proxy->swigCObject) { + XERCES_CPP_NAMESPACE::DOMDocumentType * arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *)proxy->swigCObject; + delete arg1; + } + delete proxy; + +#if (SWIG_V8_VERSION < 0x031710) + object.Dispose(); +#elif (SWIG_V8_VERSION < 0x031900) + object.Dispose(isolate); +#elif (SWIG_V8_VERSION < 0x032100) + object->Dispose(isolate); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + object->Dispose(); +#else + object.Clear(); +#endif + } + + +static SwigV8ReturnValue _wrap_DOMDocumentType_getName(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMDocumentType *arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMDocumentType_getName."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMDocumentType_getName" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMDocumentType const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getName(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMDocumentType_getEntities(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMDocumentType *arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMDocumentType_getEntities."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMDocumentType_getEntities" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMDocumentType const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getEntities(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMDocumentType_getNotations(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMDocumentType *arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMDocumentType_getNotations."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMDocumentType_getNotations" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMDocumentType const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *)(argp1); + result = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getNotations(); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMDocumentType_getPublicId(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMDocumentType *arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMDocumentType_getPublicId."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMDocumentType_getPublicId" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMDocumentType const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getPublicId(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMDocumentType_getSystemId(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMDocumentType *arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMDocumentType_getSystemId."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMDocumentType_getSystemId" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMDocumentType const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getSystemId(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMDocumentType_getInternalSubset(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMDocumentType *arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMDocumentType_getInternalSubset."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMDocumentType_getInternalSubset" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMDocumentType const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getInternalSubset(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_new_veto_DOMDocumentType(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + SWIG_exception(SWIG_ERROR, "Class DOMDocumentType can not be instantiated"); + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +#if (SWIG_V8_VERSION < 0x031710) +static void _wrap_delete_DOMCharacterData(v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < 0x031900) + static void _wrap_delete_DOMCharacterData(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + static void _wrap_delete_DOMCharacterData(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { +#else + static void _wrap_delete_DOMCharacterData(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) { + v8::Local<v8::Object> object = data.GetValue(); + SWIGV8_Proxy *proxy = data.GetParameter(); +#endif + + if(proxy->swigCMemOwn && proxy->swigCObject) { + XERCES_CPP_NAMESPACE::DOMCharacterData * arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *)proxy->swigCObject; + delete arg1; + } + delete proxy; + +#if (SWIG_V8_VERSION < 0x031710) + object.Dispose(); +#elif (SWIG_V8_VERSION < 0x031900) + object.Dispose(isolate); +#elif (SWIG_V8_VERSION < 0x032100) + object->Dispose(isolate); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + object->Dispose(); +#else + object.Clear(); +#endif + } + + +static SwigV8ReturnValue _wrap_DOMCharacterData_getData(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMCharacterData_getData."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMCharacterData_getData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMCharacterData const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMCharacterData const *)arg1)->getData(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMCharacterData_getLength(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLSize_t result; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMCharacterData_getLength."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMCharacterData_getLength" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMCharacterData const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *)(argp1); + result = ((XERCES_CPP_NAMESPACE::DOMCharacterData const *)arg1)->getLength(); + jsresult = SWIG_From_size_t((size_t)(result)); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMCharacterData_substringData(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + XMLSize_t arg2 ; + XMLSize_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMCharacterData_substringData."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMCharacterData_substringData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMCharacterData const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *)(argp1); + ecode2 = SWIG_AsVal_size_t(args[0], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DOMCharacterData_substringData" "', argument " "2"" of type '" "XMLSize_t""'"); + } + arg2 = (XMLSize_t)(val2); + ecode3 = SWIG_AsVal_size_t(args[1], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DOMCharacterData_substringData" "', argument " "3"" of type '" "XMLSize_t""'"); + } + arg3 = (XMLSize_t)(val3); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMCharacterData const *)arg1)->substringData(arg2,arg3); + + jsresult = XMLString2JS(result); + + + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMCharacterData_appendData(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMCharacterData_appendData."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMCharacterData_appendData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMCharacterData *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *)(argp1); + + arg2 = JS2XMLString(args[0]); + + (arg1)->appendData((XMLCh const *)arg2); + jsresult = SWIGV8_UNDEFINED(); + + + delete[] arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMCharacterData_insertData(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + XMLSize_t arg2 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + + if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMCharacterData_insertData."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMCharacterData_insertData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMCharacterData *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *)(argp1); + ecode2 = SWIG_AsVal_size_t(args[0], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DOMCharacterData_insertData" "', argument " "2"" of type '" "XMLSize_t""'"); + } + arg2 = (XMLSize_t)(val2); + + arg3 = JS2XMLString(args[1]); + + (arg1)->insertData(arg2,(XMLCh const *)arg3); + jsresult = SWIGV8_UNDEFINED(); + + + + delete[] arg3; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMCharacterData_deleteData(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + XMLSize_t arg2 ; + XMLSize_t arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + + if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMCharacterData_deleteData."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMCharacterData_deleteData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMCharacterData *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *)(argp1); + ecode2 = SWIG_AsVal_size_t(args[0], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DOMCharacterData_deleteData" "', argument " "2"" of type '" "XMLSize_t""'"); + } + arg2 = (XMLSize_t)(val2); + ecode3 = SWIG_AsVal_size_t(args[1], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DOMCharacterData_deleteData" "', argument " "3"" of type '" "XMLSize_t""'"); + } + arg3 = (XMLSize_t)(val3); + (arg1)->deleteData(arg2,arg3); + jsresult = SWIGV8_UNDEFINED(); + + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMCharacterData_replaceData(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + XMLSize_t arg2 ; + XMLSize_t arg3 ; + XMLCh *arg4 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + size_t val3 ; + int ecode3 = 0 ; + + if(args.Length() != 3) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMCharacterData_replaceData."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMCharacterData_replaceData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMCharacterData *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *)(argp1); + ecode2 = SWIG_AsVal_size_t(args[0], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DOMCharacterData_replaceData" "', argument " "2"" of type '" "XMLSize_t""'"); + } + arg2 = (XMLSize_t)(val2); + ecode3 = SWIG_AsVal_size_t(args[1], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DOMCharacterData_replaceData" "', argument " "3"" of type '" "XMLSize_t""'"); + } + arg3 = (XMLSize_t)(val3); + + arg4 = JS2XMLString(args[2]); + + (arg1)->replaceData(arg2,arg3,(XMLCh const *)arg4); + jsresult = SWIGV8_UNDEFINED(); + + + + + delete[] arg4; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMCharacterData_setData(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMCharacterData_setData."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMCharacterData_setData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMCharacterData *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *)(argp1); + + arg2 = JS2XMLString(args[0]); + + (arg1)->setData((XMLCh const *)arg2); + jsresult = SWIGV8_UNDEFINED(); + + + delete[] arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_new_veto_DOMCharacterData(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + SWIG_exception(SWIG_ERROR, "Class DOMCharacterData can not be instantiated"); + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +#if (SWIG_V8_VERSION < 0x031710) +static void _wrap_delete_DOMComment(v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < 0x031900) + static void _wrap_delete_DOMComment(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + static void _wrap_delete_DOMComment(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { +#else + static void _wrap_delete_DOMComment(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) { + v8::Local<v8::Object> object = data.GetValue(); + SWIGV8_Proxy *proxy = data.GetParameter(); +#endif + + if(proxy->swigCMemOwn && proxy->swigCObject) { + XERCES_CPP_NAMESPACE::DOMComment * arg1 = (XERCES_CPP_NAMESPACE::DOMComment *)proxy->swigCObject; + delete arg1; + } + delete proxy; + +#if (SWIG_V8_VERSION < 0x031710) + object.Dispose(); +#elif (SWIG_V8_VERSION < 0x031900) + object.Dispose(isolate); +#elif (SWIG_V8_VERSION < 0x032100) + object->Dispose(isolate); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + object->Dispose(); +#else + object.Clear(); +#endif + } + + +static SwigV8ReturnValue _wrap_new_veto_DOMComment(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + SWIG_exception(SWIG_ERROR, "Class DOMComment can not be instantiated"); + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +#if (SWIG_V8_VERSION < 0x031710) +static void _wrap_delete_DOMText(v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < 0x031900) + static void _wrap_delete_DOMText(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + static void _wrap_delete_DOMText(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { +#else + static void _wrap_delete_DOMText(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) { + v8::Local<v8::Object> object = data.GetValue(); + SWIGV8_Proxy *proxy = data.GetParameter(); +#endif + + if(proxy->swigCMemOwn && proxy->swigCObject) { + XERCES_CPP_NAMESPACE::DOMText * arg1 = (XERCES_CPP_NAMESPACE::DOMText *)proxy->swigCObject; + delete arg1; + } + delete proxy; + +#if (SWIG_V8_VERSION < 0x031710) + object.Dispose(); +#elif (SWIG_V8_VERSION < 0x031900) + object.Dispose(isolate); +#elif (SWIG_V8_VERSION < 0x032100) + object->Dispose(isolate); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + object->Dispose(); +#else + object.Clear(); +#endif + } + + +static SwigV8ReturnValue _wrap_DOMText_splitText(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMText *arg1 = (XERCES_CPP_NAMESPACE::DOMText *) 0 ; + XMLSize_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + XERCES_CPP_NAMESPACE::DOMText *result = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMText_splitText."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMText_splitText" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMText *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMText *)(argp1); + ecode2 = SWIG_AsVal_size_t(args[0], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DOMText_splitText" "', argument " "2"" of type '" "XMLSize_t""'"); + } + arg2 = (XMLSize_t)(val2); + result = (XERCES_CPP_NAMESPACE::DOMText *)(arg1)->splitText(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText, 0 | 0 ); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMText_getIsElementContentWhitespace(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMText *arg1 = (XERCES_CPP_NAMESPACE::DOMText *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool result; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMText_getIsElementContentWhitespace."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMText_getIsElementContentWhitespace" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMText const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMText *)(argp1); + result = (bool)((XERCES_CPP_NAMESPACE::DOMText const *)arg1)->getIsElementContentWhitespace(); + jsresult = SWIG_From_bool((bool)(result)); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMText_getWholeText(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMText *arg1 = (XERCES_CPP_NAMESPACE::DOMText *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMText_getWholeText."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMText_getWholeText" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMText const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMText *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMText const *)arg1)->getWholeText(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMText_replaceWholeText(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMText *arg1 = (XERCES_CPP_NAMESPACE::DOMText *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMText *result = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMText_replaceWholeText."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMText_replaceWholeText" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMText *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMText *)(argp1); + + arg2 = JS2XMLString(args[0]); + + result = (XERCES_CPP_NAMESPACE::DOMText *)(arg1)->replaceWholeText((XMLCh const *)arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText, 0 | 0 ); + + + delete[] arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMText_isIgnorableWhitespace(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMText *arg1 = (XERCES_CPP_NAMESPACE::DOMText *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool result; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMText_isIgnorableWhitespace."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMText_isIgnorableWhitespace" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMText const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMText *)(argp1); + result = (bool)((XERCES_CPP_NAMESPACE::DOMText const *)arg1)->isIgnorableWhitespace(); + jsresult = SWIG_From_bool((bool)(result)); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_new_veto_DOMText(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + SWIG_exception(SWIG_ERROR, "Class DOMText can not be instantiated"); + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +#if (SWIG_V8_VERSION < 0x031710) +static void _wrap_delete_DOMCDATASection(v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < 0x031900) + static void _wrap_delete_DOMCDATASection(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + static void _wrap_delete_DOMCDATASection(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { +#else + static void _wrap_delete_DOMCDATASection(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) { + v8::Local<v8::Object> object = data.GetValue(); + SWIGV8_Proxy *proxy = data.GetParameter(); +#endif + + if(proxy->swigCMemOwn && proxy->swigCObject) { + XERCES_CPP_NAMESPACE::DOMCDATASection * arg1 = (XERCES_CPP_NAMESPACE::DOMCDATASection *)proxy->swigCObject; + delete arg1; + } + delete proxy; + +#if (SWIG_V8_VERSION < 0x031710) + object.Dispose(); +#elif (SWIG_V8_VERSION < 0x031900) + object.Dispose(isolate); +#elif (SWIG_V8_VERSION < 0x032100) + object->Dispose(isolate); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + object->Dispose(); +#else + object.Clear(); +#endif + } + + +static SwigV8ReturnValue _wrap_new_veto_DOMCDATASection(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + SWIG_exception(SWIG_ERROR, "Class DOMCDATASection can not be instantiated"); + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +#if (SWIG_V8_VERSION < 0x031710) +static void _wrap_delete_DOMNodeList(v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < 0x031900) + static void _wrap_delete_DOMNodeList(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + static void _wrap_delete_DOMNodeList(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { +#else + static void _wrap_delete_DOMNodeList(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) { + v8::Local<v8::Object> object = data.GetValue(); + SWIGV8_Proxy *proxy = data.GetParameter(); +#endif + + if(proxy->swigCMemOwn && proxy->swigCObject) { + XERCES_CPP_NAMESPACE::DOMNodeList * arg1 = (XERCES_CPP_NAMESPACE::DOMNodeList *)proxy->swigCObject; + delete arg1; + } + delete proxy; + +#if (SWIG_V8_VERSION < 0x031710) + object.Dispose(); +#elif (SWIG_V8_VERSION < 0x031900) + object.Dispose(isolate); +#elif (SWIG_V8_VERSION < 0x032100) + object->Dispose(isolate); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + object->Dispose(); +#else + object.Clear(); +#endif + } + + +static SwigV8ReturnValue _wrap_DOMNodeList_item(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNodeList *arg1 = (XERCES_CPP_NAMESPACE::DOMNodeList *) 0 ; + XMLSize_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNodeList_item."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNodeList_item" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNodeList const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNodeList *)(argp1); + ecode2 = SWIG_AsVal_size_t(args[0], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DOMNodeList_item" "', argument " "2"" of type '" "XMLSize_t""'"); + } + arg2 = (XMLSize_t)(val2); + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNodeList const *)arg1)->item(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNodeList_getLength(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNodeList *arg1 = (XERCES_CPP_NAMESPACE::DOMNodeList *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLSize_t result; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNodeList_getLength."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNodeList_getLength" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNodeList const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNodeList *)(argp1); + result = ((XERCES_CPP_NAMESPACE::DOMNodeList const *)arg1)->getLength(); + jsresult = SWIG_From_size_t((size_t)(result)); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_new_veto_DOMNodeList(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + SWIG_exception(SWIG_ERROR, "Class DOMNodeList can not be instantiated"); + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +#if (SWIG_V8_VERSION < 0x031710) +static void _wrap_delete_DOMNamedNodeMap(v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < 0x031900) + static void _wrap_delete_DOMNamedNodeMap(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + static void _wrap_delete_DOMNamedNodeMap(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { +#else + static void _wrap_delete_DOMNamedNodeMap(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) { + v8::Local<v8::Object> object = data.GetValue(); + SWIGV8_Proxy *proxy = data.GetParameter(); +#endif + + if(proxy->swigCMemOwn && proxy->swigCObject) { + XERCES_CPP_NAMESPACE::DOMNamedNodeMap * arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)proxy->swigCObject; + delete arg1; + } + delete proxy; + +#if (SWIG_V8_VERSION < 0x031710) + object.Dispose(); +#elif (SWIG_V8_VERSION < 0x031900) + object.Dispose(isolate); +#elif (SWIG_V8_VERSION < 0x032100) + object->Dispose(isolate); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + object->Dispose(); +#else + object.Clear(); +#endif + } + + +static SwigV8ReturnValue _wrap_DOMNamedNodeMap_setNamedItem(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNamedNodeMap_setNamedItem."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNamedNodeMap_setNamedItem" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNamedNodeMap *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)(argp1); + res2 = SWIG_ConvertPtr(args[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMNamedNodeMap_setNamedItem" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp2); + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->setNamedItem(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNamedNodeMap_item(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XMLSize_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNamedNodeMap_item."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNamedNodeMap_item" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)(argp1); + ecode2 = SWIG_AsVal_size_t(args[0], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DOMNamedNodeMap_item" "', argument " "2"" of type '" "XMLSize_t""'"); + } + arg2 = (XMLSize_t)(val2); + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *)arg1)->item(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNamedNodeMap_getNamedItem(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNamedNodeMap_getNamedItem."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNamedNodeMap_getNamedItem" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)(argp1); + + arg2 = JS2XMLString(args[0]); + + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *)arg1)->getNamedItem((XMLCh const *)arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + delete[] arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNamedNodeMap_getLength(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLSize_t result; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNamedNodeMap_getLength."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNamedNodeMap_getLength" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)(argp1); + result = ((XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *)arg1)->getLength(); + jsresult = SWIG_From_size_t((size_t)(result)); + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNamedNodeMap_removeNamedItem(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNamedNodeMap_removeNamedItem."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNamedNodeMap_removeNamedItem" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNamedNodeMap *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)(argp1); + + arg2 = JS2XMLString(args[0]); + + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->removeNamedItem((XMLCh const *)arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + delete[] arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNamedNodeMap_getNamedItemNS(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNamedNodeMap_getNamedItemNS."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNamedNodeMap_getNamedItemNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)(argp1); + + arg2 = JS2XMLString(args[0]); + + + arg3 = JS2XMLString(args[1]); + + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *)arg1)->getNamedItemNS((XMLCh const *)arg2,(XMLCh const *)arg3); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + delete[] arg2; + + + delete[] arg3; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNamedNodeMap_setNamedItemNS(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNamedNodeMap_setNamedItemNS."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNamedNodeMap_setNamedItemNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNamedNodeMap *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)(argp1); + res2 = SWIG_ConvertPtr(args[0], &argp2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DOMNamedNodeMap_setNamedItemNS" "', argument " "2"" of type '" "XERCES_CPP_NAMESPACE::DOMNode *""'"); + } + arg2 = (XERCES_CPP_NAMESPACE::DOMNode *)(argp2); + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->setNamedItemNS(arg2); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNamedNodeMap_removeNamedItemNS(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNamedNodeMap_removeNamedItemNS."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNamedNodeMap_removeNamedItemNS" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNamedNodeMap *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)(argp1); + + arg2 = JS2XMLString(args[0]); + + + arg3 = JS2XMLString(args[1]); + + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->removeNamedItemNS((XMLCh const *)arg2,(XMLCh const *)arg3); + jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, SWIG_as_voidptrptr(&result)), 0 | 0 ); + + + delete[] arg2; + + + delete[] arg3; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_new_veto_DOMNamedNodeMap(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + SWIG_exception(SWIG_ERROR, "Class DOMNamedNodeMap can not be instantiated"); + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +#if (SWIG_V8_VERSION < 0x031710) +static void _wrap_delete_DOMDocumentFragment(v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < 0x031900) + static void _wrap_delete_DOMDocumentFragment(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + static void _wrap_delete_DOMDocumentFragment(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { +#else + static void _wrap_delete_DOMDocumentFragment(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) { + v8::Local<v8::Object> object = data.GetValue(); + SWIGV8_Proxy *proxy = data.GetParameter(); +#endif + + if(proxy->swigCMemOwn && proxy->swigCObject) { + XERCES_CPP_NAMESPACE::DOMDocumentFragment * arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentFragment *)proxy->swigCObject; + delete arg1; + } + delete proxy; + +#if (SWIG_V8_VERSION < 0x031710) + object.Dispose(); +#elif (SWIG_V8_VERSION < 0x031900) + object.Dispose(isolate); +#elif (SWIG_V8_VERSION < 0x032100) + object->Dispose(isolate); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + object->Dispose(); +#else + object.Clear(); +#endif + } + + +static SwigV8ReturnValue _wrap_new_veto_DOMDocumentFragment(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + SWIG_exception(SWIG_ERROR, "Class DOMDocumentFragment can not be instantiated"); + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +#if (SWIG_V8_VERSION < 0x031710) +static void _wrap_delete_DOMEntityReference(v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < 0x031900) + static void _wrap_delete_DOMEntityReference(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + static void _wrap_delete_DOMEntityReference(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { +#else + static void _wrap_delete_DOMEntityReference(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) { + v8::Local<v8::Object> object = data.GetValue(); + SWIGV8_Proxy *proxy = data.GetParameter(); +#endif + + if(proxy->swigCMemOwn && proxy->swigCObject) { + XERCES_CPP_NAMESPACE::DOMEntityReference * arg1 = (XERCES_CPP_NAMESPACE::DOMEntityReference *)proxy->swigCObject; + delete arg1; + } + delete proxy; + +#if (SWIG_V8_VERSION < 0x031710) + object.Dispose(); +#elif (SWIG_V8_VERSION < 0x031900) + object.Dispose(isolate); +#elif (SWIG_V8_VERSION < 0x032100) + object->Dispose(isolate); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + object->Dispose(); +#else + object.Clear(); +#endif + } + + +static SwigV8ReturnValue _wrap_new_veto_DOMEntityReference(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + SWIG_exception(SWIG_ERROR, "Class DOMEntityReference can not be instantiated"); + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +#if (SWIG_V8_VERSION < 0x031710) +static void _wrap_delete_DOMNotation(v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < 0x031900) + static void _wrap_delete_DOMNotation(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + static void _wrap_delete_DOMNotation(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { +#else + static void _wrap_delete_DOMNotation(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) { + v8::Local<v8::Object> object = data.GetValue(); + SWIGV8_Proxy *proxy = data.GetParameter(); +#endif + + if(proxy->swigCMemOwn && proxy->swigCObject) { + XERCES_CPP_NAMESPACE::DOMNotation * arg1 = (XERCES_CPP_NAMESPACE::DOMNotation *)proxy->swigCObject; + delete arg1; + } + delete proxy; + +#if (SWIG_V8_VERSION < 0x031710) + object.Dispose(); +#elif (SWIG_V8_VERSION < 0x031900) + object.Dispose(isolate); +#elif (SWIG_V8_VERSION < 0x032100) + object->Dispose(isolate); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + object->Dispose(); +#else + object.Clear(); +#endif + } + + +static SwigV8ReturnValue _wrap_DOMNotation_getPublicId(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNotation *arg1 = (XERCES_CPP_NAMESPACE::DOMNotation *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNotation_getPublicId."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNotation, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNotation_getPublicId" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNotation const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNotation *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNotation const *)arg1)->getPublicId(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMNotation_getSystemId(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMNotation *arg1 = (XERCES_CPP_NAMESPACE::DOMNotation *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMNotation_getSystemId."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNotation, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMNotation_getSystemId" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMNotation const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMNotation *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNotation const *)arg1)->getSystemId(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_new_veto_DOMNotation(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + SWIG_exception(SWIG_ERROR, "Class DOMNotation can not be instantiated"); + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +#if (SWIG_V8_VERSION < 0x031710) +static void _wrap_delete_DOMProcessingInstruction(v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < 0x031900) + static void _wrap_delete_DOMProcessingInstruction(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + static void _wrap_delete_DOMProcessingInstruction(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { +#else + static void _wrap_delete_DOMProcessingInstruction(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) { + v8::Local<v8::Object> object = data.GetValue(); + SWIGV8_Proxy *proxy = data.GetParameter(); +#endif + + if(proxy->swigCMemOwn && proxy->swigCObject) { + XERCES_CPP_NAMESPACE::DOMProcessingInstruction * arg1 = (XERCES_CPP_NAMESPACE::DOMProcessingInstruction *)proxy->swigCObject; + delete arg1; + } + delete proxy; + +#if (SWIG_V8_VERSION < 0x031710) + object.Dispose(); +#elif (SWIG_V8_VERSION < 0x031900) + object.Dispose(isolate); +#elif (SWIG_V8_VERSION < 0x032100) + object->Dispose(isolate); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + object->Dispose(); +#else + object.Clear(); +#endif + } + + +static SwigV8ReturnValue _wrap_DOMProcessingInstruction_getTarget(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMProcessingInstruction *arg1 = (XERCES_CPP_NAMESPACE::DOMProcessingInstruction *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMProcessingInstruction_getTarget."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMProcessingInstruction_getTarget" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMProcessingInstruction const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMProcessingInstruction *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMProcessingInstruction const *)arg1)->getTarget(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMProcessingInstruction_getData(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMProcessingInstruction *arg1 = (XERCES_CPP_NAMESPACE::DOMProcessingInstruction *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + XMLCh *result = 0 ; + + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMProcessingInstruction_getData."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMProcessingInstruction_getData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMProcessingInstruction const *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMProcessingInstruction *)(argp1); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMProcessingInstruction const *)arg1)->getData(); + + jsresult = XMLString2JS(result); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_DOMProcessingInstruction_setData(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + XERCES_CPP_NAMESPACE::DOMProcessingInstruction *arg1 = (XERCES_CPP_NAMESPACE::DOMProcessingInstruction *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_DOMProcessingInstruction_setData."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DOMProcessingInstruction_setData" "', argument " "1"" of type '" "XERCES_CPP_NAMESPACE::DOMProcessingInstruction *""'"); + } + arg1 = (XERCES_CPP_NAMESPACE::DOMProcessingInstruction *)(argp1); + + arg2 = JS2XMLString(args[0]); + + (arg1)->setData((XMLCh const *)arg2); + jsresult = SWIGV8_UNDEFINED(); + + + delete[] arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_new_veto_DOMProcessingInstruction(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + SWIG_exception(SWIG_ERROR, "Class DOMProcessingInstruction can not be instantiated"); + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_uscxml_Event_INTERNAL(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(uscxml::Event::INTERNAL)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_uscxml_Event_EXTERNAL(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(uscxml::Event::EXTERNAL)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_uscxml_Event_PLATFORM(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + + jsresult = SWIG_From_int((int)(uscxml::Event::PLATFORM)); + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static SwigV8ReturnValue _wrap_new_Event__SWIG_0(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Object> self = args.Holder(); + uscxml::Event *result; + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_new_Event__SWIG_0."); + result = (uscxml::Event *)new uscxml::Event(); + + + + SWIGV8_SetPrivateData(self, result, SWIGTYPE_p_uscxml__Event, SWIG_POINTER_OWN); + SWIGV8_RETURN(self); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_new_Event__SWIG_1(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Object> self = args.Holder(); + std::string *arg1 = 0 ; + uscxml::Event::Type arg2 ; + int res1 = SWIG_OLDOBJ ; + int val2 ; + int ecode2 = 0 ; + uscxml::Event *result; + if(args.Length() != 2) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_new_Event__SWIG_1."); + { + std::string *ptr = (std::string *)0; + res1 = SWIG_AsPtr_std_string(args[0], &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Event" "', argument " "1"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Event" "', argument " "1"" of type '" "std::string const &""'"); + } + arg1 = ptr; + } + ecode2 = SWIG_AsVal_int(args[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Event" "', argument " "2"" of type '" "uscxml::Event::Type""'"); + } + arg2 = (uscxml::Event::Type)(val2); + result = (uscxml::Event *)new uscxml::Event((std::string const &)*arg1,arg2); + + if (SWIG_IsNewObj(res1)) delete arg1; + + + + SWIGV8_SetPrivateData(self, result, SWIGTYPE_p_uscxml__Event, SWIG_POINTER_OWN); + SWIGV8_RETURN(self); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_new_Event__SWIG_2(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Object> self = args.Holder(); + std::string *arg1 = 0 ; + int res1 = SWIG_OLDOBJ ; + uscxml::Event *result; + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_new_Event__SWIG_2."); + { + std::string *ptr = (std::string *)0; + res1 = SWIG_AsPtr_std_string(args[0], &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Event" "', argument " "1"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Event" "', argument " "1"" of type '" "std::string const &""'"); + } + arg1 = ptr; + } + result = (uscxml::Event *)new uscxml::Event((std::string const &)*arg1); + + if (SWIG_IsNewObj(res1)) delete arg1; + + + SWIGV8_SetPrivateData(self, result, SWIGTYPE_p_uscxml__Event, SWIG_POINTER_OWN); + SWIGV8_RETURN(self); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_new_Event(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + OverloadErrorHandler errorHandler; + v8::Handle<v8::Value> self; + + // switch all cases by means of series of if-returns. + + if(args.Length() == 0) { + errorHandler.err.Clear(); +#if (SWIG_V8_VERSION < 0x031903) + self = _wrap_new_Event__SWIG_0(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + SWIGV8_ESCAPE(self); + } +#else + _wrap_new_Event__SWIG_0(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + return; + } +#endif + } + + if(args.Length() == 2) { + errorHandler.err.Clear(); +#if (SWIG_V8_VERSION < 0x031903) + self = _wrap_new_Event__SWIG_1(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + SWIGV8_ESCAPE(self); + } +#else + _wrap_new_Event__SWIG_1(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + return; + } +#endif + } + + if(args.Length() == 1) { + errorHandler.err.Clear(); +#if (SWIG_V8_VERSION < 0x031903) + self = _wrap_new_Event__SWIG_2(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + SWIGV8_ESCAPE(self); + } +#else + _wrap_new_Event__SWIG_2(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + return; + } +#endif + } + + + // default: + SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for construction of _exports_Event"); + +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_Event_operator_equal_to(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + uscxml::Event *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 ; + int res2 = 0 ; + bool result; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_Event_operator_equal_to."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_uscxml__Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_operator_equal_to" "', argument " "1"" of type '" "uscxml::Event const *""'"); + } + arg1 = (uscxml::Event *)(argp1); + res2 = SWIG_ConvertPtr(args[0], &argp2, SWIGTYPE_p_uscxml__Event, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Event_operator_equal_to" "', argument " "2"" of type '" "uscxml::Event const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_operator_equal_to" "', argument " "2"" of type '" "uscxml::Event const &""'"); + } + arg2 = (uscxml::Event *)(argp2); + result = (bool)((uscxml::Event const *)arg1)->operator ==((uscxml::Event const &)*arg2); + jsresult = SWIG_From_bool((bool)(result)); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_Event_operator_not_equal_to(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + uscxml::Event *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 ; + int res2 = 0 ; + bool result; + + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_Event_operator_not_equal_to."); + + res1 = SWIG_ConvertPtr(args.Holder(), &argp1,SWIGTYPE_p_uscxml__Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_operator_not_equal_to" "', argument " "1"" of type '" "uscxml::Event const *""'"); + } + arg1 = (uscxml::Event *)(argp1); + res2 = SWIG_ConvertPtr(args[0], &argp2, SWIGTYPE_p_uscxml__Event, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Event_operator_not_equal_to" "', argument " "2"" of type '" "uscxml::Event const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_operator_not_equal_to" "', argument " "2"" of type '" "uscxml::Event const &""'"); + } + arg2 = (uscxml::Event *)(argp2); + result = (bool)((uscxml::Event const *)arg1)->operator !=((uscxml::Event const &)*arg2); + jsresult = SWIG_From_bool((bool)(result)); + + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_Event_getParam__SWIG_0(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) +{ + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + uscxml::Event::params_t *arg1 = 0 ; + std::string *arg2 = 0 ; + Data *arg3 = 0 ; + void *argp1 ; + int res1 = 0 ; + int res2 = SWIG_OLDOBJ ; + void *argp3 = 0 ; + int res3 = 0 ; + bool result; + + res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_std__multimapT_std__string_Data_t, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_getParam" "', argument " "1"" of type '" "uscxml::Event::params_t const &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_getParam" "', argument " "1"" of type '" "uscxml::Event::params_t const &""'"); + } + arg1 = (uscxml::Event::params_t *)(argp1); + { + std::string *ptr = (std::string *)0; + res2 = SWIG_AsPtr_std_string(args[1], &ptr); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Event_getParam" "', argument " "2"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_getParam" "', argument " "2"" of type '" "std::string const &""'"); + } + arg2 = ptr; + } + res3 = SWIG_ConvertPtr(args[2], &argp3, SWIGTYPE_p_Data, 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Event_getParam" "', argument " "3"" of type '" "Data &""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_getParam" "', argument " "3"" of type '" "Data &""'"); + } + arg3 = (Data *)(argp3); + result = (bool)uscxml::Event::getParam((std::multimap< std::string,Data > const &)*arg1,(std::string const &)*arg2,*arg3); + jsresult = SWIG_From_bool((bool)(result)); + + if (SWIG_IsNewObj(res2)) delete arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_Event_getParam__SWIG_1(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) +{ + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + uscxml::Event::params_t *arg1 = 0 ; + std::string *arg2 = 0 ; + std::list< Data > *arg3 = 0 ; + void *argp1 ; + int res1 = 0 ; + int res2 = SWIG_OLDOBJ ; + void *argp3 = 0 ; + int res3 = 0 ; + bool result; + + res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_std__multimapT_std__string_Data_t, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_getParam" "', argument " "1"" of type '" "uscxml::Event::params_t const &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_getParam" "', argument " "1"" of type '" "uscxml::Event::params_t const &""'"); + } + arg1 = (uscxml::Event::params_t *)(argp1); + { + std::string *ptr = (std::string *)0; + res2 = SWIG_AsPtr_std_string(args[1], &ptr); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Event_getParam" "', argument " "2"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_getParam" "', argument " "2"" of type '" "std::string const &""'"); + } + arg2 = ptr; + } + res3 = SWIG_ConvertPtr(args[2], &argp3, SWIGTYPE_p_std__listT_Data_t, 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Event_getParam" "', argument " "3"" of type '" "std::list< Data > &""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_getParam" "', argument " "3"" of type '" "std::list< Data > &""'"); + } + arg3 = (std::list< Data > *)(argp3); + result = (bool)uscxml::Event::getParam((std::multimap< std::string,Data > const &)*arg1,(std::string const &)*arg2,*arg3); + jsresult = SWIG_From_bool((bool)(result)); + + if (SWIG_IsNewObj(res2)) delete arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_Event_getParam__SWIG_3(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) +{ + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + uscxml::Event::params_t *arg1 = 0 ; + std::string *arg2 = 0 ; + bool *arg3 = 0 ; + void *argp1 ; + int res1 = 0 ; + int res2 = SWIG_OLDOBJ ; + void *argp3 = 0 ; + int res3 = 0 ; + bool result; + + res1 = SWIG_ConvertPtr(args[0], &argp1, SWIGTYPE_p_std__multimapT_std__string_Data_t, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_getParam" "', argument " "1"" of type '" "uscxml::Event::params_t const &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_getParam" "', argument " "1"" of type '" "uscxml::Event::params_t const &""'"); + } + arg1 = (uscxml::Event::params_t *)(argp1); + { + std::string *ptr = (std::string *)0; + res2 = SWIG_AsPtr_std_string(args[1], &ptr); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Event_getParam" "', argument " "2"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_getParam" "', argument " "2"" of type '" "std::string const &""'"); + } + arg2 = ptr; + } + res3 = SWIG_ConvertPtr(args[2], &argp3, SWIGTYPE_p_bool, 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Event_getParam" "', argument " "3"" of type '" "bool &""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_getParam" "', argument " "3"" of type '" "bool &""'"); + } + arg3 = (bool *)(argp3); + result = (bool)uscxml::Event::getParam((std::multimap< std::string,Data > const &)*arg1,(std::string const &)*arg2,*arg3); + jsresult = SWIG_From_bool((bool)(result)); + + if (SWIG_IsNewObj(res2)) delete arg2; + + + SWIGV8_RETURN(jsresult); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_Event__wrap_Event_getParam(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + OverloadErrorHandler errorHandler; + + + if(args.Length() == 3) { + errorHandler.err.Clear(); +#if (SWIG_V8_VERSION < 0x031903) + jsresult = _wrap_Event_getParam__SWIG_0(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + SWIGV8_ESCAPE(jsresult); + } +#else + _wrap_Event_getParam__SWIG_0(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + return; + } +#endif + } + + + if(args.Length() == 3) { + errorHandler.err.Clear(); +#if (SWIG_V8_VERSION < 0x031903) + jsresult = _wrap_Event_getParam__SWIG_1(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + SWIGV8_ESCAPE(jsresult); + } +#else + _wrap_Event_getParam__SWIG_1(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + return; + } +#endif + } + + + if(args.Length() == 3) { + errorHandler.err.Clear(); +#if (SWIG_V8_VERSION < 0x031903) + jsresult = _wrap_Event_getParam__SWIG_3(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + SWIGV8_ESCAPE(jsresult); + } +#else + _wrap_Event_getParam__SWIG_3(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + return; + } +#endif + } + + + SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for function getParam."); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static void _wrap_Event_raw_set(v8::Local<v8::String> property, v8::Local<v8::Value> value, + const SwigV8PropertyCallbackInfoVoid &info) { + SWIGV8_HANDLESCOPE(); + + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + std::string *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 = SWIG_OLDOBJ ; + + res1 = SWIG_ConvertPtr(info.Holder(), &argp1,SWIGTYPE_p_uscxml__Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_raw_set" "', argument " "1"" of type '" "uscxml::Event *""'"); + } + arg1 = (uscxml::Event *)(argp1); + { + std::string *ptr = (std::string *)0; + res2 = SWIG_AsPtr_std_string(value, &ptr); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Event_raw_set" "', argument " "2"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_raw_set" "', argument " "2"" of type '" "std::string const &""'"); + } + arg2 = ptr; + } + if (arg1) (arg1)->raw = *arg2; + + if (SWIG_IsNewObj(res2)) delete arg2; + + goto fail; +fail: + return; +} + + +static SwigV8ReturnValue _wrap_Event_raw_get(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::string *result = 0 ; + + res1 = SWIG_ConvertPtr(info.Holder(), &argp1,SWIGTYPE_p_uscxml__Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_raw_get" "', argument " "1"" of type '" "uscxml::Event *""'"); + } + arg1 = (uscxml::Event *)(argp1); + result = (std::string *) & ((arg1)->raw); + jsresult = SWIG_From_std_string((std::string)(*result)); + + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static void _wrap_Event_name_set(v8::Local<v8::String> property, v8::Local<v8::Value> value, + const SwigV8PropertyCallbackInfoVoid &info) { + SWIGV8_HANDLESCOPE(); + + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + std::string *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 = SWIG_OLDOBJ ; + + res1 = SWIG_ConvertPtr(info.Holder(), &argp1,SWIGTYPE_p_uscxml__Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_name_set" "', argument " "1"" of type '" "uscxml::Event *""'"); + } + arg1 = (uscxml::Event *)(argp1); + { + std::string *ptr = (std::string *)0; + res2 = SWIG_AsPtr_std_string(value, &ptr); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Event_name_set" "', argument " "2"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Event_name_set" "', argument " "2"" of type '" "std::string const &""'"); + } + arg2 = ptr; + } + if (arg1) (arg1)->name = *arg2; + + if (SWIG_IsNewObj(res2)) delete arg2; + + goto fail; +fail: + return; +} + + +static SwigV8ReturnValue _wrap_Event_name_get(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::string *result = 0 ; + + res1 = SWIG_ConvertPtr(info.Holder(), &argp1,SWIGTYPE_p_uscxml__Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_name_get" "', argument " "1"" of type '" "uscxml::Event *""'"); + } + arg1 = (uscxml::Event *)(argp1); + result = (std::string *) & ((arg1)->name); + jsresult = SWIG_From_std_string((std::string)(*result)); + + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +static void _wrap_Event_eventType_set(v8::Local<v8::String> property, v8::Local<v8::Value> value, + const SwigV8PropertyCallbackInfoVoid &info) { + SWIGV8_HANDLESCOPE(); + + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + uscxml::Event::Type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + + res1 = SWIG_ConvertPtr(info.Holder(), &argp1,SWIGTYPE_p_uscxml__Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_eventType_set" "', argument " "1"" of type '" "uscxml::Event *""'"); + } + arg1 = (uscxml::Event *)(argp1); + ecode2 = SWIG_AsVal_int(value, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Event_eventType_set" "', argument " "2"" of type '" "uscxml::Event::Type""'"); + } + arg2 = (uscxml::Event::Type)(val2); + if (arg1) (arg1)->eventType = arg2; + + + + goto fail; +fail: + return; +} + + +static SwigV8ReturnValue _wrap_Event_eventType_get(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Value> jsresult; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + uscxml::Event::Type result; + + res1 = SWIG_ConvertPtr(info.Holder(), &argp1,SWIGTYPE_p_uscxml__Event, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_eventType_get" "', argument " "1"" of type '" "uscxml::Event *""'"); + } + arg1 = (uscxml::Event *)(argp1); + result = (uscxml::Event::Type) ((arg1)->eventType); + jsresult = SWIG_From_int((int)(result)); + + + SWIGV8_RETURN_INFO(jsresult, info); + + goto fail; +fail: + SWIGV8_RETURN_INFO(SWIGV8_UNDEFINED(), info); +} + + +#if (SWIG_V8_VERSION < 0x031710) +static void _wrap_delete_Event(v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < 0x031900) + static void _wrap_delete_Event(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + static void _wrap_delete_Event(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { +#else + static void _wrap_delete_Event(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) { + v8::Local<v8::Object> object = data.GetValue(); + SWIGV8_Proxy *proxy = data.GetParameter(); +#endif + + if(proxy->swigCMemOwn && proxy->swigCObject) { + uscxml::Event * arg1 = (uscxml::Event *)proxy->swigCObject; + delete arg1; + } + delete proxy; + +#if (SWIG_V8_VERSION < 0x031710) + object.Dispose(); +#elif (SWIG_V8_VERSION < 0x031900) + object.Dispose(isolate); +#elif (SWIG_V8_VERSION < 0x032100) + object->Dispose(isolate); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + object->Dispose(); +#else + object.Clear(); +#endif + } + + +static SwigV8ReturnValue _wrap_new_ErrorEvent__SWIG_0(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Object> self = args.Holder(); + uscxml::ErrorEvent *result; + if(args.Length() != 0) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_new_ErrorEvent__SWIG_0."); + result = (uscxml::ErrorEvent *)new uscxml::ErrorEvent(); + + + + SWIGV8_SetPrivateData(self, result, SWIGTYPE_p_uscxml__ErrorEvent, SWIG_POINTER_OWN); + SWIGV8_RETURN(self); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_new_ErrorEvent__SWIG_1(const SwigV8Arguments &args, V8ErrorHandler &SWIGV8_ErrorHandler) { + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Object> self = args.Holder(); + std::string *arg1 = 0 ; + int res1 = SWIG_OLDOBJ ; + uscxml::ErrorEvent *result; + if(args.Length() != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_new_ErrorEvent__SWIG_1."); + { + std::string *ptr = (std::string *)0; + res1 = SWIG_AsPtr_std_string(args[0], &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ErrorEvent" "', argument " "1"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_ErrorEvent" "', argument " "1"" of type '" "std::string const &""'"); + } + arg1 = ptr; + } + result = (uscxml::ErrorEvent *)new uscxml::ErrorEvent((std::string const &)*arg1); + + if (SWIG_IsNewObj(res1)) delete arg1; + + + SWIGV8_SetPrivateData(self, result, SWIGTYPE_p_uscxml__ErrorEvent, SWIG_POINTER_OWN); + SWIGV8_RETURN(self); + + goto fail; +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +static SwigV8ReturnValue _wrap_new_ErrorEvent(const SwigV8Arguments &args) { + SWIGV8_HANDLESCOPE(); + + OverloadErrorHandler errorHandler; + v8::Handle<v8::Value> self; + + // switch all cases by means of series of if-returns. + + if(args.Length() == 0) { + errorHandler.err.Clear(); +#if (SWIG_V8_VERSION < 0x031903) + self = _wrap_new_ErrorEvent__SWIG_0(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + SWIGV8_ESCAPE(self); + } +#else + _wrap_new_ErrorEvent__SWIG_0(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + return; + } +#endif + } + + if(args.Length() == 1) { + errorHandler.err.Clear(); +#if (SWIG_V8_VERSION < 0x031903) + self = _wrap_new_ErrorEvent__SWIG_1(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + SWIGV8_ESCAPE(self); + } +#else + _wrap_new_ErrorEvent__SWIG_1(args, errorHandler); + if(errorHandler.err.IsEmpty()) { + return; + } +#endif + } + + + // default: + SWIG_exception_fail(SWIG_ERROR, "Illegal arguments for construction of _exports_ErrorEvent"); + +fail: + SWIGV8_RETURN(SWIGV8_UNDEFINED()); +} + + +#if (SWIG_V8_VERSION < 0x031710) +static void _wrap_delete_ErrorEvent(v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < 0x031900) + static void _wrap_delete_ErrorEvent(v8::Isolate *isolate, v8::Persistent<v8::Value> object, void *parameter) { + SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + static void _wrap_delete_ErrorEvent(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) { +#else + static void _wrap_delete_ErrorEvent(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) { + v8::Local<v8::Object> object = data.GetValue(); + SWIGV8_Proxy *proxy = data.GetParameter(); +#endif + + if(proxy->swigCMemOwn && proxy->swigCObject) { + uscxml::ErrorEvent * arg1 = (uscxml::ErrorEvent *)proxy->swigCObject; + delete arg1; + } + delete proxy; + +#if (SWIG_V8_VERSION < 0x031710) + object.Dispose(); +#elif (SWIG_V8_VERSION < 0x031900) + object.Dispose(isolate); +#elif (SWIG_V8_VERSION < 0x032100) + object->Dispose(isolate); +#elif (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION) + object->Dispose(); +#else + object.Clear(); +#endif + } + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ + +static void *_p_XERCES_CPP_NAMESPACE__DOMCDATASectionTo_p_XERCES_CPP_NAMESPACE__DOMText(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMText *) ((XERCES_CPP_NAMESPACE::DOMCDATASection *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMTextTo_p_XERCES_CPP_NAMESPACE__DOMCharacterData(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMCharacterData *) ((XERCES_CPP_NAMESPACE::DOMText *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMCommentTo_p_XERCES_CPP_NAMESPACE__DOMCharacterData(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMCharacterData *) ((XERCES_CPP_NAMESPACE::DOMComment *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMCDATASectionTo_p_XERCES_CPP_NAMESPACE__DOMCharacterData(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMCharacterData *) (XERCES_CPP_NAMESPACE::DOMText *) ((XERCES_CPP_NAMESPACE::DOMCDATASection *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMElementTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMElement *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMDocumentFragmentTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMDocumentFragment *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMAttrTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMAttr *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMDocumentTypeTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMDocumentType *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMCharacterDataTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMCharacterData *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMTextTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) (XERCES_CPP_NAMESPACE::DOMCharacterData *) ((XERCES_CPP_NAMESPACE::DOMText *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMCommentTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) (XERCES_CPP_NAMESPACE::DOMCharacterData *) ((XERCES_CPP_NAMESPACE::DOMComment *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMProcessingInstructionTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMProcessingInstruction *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMEntityTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMEntity *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMEntityReferenceTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMEntityReference *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMCDATASectionTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) (XERCES_CPP_NAMESPACE::DOMCharacterData *)(XERCES_CPP_NAMESPACE::DOMText *) ((XERCES_CPP_NAMESPACE::DOMCDATASection *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMNotationTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMNotation *) x)); +} +static void *_p_uscxml__ErrorEventTo_p_uscxml__Event(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((uscxml::Event *) ((uscxml::ErrorEvent *) x)); +} +static swig_type_info _swigt__p_Data = {"_p_Data", "Data *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMAttr = {"_p_XERCES_CPP_NAMESPACE__DOMAttr", "XERCES_CPP_NAMESPACE::DOMAttr *|p_XERCES_CPP_NAMESPACE__DOMAttr", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMCDATASection = {"_p_XERCES_CPP_NAMESPACE__DOMCDATASection", "p_XERCES_CPP_NAMESPACE__DOMCDATASection", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMCharacterData = {"_p_XERCES_CPP_NAMESPACE__DOMCharacterData", "XERCES_CPP_NAMESPACE::DOMCharacterData *|p_XERCES_CPP_NAMESPACE__DOMCharacterData", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMComment = {"_p_XERCES_CPP_NAMESPACE__DOMComment", "p_XERCES_CPP_NAMESPACE__DOMComment", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMDocument = {"_p_XERCES_CPP_NAMESPACE__DOMDocument", "XERCES_CPP_NAMESPACE::DOMDocument *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentFragment = {"_p_XERCES_CPP_NAMESPACE__DOMDocumentFragment", "p_XERCES_CPP_NAMESPACE__DOMDocumentFragment", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentType = {"_p_XERCES_CPP_NAMESPACE__DOMDocumentType", "XERCES_CPP_NAMESPACE::DOMDocumentType *|p_XERCES_CPP_NAMESPACE__DOMDocumentType", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMElement = {"_p_XERCES_CPP_NAMESPACE__DOMElement", "p_XERCES_CPP_NAMESPACE__DOMElement|XERCES_CPP_NAMESPACE::DOMElement *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMEntity = {"_p_XERCES_CPP_NAMESPACE__DOMEntity", "XERCES_CPP_NAMESPACE::DOMEntity *|p_XERCES_CPP_NAMESPACE__DOMEntity", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMEntityReference = {"_p_XERCES_CPP_NAMESPACE__DOMEntityReference", "p_XERCES_CPP_NAMESPACE__DOMEntityReference", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMException = {"_p_XERCES_CPP_NAMESPACE__DOMException", "p_XERCES_CPP_NAMESPACE__DOMException|XERCES_CPP_NAMESPACE::DOMException *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap = {"_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap", "p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap|XERCES_CPP_NAMESPACE::DOMNamedNodeMap *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMNode = {"_p_XERCES_CPP_NAMESPACE__DOMNode", "XERCES_CPP_NAMESPACE::DOMNode *|p_XERCES_CPP_NAMESPACE__DOMNode", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMNodeList = {"_p_XERCES_CPP_NAMESPACE__DOMNodeList", "p_XERCES_CPP_NAMESPACE__DOMNodeList|XERCES_CPP_NAMESPACE::DOMNodeList *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMNotation = {"_p_XERCES_CPP_NAMESPACE__DOMNotation", "XERCES_CPP_NAMESPACE::DOMNotation *|p_XERCES_CPP_NAMESPACE__DOMNotation", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction = {"_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction", "XERCES_CPP_NAMESPACE::DOMProcessingInstruction *|p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMText = {"_p_XERCES_CPP_NAMESPACE__DOMText", "XERCES_CPP_NAMESPACE::DOMText *|p_XERCES_CPP_NAMESPACE__DOMText", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMTypeInfo = {"_p_XERCES_CPP_NAMESPACE__DOMTypeInfo", "XERCES_CPP_NAMESPACE::DOMTypeInfo *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMUserDataHandler = {"_p_XERCES_CPP_NAMESPACE__DOMUserDataHandler", "XERCES_CPP_NAMESPACE::DOMUserDataHandler *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__MemoryManager = {"_p_XERCES_CPP_NAMESPACE__MemoryManager", "XERCES_CPP_NAMESPACE::MemoryManager *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_bool = {"_p_bool", "bool *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int16_t = {"_p_int16_t", "XMLInt16 *|int16_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int32_t = {"_p_int32_t", "int32_t *|XMLInt32 *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int64_t = {"_p_int64_t", "int64_t *|XMLInt64 *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_namelist_t = {"_p_namelist_t", "namelist_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_params_t = {"_p_params_t", "params_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_size_t = {"_p_size_t", "size_t *|XMLSize_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_ssize_t = {"_p_ssize_t", "ssize_t *|XMLSSize_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__listT_Data_t = {"_p_std__listT_Data_t", "std::list< Data > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__multimapT_std__string_Data_t = {"_p_std__multimapT_std__string_Data_t", "uscxml::Event::params_t *|std::multimap< std::string,Data > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_uint16_t = {"_p_uint16_t", "XMLUInt16 *|UTF16Ch *|XMLCh *|uint16_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_uint32_t = {"_p_uint32_t", "uint32_t *|XMLUInt32 *|UCS4Ch *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_uint64_t = {"_p_uint64_t", "uint64_t *|XMLUInt64 *|XMLFilePos *|XMLFileLoc *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *|XMLByte *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_uscxml__ErrorEvent = {"_p_uscxml__ErrorEvent", "p_uscxml__ErrorEvent", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_uscxml__Event = {"_p_uscxml__Event", "uscxml::Event *|p_uscxml__Event", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_void = {"_p_void", "void *", 0, 0, (void*)0, 0}; + +static swig_type_info *swig_type_initial[] = { + &_swigt__p_Data, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMAttr, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMCDATASection, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMCharacterData, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMComment, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMDocument, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentFragment, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentType, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMElement, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMEntity, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMEntityReference, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMException, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMNode, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMNodeList, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMNotation, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMText, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMTypeInfo, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMUserDataHandler, + &_swigt__p_XERCES_CPP_NAMESPACE__MemoryManager, + &_swigt__p_bool, + &_swigt__p_char, + &_swigt__p_int16_t, + &_swigt__p_int32_t, + &_swigt__p_int64_t, + &_swigt__p_namelist_t, + &_swigt__p_params_t, + &_swigt__p_size_t, + &_swigt__p_ssize_t, + &_swigt__p_std__listT_Data_t, + &_swigt__p_std__multimapT_std__string_Data_t, + &_swigt__p_uint16_t, + &_swigt__p_uint32_t, + &_swigt__p_uint64_t, + &_swigt__p_unsigned_char, + &_swigt__p_uscxml__ErrorEvent, + &_swigt__p_uscxml__Event, + &_swigt__p_void, +}; + +static swig_cast_info _swigc__p_Data[] = { {&_swigt__p_Data, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMAttr[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMAttr, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMCDATASection[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMCDATASection, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMCharacterData[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMText, _p_XERCES_CPP_NAMESPACE__DOMTextTo_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMComment, _p_XERCES_CPP_NAMESPACE__DOMCommentTo_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMCDATASection, _p_XERCES_CPP_NAMESPACE__DOMCDATASectionTo_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMComment[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMComment, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMDocument[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMDocument, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMDocumentFragment[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentFragment, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMDocumentType[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentType, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMElement[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMElement, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMEntity[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMEntity, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMEntityReference[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMEntityReference, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMException[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMException, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMNode[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMElement, _p_XERCES_CPP_NAMESPACE__DOMElementTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentFragment, _p_XERCES_CPP_NAMESPACE__DOMDocumentFragmentTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMAttr, _p_XERCES_CPP_NAMESPACE__DOMAttrTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentType, _p_XERCES_CPP_NAMESPACE__DOMDocumentTypeTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMCharacterData, _p_XERCES_CPP_NAMESPACE__DOMCharacterDataTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMText, _p_XERCES_CPP_NAMESPACE__DOMTextTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMComment, _p_XERCES_CPP_NAMESPACE__DOMCommentTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction, _p_XERCES_CPP_NAMESPACE__DOMProcessingInstructionTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMEntity, _p_XERCES_CPP_NAMESPACE__DOMEntityTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMEntityReference, _p_XERCES_CPP_NAMESPACE__DOMEntityReferenceTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMCDATASection, _p_XERCES_CPP_NAMESPACE__DOMCDATASectionTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMNotation, _p_XERCES_CPP_NAMESPACE__DOMNotationTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMNodeList[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMNodeList, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMNotation[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMNotation, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMText[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMText, 0, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMCDATASection, _p_XERCES_CPP_NAMESPACE__DOMCDATASectionTo_p_XERCES_CPP_NAMESPACE__DOMText, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMTypeInfo[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMTypeInfo, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMUserDataHandler[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMUserDataHandler, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__MemoryManager[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__MemoryManager, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_bool[] = { {&_swigt__p_bool, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int16_t[] = { {&_swigt__p_int16_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int32_t[] = { {&_swigt__p_int32_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int64_t[] = { {&_swigt__p_int64_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_namelist_t[] = { {&_swigt__p_namelist_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_params_t[] = { {&_swigt__p_params_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_size_t[] = { {&_swigt__p_size_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_ssize_t[] = { {&_swigt__p_ssize_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__listT_Data_t[] = { {&_swigt__p_std__listT_Data_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__multimapT_std__string_Data_t[] = { {&_swigt__p_std__multimapT_std__string_Data_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_uint16_t[] = { {&_swigt__p_uint16_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_uint32_t[] = { {&_swigt__p_uint32_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_uint64_t[] = { {&_swigt__p_uint64_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_uscxml__ErrorEvent[] = { {&_swigt__p_uscxml__ErrorEvent, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_uscxml__Event[] = { {&_swigt__p_uscxml__Event, 0, 0, 0}, {&_swigt__p_uscxml__ErrorEvent, _p_uscxml__ErrorEventTo_p_uscxml__Event, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_void[] = { {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}}; + +static swig_cast_info *swig_cast_initial[] = { + _swigc__p_Data, + _swigc__p_XERCES_CPP_NAMESPACE__DOMAttr, + _swigc__p_XERCES_CPP_NAMESPACE__DOMCDATASection, + _swigc__p_XERCES_CPP_NAMESPACE__DOMCharacterData, + _swigc__p_XERCES_CPP_NAMESPACE__DOMComment, + _swigc__p_XERCES_CPP_NAMESPACE__DOMDocument, + _swigc__p_XERCES_CPP_NAMESPACE__DOMDocumentFragment, + _swigc__p_XERCES_CPP_NAMESPACE__DOMDocumentType, + _swigc__p_XERCES_CPP_NAMESPACE__DOMElement, + _swigc__p_XERCES_CPP_NAMESPACE__DOMEntity, + _swigc__p_XERCES_CPP_NAMESPACE__DOMEntityReference, + _swigc__p_XERCES_CPP_NAMESPACE__DOMException, + _swigc__p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, + _swigc__p_XERCES_CPP_NAMESPACE__DOMNode, + _swigc__p_XERCES_CPP_NAMESPACE__DOMNodeList, + _swigc__p_XERCES_CPP_NAMESPACE__DOMNotation, + _swigc__p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction, + _swigc__p_XERCES_CPP_NAMESPACE__DOMText, + _swigc__p_XERCES_CPP_NAMESPACE__DOMTypeInfo, + _swigc__p_XERCES_CPP_NAMESPACE__DOMUserDataHandler, + _swigc__p_XERCES_CPP_NAMESPACE__MemoryManager, + _swigc__p_bool, + _swigc__p_char, + _swigc__p_int16_t, + _swigc__p_int32_t, + _swigc__p_int64_t, + _swigc__p_namelist_t, + _swigc__p_params_t, + _swigc__p_size_t, + _swigc__p_ssize_t, + _swigc__p_std__listT_Data_t, + _swigc__p_std__multimapT_std__string_Data_t, + _swigc__p_uint16_t, + _swigc__p_uint32_t, + _swigc__p_uint64_t, + _swigc__p_unsigned_char, + _swigc__p_uscxml__ErrorEvent, + _swigc__p_uscxml__Event, + _swigc__p_void, +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ + + + + +#include <assert.h> + +SWIGRUNTIME void +SWIG_V8_SetModule(void *, swig_module_info *swig_module) { + v8::Local<v8::Object> global_obj = SWIGV8_CURRENT_CONTEXT()->Global(); + v8::Local<v8::External> mod = SWIGV8_EXTERNAL_NEW(swig_module); + assert(!mod.IsEmpty()); + global_obj->SetHiddenValue(SWIGV8_STRING_NEW("swig_module_info_data"), mod); +} + +SWIGRUNTIME swig_module_info * +SWIG_V8_GetModule(void *) { + v8::Local<v8::Object> global_obj = SWIGV8_CURRENT_CONTEXT()->Global(); + v8::Local<v8::Value> moduleinfo = global_obj->GetHiddenValue(SWIGV8_STRING_NEW("swig_module_info_data")); + + if (moduleinfo.IsEmpty()) + { + // It's not yet loaded + return 0; + } + + v8::Local<v8::External> moduleinfo_extern = v8::Local<v8::External>::Cast(moduleinfo); + + if (moduleinfo_extern.IsEmpty()) + { + // Something's not right + return 0; + } + + void *ptr = moduleinfo_extern->Value(); + assert(ptr); + swig_module_info *retptr = static_cast<swig_module_info *>(ptr); + assert(retptr); + return retptr; +} + +#define SWIG_GetModule(clientdata) SWIG_V8_GetModule(clientdata) +#define SWIG_SetModule(clientdata, pointer) SWIG_V8_SetModule(clientdata, pointer) + + +/* ----------------------------------------------------------------------------- + * Type initialization: + * This problem is tough by the requirement that no dynamic + * memory is used. Also, since swig_type_info structures store pointers to + * swig_cast_info structures and swig_cast_info structures store pointers back + * to swig_type_info structures, we need some lookup code at initialization. + * The idea is that swig generates all the structures that are needed. + * The runtime then collects these partially filled structures. + * The SWIG_InitializeModule function takes these initial arrays out of + * swig_module, and does all the lookup, filling in the swig_module.types + * array with the correct data and linking the correct swig_cast_info + * structures together. + * + * The generated swig_type_info structures are assigned statically to an initial + * array. We just loop through that array, and handle each type individually. + * First we lookup if this type has been already loaded, and if so, use the + * loaded structure instead of the generated one. Then we have to fill in the + * cast linked list. The cast data is initially stored in something like a + * two-dimensional array. Each row corresponds to a type (there are the same + * number of rows as there are in the swig_type_initial array). Each entry in + * a column is one of the swig_cast_info structures for that type. + * The cast_initial array is actually an array of arrays, because each row has + * a variable number of columns. So to actually build the cast linked list, + * we find the array of casts associated with the type, and loop through it + * adding the casts to the list. The one last trick we need to do is making + * sure the type pointer in the swig_cast_info struct is correct. + * + * First off, we lookup the cast->type name to see if it is already loaded. + * There are three cases to handle: + * 1) If the cast->type has already been loaded AND the type we are adding + * casting info to has not been loaded (it is in this module), THEN we + * replace the cast->type pointer with the type pointer that has already + * been loaded. + * 2) If BOTH types (the one we are adding casting info to, and the + * cast->type) are loaded, THEN the cast info has already been loaded by + * the previous module so we just ignore it. + * 3) Finally, if cast->type has not already been loaded, then we add that + * swig_cast_info to the linked list (because the cast->type) pointer will + * be correct. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* c-mode */ +#endif +#endif + +#if 0 +#define SWIGRUNTIME_DEBUG +#endif + + +SWIGRUNTIME void +SWIG_InitializeModule(void *clientdata) { + size_t i; + swig_module_info *module_head, *iter; + int init; + + /* check to see if the circular list has been setup, if not, set it up */ + if (swig_module.next==0) { + /* Initialize the swig_module */ + swig_module.type_initial = swig_type_initial; + swig_module.cast_initial = swig_cast_initial; + swig_module.next = &swig_module; + init = 1; + } else { + init = 0; + } + + /* Try and load any already created modules */ + module_head = SWIG_GetModule(clientdata); + if (!module_head) { + /* This is the first module loaded for this interpreter */ + /* so set the swig module into the interpreter */ + SWIG_SetModule(clientdata, &swig_module); + } else { + /* the interpreter has loaded a SWIG module, but has it loaded this one? */ + iter=module_head; + do { + if (iter==&swig_module) { + /* Our module is already in the list, so there's nothing more to do. */ + return; + } + iter=iter->next; + } while (iter!= module_head); + + /* otherwise we must add our module into the list */ + swig_module.next = module_head->next; + module_head->next = &swig_module; + } + + /* When multiple interpreters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + + /* Now work on filling in swig_module.types */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: size %d\n", swig_module.size); +#endif + for (i = 0; i < swig_module.size; ++i) { + swig_type_info *type = 0; + swig_type_info *ret; + swig_cast_info *cast; + +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); +#endif + + /* if there is another module already loaded */ + if (swig_module.next != &swig_module) { + type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); + } + if (type) { + /* Overwrite clientdata field */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found type %s\n", type->name); +#endif + if (swig_module.type_initial[i]->clientdata) { + type->clientdata = swig_module.type_initial[i]->clientdata; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); +#endif + } + } else { + type = swig_module.type_initial[i]; + } + + /* Insert casting types */ + cast = swig_module.cast_initial[i]; + while (cast->type) { + + /* Don't need to add information already in the list */ + ret = 0; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); +#endif + if (swig_module.next != &swig_module) { + ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); +#ifdef SWIGRUNTIME_DEBUG + if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); +#endif + } + if (ret) { + if (type == swig_module.type_initial[i]) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: skip old type %s\n", ret->name); +#endif + cast->type = ret; + ret = 0; + } else { + /* Check for casting already in the list */ + swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); +#ifdef SWIGRUNTIME_DEBUG + if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); +#endif + if (!ocast) ret = 0; + } + } + + if (!ret) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); +#endif + if (type->cast) { + type->cast->prev = cast; + cast->next = type->cast; + } + type->cast = cast; + } + cast++; + } + /* Set entry in modules->types array equal to the type */ + swig_module.types[i] = type; + } + swig_module.types[i] = 0; + +#ifdef SWIGRUNTIME_DEBUG + printf("**** SWIG_InitializeModule: Cast List ******\n"); + for (i = 0; i < swig_module.size; ++i) { + int j = 0; + swig_cast_info *cast = swig_module.cast_initial[i]; + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + while (cast->type) { + printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); + cast++; + ++j; + } + printf("---- Total casts: %d\n",j); + } + printf("**** SWIG_InitializeModule: Cast List ******\n"); +#endif +} + +/* This function will propagate the clientdata field of type to +* any new swig_type_info structures that have been added into the list +* of equivalent types. It is like calling +* SWIG_TypeClientData(type, clientdata) a second time. +*/ +SWIGRUNTIME void +SWIG_PropagateClientData(void) { + size_t i; + swig_cast_info *equiv; + static int init_run = 0; + + if (init_run) return; + init_run = 1; + + for (i = 0; i < swig_module.size; i++) { + if (swig_module.types[i]->clientdata) { + equiv = swig_module.types[i]->cast; + while (equiv) { + if (!equiv->converter) { + if (equiv->type && !equiv->type->clientdata) + SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); + } + equiv = equiv->next; + } + } + } +} + +#ifdef __cplusplus +#if 0 +{ /* c-mode */ +#endif +} +#endif + + +// Note: 'extern "C"'' disables name mangling which makes it easier to load the symbol manually +// TODO: is it ok to do that? +extern "C" +#if (NODE_MODULE_VERSION < 0x000C) +void SWIGV8_INIT (v8::Handle<v8::Object> exports) +#else +void SWIGV8_INIT (v8::Handle<v8::Object> exports, v8::Handle<v8::Object> /*module*/) +#endif +{ + SWIG_InitializeModule(static_cast<void *>(&exports)); + + SWIGV8_HANDLESCOPE(); + + v8::Handle<v8::Object> exports_obj = exports; + + + SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->dcast = (swig_dycast_func) DOMNode_dynamic_cast; + + + // a class template for creating proxies of undefined types + SWIGV8_SET_CLASS_TEMPL(SWIGV8_SWIGTYPE_Proxy_class_templ, SWIGV8_CreateClassTemplate("SwigProxy")); + + /* create objects for namespaces */ + + + /* create class templates */ + /* Name: _exports_DOMException, Type: p_XERCES_CPP_NAMESPACE__DOMException, Dtor: _wrap_delete_DOMException */ +v8::Handle<v8::FunctionTemplate> _exports_DOMException_class = SWIGV8_CreateClassTemplate("_exports_DOMException"); +SWIGV8_SET_CLASS_TEMPL(_exports_DOMException_clientData.class_templ, _exports_DOMException_class); +_exports_DOMException_clientData.dtor = _wrap_delete_DOMException; +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException->clientdata == 0) { + SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException->clientdata = &_exports_DOMException_clientData; +} +/* Name: _exports_DOMNode, Type: p_XERCES_CPP_NAMESPACE__DOMNode, Dtor: _wrap_delete_DOMNode */ +v8::Handle<v8::FunctionTemplate> _exports_DOMNode_class = SWIGV8_CreateClassTemplate("_exports_DOMNode"); +SWIGV8_SET_CLASS_TEMPL(_exports_DOMNode_clientData.class_templ, _exports_DOMNode_class); +_exports_DOMNode_clientData.dtor = _wrap_delete_DOMNode; +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata == 0) { + SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata = &_exports_DOMNode_clientData; +} +/* Name: _exports_DOMAttr, Type: p_XERCES_CPP_NAMESPACE__DOMAttr, Dtor: _wrap_delete_DOMAttr */ +v8::Handle<v8::FunctionTemplate> _exports_DOMAttr_class = SWIGV8_CreateClassTemplate("_exports_DOMAttr"); +SWIGV8_SET_CLASS_TEMPL(_exports_DOMAttr_clientData.class_templ, _exports_DOMAttr_class); +_exports_DOMAttr_clientData.dtor = _wrap_delete_DOMAttr; +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr->clientdata == 0) { + SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr->clientdata = &_exports_DOMAttr_clientData; +} +/* Name: _exports_DOMElement, Type: p_XERCES_CPP_NAMESPACE__DOMElement, Dtor: _wrap_delete_DOMElement */ +v8::Handle<v8::FunctionTemplate> _exports_DOMElement_class = SWIGV8_CreateClassTemplate("_exports_DOMElement"); +SWIGV8_SET_CLASS_TEMPL(_exports_DOMElement_clientData.class_templ, _exports_DOMElement_class); +_exports_DOMElement_clientData.dtor = _wrap_delete_DOMElement; +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement->clientdata == 0) { + SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement->clientdata = &_exports_DOMElement_clientData; +} +/* Name: _exports_DOMEntity, Type: p_XERCES_CPP_NAMESPACE__DOMEntity, Dtor: _wrap_delete_DOMEntity */ +v8::Handle<v8::FunctionTemplate> _exports_DOMEntity_class = SWIGV8_CreateClassTemplate("_exports_DOMEntity"); +SWIGV8_SET_CLASS_TEMPL(_exports_DOMEntity_clientData.class_templ, _exports_DOMEntity_class); +_exports_DOMEntity_clientData.dtor = _wrap_delete_DOMEntity; +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity->clientdata == 0) { + SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity->clientdata = &_exports_DOMEntity_clientData; +} +/* Name: _exports_DOMDocumentType, Type: p_XERCES_CPP_NAMESPACE__DOMDocumentType, Dtor: _wrap_delete_DOMDocumentType */ +v8::Handle<v8::FunctionTemplate> _exports_DOMDocumentType_class = SWIGV8_CreateClassTemplate("_exports_DOMDocumentType"); +SWIGV8_SET_CLASS_TEMPL(_exports_DOMDocumentType_clientData.class_templ, _exports_DOMDocumentType_class); +_exports_DOMDocumentType_clientData.dtor = _wrap_delete_DOMDocumentType; +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType->clientdata == 0) { + SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType->clientdata = &_exports_DOMDocumentType_clientData; +} +/* Name: _exports_DOMCharacterData, Type: p_XERCES_CPP_NAMESPACE__DOMCharacterData, Dtor: _wrap_delete_DOMCharacterData */ +v8::Handle<v8::FunctionTemplate> _exports_DOMCharacterData_class = SWIGV8_CreateClassTemplate("_exports_DOMCharacterData"); +SWIGV8_SET_CLASS_TEMPL(_exports_DOMCharacterData_clientData.class_templ, _exports_DOMCharacterData_class); +_exports_DOMCharacterData_clientData.dtor = _wrap_delete_DOMCharacterData; +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData->clientdata == 0) { + SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData->clientdata = &_exports_DOMCharacterData_clientData; +} +/* Name: _exports_DOMComment, Type: p_XERCES_CPP_NAMESPACE__DOMComment, Dtor: _wrap_delete_DOMComment */ +v8::Handle<v8::FunctionTemplate> _exports_DOMComment_class = SWIGV8_CreateClassTemplate("_exports_DOMComment"); +SWIGV8_SET_CLASS_TEMPL(_exports_DOMComment_clientData.class_templ, _exports_DOMComment_class); +_exports_DOMComment_clientData.dtor = _wrap_delete_DOMComment; +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMComment->clientdata == 0) { + SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMComment->clientdata = &_exports_DOMComment_clientData; +} +/* Name: _exports_DOMText, Type: p_XERCES_CPP_NAMESPACE__DOMText, Dtor: _wrap_delete_DOMText */ +v8::Handle<v8::FunctionTemplate> _exports_DOMText_class = SWIGV8_CreateClassTemplate("_exports_DOMText"); +SWIGV8_SET_CLASS_TEMPL(_exports_DOMText_clientData.class_templ, _exports_DOMText_class); +_exports_DOMText_clientData.dtor = _wrap_delete_DOMText; +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText->clientdata == 0) { + SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText->clientdata = &_exports_DOMText_clientData; +} +/* Name: _exports_DOMCDATASection, Type: p_XERCES_CPP_NAMESPACE__DOMCDATASection, Dtor: _wrap_delete_DOMCDATASection */ +v8::Handle<v8::FunctionTemplate> _exports_DOMCDATASection_class = SWIGV8_CreateClassTemplate("_exports_DOMCDATASection"); +SWIGV8_SET_CLASS_TEMPL(_exports_DOMCDATASection_clientData.class_templ, _exports_DOMCDATASection_class); +_exports_DOMCDATASection_clientData.dtor = _wrap_delete_DOMCDATASection; +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCDATASection->clientdata == 0) { + SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCDATASection->clientdata = &_exports_DOMCDATASection_clientData; +} +/* Name: _exports_DOMNodeList, Type: p_XERCES_CPP_NAMESPACE__DOMNodeList, Dtor: _wrap_delete_DOMNodeList */ +v8::Handle<v8::FunctionTemplate> _exports_DOMNodeList_class = SWIGV8_CreateClassTemplate("_exports_DOMNodeList"); +//_exports_DOMNodeList_class->InstanceTemplate()->SetIndexedPropertyHandler(V8NodeListIndexedPropertyHandler2); +SWIGV8_SET_CLASS_TEMPL(_exports_DOMNodeList_clientData.class_templ, _exports_DOMNodeList_class); +_exports_DOMNodeList_clientData.dtor = _wrap_delete_DOMNodeList; +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList->clientdata == 0) { + SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList->clientdata = &_exports_DOMNodeList_clientData; +} +/* Name: _exports_DOMNamedNodeMap, Type: p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, Dtor: _wrap_delete_DOMNamedNodeMap */ +v8::Handle<v8::FunctionTemplate> _exports_DOMNamedNodeMap_class = SWIGV8_CreateClassTemplate("_exports_DOMNamedNodeMap"); +SWIGV8_SET_CLASS_TEMPL(_exports_DOMNamedNodeMap_clientData.class_templ, _exports_DOMNamedNodeMap_class); +_exports_DOMNamedNodeMap_clientData.dtor = _wrap_delete_DOMNamedNodeMap; +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap->clientdata == 0) { + SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap->clientdata = &_exports_DOMNamedNodeMap_clientData; +} +/* Name: _exports_DOMDocumentFragment, Type: p_XERCES_CPP_NAMESPACE__DOMDocumentFragment, Dtor: _wrap_delete_DOMDocumentFragment */ +v8::Handle<v8::FunctionTemplate> _exports_DOMDocumentFragment_class = SWIGV8_CreateClassTemplate("_exports_DOMDocumentFragment"); +SWIGV8_SET_CLASS_TEMPL(_exports_DOMDocumentFragment_clientData.class_templ, _exports_DOMDocumentFragment_class); +_exports_DOMDocumentFragment_clientData.dtor = _wrap_delete_DOMDocumentFragment; +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentFragment->clientdata == 0) { + SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentFragment->clientdata = &_exports_DOMDocumentFragment_clientData; +} +/* Name: _exports_DOMEntityReference, Type: p_XERCES_CPP_NAMESPACE__DOMEntityReference, Dtor: _wrap_delete_DOMEntityReference */ +v8::Handle<v8::FunctionTemplate> _exports_DOMEntityReference_class = SWIGV8_CreateClassTemplate("_exports_DOMEntityReference"); +SWIGV8_SET_CLASS_TEMPL(_exports_DOMEntityReference_clientData.class_templ, _exports_DOMEntityReference_class); +_exports_DOMEntityReference_clientData.dtor = _wrap_delete_DOMEntityReference; +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntityReference->clientdata == 0) { + SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntityReference->clientdata = &_exports_DOMEntityReference_clientData; +} +/* Name: _exports_DOMNotation, Type: p_XERCES_CPP_NAMESPACE__DOMNotation, Dtor: _wrap_delete_DOMNotation */ +v8::Handle<v8::FunctionTemplate> _exports_DOMNotation_class = SWIGV8_CreateClassTemplate("_exports_DOMNotation"); +SWIGV8_SET_CLASS_TEMPL(_exports_DOMNotation_clientData.class_templ, _exports_DOMNotation_class); +_exports_DOMNotation_clientData.dtor = _wrap_delete_DOMNotation; +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNotation->clientdata == 0) { + SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNotation->clientdata = &_exports_DOMNotation_clientData; +} +/* Name: _exports_DOMProcessingInstruction, Type: p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction, Dtor: _wrap_delete_DOMProcessingInstruction */ +v8::Handle<v8::FunctionTemplate> _exports_DOMProcessingInstruction_class = SWIGV8_CreateClassTemplate("_exports_DOMProcessingInstruction"); +SWIGV8_SET_CLASS_TEMPL(_exports_DOMProcessingInstruction_clientData.class_templ, _exports_DOMProcessingInstruction_class); +_exports_DOMProcessingInstruction_clientData.dtor = _wrap_delete_DOMProcessingInstruction; +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction->clientdata == 0) { + SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction->clientdata = &_exports_DOMProcessingInstruction_clientData; +} +/* Name: _exports_Event, Type: p_uscxml__Event, Dtor: _wrap_delete_Event */ +v8::Handle<v8::FunctionTemplate> _exports_Event_class = SWIGV8_CreateClassTemplate("_exports_Event"); +SWIGV8_SET_CLASS_TEMPL(_exports_Event_clientData.class_templ, _exports_Event_class); +_exports_Event_clientData.dtor = _wrap_delete_Event; +if (SWIGTYPE_p_uscxml__Event->clientdata == 0) { + SWIGTYPE_p_uscxml__Event->clientdata = &_exports_Event_clientData; +} +/* Name: _exports_ErrorEvent, Type: p_uscxml__ErrorEvent, Dtor: _wrap_delete_ErrorEvent */ +v8::Handle<v8::FunctionTemplate> _exports_ErrorEvent_class = SWIGV8_CreateClassTemplate("_exports_ErrorEvent"); +SWIGV8_SET_CLASS_TEMPL(_exports_ErrorEvent_clientData.class_templ, _exports_ErrorEvent_class); +_exports_ErrorEvent_clientData.dtor = _wrap_delete_ErrorEvent; +if (SWIGTYPE_p_uscxml__ErrorEvent->clientdata == 0) { + SWIGTYPE_p_uscxml__ErrorEvent->clientdata = &_exports_ErrorEvent_clientData; +} + + + /* register wrapper functions */ + SWIGV8_AddStaticVariable(exports_obj, "XERCES_HAS_CPP_NAMESPACE", _wrap_XERCES_HAS_CPP_NAMESPACE, JS_veto_set_variable); +SWIGV8_AddStaticVariable(exports_obj, "DEBUG_UTF8_OUT", _wrap_DEBUG_UTF8_OUT_get, _wrap_DEBUG_UTF8_OUT_set); +SWIGV8_AddStaticVariable(exports_obj, "DEBUG_UTF8_IN", _wrap_DEBUG_UTF8_IN_get, _wrap_DEBUG_UTF8_IN_set); +SWIGV8_AddMemberFunction(_exports_DOMException_class, "getMessage", _wrap_DOMException_getMessage); +SWIGV8_AddMemberVariable(_exports_DOMException_class, "code", _wrap_DOMException_code_get, _wrap_DOMException_code_set); +SWIGV8_AddMemberVariable(_exports_DOMException_class, "msg", _wrap_DOMException_msg_get, _wrap_DOMException_msg_set); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "getNodeName", _wrap_DOMNode_getNodeName); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "getNodeValue", _wrap_DOMNode_getNodeValue); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "getNodeType", _wrap_DOMNode_getNodeType); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "getParentNode", _wrap_DOMNode_getParentNode); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "getChildNodes", _wrap_DOMNode_getChildNodes); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "getFirstChild", _wrap_DOMNode_getFirstChild); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "getLastChild", _wrap_DOMNode_getLastChild); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "getPreviousSibling", _wrap_DOMNode_getPreviousSibling); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "getNextSibling", _wrap_DOMNode_getNextSibling); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "getAttributes", _wrap_DOMNode_getAttributes); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "getOwnerDocument", _wrap_DOMNode_getOwnerDocument); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "cloneNode", _wrap_DOMNode_cloneNode); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "insertBefore", _wrap_DOMNode_insertBefore); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "replaceChild", _wrap_DOMNode_replaceChild); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "removeChild", _wrap_DOMNode_removeChild); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "appendChild", _wrap_DOMNode_appendChild); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "hasChildNodes", _wrap_DOMNode_hasChildNodes); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "setNodeValue", _wrap_DOMNode_setNodeValue); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "normalize", _wrap_DOMNode_normalize); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "isSupported", _wrap_DOMNode_isSupported); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "getNamespaceURI", _wrap_DOMNode_getNamespaceURI); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "getLocalName", _wrap_DOMNode_getLocalName); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "setPrefix", _wrap_DOMNode_setPrefix); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "hasAttributes", _wrap_DOMNode_hasAttributes); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "isSameNode", _wrap_DOMNode_isSameNode); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "isEqualNode", _wrap_DOMNode_isEqualNode); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "setUserData", _wrap_DOMNode_setUserData); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "getUserData", _wrap_DOMNode_getUserData); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "getBaseURI", _wrap_DOMNode_getBaseURI); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "compareDocumentPosition", _wrap_DOMNode_compareDocumentPosition); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "getTextContent", _wrap_DOMNode_getTextContent); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "setTextContent", _wrap_DOMNode_setTextContent); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "lookupPrefix", _wrap_DOMNode_lookupPrefix); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "isDefaultNamespace", _wrap_DOMNode_isDefaultNamespace); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "lookupNamespaceURI", _wrap_DOMNode_lookupNamespaceURI); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "getFeature", _wrap_DOMNode_getFeature); +SWIGV8_AddMemberFunction(_exports_DOMNode_class, "release", _wrap_DOMNode_release); +SWIGV8_AddMemberFunction(_exports_DOMAttr_class, "getName", _wrap_DOMAttr_getName); +SWIGV8_AddMemberFunction(_exports_DOMAttr_class, "getSpecified", _wrap_DOMAttr_getSpecified); +SWIGV8_AddMemberFunction(_exports_DOMAttr_class, "getValue", _wrap_DOMAttr_getValue); +SWIGV8_AddMemberFunction(_exports_DOMAttr_class, "setValue", _wrap_DOMAttr_setValue); +SWIGV8_AddMemberFunction(_exports_DOMAttr_class, "getOwnerElement", _wrap_DOMAttr_getOwnerElement); +SWIGV8_AddMemberFunction(_exports_DOMAttr_class, "isId", _wrap_DOMAttr_isId); +SWIGV8_AddMemberFunction(_exports_DOMAttr_class, "getSchemaTypeInfo", _wrap_DOMAttr_getSchemaTypeInfo); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "getTagName", _wrap_DOMElement_getTagName); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "getAttribute", _wrap_DOMElement_getAttribute); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "getAttributeNode", _wrap_DOMElement_getAttributeNode); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "getElementsByTagName", _wrap_DOMElement_getElementsByTagName); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "setAttribute", _wrap_DOMElement_setAttribute); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "setAttributeNode", _wrap_DOMElement_setAttributeNode); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "removeAttributeNode", _wrap_DOMElement_removeAttributeNode); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "removeAttribute", _wrap_DOMElement_removeAttribute); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "getAttributeNS", _wrap_DOMElement_getAttributeNS); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "setAttributeNS", _wrap_DOMElement_setAttributeNS); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "removeAttributeNS", _wrap_DOMElement_removeAttributeNS); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "getAttributeNodeNS", _wrap_DOMElement_getAttributeNodeNS); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "setAttributeNodeNS", _wrap_DOMElement_setAttributeNodeNS); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "getElementsByTagNameNS", _wrap_DOMElement_getElementsByTagNameNS); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "hasAttribute", _wrap_DOMElement_hasAttribute); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "hasAttributeNS", _wrap_DOMElement_hasAttributeNS); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "setIdAttribute", _wrap_DOMElement_setIdAttribute); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "setIdAttributeNS", _wrap_DOMElement_setIdAttributeNS); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "setIdAttributeNode", _wrap_DOMElement_setIdAttributeNode); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "getSchemaTypeInfo", _wrap_DOMElement_getSchemaTypeInfo); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "getFirstElementChild", _wrap_DOMElement_getFirstElementChild); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "getLastElementChild", _wrap_DOMElement_getLastElementChild); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "getPreviousElementSibling", _wrap_DOMElement_getPreviousElementSibling); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "getNextElementSibling", _wrap_DOMElement_getNextElementSibling); +SWIGV8_AddMemberFunction(_exports_DOMElement_class, "getChildElementCount", _wrap_DOMElement_getChildElementCount); +SWIGV8_AddMemberFunction(_exports_DOMEntity_class, "getPublicId", _wrap_DOMEntity_getPublicId); +SWIGV8_AddMemberFunction(_exports_DOMEntity_class, "getSystemId", _wrap_DOMEntity_getSystemId); +SWIGV8_AddMemberFunction(_exports_DOMEntity_class, "getNotationName", _wrap_DOMEntity_getNotationName); +SWIGV8_AddMemberFunction(_exports_DOMEntity_class, "getInputEncoding", _wrap_DOMEntity_getInputEncoding); +SWIGV8_AddMemberFunction(_exports_DOMEntity_class, "getXmlEncoding", _wrap_DOMEntity_getXmlEncoding); +SWIGV8_AddMemberFunction(_exports_DOMEntity_class, "getXmlVersion", _wrap_DOMEntity_getXmlVersion); +SWIGV8_AddMemberFunction(_exports_DOMDocumentType_class, "getName", _wrap_DOMDocumentType_getName); +SWIGV8_AddMemberFunction(_exports_DOMDocumentType_class, "getEntities", _wrap_DOMDocumentType_getEntities); +SWIGV8_AddMemberFunction(_exports_DOMDocumentType_class, "getNotations", _wrap_DOMDocumentType_getNotations); +SWIGV8_AddMemberFunction(_exports_DOMDocumentType_class, "getPublicId", _wrap_DOMDocumentType_getPublicId); +SWIGV8_AddMemberFunction(_exports_DOMDocumentType_class, "getSystemId", _wrap_DOMDocumentType_getSystemId); +SWIGV8_AddMemberFunction(_exports_DOMDocumentType_class, "getInternalSubset", _wrap_DOMDocumentType_getInternalSubset); +SWIGV8_AddMemberFunction(_exports_DOMCharacterData_class, "getData", _wrap_DOMCharacterData_getData); +SWIGV8_AddMemberFunction(_exports_DOMCharacterData_class, "getLength", _wrap_DOMCharacterData_getLength); +SWIGV8_AddMemberFunction(_exports_DOMCharacterData_class, "substringData", _wrap_DOMCharacterData_substringData); +SWIGV8_AddMemberFunction(_exports_DOMCharacterData_class, "appendData", _wrap_DOMCharacterData_appendData); +SWIGV8_AddMemberFunction(_exports_DOMCharacterData_class, "insertData", _wrap_DOMCharacterData_insertData); +SWIGV8_AddMemberFunction(_exports_DOMCharacterData_class, "deleteData", _wrap_DOMCharacterData_deleteData); +SWIGV8_AddMemberFunction(_exports_DOMCharacterData_class, "replaceData", _wrap_DOMCharacterData_replaceData); +SWIGV8_AddMemberFunction(_exports_DOMCharacterData_class, "setData", _wrap_DOMCharacterData_setData); +SWIGV8_AddMemberFunction(_exports_DOMText_class, "splitText", _wrap_DOMText_splitText); +SWIGV8_AddMemberFunction(_exports_DOMText_class, "getIsElementContentWhitespace", _wrap_DOMText_getIsElementContentWhitespace); +SWIGV8_AddMemberFunction(_exports_DOMText_class, "getWholeText", _wrap_DOMText_getWholeText); +SWIGV8_AddMemberFunction(_exports_DOMText_class, "replaceWholeText", _wrap_DOMText_replaceWholeText); +SWIGV8_AddMemberFunction(_exports_DOMText_class, "isIgnorableWhitespace", _wrap_DOMText_isIgnorableWhitespace); +SWIGV8_AddMemberFunction(_exports_DOMNodeList_class, "item", _wrap_DOMNodeList_item); +SWIGV8_AddMemberFunction(_exports_DOMNodeList_class, "getLength", _wrap_DOMNodeList_getLength); +SWIGV8_AddMemberFunction(_exports_DOMNamedNodeMap_class, "setNamedItem", _wrap_DOMNamedNodeMap_setNamedItem); +SWIGV8_AddMemberFunction(_exports_DOMNamedNodeMap_class, "item", _wrap_DOMNamedNodeMap_item); +SWIGV8_AddMemberFunction(_exports_DOMNamedNodeMap_class, "getNamedItem", _wrap_DOMNamedNodeMap_getNamedItem); +SWIGV8_AddMemberFunction(_exports_DOMNamedNodeMap_class, "getLength", _wrap_DOMNamedNodeMap_getLength); +SWIGV8_AddMemberFunction(_exports_DOMNamedNodeMap_class, "removeNamedItem", _wrap_DOMNamedNodeMap_removeNamedItem); +SWIGV8_AddMemberFunction(_exports_DOMNamedNodeMap_class, "getNamedItemNS", _wrap_DOMNamedNodeMap_getNamedItemNS); +SWIGV8_AddMemberFunction(_exports_DOMNamedNodeMap_class, "setNamedItemNS", _wrap_DOMNamedNodeMap_setNamedItemNS); +SWIGV8_AddMemberFunction(_exports_DOMNamedNodeMap_class, "removeNamedItemNS", _wrap_DOMNamedNodeMap_removeNamedItemNS); +SWIGV8_AddMemberFunction(_exports_DOMNotation_class, "getPublicId", _wrap_DOMNotation_getPublicId); +SWIGV8_AddMemberFunction(_exports_DOMNotation_class, "getSystemId", _wrap_DOMNotation_getSystemId); +SWIGV8_AddMemberFunction(_exports_DOMProcessingInstruction_class, "getTarget", _wrap_DOMProcessingInstruction_getTarget); +SWIGV8_AddMemberFunction(_exports_DOMProcessingInstruction_class, "getData", _wrap_DOMProcessingInstruction_getData); +SWIGV8_AddMemberFunction(_exports_DOMProcessingInstruction_class, "setData", _wrap_DOMProcessingInstruction_setData); +SWIGV8_AddMemberFunction(_exports_Event_class, "operator_equal_to", _wrap_Event_operator_equal_to); +SWIGV8_AddMemberFunction(_exports_Event_class, "operator_not_equal_to", _wrap_Event_operator_not_equal_to); +SWIGV8_AddMemberVariable(_exports_Event_class, "raw", _wrap_Event_raw_get, _wrap_Event_raw_set); +SWIGV8_AddMemberVariable(_exports_Event_class, "name", _wrap_Event_name_get, _wrap_Event_name_set); +SWIGV8_AddMemberVariable(_exports_Event_class, "eventType", _wrap_Event_eventType_get, _wrap_Event_eventType_set); + + + /* setup inheritances */ + if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata && !(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ.IsEmpty())) +{ +#if (SWIG_V8_VERSION < 0x031903) + _exports_DOMAttr_class->Inherit(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ); +#else + _exports_DOMAttr_class->Inherit( + v8::Local<v8::FunctionTemplate>::New( + v8::Isolate::GetCurrent(), + static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ) + ); +#endif + +#ifdef SWIGRUNTIME_DEBUG + printf("Inheritance successful _exports_DOMAttr _XERCES_CPP_NAMESPACE__DOMNode\n"); +#endif +} else { +#ifdef SWIGRUNTIME_DEBUG + printf("Unable to inherit baseclass, it didn't exist _exports_DOMAttr _XERCES_CPP_NAMESPACE__DOMNode\n"); +#endif +} +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata && !(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ.IsEmpty())) +{ +#if (SWIG_V8_VERSION < 0x031903) + _exports_DOMElement_class->Inherit(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ); +#else + _exports_DOMElement_class->Inherit( + v8::Local<v8::FunctionTemplate>::New( + v8::Isolate::GetCurrent(), + static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ) + ); +#endif + +#ifdef SWIGRUNTIME_DEBUG + printf("Inheritance successful _exports_DOMElement _XERCES_CPP_NAMESPACE__DOMNode\n"); +#endif +} else { +#ifdef SWIGRUNTIME_DEBUG + printf("Unable to inherit baseclass, it didn't exist _exports_DOMElement _XERCES_CPP_NAMESPACE__DOMNode\n"); +#endif +} +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata && !(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ.IsEmpty())) +{ +#if (SWIG_V8_VERSION < 0x031903) + _exports_DOMEntity_class->Inherit(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ); +#else + _exports_DOMEntity_class->Inherit( + v8::Local<v8::FunctionTemplate>::New( + v8::Isolate::GetCurrent(), + static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ) + ); +#endif + +#ifdef SWIGRUNTIME_DEBUG + printf("Inheritance successful _exports_DOMEntity _XERCES_CPP_NAMESPACE__DOMNode\n"); +#endif +} else { +#ifdef SWIGRUNTIME_DEBUG + printf("Unable to inherit baseclass, it didn't exist _exports_DOMEntity _XERCES_CPP_NAMESPACE__DOMNode\n"); +#endif +} +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata && !(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ.IsEmpty())) +{ +#if (SWIG_V8_VERSION < 0x031903) + _exports_DOMDocumentType_class->Inherit(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ); +#else + _exports_DOMDocumentType_class->Inherit( + v8::Local<v8::FunctionTemplate>::New( + v8::Isolate::GetCurrent(), + static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ) + ); +#endif + +#ifdef SWIGRUNTIME_DEBUG + printf("Inheritance successful _exports_DOMDocumentType _XERCES_CPP_NAMESPACE__DOMNode\n"); +#endif +} else { +#ifdef SWIGRUNTIME_DEBUG + printf("Unable to inherit baseclass, it didn't exist _exports_DOMDocumentType _XERCES_CPP_NAMESPACE__DOMNode\n"); +#endif +} +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata && !(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ.IsEmpty())) +{ +#if (SWIG_V8_VERSION < 0x031903) + _exports_DOMCharacterData_class->Inherit(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ); +#else + _exports_DOMCharacterData_class->Inherit( + v8::Local<v8::FunctionTemplate>::New( + v8::Isolate::GetCurrent(), + static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ) + ); +#endif + +#ifdef SWIGRUNTIME_DEBUG + printf("Inheritance successful _exports_DOMCharacterData _XERCES_CPP_NAMESPACE__DOMNode\n"); +#endif +} else { +#ifdef SWIGRUNTIME_DEBUG + printf("Unable to inherit baseclass, it didn't exist _exports_DOMCharacterData _XERCES_CPP_NAMESPACE__DOMNode\n"); +#endif +} +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData->clientdata && !(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData->clientdata)->class_templ.IsEmpty())) +{ +#if (SWIG_V8_VERSION < 0x031903) + _exports_DOMComment_class->Inherit(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData->clientdata)->class_templ); +#else + _exports_DOMComment_class->Inherit( + v8::Local<v8::FunctionTemplate>::New( + v8::Isolate::GetCurrent(), + static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData->clientdata)->class_templ) + ); +#endif + +#ifdef SWIGRUNTIME_DEBUG + printf("Inheritance successful _exports_DOMComment _XERCES_CPP_NAMESPACE__DOMCharacterData\n"); +#endif +} else { +#ifdef SWIGRUNTIME_DEBUG + printf("Unable to inherit baseclass, it didn't exist _exports_DOMComment _XERCES_CPP_NAMESPACE__DOMCharacterData\n"); +#endif +} +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData->clientdata && !(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData->clientdata)->class_templ.IsEmpty())) +{ +#if (SWIG_V8_VERSION < 0x031903) + _exports_DOMText_class->Inherit(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData->clientdata)->class_templ); +#else + _exports_DOMText_class->Inherit( + v8::Local<v8::FunctionTemplate>::New( + v8::Isolate::GetCurrent(), + static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData->clientdata)->class_templ) + ); +#endif + +#ifdef SWIGRUNTIME_DEBUG + printf("Inheritance successful _exports_DOMText _XERCES_CPP_NAMESPACE__DOMCharacterData\n"); +#endif +} else { +#ifdef SWIGRUNTIME_DEBUG + printf("Unable to inherit baseclass, it didn't exist _exports_DOMText _XERCES_CPP_NAMESPACE__DOMCharacterData\n"); +#endif +} +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText->clientdata && !(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText->clientdata)->class_templ.IsEmpty())) +{ +#if (SWIG_V8_VERSION < 0x031903) + _exports_DOMCDATASection_class->Inherit(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText->clientdata)->class_templ); +#else + _exports_DOMCDATASection_class->Inherit( + v8::Local<v8::FunctionTemplate>::New( + v8::Isolate::GetCurrent(), + static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText->clientdata)->class_templ) + ); +#endif + +#ifdef SWIGRUNTIME_DEBUG + printf("Inheritance successful _exports_DOMCDATASection _XERCES_CPP_NAMESPACE__DOMText\n"); +#endif +} else { +#ifdef SWIGRUNTIME_DEBUG + printf("Unable to inherit baseclass, it didn't exist _exports_DOMCDATASection _XERCES_CPP_NAMESPACE__DOMText\n"); +#endif +} +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata && !(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ.IsEmpty())) +{ +#if (SWIG_V8_VERSION < 0x031903) + _exports_DOMDocumentFragment_class->Inherit(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ); +#else + _exports_DOMDocumentFragment_class->Inherit( + v8::Local<v8::FunctionTemplate>::New( + v8::Isolate::GetCurrent(), + static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ) + ); +#endif + +#ifdef SWIGRUNTIME_DEBUG + printf("Inheritance successful _exports_DOMDocumentFragment _XERCES_CPP_NAMESPACE__DOMNode\n"); +#endif +} else { +#ifdef SWIGRUNTIME_DEBUG + printf("Unable to inherit baseclass, it didn't exist _exports_DOMDocumentFragment _XERCES_CPP_NAMESPACE__DOMNode\n"); +#endif +} +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata && !(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ.IsEmpty())) +{ +#if (SWIG_V8_VERSION < 0x031903) + _exports_DOMEntityReference_class->Inherit(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ); +#else + _exports_DOMEntityReference_class->Inherit( + v8::Local<v8::FunctionTemplate>::New( + v8::Isolate::GetCurrent(), + static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ) + ); +#endif + +#ifdef SWIGRUNTIME_DEBUG + printf("Inheritance successful _exports_DOMEntityReference _XERCES_CPP_NAMESPACE__DOMNode\n"); +#endif +} else { +#ifdef SWIGRUNTIME_DEBUG + printf("Unable to inherit baseclass, it didn't exist _exports_DOMEntityReference _XERCES_CPP_NAMESPACE__DOMNode\n"); +#endif +} +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata && !(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ.IsEmpty())) +{ +#if (SWIG_V8_VERSION < 0x031903) + _exports_DOMNotation_class->Inherit(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ); +#else + _exports_DOMNotation_class->Inherit( + v8::Local<v8::FunctionTemplate>::New( + v8::Isolate::GetCurrent(), + static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ) + ); +#endif + +#ifdef SWIGRUNTIME_DEBUG + printf("Inheritance successful _exports_DOMNotation _XERCES_CPP_NAMESPACE__DOMNode\n"); +#endif +} else { +#ifdef SWIGRUNTIME_DEBUG + printf("Unable to inherit baseclass, it didn't exist _exports_DOMNotation _XERCES_CPP_NAMESPACE__DOMNode\n"); +#endif +} +if (SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata && !(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ.IsEmpty())) +{ +#if (SWIG_V8_VERSION < 0x031903) + _exports_DOMProcessingInstruction_class->Inherit(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ); +#else + _exports_DOMProcessingInstruction_class->Inherit( + v8::Local<v8::FunctionTemplate>::New( + v8::Isolate::GetCurrent(), + static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->clientdata)->class_templ) + ); +#endif + +#ifdef SWIGRUNTIME_DEBUG + printf("Inheritance successful _exports_DOMProcessingInstruction _XERCES_CPP_NAMESPACE__DOMNode\n"); +#endif +} else { +#ifdef SWIGRUNTIME_DEBUG + printf("Unable to inherit baseclass, it didn't exist _exports_DOMProcessingInstruction _XERCES_CPP_NAMESPACE__DOMNode\n"); +#endif +} +if (SWIGTYPE_p_uscxml__Event->clientdata && !(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_uscxml__Event->clientdata)->class_templ.IsEmpty())) +{ +#if (SWIG_V8_VERSION < 0x031903) + _exports_ErrorEvent_class->Inherit(static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_uscxml__Event->clientdata)->class_templ); +#else + _exports_ErrorEvent_class->Inherit( + v8::Local<v8::FunctionTemplate>::New( + v8::Isolate::GetCurrent(), + static_cast<SWIGV8_ClientData *>(SWIGTYPE_p_uscxml__Event->clientdata)->class_templ) + ); +#endif + +#ifdef SWIGRUNTIME_DEBUG + printf("Inheritance successful _exports_ErrorEvent _uscxml__Event\n"); +#endif +} else { +#ifdef SWIGRUNTIME_DEBUG + printf("Unable to inherit baseclass, it didn't exist _exports_ErrorEvent _uscxml__Event\n"); +#endif +} + + + /* class instances */ + /* Class: DOMException (_exports_DOMException) */ +v8::Handle<v8::FunctionTemplate> _exports_DOMException_class_0 = SWIGV8_CreateClassTemplate("DOMException"); +_exports_DOMException_class_0->SetCallHandler(_wrap_new_DOMException); +_exports_DOMException_class_0->Inherit(_exports_DOMException_class); +_exports_DOMException_class_0->SetHiddenPrototype(true); +v8::Handle<v8::Object> _exports_DOMException_obj = _exports_DOMException_class_0->GetFunction(); +/* Class: DOMNode (_exports_DOMNode) */ +v8::Handle<v8::FunctionTemplate> _exports_DOMNode_class_0 = SWIGV8_CreateClassTemplate("DOMNode"); +_exports_DOMNode_class_0->SetCallHandler(_wrap_new_veto_DOMNode); +_exports_DOMNode_class_0->Inherit(_exports_DOMNode_class); +_exports_DOMNode_class_0->SetHiddenPrototype(true); +v8::Handle<v8::Object> _exports_DOMNode_obj = _exports_DOMNode_class_0->GetFunction(); +/* Class: DOMAttr (_exports_DOMAttr) */ +v8::Handle<v8::FunctionTemplate> _exports_DOMAttr_class_0 = SWIGV8_CreateClassTemplate("DOMAttr"); +_exports_DOMAttr_class_0->SetCallHandler(_wrap_new_veto_DOMAttr); +_exports_DOMAttr_class_0->Inherit(_exports_DOMAttr_class); +_exports_DOMAttr_class_0->SetHiddenPrototype(true); +v8::Handle<v8::Object> _exports_DOMAttr_obj = _exports_DOMAttr_class_0->GetFunction(); +/* Class: DOMElement (_exports_DOMElement) */ +v8::Handle<v8::FunctionTemplate> _exports_DOMElement_class_0 = SWIGV8_CreateClassTemplate("DOMElement"); +_exports_DOMElement_class_0->SetCallHandler(_wrap_new_veto_DOMElement); +_exports_DOMElement_class_0->Inherit(_exports_DOMElement_class); +_exports_DOMElement_class_0->SetHiddenPrototype(true); +v8::Handle<v8::Object> _exports_DOMElement_obj = _exports_DOMElement_class_0->GetFunction(); +/* Class: DOMEntity (_exports_DOMEntity) */ +v8::Handle<v8::FunctionTemplate> _exports_DOMEntity_class_0 = SWIGV8_CreateClassTemplate("DOMEntity"); +_exports_DOMEntity_class_0->SetCallHandler(_wrap_new_veto_DOMEntity); +_exports_DOMEntity_class_0->Inherit(_exports_DOMEntity_class); +_exports_DOMEntity_class_0->SetHiddenPrototype(true); +v8::Handle<v8::Object> _exports_DOMEntity_obj = _exports_DOMEntity_class_0->GetFunction(); +/* Class: DOMDocumentType (_exports_DOMDocumentType) */ +v8::Handle<v8::FunctionTemplate> _exports_DOMDocumentType_class_0 = SWIGV8_CreateClassTemplate("DOMDocumentType"); +_exports_DOMDocumentType_class_0->SetCallHandler(_wrap_new_veto_DOMDocumentType); +_exports_DOMDocumentType_class_0->Inherit(_exports_DOMDocumentType_class); +_exports_DOMDocumentType_class_0->SetHiddenPrototype(true); +v8::Handle<v8::Object> _exports_DOMDocumentType_obj = _exports_DOMDocumentType_class_0->GetFunction(); +/* Class: DOMCharacterData (_exports_DOMCharacterData) */ +v8::Handle<v8::FunctionTemplate> _exports_DOMCharacterData_class_0 = SWIGV8_CreateClassTemplate("DOMCharacterData"); +_exports_DOMCharacterData_class_0->SetCallHandler(_wrap_new_veto_DOMCharacterData); +_exports_DOMCharacterData_class_0->Inherit(_exports_DOMCharacterData_class); +_exports_DOMCharacterData_class_0->SetHiddenPrototype(true); +v8::Handle<v8::Object> _exports_DOMCharacterData_obj = _exports_DOMCharacterData_class_0->GetFunction(); +/* Class: DOMComment (_exports_DOMComment) */ +v8::Handle<v8::FunctionTemplate> _exports_DOMComment_class_0 = SWIGV8_CreateClassTemplate("DOMComment"); +_exports_DOMComment_class_0->SetCallHandler(_wrap_new_veto_DOMComment); +_exports_DOMComment_class_0->Inherit(_exports_DOMComment_class); +_exports_DOMComment_class_0->SetHiddenPrototype(true); +v8::Handle<v8::Object> _exports_DOMComment_obj = _exports_DOMComment_class_0->GetFunction(); +/* Class: DOMText (_exports_DOMText) */ +v8::Handle<v8::FunctionTemplate> _exports_DOMText_class_0 = SWIGV8_CreateClassTemplate("DOMText"); +_exports_DOMText_class_0->SetCallHandler(_wrap_new_veto_DOMText); +_exports_DOMText_class_0->Inherit(_exports_DOMText_class); +_exports_DOMText_class_0->SetHiddenPrototype(true); +v8::Handle<v8::Object> _exports_DOMText_obj = _exports_DOMText_class_0->GetFunction(); +/* Class: DOMCDATASection (_exports_DOMCDATASection) */ +v8::Handle<v8::FunctionTemplate> _exports_DOMCDATASection_class_0 = SWIGV8_CreateClassTemplate("DOMCDATASection"); +_exports_DOMCDATASection_class_0->SetCallHandler(_wrap_new_veto_DOMCDATASection); +_exports_DOMCDATASection_class_0->Inherit(_exports_DOMCDATASection_class); +_exports_DOMCDATASection_class_0->SetHiddenPrototype(true); +v8::Handle<v8::Object> _exports_DOMCDATASection_obj = _exports_DOMCDATASection_class_0->GetFunction(); +/* Class: DOMNodeList (_exports_DOMNodeList) */ +v8::Handle<v8::FunctionTemplate> _exports_DOMNodeList_class_0 = SWIGV8_CreateClassTemplate("DOMNodeList"); +_exports_DOMNodeList_class_0->SetCallHandler(_wrap_new_veto_DOMNodeList); +_exports_DOMNodeList_class_0->Inherit(_exports_DOMNodeList_class); +_exports_DOMNodeList_class_0->SetHiddenPrototype(true); +v8::Handle<v8::Object> _exports_DOMNodeList_obj = _exports_DOMNodeList_class_0->GetFunction(); +/* Class: DOMNamedNodeMap (_exports_DOMNamedNodeMap) */ +v8::Handle<v8::FunctionTemplate> _exports_DOMNamedNodeMap_class_0 = SWIGV8_CreateClassTemplate("DOMNamedNodeMap"); +_exports_DOMNamedNodeMap_class_0->SetCallHandler(_wrap_new_veto_DOMNamedNodeMap); +_exports_DOMNamedNodeMap_class_0->Inherit(_exports_DOMNamedNodeMap_class); +_exports_DOMNamedNodeMap_class_0->SetHiddenPrototype(true); +v8::Handle<v8::Object> _exports_DOMNamedNodeMap_obj = _exports_DOMNamedNodeMap_class_0->GetFunction(); +/* Class: DOMDocumentFragment (_exports_DOMDocumentFragment) */ +v8::Handle<v8::FunctionTemplate> _exports_DOMDocumentFragment_class_0 = SWIGV8_CreateClassTemplate("DOMDocumentFragment"); +_exports_DOMDocumentFragment_class_0->SetCallHandler(_wrap_new_veto_DOMDocumentFragment); +_exports_DOMDocumentFragment_class_0->Inherit(_exports_DOMDocumentFragment_class); +_exports_DOMDocumentFragment_class_0->SetHiddenPrototype(true); +v8::Handle<v8::Object> _exports_DOMDocumentFragment_obj = _exports_DOMDocumentFragment_class_0->GetFunction(); +/* Class: DOMEntityReference (_exports_DOMEntityReference) */ +v8::Handle<v8::FunctionTemplate> _exports_DOMEntityReference_class_0 = SWIGV8_CreateClassTemplate("DOMEntityReference"); +_exports_DOMEntityReference_class_0->SetCallHandler(_wrap_new_veto_DOMEntityReference); +_exports_DOMEntityReference_class_0->Inherit(_exports_DOMEntityReference_class); +_exports_DOMEntityReference_class_0->SetHiddenPrototype(true); +v8::Handle<v8::Object> _exports_DOMEntityReference_obj = _exports_DOMEntityReference_class_0->GetFunction(); +/* Class: DOMNotation (_exports_DOMNotation) */ +v8::Handle<v8::FunctionTemplate> _exports_DOMNotation_class_0 = SWIGV8_CreateClassTemplate("DOMNotation"); +_exports_DOMNotation_class_0->SetCallHandler(_wrap_new_veto_DOMNotation); +_exports_DOMNotation_class_0->Inherit(_exports_DOMNotation_class); +_exports_DOMNotation_class_0->SetHiddenPrototype(true); +v8::Handle<v8::Object> _exports_DOMNotation_obj = _exports_DOMNotation_class_0->GetFunction(); +/* Class: DOMProcessingInstruction (_exports_DOMProcessingInstruction) */ +v8::Handle<v8::FunctionTemplate> _exports_DOMProcessingInstruction_class_0 = SWIGV8_CreateClassTemplate("DOMProcessingInstruction"); +_exports_DOMProcessingInstruction_class_0->SetCallHandler(_wrap_new_veto_DOMProcessingInstruction); +_exports_DOMProcessingInstruction_class_0->Inherit(_exports_DOMProcessingInstruction_class); +_exports_DOMProcessingInstruction_class_0->SetHiddenPrototype(true); +v8::Handle<v8::Object> _exports_DOMProcessingInstruction_obj = _exports_DOMProcessingInstruction_class_0->GetFunction(); +/* Class: Event (_exports_Event) */ +v8::Handle<v8::FunctionTemplate> _exports_Event_class_0 = SWIGV8_CreateClassTemplate("Event"); +_exports_Event_class_0->SetCallHandler(_wrap_new_Event); +_exports_Event_class_0->Inherit(_exports_Event_class); +_exports_Event_class_0->SetHiddenPrototype(true); +v8::Handle<v8::Object> _exports_Event_obj = _exports_Event_class_0->GetFunction(); +/* Class: ErrorEvent (_exports_ErrorEvent) */ +v8::Handle<v8::FunctionTemplate> _exports_ErrorEvent_class_0 = SWIGV8_CreateClassTemplate("ErrorEvent"); +_exports_ErrorEvent_class_0->SetCallHandler(_wrap_new_ErrorEvent); +_exports_ErrorEvent_class_0->Inherit(_exports_ErrorEvent_class); +_exports_ErrorEvent_class_0->SetHiddenPrototype(true); +v8::Handle<v8::Object> _exports_ErrorEvent_obj = _exports_ErrorEvent_class_0->GetFunction(); + + + /* add static class functions and variables */ + SWIGV8_AddStaticVariable(_exports_DOMException_obj, "INDEX_SIZE_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_INDEX_SIZE_ERR, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMException_obj, "DOMSTRING_SIZE_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_DOMSTRING_SIZE_ERR, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMException_obj, "HIERARCHY_REQUEST_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_HIERARCHY_REQUEST_ERR, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMException_obj, "WRONG_DOCUMENT_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_WRONG_DOCUMENT_ERR, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMException_obj, "INVALID_CHARACTER_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_INVALID_CHARACTER_ERR, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMException_obj, "NO_DATA_ALLOWED_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_NO_DATA_ALLOWED_ERR, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMException_obj, "NO_MODIFICATION_ALLOWED_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_NO_MODIFICATION_ALLOWED_ERR, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMException_obj, "NOT_FOUND_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_NOT_FOUND_ERR, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMException_obj, "NOT_SUPPORTED_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_NOT_SUPPORTED_ERR, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMException_obj, "INUSE_ATTRIBUTE_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_INUSE_ATTRIBUTE_ERR, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMException_obj, "INVALID_STATE_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_INVALID_STATE_ERR, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMException_obj, "SYNTAX_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_SYNTAX_ERR, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMException_obj, "INVALID_MODIFICATION_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_INVALID_MODIFICATION_ERR, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMException_obj, "NAMESPACE_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_NAMESPACE_ERR, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMException_obj, "INVALID_ACCESS_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_INVALID_ACCESS_ERR, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMException_obj, "VALIDATION_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_VALIDATION_ERR, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMException_obj, "TYPE_MISMATCH_ERR", _wrap_XERCES_CPP_NAMESPACE_DOMException_TYPE_MISMATCH_ERR, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMNode_obj, "ELEMENT_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_ELEMENT_NODE, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMNode_obj, "ATTRIBUTE_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_ATTRIBUTE_NODE, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMNode_obj, "TEXT_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_TEXT_NODE, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMNode_obj, "CDATA_SECTION_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_CDATA_SECTION_NODE, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMNode_obj, "ENTITY_REFERENCE_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_ENTITY_REFERENCE_NODE, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMNode_obj, "ENTITY_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_ENTITY_NODE, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMNode_obj, "PROCESSING_INSTRUCTION_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_PROCESSING_INSTRUCTION_NODE, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMNode_obj, "COMMENT_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_COMMENT_NODE, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMNode_obj, "DOCUMENT_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_NODE, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMNode_obj, "DOCUMENT_TYPE_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_TYPE_NODE, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMNode_obj, "DOCUMENT_FRAGMENT_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_FRAGMENT_NODE, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMNode_obj, "NOTATION_NODE", _wrap_XERCES_CPP_NAMESPACE_DOMNode_NOTATION_NODE, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMNode_obj, "DOCUMENT_POSITION_DISCONNECTED", _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_DISCONNECTED, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMNode_obj, "DOCUMENT_POSITION_PRECEDING", _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_PRECEDING, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMNode_obj, "DOCUMENT_POSITION_FOLLOWING", _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_FOLLOWING, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMNode_obj, "DOCUMENT_POSITION_CONTAINS", _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_CONTAINS, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMNode_obj, "DOCUMENT_POSITION_CONTAINED_BY", _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_CONTAINED_BY, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_DOMNode_obj, "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC", _wrap_XERCES_CPP_NAMESPACE_DOMNode_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_Event_obj, "INTERNAL", _wrap_uscxml_Event_INTERNAL, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_Event_obj, "EXTERNAL", _wrap_uscxml_Event_EXTERNAL, JS_veto_set_variable); +SWIGV8_AddStaticVariable(_exports_Event_obj, "PLATFORM", _wrap_uscxml_Event_PLATFORM, JS_veto_set_variable); +SWIGV8_AddStaticFunction(_exports_Event_obj, "getParam", _wrap_Event__wrap_Event_getParam); + + + /* register classes */ + exports_obj->Set(SWIGV8_SYMBOL_NEW("DOMException"), _exports_DOMException_obj); +exports_obj->Set(SWIGV8_SYMBOL_NEW("DOMNode"), _exports_DOMNode_obj); +exports_obj->Set(SWIGV8_SYMBOL_NEW("DOMAttr"), _exports_DOMAttr_obj); +exports_obj->Set(SWIGV8_SYMBOL_NEW("DOMElement"), _exports_DOMElement_obj); +exports_obj->Set(SWIGV8_SYMBOL_NEW("DOMEntity"), _exports_DOMEntity_obj); +exports_obj->Set(SWIGV8_SYMBOL_NEW("DOMDocumentType"), _exports_DOMDocumentType_obj); +exports_obj->Set(SWIGV8_SYMBOL_NEW("DOMCharacterData"), _exports_DOMCharacterData_obj); +exports_obj->Set(SWIGV8_SYMBOL_NEW("DOMComment"), _exports_DOMComment_obj); +exports_obj->Set(SWIGV8_SYMBOL_NEW("DOMText"), _exports_DOMText_obj); +exports_obj->Set(SWIGV8_SYMBOL_NEW("DOMCDATASection"), _exports_DOMCDATASection_obj); +exports_obj->Set(SWIGV8_SYMBOL_NEW("DOMNodeList"), _exports_DOMNodeList_obj); +exports_obj->Set(SWIGV8_SYMBOL_NEW("DOMNamedNodeMap"), _exports_DOMNamedNodeMap_obj); +exports_obj->Set(SWIGV8_SYMBOL_NEW("DOMDocumentFragment"), _exports_DOMDocumentFragment_obj); +exports_obj->Set(SWIGV8_SYMBOL_NEW("DOMEntityReference"), _exports_DOMEntityReference_obj); +exports_obj->Set(SWIGV8_SYMBOL_NEW("DOMNotation"), _exports_DOMNotation_obj); +exports_obj->Set(SWIGV8_SYMBOL_NEW("DOMProcessingInstruction"), _exports_DOMProcessingInstruction_obj); +exports_obj->Set(SWIGV8_SYMBOL_NEW("Event"), _exports_Event_obj); +exports_obj->Set(SWIGV8_SYMBOL_NEW("ErrorEvent"), _exports_ErrorEvent_obj); + + + /* create and register namespace objects */ + +} + +#if defined(BUILDING_NODE_EXTENSION) +NODE_MODULE(V8DOM, V8DOM_initialize) +#endif diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h deleted file mode 100644 index dd0c18a..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h +++ /dev/null @@ -1,106 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef V8DOM_H_LKE1HKJK -#define V8DOM_H_LKE1HKJK - -#include "uscxml/Common.h" -#include "uscxml/Interpreter.h" -#include <v8.h> -#include <XPath/XPath.hpp> -#include "../Storage.h" - -#define V8_DESTRUCTOR(type) \ -static void jsDestructor(v8::Persistent<v8::Value> object, void* data) { \ - v8::HandleScope handleScope; \ - type* thing = static_cast<type*>(v8::Local<v8::External>::Cast(object->ToObject()->GetInternalField(0))->Value()); \ - delete thing->nativeObj; \ - delete thing; \ - object.Dispose(); \ - object.Clear(); \ -} - -#define V8_DESTRUCTOR_KEEP_WRAPPED(type) \ -static void jsDestructor(v8::Persistent<v8::Value> object, void* data) { \ -v8::HandleScope handleScope; \ -type* thing = static_cast<type*>(v8::Local<v8::External>::Cast(object->ToObject()->GetInternalField(0))->Value()); \ -delete thing; \ -object.Dispose(); \ -object.Clear(); \ -} - -namespace Arabica { -namespace DOM { - -class V8DOM { -public: - V8DOM(); - virtual ~V8DOM(); - - template <typename T> - static T* toClassPtr(v8::Local<v8::Value> data) { - if(data.IsEmpty()) - return NULL; - else if(!data->IsExternal()) - return NULL; - else -// return v8::External::Cast(*data)->Value(); - return static_cast<T *>(v8::External::Unwrap(data)); - return NULL; - } - static v8::Local<v8::External> toExternal(void* pointer) { - v8::HandleScope scope; - return scope.Close(v8::External::New(pointer)); -// return v8::External::New(pointer); - } - - uscxml::NameSpaceInfo* nsInfo; - Arabica::XPath::XPath<std::string>* xpath; - uscxml::Storage* storage; -}; - -class V8Exception : public std::runtime_error { -public: - - V8Exception(const std::string& reason) : - std::runtime_error("DOMException") { - } // V8Exception - - V8Exception(const V8Exception& rhs) : - std::runtime_error(rhs), - reason_(rhs.reason_) { - } // DOMException - - virtual ~V8Exception() throw() { - } // DOMBadCast - - virtual const char* what() const throw() { - return reason_.c_str(); - } // what - -private: - DOMBadCast& operator=(const DOMBadCast&); - bool operator==(const DOMBadCast&) const; - - std::string reason_; -}; // class DOMException - -} -} -#endif /* end of include guard: V8DOM_H_LKE1HKJK */ diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp index 85ae0cd..8b2bb04 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp @@ -23,74 +23,50 @@ */ #include "uscxml/Common.h" -#include "uscxml/config.h" -#include "V8DataModel.h" -#include "V8DOM.h" -#include "dom/V8Document.h" -#include "dom/V8Node.h" -#include "dom/V8Element.h" -#include "dom/V8Text.h" -#include "dom/V8CDATASection.h" -#include "dom/V8SCXMLEvent.h" - -#include "dom/V8ArrayBuffer.h" -#include "dom/V8Int8Array.h" -#include "dom/V8Uint8Array.h" -#include "dom/V8Uint8ClampedArray.h" -#include "dom/V8Int16Array.h" -#include "dom/V8Uint16Array.h" -#include "dom/V8Int32Array.h" -#include "dom/V8Uint32Array.h" -#include "dom/V8Float32Array.h" -#include "dom/V8Float64Array.h" -#include "dom/V8DataView.h" - -#include "uscxml/Message.h" -#include "uscxml/dom/DOMUtils.h" -#include <glog/logging.h> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif +#include "uscxml/util/URL.h" +#include "uscxml/util/String.h" -#define TO_V8_DOMVALUE(type) \ -v8::Handle<v8::Function> retCtor = V8##type::getTmpl()->GetFunction();\ -v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance());\ -struct V8##type::V8##type##Private* retPrivData = new V8##type::V8##type##Private();\ -retPrivData->dom = _dom;\ -retPrivData->nativeObj = new type<std::string>(node);\ -retObj->SetInternalField(0, V8DOM::toExternal(retPrivData));\ -retObj.MakeWeak(0, V8##type::jsDestructor);\ -return retObj; +#include "V8DataModel.h" +//#include "V8SCXMLEvent.h" +#include "uscxml/messages/Event.h" +#include "uscxml/util/DOM.h" +#include <easylogging++.h> -namespace uscxml { +using namespace xercesc; -using namespace Arabica::XPath; -using namespace Arabica::DOM; +static v8::Local<v8::Value> XMLString2JS(const XMLCh* input) { + char* res = xercesc::XMLString::transcode(input); + v8::Local<v8::Value> handle = v8::String::New(res); + return handle; +} -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new V8DataModelProvider() ); - return true; +static XMLCh* JS2XMLString(const v8::Local<v8::Value>& value) { + v8::String::AsciiValue s(value); + XMLCh* ret = xercesc::XMLString::transcode(*s); + return(ret); } -#endif -V8DataModel::V8DataModel() : _ioProcessorsAreSet(false), _invokersAreSet(false) { +// javascript magic here + +#define SWIG_V8_VERSION 0x034000 +#include "V8DOM.cpp.inc" + +namespace uscxml { + +V8DataModel::V8DataModel() { // _contexts.push_back(v8::Context::New()); } V8DataModel::~V8DataModel() { - while(_contexts.size() > 0) { - _contexts.back().Dispose(); - _contexts.pop_back(); - } - if (_dom) - delete _dom; + _context.Dispose(); +// if (_isolate != NULL) { +// _isolate->Dispose(); +// } } void V8DataModel::addExtension(DataModelExtension* ext) { +#if 0 if (_extensions.find(ext) != _extensions.end()) return; @@ -100,7 +76,7 @@ void V8DataModel::addExtension(DataModelExtension* ext) { v8::Locker locker; v8::HandleScope scope; v8::Context::Scope contextScope(_contexts.front()); - v8::Handle<v8::Object> currScope = _contexts.front()->Global(); + v8::Local<v8::Object> currScope = _contexts.front()->Global(); std::list<std::string> locPath = tokenize(ext->provides(), '.'); std::list<std::string>::iterator locIter = locPath.begin(); @@ -126,9 +102,11 @@ void V8DataModel::addExtension(DataModelExtension* ext) { break; } } +#endif } -v8::Handle<v8::Value> V8DataModel::jsExtension(const v8::Arguments& args) { +void V8DataModel::jsExtension(const v8::FunctionCallbackInfo<v8::Value>& info) { +#if 0 DataModelExtension* extension = static_cast<DataModelExtension*>(v8::External::Unwrap(args.Data())); v8::Local<v8::String> memberJS; @@ -151,33 +129,101 @@ v8::Handle<v8::Value> V8DataModel::jsExtension(const v8::Arguments& args) { return ((V8DataModel*)(extension->dm))->getDataAsValue(extension->getValueOf(memberName)); } return v8::Undefined(); +#endif } -boost::shared_ptr<DataModelImpl> V8DataModel::create(InterpreterInfo* interpreter) { - boost::shared_ptr<V8DataModel> dm = boost::shared_ptr<V8DataModel>(new V8DataModel()); - dm->_interpreter = interpreter; - v8::Locker locker; - v8::HandleScope scope; +std::mutex V8DataModel::_initMutex; + +v8::Isolate* V8DataModel::_isolate = NULL; + +void V8NodeListIndexedPropertyHandler(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) { + xercesc::DOMNodeList* list; + SWIG_V8_GetInstancePtr(info.Holder(), (void**)&list); + + if (list->getLength() >= index) { + xercesc::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); + return; + } + info.GetReturnValue().Set(v8::Undefined()); - dm->_dom = new V8DOM(); -// dom->interpreter = interpreter; - dm->_dom->xpath = new XPath<std::string>(); - dm->_dom->xpath->setNamespaceContext(*interpreter->getNameSpaceInfo().getNSContext()); - dm->_dom->storage = new Storage(URL::getResourceDir() + PATH_SEPERATOR + interpreter->getName() + ".storage"); - dm->_dom->nsInfo = new NameSpaceInfo(interpreter->getNameSpaceInfo()); - // see http://stackoverflow.com/questions/3171418/v8-functiontemplate-class-instance +} + +std::shared_ptr<DataModelImpl> V8DataModel::create(DataModelCallbacks* callbacks) { + std::shared_ptr<V8DataModel> dm(new V8DataModel()); + dm->_callbacks = callbacks; + + // TODO: we cannot use one isolate per thread as swig's type will be unknown :( + // We could register them by hand and avoid the _export_ globals in swig? + if (dm->_isolate == NULL) { + dm->_isolate = v8::Isolate::New(); + } + + v8::Locker locker(dm->_isolate); + v8::Isolate::Scope isoScope(dm->_isolate); + + // Create a handle scope to hold the temporary references. + v8::HandleScope scope(dm->_isolate); + + // Create a template for the global object where we set the built-in global functions. + v8::Local<v8::ObjectTemplate> global = v8::ObjectTemplate::New(); // some free functions - v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(); - global->Set(v8::String::New("In"), v8::FunctionTemplate::New(jsIn, v8::External::New(reinterpret_cast<void*>(dm.get()))), v8::ReadOnly); - global->Set(v8::String::New("print"), v8::FunctionTemplate::New(jsPrint, v8::External::New(reinterpret_cast<void*>(dm.get()))), v8::ReadOnly); + global->Set(v8::String::NewSymbol("print"), + v8::FunctionTemplate::New(dm->_isolate, jsPrint,v8::External::New(reinterpret_cast<void*>(dm.get())))); + global->Set(v8::String::NewSymbol("In"), + v8::FunctionTemplate::New(dm->_isolate, jsIn, v8::External::New(reinterpret_cast<void*>(dm.get())))); + + v8::Local<v8::Context> context = v8::Context::New(dm->_isolate, NULL, global); + + dm->_context.Reset(dm->_isolate, context); - v8::Persistent<v8::Context> context = v8::Context::New(0, global); + // Enter the new context so all the following operations take place within it. v8::Context::Scope contextScope(context); + assert(dm->_isolate->GetCurrentContext() == context); + + // not thread safe! + { + std::lock_guard<std::mutex> lock(_initMutex); + SWIGV8_INIT(context->Global()); + + // register subscript operator with nodelist + v8::Handle<v8::FunctionTemplate> _exports_DOMNodeList_class = SWIGV8_CreateClassTemplate("_exports_DOMNodeList"); + + _exports_DOMNodeList_class->InstanceTemplate()->SetIndexedPropertyHandler(V8NodeListIndexedPropertyHandler); + SWIGV8_AddMemberFunction(_exports_DOMNodeList_class, "item", _wrap_DOMNodeList_item); + SWIGV8_AddMemberFunction(_exports_DOMNodeList_class, "getLength", _wrap_DOMNodeList_getLength); + + SWIGV8_SET_CLASS_TEMPL(_exports_DOMNodeList_clientData.class_templ, _exports_DOMNodeList_class); + + } + + context->Global()->SetAccessor(v8::String::NewSymbol("_sessionid"), + V8DataModel::getAttribute, + V8DataModel::setWithException, + v8::String::New(callbacks->getSessionId().c_str())); + context->Global()->SetAccessor(v8::String::NewSymbol("_name"), + V8DataModel::getAttribute, + V8DataModel::setWithException, + v8::String::New(callbacks->getName().c_str())); + context->Global()->SetAccessor(v8::String::NewSymbol("_ioprocessors"), + V8DataModel::getIOProcessors, + V8DataModel::setWithException, + v8::External::New(reinterpret_cast<void*>(dm.get()))); + context->Global()->SetAccessor(v8::String::NewSymbol("_invokers"), + V8DataModel::getInvokers, + V8DataModel::setWithException, + v8::External::New(reinterpret_cast<void*>(dm.get()))); + +// v8::Persistent<v8::Value, v8::CopyablePersistentTraits<v8::Value> > persistent(_isolate, context); + +#if 0 // instantiate the document function - v8::Handle<v8::Function> docCtor = V8Document::getTmpl()->GetFunction(); - v8::Handle<v8::Object> docObj = docCtor->NewInstance(); + v8::Local<v8::Function> docCtor = V8Document::getTmpl()->GetFunction(); + v8::Local<v8::Object> docObj = docCtor->NewInstance(); V8Document::V8DocumentPrivate* privData = new V8Document::V8DocumentPrivate(); privData->nativeObj = new Document<std::string>(interpreter->getDocument()); @@ -200,169 +246,209 @@ boost::shared_ptr<DataModelImpl> V8DataModel::create(InterpreterInfo* interprete context->Global()->Set(v8::String::New("DataView"), V8DataView::getConstructor()->GetFunction()); - context->Global()->SetAccessor(v8::String::New("_sessionid"), - V8DataModel::getAttribute, - V8DataModel::setWithException, - v8::String::New(interpreter->getSessionId().c_str())); - context->Global()->SetAccessor(v8::String::New("_name"), - V8DataModel::getAttribute, - V8DataModel::setWithException, - v8::String::New(interpreter->getName().c_str())); - context->Global()->SetAccessor(v8::String::New("_ioprocessors"), - V8DataModel::getIOProcessors, - V8DataModel::setWithException, - v8::External::New(reinterpret_cast<void*>(dm.get()))); - context->Global()->SetAccessor(v8::String::New("_invokers"), - V8DataModel::getInvokers, - V8DataModel::setWithException, - v8::External::New(reinterpret_cast<void*>(dm.get()))); - - dm->_contexts.push_back(context); // instantiate objects - we have to have a context for that! dm->eval(Element<std::string>(), "_x = {};"); +#endif return dm; } -v8::Handle<v8::Value> V8DataModel::getAttribute(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - return info.Data(); +void V8DataModel::getAttribute(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info) { + info.GetReturnValue().Set(info.Data()); } -void V8DataModel::setWithException(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info) { +void V8DataModel::setWithException(v8::Local<v8::String> property, + v8::Local<v8::Value> value, + const v8::PropertyCallbackInfo<void>& info) { v8::String::AsciiValue data(property); std::string msg = "Cannot set " + std::string(*data); v8::ThrowException(v8::Exception::ReferenceError(v8::String::New(msg.c_str()))); } -v8::Handle<v8::Value> V8DataModel::getIOProcessors(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - V8DataModel* dataModel = V8DOM::toClassPtr<V8DataModel>(info.Data()); +void V8DataModel::getIOProcessors(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info) { + v8::Local<v8::External> field = v8::Local<v8::External>::Cast(info.Data()); + V8DataModel* dataModel = (V8DataModel*)field->Value(); + + if (dataModel->_ioProcessors.IsEmpty()) { - if (!dataModel->_ioProcessorsAreSet) { - dataModel->_ioProcessors = v8::Persistent<v8::Object>::New(v8::Object::New()); - //v8::Handle<v8::Object> ioProcessorObj = v8::Object::New(); - std::map<std::string, IOProcessor> ioProcessors = dataModel->_interpreter->getIOProcessors(); + v8::Local<v8::Object> ioProcs = v8::Local<v8::Object>::New(v8::Isolate::GetCurrent(), v8::Object::New()); + //v8::Local<v8::Object> ioProcessorObj = v8::Object::New(); + std::map<std::string, IOProcessor> ioProcessors = dataModel->_callbacks->getIOProcessors(); std::map<std::string, IOProcessor>::const_iterator ioProcIter = ioProcessors.begin(); while(ioProcIter != ioProcessors.end()) { // std::cout << ioProcIter->first << std::endl; - dataModel->_ioProcessors->Set(v8::String::New(ioProcIter->first.c_str()), - dataModel->getDataAsValue(ioProcIter->second.getDataModelVariables())); + ioProcs->Set(v8::String::New(ioProcIter->first.c_str()), + dataModel->getDataAsValue(ioProcIter->second.getDataModelVariables())); ioProcIter++; } - dataModel->_ioProcessorsAreSet = true; + dataModel->_ioProcessors.Reset(v8::Isolate::GetCurrent(), ioProcs); } - return dataModel->_ioProcessors; + info.GetReturnValue().Set(dataModel->_ioProcessors); } -v8::Handle<v8::Value> V8DataModel::getInvokers(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - V8DataModel* dataModel = V8DOM::toClassPtr<V8DataModel>(info.Data()); +void V8DataModel::getInvokers(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info) { + v8::Local<v8::External> field = v8::Local<v8::External>::Cast(info.Data()); + V8DataModel* dataModel = (V8DataModel*)field->Value(); - if (!dataModel->_invokersAreSet) { - dataModel->_invokers = v8::Persistent<v8::Object>::New(v8::Object::New()); - //v8::Handle<v8::Object> ioProcessorObj = v8::Object::New(); - std::map<std::string, Invoker> invokers = dataModel->_interpreter->getInvokers(); + if (dataModel->_invokers.IsEmpty()) { + v8::Local<v8::Object> invoks = v8::Local<v8::Object>::New(v8::Isolate::GetCurrent(), v8::Object::New()); + //v8::Local<v8::Object> ioProcessorObj = v8::Object::New(); + std::map<std::string, Invoker> invokers = dataModel->_callbacks->getInvokers(); std::map<std::string, Invoker>::const_iterator invokerIter = invokers.begin(); while(invokerIter != invokers.end()) { // std::cout << ioProcIter->first << std::endl; - dataModel->_invokers->Set(v8::String::New(invokerIter->first.c_str()), - dataModel->getDataAsValue(invokerIter->second.getDataModelVariables())); + invoks->Set(v8::String::New(invokerIter->first.c_str()), + dataModel->getDataAsValue(invokerIter->second.getDataModelVariables())); invokerIter++; } - dataModel->_invokersAreSet = true; + dataModel->_invokers.Reset(v8::Isolate::GetCurrent(), invoks); } - return dataModel->_invokers; + info.GetReturnValue().Set(dataModel->_invokers); } -void V8DataModel::pushContext() { - _contexts.push_back(_contexts.back().New(_contexts.back())); -} +void V8DataModel::setEvent(const Event& event) { + + v8::Locker locker(_isolate); + v8::Isolate::Scope isoScope(_isolate); -void V8DataModel::popContext() { - if (_contexts.size() > 1) { - _contexts.back().Dispose(); - _contexts.pop_back(); + v8::HandleScope scope(_isolate); + v8::Local<v8::Context> ctx = v8::Local<v8::Context>::New(_isolate, _context); + + v8::Local<v8::Object> global = ctx->Global(); + v8::Context::Scope contextScope(ctx); // segfaults at newinstance without! + assert(_isolate->GetCurrentContext() == ctx); // only valid in context::scope + + +#if 0 + // this would work as swig_exports_ will get redefined per isolate + { + std::lock_guard<std::mutex> lock(_initMutex); + SWIGV8_INIT(context->Global()); } -} +#endif -void V8DataModel::initialize() { -} + Event* evPtr = new Event(event); -void V8DataModel::setEvent(const Event& event) { - v8::Locker locker; - v8::HandleScope handleScope; - v8::Context::Scope contextScope(_contexts.front()); - v8::Handle<v8::Object> global = _contexts.front()->Global(); +// v8::Handle<v8::FunctionTemplate> classTmpl = v8::Local<v8::FunctionTemplate>::New(_isolate, V8SCXMLEvent::getTmpl()); +// v8::Local<v8::Object> eventObj = classTmpl->InstanceTemplate()->NewInstance(); +// eventObj->SetAlignedPointerInInternalField(0, (void*)evPtr); +// assert(eventObj->GetAlignedPointerFromInternalField(0) == evPtr); - v8::Handle<v8::Function> eventCtor = V8SCXMLEvent::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> eventObj = v8::Persistent<v8::Object>::New(eventCtor->NewInstance()); + v8::Local<v8::Value> eventVal = SWIG_V8_NewPointerObj(evPtr, SWIGTYPE_p_uscxml__Event, SWIG_POINTER_OWN); + v8::Local<v8::Object> eventObj = v8::Local<v8::Object>::Cast(eventVal); - V8SCXMLEvent::V8SCXMLEventPrivate* privData = new V8SCXMLEvent::V8SCXMLEventPrivate(); - privData->nativeObj = new Event(event); - privData->dom = _dom; - eventObj->SetInternalField(0, V8DOM::toExternal(privData)); - eventObj.MakeWeak(0, V8SCXMLEvent::jsDestructor); + /* + v8::Local<v8::Array> properties = eventObj->GetPropertyNames(); + for (int i = 0; i < properties->Length(); i++) { + assert(properties->Get(i)->IsString()); + v8::String::AsciiValue key(v8::Local<v8::String>::Cast(properties->Get(i))); + std::cout << *key << std::endl; + } + */ + + // test333 + if (event.origintype.size() > 0) { + eventObj->Set(v8::String::NewSymbol("origintype"),v8::String::NewFromUtf8(_isolate, event.origintype.c_str())); + } else { + eventObj->Set(v8::String::NewSymbol("origintype"),v8::Undefined(_isolate)); + } + // test335 + if (event.origin.size() > 0) { + eventObj->Set(v8::String::NewSymbol("origin"),v8::String::NewFromUtf8(_isolate, event.origin.c_str())); + } else { + eventObj->Set(v8::String::NewSymbol("origin"),v8::Undefined(_isolate)); + } + // test337 + if (!event.hideSendId) { + eventObj->Set(v8::String::NewSymbol("sendid"),v8::String::NewFromUtf8(_isolate, event.sendid.c_str())); + } else { + eventObj->Set(v8::String::NewSymbol("sendid"),v8::Undefined(_isolate)); + } + // test339 + if (event.invokeid.size() > 0) { + eventObj->Set(v8::String::NewSymbol("invokeid"),v8::String::NewFromUtf8(_isolate, event.invokeid.c_str())); + } else { + eventObj->Set(v8::String::NewSymbol("invokeid"),v8::Undefined(_isolate)); + } - if (event.raw.size() == 0) { - std::stringstream ssRaw; - ssRaw << event; - privData->nativeObj->raw = ssRaw.str(); + // test 331 + switch (event.eventType) { + case Event::EXTERNAL: + eventObj->Set(v8::String::NewSymbol("type"), v8::String::NewFromUtf8(_isolate, "external")); + break; + case Event::INTERNAL: + eventObj->Set(v8::String::NewSymbol("type"), v8::String::NewFromUtf8(_isolate, "internal")); + break; + case Event::PLATFORM: + eventObj->Set(v8::String::NewSymbol("type"), v8::String::NewFromUtf8(_isolate, "platform")); + break; } - if (event.dom) { - eventObj->Set(v8::String::New("data"), getNodeAsValue(event.dom)); - } else if (event.content.length() > 0) { - // _event.data is a string or JSON - Data json = Data::fromJSON(event.content); - if (!json.empty()) { - eventObj->Set(v8::String::New("data"), getDataAsValue(json)); - } else { - eventObj->Set(v8::String::New("data"), v8::String::New(spaceNormalize(event.content).c_str())); - } + if (event.data.node) { + eventObj->Set(v8::String::NewSymbol("data"), getNodeAsValue(event.data.node)); } else { // _event.data is KVP - Event eventCopy(event); - if (!eventCopy.params.empty()) { - Event::params_t::iterator paramIter = eventCopy.params.begin(); - while(paramIter != eventCopy.params.end()) { - eventCopy.data.compound[paramIter->first] = paramIter->second; + Data data = event.data; + if (!event.params.empty()) { + Event::params_t::const_iterator paramIter = event.params.begin(); + while(paramIter != event.params.end()) { + data.compound[paramIter->first] = paramIter->second; paramIter++; } } - if (!eventCopy.namelist.empty()) { - Event::namelist_t::iterator nameListIter = eventCopy.namelist.begin(); - while(nameListIter != eventCopy.namelist.end()) { - eventCopy.data.compound[nameListIter->first] = nameListIter->second; + if (!event.namelist.empty()) { + Event::namelist_t::const_iterator nameListIter = event.namelist.begin(); + while(nameListIter != event.namelist.end()) { + data.compound[nameListIter->first] = nameListIter->second; nameListIter++; } } - if (!eventCopy.data.empty()) { + if (!data.empty()) { // std::cout << Data::toJSON(eventCopy.data); - eventObj->Set(v8::String::New("data"), getDataAsValue(eventCopy.data)); // set data part of _event + eventObj->Set(v8::String::NewSymbol("data"), getDataAsValue(data)); // set data part of _event } else { // test 343 / test 488 - eventObj->Set(v8::String::New("data"), v8::Undefined()); // set data part of _event + eventObj->Set(v8::String::NewSymbol("data"), v8::Undefined()); // set data part of _event } } // we cannot make _event v8::ReadOnly as it will ignore subsequent setEvents - global->Set(v8::String::New("_event"), eventObj); + global->Set(v8::String::NewSymbol("_event"), eventObj); + _event.Reset(_isolate, eventObj); } -Data V8DataModel::getStringAsData(const std::string& content) { - v8::Locker locker; - v8::HandleScope handleScope; - v8::Context::Scope contextScope(_contexts.front()); - v8::Handle<v8::Value> result = evalAsValue(content); +Data V8DataModel::getAsData(const std::string& content) { + return Data::fromJSON(content); +} + +Data V8DataModel::evalAsData(const std::string& content) { + v8::Locker locker(_isolate); + v8::Isolate::Scope isoScope(_isolate); + + v8::HandleScope scope(_isolate); + v8::Local<v8::Context> ctx = v8::Local<v8::Context>::New(_isolate, _context); + v8::Context::Scope contextScope(ctx); // segfaults at newinstance without! + + v8::Local<v8::Value> result = evalAsValue(content); Data data = getValueAsData(result); return data; } -Data V8DataModel::getValueAsData(const v8::Handle<v8::Value>& value) { +Data V8DataModel::getValueAsData(const v8::Local<v8::Value>& value) { + v8::Locker locker(_isolate); + v8::Isolate::Scope isoScope(_isolate); + v8::HandleScope scope(_isolate); + std::set<v8::Value*> foo = std::set<v8::Value*>(); return getValueAsData(value, foo); } -Data V8DataModel::getValueAsData(const v8::Handle<v8::Value>& value, std::set<v8::Value*>& alreadySeen) { +Data V8DataModel::getValueAsData(const v8::Local<v8::Value>& value, std::set<v8::Value*>& alreadySeen) { + + v8::Local<v8::Context> ctx = v8::Local<v8::Context>::New(_isolate, _context); + v8::Context::Scope contextScope(ctx); // segfaults at newinstance without! + Data data; /// TODO: Breaking cycles does not work yet @@ -372,7 +458,7 @@ Data V8DataModel::getValueAsData(const v8::Handle<v8::Value>& value, std::set<v8 if (false) { } else if (value->IsArray()) { - v8::Handle<v8::Array> array = v8::Handle<v8::Array>::Cast(value); + v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(value); for (int i = 0; i < array->Length(); i++) { data.array.push_back(getValueAsData(array->Get(i), alreadySeen)); } @@ -396,33 +482,36 @@ Data V8DataModel::getValueAsData(const v8::Handle<v8::Value>& value, std::set<v8 } else if (value->IsNull()) { LOG(ERROR) << "IsNull is unimplemented" << std::endl; } else if (value->IsNumber()) { - v8::String::AsciiValue prop(v8::Handle<v8::String>::Cast(v8::Handle<v8::Number>::Cast(value))); + v8::String::AsciiValue prop(v8::Local<v8::String>::Cast(v8::Local<v8::Number>::Cast(value))); data.atom = *prop; } else if (value->IsNumberObject()) { LOG(ERROR) << "IsNumberObject is unimplemented" << std::endl; } else if (value->IsObject()) { - if (V8ArrayBuffer::hasInstance(value)) { - uscxml::V8ArrayBuffer::V8ArrayBufferPrivate* privObj = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(value->ToObject()->GetInternalField(0)); - data.binary = privObj->nativeObj->_blob; - return data; - } - if (V8Node::hasInstance(value)) { - uscxml::V8Node::V8NodePrivate* privObj = V8DOM::toClassPtr<V8Node::V8NodePrivate >(value->ToObject()->GetInternalField(0)); - data.node = *privObj->nativeObj; + +// if (V8ArrayBuffer::hasInstance(value)) { +// uscxml::V8ArrayBuffer::V8ArrayBufferPrivate* privObj = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(value->ToObject()->GetInternalField(0)); +// data.binary = privObj->nativeObj->_blob; +// return data; +// } + + v8::Local<v8::FunctionTemplate> tmpl = v8::Local<v8::FunctionTemplate>::New(_isolate, _exports_DOMNode_clientData.class_templ); + if (tmpl->HasInstance(value)) { + SWIG_V8_GetInstancePtr(value, (void**)&(data.node)); return data; } - v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(value); + + v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(value); v8::Local<v8::Array> properties = object->GetPropertyNames(); for (int i = 0; i < properties->Length(); i++) { assert(properties->Get(i)->IsString()); - v8::String::AsciiValue key(v8::Handle<v8::String>::Cast(properties->Get(i))); + v8::String::AsciiValue key(v8::Local<v8::String>::Cast(properties->Get(i))); v8::Local<v8::Value> property = object->Get(properties->Get(i)); data.compound[*key] = getValueAsData(property, alreadySeen); } } else if (value->IsRegExp()) { LOG(ERROR) << "IsRegExp is unimplemented" << std::endl; } else if(value->IsString()) { - v8::String::AsciiValue property(v8::Handle<v8::String>::Cast(value)); + v8::String::AsciiValue property(v8::Local<v8::String>::Cast(value)); data.atom = *property; data.type = Data::VERBATIM; } else if(value->IsStringObject()) { @@ -433,45 +522,32 @@ Data V8DataModel::getValueAsData(const v8::Handle<v8::Value>& value, std::set<v8 LOG(ERROR) << "IsUint32 is unimplemented" << std::endl; } else if(value->IsUndefined()) { data.atom = "undefined"; + } else { + LOG(ERROR) << "Value's type is unknown!" << std::endl; } return data; } -v8::Handle<v8::Value> V8DataModel::getNodeAsValue(const Node<std::string>& node) { - - switch (node.getNodeType()) { - case Node_base::ELEMENT_NODE: { - TO_V8_DOMVALUE(Element); - } - case Node_base::TEXT_NODE: { - TO_V8_DOMVALUE(Text); - } - case Node_base::CDATA_SECTION_NODE: { - TO_V8_DOMVALUE(CDATASection); - } - case Node_base::DOCUMENT_NODE: { - TO_V8_DOMVALUE(Document); - } - default: { - TO_V8_DOMVALUE(Node); - } - } - +v8::Local<v8::Value> V8DataModel::getNodeAsValue(const xercesc::DOMNode* node) { + return SWIG_NewPointerObj(SWIG_as_voidptr(node), + SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, + SWIG_as_voidptrptr(&node)), + 0); } -v8::Handle<v8::Value> V8DataModel::getDataAsValue(const Data& data) { +v8::Local<v8::Value> V8DataModel::getDataAsValue(const Data& data) { + if (data.compound.size() > 0) { - v8::Handle<v8::Object> value = v8::Object::New(); + v8::Local<v8::Object> value = v8::Object::New(); std::map<std::string, Data>::const_iterator compoundIter = data.compound.begin(); while(compoundIter != data.compound.end()) { -// std::cout << compoundIter->first.c_str() << std::endl; - value->Set(v8::String::New(compoundIter->first.c_str()), getDataAsValue(compoundIter->second)); + value->Set(v8::String::NewSymbol(compoundIter->first.c_str()), getDataAsValue(compoundIter->second)); compoundIter++; } return value; } if (data.array.size() > 0) { - v8::Handle<v8::Object> value = v8::Array::New(); + v8::Local<v8::Object> value = v8::Array::New(_isolate, data.array.size()); std::list<Data>::const_iterator arrayIter = data.array.begin(); uint32_t index = 0; while(arrayIter != data.array.end()) { @@ -490,61 +566,55 @@ v8::Handle<v8::Value> V8DataModel::getDataAsValue(const Data& data) { break; } } - if (data.binary) { - uscxml::ArrayBuffer* arrBuffer = new uscxml::ArrayBuffer(data.binary); - v8::Handle<v8::Function> retCtor = V8ArrayBuffer::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8ArrayBuffer::V8ArrayBufferPrivate* retPrivData = new V8ArrayBuffer::V8ArrayBufferPrivate(); - retPrivData->nativeObj = arrBuffer; - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8ArrayBuffer::jsDestructor); - return retObj; - } + if (data.node) { + return getNodeAsValue(data.node); + } + +// if (data.binary) { +// uscxml::ArrayBuffer* arrBuffer = new uscxml::ArrayBuffer(data.binary); +// v8::Local<v8::Function> retCtor = V8ArrayBuffer::getTmpl()->GetFunction(); +// v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); +// +// struct V8ArrayBuffer::V8ArrayBufferPrivate* retPrivData = new V8ArrayBuffer::V8ArrayBufferPrivate(); +// retPrivData->nativeObj = arrBuffer; +// retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); +// +// retObj.MakeWeak(0, V8ArrayBuffer::jsDestructor); +// return retObj; +// } // this will never be reached return v8::Undefined(); } -v8::Handle<v8::Value> V8DataModel::jsPrint(const v8::Arguments& args) { - if (args.Length() > 0) { - v8::String::AsciiValue printMsg(args[0]->ToString()); +void V8DataModel::jsPrint(const v8::FunctionCallbackInfo<v8::Value>& info) { + if (info.Length() > 0) { + v8::String::AsciiValue printMsg(info[0]->ToString()); std::cout << *printMsg; } - return v8::Undefined(); } -v8::Handle<v8::Value> V8DataModel::jsIn(const v8::Arguments& args) { - V8DataModel* INSTANCE = static_cast<V8DataModel*>(v8::External::Unwrap(args.Data())); - for (unsigned int i = 0; i < args.Length(); i++) { - if (args[i]->IsString()) { - std::string stateName(*v8::String::AsciiValue(args[i]->ToString())); - if (INSTANCE->_interpreter->isInState(stateName)) { +void V8DataModel::jsIn(const v8::FunctionCallbackInfo<v8::Value>& info) { + v8::Local<v8::External> field = v8::Local<v8::External>::Cast(info.Data()); + V8DataModel* dataModel = (V8DataModel*)field->Value(); + + for (unsigned int i = 0; i < info.Length(); i++) { + if (info[i]->IsString()) { + std::string stateName(*v8::String::AsciiValue(info[i]->ToString())); + if (dataModel->_callbacks->isInState(stateName)) { continue; } } - return v8::Boolean::New(false); + info.GetReturnValue().Set(false); + return; } - return v8::Boolean::New(true); -} - -bool V8DataModel::validate(const std::string& location, const std::string& schema) { - return true; -} - -bool V8DataModel::isLocation(const std::string& expr) { - // location needs to be RHS and ++ is only valid for RHS - return isValidSyntax(expr + "++"); + info.GetReturnValue().Set(true); } bool V8DataModel::isValidSyntax(const std::string& expr) { - v8::Locker locker; - v8::HandleScope handleScope; v8::TryCatch tryCatch; - v8::Context::Scope contextScope(_contexts.back()); - v8::Handle<v8::String> source = v8::String::New(expr.c_str()); - v8::Handle<v8::Script> script = v8::Script::Compile(source); + v8::Local<v8::String> source = v8::String::New(expr.c_str()); + v8::Local<v8::Script> script = v8::Script::Compile(source); if (script.IsEmpty() || tryCatch.HasCaught()) { return false; @@ -554,19 +624,18 @@ bool V8DataModel::isValidSyntax(const std::string& expr) { } uint32_t V8DataModel::getLength(const std::string& expr) { - v8::Locker locker; - v8::HandleScope handleScope; - v8::TryCatch tryCatch; - v8::Context::Scope contextScope(_contexts.back()); - v8::Handle<v8::Value> result = evalAsValue(expr); + v8::Locker locker(_isolate); + v8::Isolate::Scope isoScope(_isolate); + v8::HandleScope scope(_isolate); + + v8::Local<v8::Context> ctx = v8::Local<v8::Context>::New(_isolate, _context); + v8::Context::Scope contextScope(ctx); // segfaults at newinstance without! + + v8::Local<v8::Value> result = evalAsValue(expr); if (!result.IsEmpty() && result->IsArray()) return result.As<v8::Array>()->Length(); - Event exceptionEvent; - exceptionEvent.name = "error.execution"; - exceptionEvent.data.compound["cause"] = Data("'" + expr + "' does not evaluate to an array.", Data::VERBATIM); - - throw(exceptionEvent); + ERROR_EXECUTION_THROW("'" + expr + "' does not evaluate to an array.") } void V8DataModel::setForeach(const std::string& item, @@ -576,10 +645,20 @@ void V8DataModel::setForeach(const std::string& item, if (!isDeclared(item)) { assign(item, Data()); } + + v8::Locker locker(_isolate); + v8::Isolate::Scope isoScope(_isolate); + v8::HandleScope scope(_isolate); + + v8::Local<v8::Context> ctx = v8::Local<v8::Context>::New(_isolate, _context); + v8::Context::Scope contextScope(ctx); // segfaults at newinstance without! + // assign array element to item std::stringstream ss; - ss << array << "[" << iteration << "]"; - assign(item, Data(ss.str(), Data::INTERPRETED)); + ss << item << " = " << array << "[" << iteration << "]"; +// assign(item, Data(ss.str(), Data::INTERPRETED)); + // test152: we need "'continue' = array[index]" to throw + evalAsValue(ss.str()); if (index.length() > 0) { // assign iteration element to index std::stringstream ss; @@ -588,29 +667,23 @@ void V8DataModel::setForeach(const std::string& item, } } -void V8DataModel::eval(const Element<std::string>& scriptElem, - const std::string& expr) { - v8::Locker locker; - v8::HandleScope handleScope; - v8::Context::Scope contextScope(_contexts.back()); - evalAsValue(expr); -} - bool V8DataModel::isDeclared(const std::string& expr) { /** * Undeclared variables can be checked by trying to access them and catching * a reference error. */ - v8::Locker locker; - v8::HandleScope handleScope; - v8::Context::Scope contextScope(_contexts.back()); + v8::Locker locker(_isolate); + v8::Isolate::Scope isoScope(_isolate); - v8::TryCatch tryCatch; - v8::Handle<v8::String> source = v8::String::New(expr.c_str()); - v8::Handle<v8::Script> script = v8::Script::Compile(source); + v8::HandleScope scope(_isolate); + v8::Local<v8::Context> ctx = v8::Local<v8::Context>::New(_isolate, _context); + v8::Context::Scope contextScope(ctx); // segfaults at newinstance without! + + v8::Local<v8::String> source = v8::String::New(expr.c_str()); + v8::Local<v8::Script> script = v8::Script::Compile(source); - v8::Handle<v8::Value> result; + v8::Local<v8::Value> result; if (!script.IsEmpty()) result = script->Run(); @@ -621,152 +694,62 @@ bool V8DataModel::isDeclared(const std::string& expr) { } bool V8DataModel::evalAsBool(const std::string& expr) { - return evalAsBool(Arabica::DOM::Element<std::string>(), expr); -} + v8::Locker locker(_isolate); + v8::Isolate::Scope isoScope(_isolate); -bool V8DataModel::evalAsBool(const Arabica::DOM::Element<std::string>& node, const std::string& expr) { - v8::Locker locker; - v8::HandleScope handleScope; - v8::Context::Scope contextScope(_contexts.back()); - v8::Handle<v8::Value> result = evalAsValue(expr); + v8::HandleScope scope(_isolate); + v8::Local<v8::Context> ctx = v8::Local<v8::Context>::New(_isolate, _context); + v8::Context::Scope contextScope(ctx); // segfaults at newinstance without! + + v8::Local<v8::Value> result = evalAsValue(expr); return(result->ToBoolean()->BooleanValue()); } -std::string V8DataModel::evalAsString(const std::string& expr) { - v8::Locker locker; - v8::HandleScope handleScope; - v8::Context::Scope contextScope(_contexts.back()); - v8::Handle<v8::Value> result = evalAsValue(expr); - if (result->IsObject()) { - v8::Local<v8::Object> obj = result->ToObject(); - v8::Local<v8::Object> proto; - - proto = obj->FindInstanceInPrototypeChain(V8Document::getTmpl()); - if (!proto.IsEmpty()) { - struct V8Document::V8DocumentPrivate* privData = - V8DOM::toClassPtr<V8Document::V8DocumentPrivate >(obj->GetInternalField(0)); - std::stringstream ss; - ss << privData->nativeObj->getDocumentElement(); - return ss.str(); - } - - proto = obj->FindInstanceInPrototypeChain(V8Node::getTmpl()); - if (!proto.IsEmpty()) { - struct V8Node::V8NodePrivate* privData = - V8DOM::toClassPtr<V8Node::V8NodePrivate >(obj->GetInternalField(0)); - std::stringstream ss; - ss << privData->nativeObj; - return ss.str(); - } - Data data = getValueAsData(result); - return toStr(data); - } - if (result->IsNumber()) { - return toStr(result->ToNumber()->NumberValue()); - } - v8::String::AsciiValue data(result->ToString()); - return std::string(*data); -} +void V8DataModel::assign(const std::string& location, const Data& data) { -double V8DataModel::evalAsNumber(const std::string& expr) { - v8::Locker locker; - v8::HandleScope handleScope; - v8::Context::Scope contextScope(_contexts.back()); - v8::Handle<v8::Value> result = evalAsValue(expr); - if (result->IsNumber()) { - return result->ToNumber()->NumberValue(); - } - return 0; -} + v8::Locker locker(_isolate); + v8::Isolate::Scope isoScope(_isolate); + v8::HandleScope scope(_isolate); -void V8DataModel::assign(const Element<std::string>& assignElem, - const Node<std::string>& node, - const std::string& content) { - v8::Locker locker; - v8::HandleScope handleScope; - v8::Context::Scope contextScope(_contexts.front()); - v8::Handle<v8::Object> global = _contexts.front()->Global(); + v8::Local<v8::Context> ctx = v8::Local<v8::Context>::New(_isolate, _context); + v8::Local<v8::Object> global = ctx->Global(); + v8::Context::Scope contextScope(ctx); // segfaults at newinstance without! - std::string key; - if (HAS_ATTR(assignElem, "id")) { - key = ATTR(assignElem, "id"); - } else if (HAS_ATTR(assignElem, "location")) { - key = ATTR(assignElem, "location"); - } - if (key.length() == 0) - throw Event("error.execution", Event::PLATFORM); - - if (key.compare("_sessionid") == 0) // test 322 + if (location.compare("_sessionid") == 0) // test 322 ERROR_EXECUTION_THROW("Cannot assign to _sessionId"); - if (key.compare("_name") == 0) + if (location.compare("_name") == 0) ERROR_EXECUTION_THROW("Cannot assign to _name"); - if (key.compare("_ioprocessors") == 0) // test 326 + if (location.compare("_ioprocessors") == 0) // test 326 ERROR_EXECUTION_THROW("Cannot assign to _ioprocessors"); - if (key.compare("_invokers") == 0) + if (location.compare("_invokers") == 0) ERROR_EXECUTION_THROW("Cannot assign to _invokers"); - if (key.compare("_event") == 0) + if (location.compare("_event") == 0) ERROR_EXECUTION_THROW("Cannot assign to _event"); - if (HAS_ATTR(assignElem, "expr")) { - evalAsValue(key + " = " + ATTR(assignElem, "expr")); - } else if (node) { - global->Set(v8::String::New(key.c_str()), getNodeAsValue(node)); - } else if (content.size() > 0) { - try { - evalAsValue(key + " = " + content); - } catch (...) { - evalAsValue(key + " = " + "\"" + spaceNormalize(content) + "\""); - } + if (data.node) { + global->Set(v8::String::NewSymbol(location.c_str()), getNodeAsValue(data.node)); } else { - global->Set(v8::String::New(key.c_str()), v8::Undefined()); + evalAsValue(location + " = " + Data::toJSON(data)); } } -void V8DataModel::assign(const std::string& location, - const Data& data) { - v8::Locker locker; - v8::HandleScope handleScope; - v8::Context::Scope contextScope(_contexts.front()); - - std::stringstream ssJSON; - ssJSON << data; - evalAsValue(location + " = " + ssJSON.str()); -} - -void V8DataModel::init(const Element<std::string>& dataElem, - const Node<std::string>& doc, - const std::string& content) { - try { - assign(dataElem, doc, content); - } catch (Event e) { - // test 277 - std::string key; - if (HAS_ATTR(dataElem, "id")) { - key = ATTR(dataElem, "id"); - } else if (HAS_ATTR(dataElem, "location")) { - key = ATTR(dataElem, "location"); - } - v8::Locker locker; - v8::HandleScope handleScope; - v8::Context::Scope contextScope(_contexts.front()); - - evalAsValue(key + " = undefined", true); - throw e; - } -}; - void V8DataModel::init(const std::string& location, const Data& data) { + v8::Locker locker(_isolate); + v8::Isolate::Scope isoScope(_isolate); + v8::HandleScope scope(_isolate); + + v8::Local<v8::Context> ctx = v8::Local<v8::Context>::New(_isolate, _context); + v8::Context::Scope contextScope(ctx); // segfaults at newinstance without! + try { assign(location, data); - } catch (Event e) { + } catch (ErrorEvent e) { // test 277 - v8::Locker locker; - v8::HandleScope handleScope; - v8::Context::Scope contextScope(_contexts.front()); - evalAsValue(location + " = undefined", true); + + // we need to get error.execution into the queue throw e; } } @@ -791,12 +774,22 @@ std::string V8DataModel::andExpressions(std::list<std::string> expressions) { return exprSS.str(); } -v8::Handle<v8::Value> V8DataModel::evalAsValue(const std::string& expr, bool dontThrow) { +v8::Local<v8::Value> V8DataModel::evalAsValue(const std::string& expr, bool dontThrow) { + +// v8::Locker locker(_isolate); +// v8::Isolate::Scope isoScope(_isolate); +// +// v8::HandleScope scope(_isolate); +// v8::EscapableHandleScope escape(_isolate); +// v8::Local<v8::Context> ctx = v8::Local<v8::Context>::New(_isolate, _context); +// v8::Context::Scope contextScope(ctx); // segfaults at newinstance without! + v8::TryCatch tryCatch; - v8::Handle<v8::String> source = v8::String::New(expr.c_str()); - v8::Handle<v8::Script> script = v8::Script::Compile(source); - v8::Handle<v8::Value> result; + v8::Local<v8::String> source = v8::String::New(expr.c_str()); + v8::Local<v8::Script> script = v8::Script::Compile(source); + + v8::Local<v8::Value> result; if (!script.IsEmpty()) result = script->Run(); @@ -811,14 +804,14 @@ v8::Handle<v8::Value> V8DataModel::evalAsValue(const std::string& expr, bool don void V8DataModel::throwExceptionEvent(const v8::TryCatch& tryCatch) { assert(tryCatch.HasCaught()); - Event exceptionEvent; + ErrorEvent exceptionEvent; exceptionEvent.name = "error.execution"; exceptionEvent.eventType = Event::PLATFORM; std::string exceptionString(*v8::String::AsciiValue(tryCatch.Exception())); exceptionEvent.data.compound["cause"] = Data(exceptionString, Data::VERBATIM);; - v8::Handle<v8::Message> message = tryCatch.Message(); + v8::Local<v8::Message> message = tryCatch.Message(); if (!message.IsEmpty()) { std::string filename(*v8::String::AsciiValue(message->GetScriptResourceName())); exceptionEvent.data.compound["filename"] = Data(filename, Data::VERBATIM); diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h index 8e665b7..29b2b58 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h @@ -20,10 +20,10 @@ #ifndef V8DATAMODEL_H_KN8TWG0V #define V8DATAMODEL_H_KN8TWG0V -#include "uscxml/InterpreterInfo.h" +#include "uscxml/plugins/DataModel.h" #include <list> +#include <set> #include <v8.h> -#include "V8DOM.h" #ifdef BUILD_AS_PLUGINS #include "uscxml/plugins/Plugins.h" @@ -32,7 +32,6 @@ namespace uscxml { class Event; class Data; -class V8SCXMLDOM; } namespace uscxml { @@ -41,7 +40,9 @@ class V8DataModel : public DataModelImpl { public: V8DataModel(); virtual ~V8DataModel(); - virtual boost::shared_ptr<DataModelImpl> create(InterpreterInfo* interpreter); + virtual std::shared_ptr<DataModelImpl> create(DataModelCallbacks* callbacks); + + virtual void addExtension(DataModelExtension* ext); virtual std::list<std::string> getNames() { std::list<std::string> names; @@ -49,79 +50,61 @@ public: return names; } - virtual void initialize(); - virtual void setEvent(const Event& event); - - virtual bool validate(const std::string& location, const std::string& schema); - virtual bool isLocation(const std::string& expr); virtual bool isValidSyntax(const std::string& expr); + virtual void setEvent(const Event& event); + + // foreach virtual uint32_t getLength(const std::string& expr); virtual void setForeach(const std::string& item, const std::string& array, const std::string& index, uint32_t iteration); - virtual void pushContext(); - virtual void popContext(); - - virtual bool supportsJSON() { - return true; - } - - virtual void eval(const Arabica::DOM::Element<std::string>& scriptElem, - const std::string& expr); - virtual void assign(const Arabica::DOM::Element<std::string>& assignElem, - const Arabica::DOM::Node<std::string>& node, - const std::string& content); - virtual void assign(const std::string& location, - const Data& data); - - virtual void init(const Arabica::DOM::Element<std::string>& dataElem, - const Arabica::DOM::Node<std::string>& node, - const std::string& content); - virtual void init(const std::string& location, - const Data& data); - - virtual std::string andExpressions(std::list<std::string>); - virtual Data getStringAsData(const std::string& content); - virtual Data getValueAsData(const v8::Handle<v8::Value>& value, - std::set<v8::Value*>& alreadySeen); - virtual Data getValueAsData(const v8::Handle<v8::Value>& value); + virtual bool evalAsBool(const std::string& expr); + virtual Data evalAsData(const std::string& expr); + virtual Data getAsData(const std::string& content); virtual bool isDeclared(const std::string& expr); - virtual std::string evalAsString(const std::string& expr); - virtual bool evalAsBool(const Arabica::DOM::Element<std::string>& node, const std::string& expr); - virtual bool evalAsBool(const std::string& expr); - virtual double evalAsNumber(const std::string& expr); - - virtual void addExtension(DataModelExtension* ext); + virtual void assign(const std::string& location, const Data& data); + virtual void init(const std::string& location, const Data& data); - static v8::Handle<v8::Value> jsExtension(const v8::Arguments& args); - static v8::Handle<v8::Value> jsIn(const v8::Arguments& args); - static v8::Handle<v8::Value> jsPrint(const v8::Arguments& args); + virtual std::string andExpressions(std::list<std::string>); protected: - std::list<v8::Persistent<v8::Context> > _contexts; - Arabica::DOM::V8DOM* _dom; + static void jsExtension(const v8::FunctionCallbackInfo<v8::Value>& info); + static void jsIn(const v8::FunctionCallbackInfo<v8::Value>& info); + static void jsPrint(const v8::FunctionCallbackInfo<v8::Value>& info); + + v8::Persistent<v8::Object> _event; + v8::Persistent<v8::Context> _context; + static v8::Isolate* _isolate; - bool _ioProcessorsAreSet; - bool _invokersAreSet; v8::Persistent<v8::Object> _ioProcessors; v8::Persistent<v8::Object> _invokers; - static v8::Handle<v8::Value> getIOProcessors(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> getInvokers(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> getAttribute(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static void setWithException(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info); - - v8::Handle<v8::Value> evalAsValue(const std::string& expr, bool dontThrow = false); - v8::Handle<v8::Value> getDataAsValue(const Data& data); - v8::Handle<v8::Value> getNodeAsValue(const Arabica::DOM::Node<std::string>& node); + + static void getIOProcessors(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info); + static void getInvokers(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info); + static void getAttribute(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info); + static void setWithException(v8::Local<v8::String> property, + v8::Local<v8::Value> value, + const v8::PropertyCallbackInfo<void>& info); + + 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); void throwExceptionEvent(const v8::TryCatch& tryCatch); std::set<DataModelExtension*> _extensions; + +private: + Data getValueAsData(const v8::Local<v8::Value>& value, std::set<v8::Value*>& alreadySeen); + + static std::mutex _initMutex; + }; #ifdef BUILD_AS_PLUGINS diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/bindings.i b/src/uscxml/plugins/datamodel/ecmascript/v8/bindings.i new file mode 100644 index 0000000..560671f --- /dev/null +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/bindings.i @@ -0,0 +1,45 @@ +#define XERCES_HAS_CPP_NAMESPACE 1 + +%include <std_string.i> + +/* + +swig -I/Users/sradomski/Documents/TK/Code/uscxml2/build/cli/deps/xerces-c/include/ -javascript -jsc -c++ uscxml.i +gcc -I/Users/sradomski/Documents/TK/Code/uscxml2/build/cli/deps/xerces-c/include/ ./uscxml_wrap.cxx + +*/ + +%module V8DOM + +%import "uscxml/config.h" +%import "uscxml/Common.h" + +%import "xercesc/util/XercesDefs.hpp" +%import "xercesc/util/Xerces_autoconf_config.hpp" + +%include "../../common/bindings/dom/ignore.i" +%include "../../common/bindings/dom/defines.i" +%include "../../common/bindings/dom/typemaps-general.i" + +// in typemap +%typemap(in) XMLCh * %{ + $1 = JS2XMLString($input); +%} + +%typemap(freearg) XMLCh * %{ + delete[] $1; +%} + +// out typemap +%typemap(out) XMLCh * %{ + $result = XMLString2JS($1); +%} + +%include "../../common/bindings/dom/dom.i" + +// Operators we do want +// %rename(operator_assignment) operator=; +%rename(operator_equal_to) operator==; +%rename(operator_not_equal_to) operator!=; + +%include "../../common/bindings/event.i" diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.cpp deleted file mode 100644 index 1328b19..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.cpp +++ /dev/null @@ -1,176 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8ArrayBuffer.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8ArrayBuffer::Tmpl; -v8::Persistent<v8::FunctionTemplate> V8ArrayBuffer::Constr; - -v8::Handle<v8::Value> V8ArrayBuffer::constructor(const v8::Arguments& args) { - if (!args.IsConstructCall()) - return v8::ThrowException(v8::String::New("Cannot call constructor as function")); - - uscxml::ArrayBuffer* localInstance = NULL; - if (false) { - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - - unsigned long localLength = args[0]->ToNumber()->Uint32Value(); - localInstance = new uscxml::ArrayBuffer(localLength); - - } - if (!localInstance) { - throw V8Exception("Parameter mismatch while calling constructor for ArrayBuffer"); - return v8::Undefined(); - } - - v8::Handle<v8::Function> retCtor = V8ArrayBuffer::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8ArrayBuffer::V8ArrayBufferPrivate* retPrivData = new V8ArrayBuffer::V8ArrayBufferPrivate(); - retPrivData->nativeObj = localInstance; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8ArrayBuffer::jsDestructor); - return retObj; -} - -v8::Handle<v8::Value> V8ArrayBuffer::byteLengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8ArrayBufferPrivate* privData = V8DOM::toClassPtr<V8ArrayBufferPrivate >(self->GetInternalField(0)); - - return v8::Integer::New(privData->nativeObj->getByteLength()); -} - -v8::Handle<v8::Value> V8ArrayBuffer::mimeTypeAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8ArrayBufferPrivate* privData = V8DOM::toClassPtr<V8ArrayBufferPrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getMimeType().c_str()); -} - -void V8ArrayBuffer::mimeTypeAttrSetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8ArrayBufferPrivate* privData = V8DOM::toClassPtr<V8ArrayBufferPrivate >(self->GetInternalField(0)); - v8::String::AsciiValue localMimeType(value); - 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(); - struct V8ArrayBufferPrivate* privData = V8DOM::toClassPtr<V8ArrayBufferPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsInt32() && - args[1]->IsInt32()) { - long localBegin = args[0]->ToNumber()->Int32Value(); - long localEnd = args[1]->ToNumber()->Int32Value(); - - uscxml::ArrayBuffer* retVal = new uscxml::ArrayBuffer(privData->nativeObj->slice(localBegin, localEnd)); - v8::Handle<v8::Function> retCtor = V8ArrayBuffer::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8ArrayBuffer::V8ArrayBufferPrivate* retPrivData = new V8ArrayBuffer::V8ArrayBufferPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8ArrayBuffer::jsDestructor); - return retObj; - - } else if (args.Length() == 1 && - args[0]->IsInt32()) { - long localBegin = args[0]->ToNumber()->Int32Value(); - - uscxml::ArrayBuffer* retVal = new uscxml::ArrayBuffer(privData->nativeObj->slice(localBegin)); - v8::Handle<v8::Function> retCtor = V8ArrayBuffer::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8ArrayBuffer::V8ArrayBufferPrivate* retPrivData = new V8ArrayBuffer::V8ArrayBufferPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8ArrayBuffer::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling slice"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8ArrayBuffer::isViewCallback(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() == 1 && - true) { - void* localValue = v8::External::Unwrap(args[0]->ToObject()->GetInternalField(0)); - - bool retVal = privData->nativeObj->isView(localValue); - - return v8::Boolean::New(retVal); - } - throw V8Exception("Parameter mismatch while calling isView"); - return v8::Undefined(); -} -bool V8ArrayBuffer::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.h deleted file mode 100644 index 14b92b0..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.h +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8ArrayBuffer_h -#define V8ArrayBuffer_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8ArrayBuffer { -public: - struct V8ArrayBufferPrivate { - V8DOM* dom; - uscxml::ArrayBuffer* nativeObj; - }; - - V8_DESTRUCTOR(V8ArrayBufferPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> md5Callback(const v8::Arguments&); - static v8::Handle<v8::Value> base64Callback(const v8::Arguments&); - static v8::Handle<v8::Value> sliceCallback(const v8::Arguments&); - static v8::Handle<v8::Value> isViewCallback(const v8::Arguments&); - - static v8::Handle<v8::Value> byteLengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> mimeTypeAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static void mimeTypeAttrSetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info); - - static v8::Handle<v8::Value> constructor(const v8::Arguments&); - static v8::Persistent<v8::FunctionTemplate> Constr; - static v8::Handle<v8::FunctionTemplate> getConstructor() { - if (Constr.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> constr = v8::FunctionTemplate::New(constructor); - Constr = v8::Persistent<v8::FunctionTemplate>::New(constr); - } - return Constr; - } - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("ArrayBuffer")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("byteLength"), V8ArrayBuffer::byteLengthAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("mimeType"), V8ArrayBuffer::mimeTypeAttrGetter, V8ArrayBuffer::mimeTypeAttrSetter, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - prototype->Set(v8::String::NewSymbol("md5"), - v8::FunctionTemplate::New(V8ArrayBuffer::md5Callback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("base64"), - v8::FunctionTemplate::New(V8ArrayBuffer::base64Callback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("slice"), - v8::FunctionTemplate::New(V8ArrayBuffer::sliceCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("isView"), - v8::FunctionTemplate::New(V8ArrayBuffer::isViewCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8ArrayBuffer_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBufferView.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBufferView.cpp deleted file mode 100644 index 60a2530..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBufferView.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8ArrayBuffer.h" -#include "V8ArrayBufferView.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8ArrayBufferView::Tmpl; - -v8::Handle<v8::Value> V8ArrayBufferView::bufferAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8ArrayBufferViewPrivate* privData = V8DOM::toClassPtr<V8ArrayBufferViewPrivate >(self->GetInternalField(0)); - - if (!privData->nativeObj->getBuffer()) return v8::Undefined(); - uscxml::ArrayBuffer* arbaicaRet = new uscxml::ArrayBuffer(privData->nativeObj->getBuffer()); - - v8::Handle<v8::Function> arbaicaRetCtor = V8ArrayBuffer::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> arbaicaRetObj = v8::Persistent<v8::Object>::New(arbaicaRetCtor->NewInstance()); - - struct V8ArrayBuffer::V8ArrayBufferPrivate* retPrivData = new V8ArrayBuffer::V8ArrayBufferPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arbaicaRet; - - arbaicaRetObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - arbaicaRetObj.MakeWeak(0, V8ArrayBuffer::jsDestructor); - return arbaicaRetObj; - -} - -v8::Handle<v8::Value> V8ArrayBufferView::byteOffsetAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8ArrayBufferViewPrivate* privData = V8DOM::toClassPtr<V8ArrayBufferViewPrivate >(self->GetInternalField(0)); - - return v8::Integer::New(privData->nativeObj->getByteOffset()); -} - -v8::Handle<v8::Value> V8ArrayBufferView::byteLengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8ArrayBufferViewPrivate* privData = V8DOM::toClassPtr<V8ArrayBufferViewPrivate >(self->GetInternalField(0)); - - return v8::Integer::New(privData->nativeObj->getByteLength()); -} -bool V8ArrayBufferView::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBufferView.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBufferView.h deleted file mode 100644 index 8ed542f..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBufferView.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8ArrayBufferView_h -#define V8ArrayBufferView_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8ArrayBufferView { -public: - struct V8ArrayBufferViewPrivate { - V8DOM* dom; - uscxml::ArrayBufferView* nativeObj; - }; - - V8_DESTRUCTOR(V8ArrayBufferViewPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - - static v8::Handle<v8::Value> bufferAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> byteOffsetAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> byteLengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("ArrayBufferView")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("buffer"), V8ArrayBufferView::bufferAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("byteOffset"), V8ArrayBufferView::byteOffsetAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("byteLength"), V8ArrayBufferView::byteLengthAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - - - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8ArrayBufferView_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Attr.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Attr.cpp deleted file mode 100644 index 9480cb6..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Attr.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8Attr.h" -#include "V8Element.h" -#include "V8Node.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8Attr::Tmpl; - -v8::Handle<v8::Value> V8Attr::nameAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8AttrPrivate* privData = V8DOM::toClassPtr<V8AttrPrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getName().c_str()); -} - -v8::Handle<v8::Value> V8Attr::specifiedAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8AttrPrivate* privData = V8DOM::toClassPtr<V8AttrPrivate >(self->GetInternalField(0)); - - return v8::Boolean::New(privData->nativeObj->getSpecified()); -} - -v8::Handle<v8::Value> V8Attr::valueAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8AttrPrivate* privData = V8DOM::toClassPtr<V8AttrPrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getValue().c_str()); -} - -void V8Attr::valueAttrSetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8AttrPrivate* privData = V8DOM::toClassPtr<V8AttrPrivate >(self->GetInternalField(0)); - v8::String::AsciiValue localValue(value); - privData->nativeObj->setValue(*localValue); -} - -v8::Handle<v8::Value> V8Attr::ownerElementAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8AttrPrivate* privData = V8DOM::toClassPtr<V8AttrPrivate >(self->GetInternalField(0)); - - if (!privData->nativeObj->getOwnerElement()) return v8::Undefined(); - Arabica::DOM::Element<std::string>* arbaicaRet = new Arabica::DOM::Element<std::string>(privData->nativeObj->getOwnerElement()); - - v8::Handle<v8::Function> arbaicaRetCtor = V8Element::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> arbaicaRetObj = v8::Persistent<v8::Object>::New(arbaicaRetCtor->NewInstance()); - - struct V8Element::V8ElementPrivate* retPrivData = new V8Element::V8ElementPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arbaicaRet; - - arbaicaRetObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - arbaicaRetObj.MakeWeak(0, V8Element::jsDestructor); - return arbaicaRetObj; - -} -bool V8Attr::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Attr.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Attr.h deleted file mode 100644 index ca0c58b..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Attr.h +++ /dev/null @@ -1,87 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8Attr_h -#define V8Attr_h - -#include <string> -#include "DOM/Node.hpp" -#include "V8Node.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8Attr { -public: - struct V8AttrPrivate { - V8DOM* dom; - Arabica::DOM::Attr<std::string>* nativeObj; - }; - - V8_DESTRUCTOR(V8AttrPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - - static v8::Handle<v8::Value> nameAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> specifiedAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> valueAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static void valueAttrSetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> ownerElementAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("Attr")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("name"), V8Attr::nameAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("specified"), V8Attr::specifiedAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("value"), V8Attr::valueAttrGetter, V8Attr::valueAttrSetter, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("ownerElement"), V8Attr::ownerElementAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - - - tmpl->Inherit(V8Node::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8Attr_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CDATASection.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CDATASection.cpp deleted file mode 100644 index 2d833fe..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CDATASection.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8CDATASection.h" -#include "V8Text.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8CDATASection::Tmpl; -bool V8CDATASection::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CDATASection.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CDATASection.h deleted file mode 100644 index b7d2a2e..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CDATASection.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8CDATASection_h -#define V8CDATASection_h - -#include <string> -#include "DOM/Node.hpp" -#include "V8Text.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8CDATASection { -public: - struct V8CDATASectionPrivate { - V8DOM* dom; - Arabica::DOM::CDATASection<std::string>* nativeObj; - }; - - V8_DESTRUCTOR(V8CDATASectionPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("CDATASection")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - - - - tmpl->Inherit(V8Text::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8CDATASection_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CharacterData.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CharacterData.cpp deleted file mode 100644 index 217d035..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CharacterData.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8CharacterData.h" -#include "V8Node.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8CharacterData::Tmpl; - -v8::Handle<v8::Value> V8CharacterData::dataAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8CharacterDataPrivate* privData = V8DOM::toClassPtr<V8CharacterDataPrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getData().c_str()); -} - -void V8CharacterData::dataAttrSetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8CharacterDataPrivate* privData = V8DOM::toClassPtr<V8CharacterDataPrivate >(self->GetInternalField(0)); - v8::String::AsciiValue localData(value); - privData->nativeObj->setData(*localData); -} - -v8::Handle<v8::Value> V8CharacterData::lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8CharacterDataPrivate* privData = V8DOM::toClassPtr<V8CharacterDataPrivate >(self->GetInternalField(0)); - - return v8::Integer::New(privData->nativeObj->getLength()); -} - -v8::Handle<v8::Value> V8CharacterData::substringDataCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8CharacterDataPrivate* privData = V8DOM::toClassPtr<V8CharacterDataPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsUint32()) { - unsigned long localOffset = args[0]->ToNumber()->Uint32Value(); - unsigned long localCount = args[1]->ToNumber()->Uint32Value(); - - std::string retVal = privData->nativeObj->substringData(localOffset, localCount); - - return v8::String::New(retVal.c_str()); - } - throw V8Exception("Parameter mismatch while calling substringData"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8CharacterData::appendDataCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8CharacterDataPrivate* privData = V8DOM::toClassPtr<V8CharacterDataPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localArg(args[0]); - - privData->nativeObj->appendData(*localArg); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling appendData"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8CharacterData::insertDataCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8CharacterDataPrivate* privData = V8DOM::toClassPtr<V8CharacterDataPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsString()) { - unsigned long localOffset = args[0]->ToNumber()->Uint32Value(); - v8::String::AsciiValue localArg(args[1]); - - privData->nativeObj->insertData(localOffset, *localArg); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling insertData"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8CharacterData::deleteDataCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8CharacterDataPrivate* privData = V8DOM::toClassPtr<V8CharacterDataPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsUint32()) { - unsigned long localOffset = args[0]->ToNumber()->Uint32Value(); - unsigned long localCount = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->deleteData(localOffset, localCount); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling deleteData"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8CharacterData::replaceDataCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8CharacterDataPrivate* privData = V8DOM::toClassPtr<V8CharacterDataPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 3 && - args[0]->IsUint32() && - args[1]->IsUint32() && - args[2]->IsString()) { - unsigned long localOffset = args[0]->ToNumber()->Uint32Value(); - unsigned long localCount = args[1]->ToNumber()->Uint32Value(); - v8::String::AsciiValue localArg(args[2]); - - privData->nativeObj->replaceData(localOffset, localCount, *localArg); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling replaceData"); - return v8::Undefined(); -} -bool V8CharacterData::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CharacterData.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CharacterData.h deleted file mode 100644 index bf21603..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8CharacterData.h +++ /dev/null @@ -1,96 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8CharacterData_h -#define V8CharacterData_h - -#include <string> -#include "DOM/Node.hpp" -#include "V8Node.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8CharacterData { -public: - struct V8CharacterDataPrivate { - V8DOM* dom; - Arabica::DOM::CharacterData<std::string>* nativeObj; - }; - - V8_DESTRUCTOR(V8CharacterDataPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> substringDataCallback(const v8::Arguments&); - static v8::Handle<v8::Value> appendDataCallback(const v8::Arguments&); - static v8::Handle<v8::Value> insertDataCallback(const v8::Arguments&); - static v8::Handle<v8::Value> deleteDataCallback(const v8::Arguments&); - static v8::Handle<v8::Value> replaceDataCallback(const v8::Arguments&); - - static v8::Handle<v8::Value> dataAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static void dataAttrSetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("CharacterData")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("data"), V8CharacterData::dataAttrGetter, V8CharacterData::dataAttrSetter, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("length"), V8CharacterData::lengthAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - prototype->Set(v8::String::NewSymbol("substringData"), - v8::FunctionTemplate::New(V8CharacterData::substringDataCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("appendData"), - v8::FunctionTemplate::New(V8CharacterData::appendDataCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("insertData"), - v8::FunctionTemplate::New(V8CharacterData::insertDataCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("deleteData"), - v8::FunctionTemplate::New(V8CharacterData::deleteDataCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("replaceData"), - v8::FunctionTemplate::New(V8CharacterData::replaceDataCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - - tmpl->Inherit(V8Node::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8CharacterData_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Comment.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Comment.cpp deleted file mode 100644 index 9c7e0a7..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Comment.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8CharacterData.h" -#include "V8Comment.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8Comment::Tmpl; -bool V8Comment::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Comment.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Comment.h deleted file mode 100644 index e0ed9a7..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Comment.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8Comment_h -#define V8Comment_h - -#include <string> -#include "DOM/Node.hpp" -#include "V8CharacterData.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8Comment { -public: - struct V8CommentPrivate { - V8DOM* dom; - Arabica::DOM::Comment<std::string>* nativeObj; - }; - - V8_DESTRUCTOR(V8CommentPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("Comment")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - - - - tmpl->Inherit(V8CharacterData::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8Comment_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DOMImplementation.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DOMImplementation.cpp deleted file mode 100644 index a9c3838..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DOMImplementation.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8DOMImplementation.h" -#include "V8Document.h" -#include "V8DocumentType.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8DOMImplementation::Tmpl; - -v8::Handle<v8::Value> V8DOMImplementation::hasFeatureCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DOMImplementationPrivate* privData = V8DOM::toClassPtr<V8DOMImplementationPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localFeature(args[0]); - v8::String::AsciiValue localVersion(args[1]); - - bool retVal = privData->nativeObj->hasFeature(*localFeature, *localVersion); - - return v8::Boolean::New(retVal); - } - throw V8Exception("Parameter mismatch while calling hasFeature"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8DOMImplementation::createDocumentTypeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DOMImplementationPrivate* privData = V8DOM::toClassPtr<V8DOMImplementationPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 3 && - args[0]->IsString() && - args[1]->IsString() && - args[2]->IsString()) { - v8::String::AsciiValue localQualifiedName(args[0]); - v8::String::AsciiValue localPublicId(args[1]); - v8::String::AsciiValue localSystemId(args[2]); - - Arabica::DOM::DocumentType<std::string>* retVal = new Arabica::DOM::DocumentType<std::string>(privData->nativeObj->createDocumentType(*localQualifiedName, *localPublicId, *localSystemId)); - v8::Handle<v8::Function> retCtor = V8DocumentType::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8DocumentType::V8DocumentTypePrivate* retPrivData = new V8DocumentType::V8DocumentTypePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8DocumentType::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling createDocumentType"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8DOMImplementation::createDocumentCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DOMImplementationPrivate* privData = V8DOM::toClassPtr<V8DOMImplementationPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 3 && - args[0]->IsString() && - args[1]->IsString() && - args[2]->IsObject() && V8DocumentType::hasInstance(args[2])) { - v8::String::AsciiValue localNamespaceURI(args[0]); - v8::String::AsciiValue localQualifiedName(args[1]); - Arabica::DOM::DocumentType<std::string>* localDoctype = V8DOM::toClassPtr<V8DocumentType::V8DocumentTypePrivate >(args[2]->ToObject()->GetInternalField(0))->nativeObj; - - Arabica::DOM::Document<std::string>* retVal = new Arabica::DOM::Document<std::string>(privData->nativeObj->createDocument(*localNamespaceURI, *localQualifiedName, *localDoctype)); - v8::Handle<v8::Function> retCtor = V8Document::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Document::V8DocumentPrivate* retPrivData = new V8Document::V8DocumentPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Document::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling createDocument"); - return v8::Undefined(); -} -bool V8DOMImplementation::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DOMImplementation.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DOMImplementation.h deleted file mode 100644 index 5627a19..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DOMImplementation.h +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8DOMImplementation_h -#define V8DOMImplementation_h - -#include <string> -#include "DOM/Node.hpp" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8DOMImplementation { -public: - struct V8DOMImplementationPrivate { - V8DOM* dom; - Arabica::DOM::DOMImplementation<std::string>* nativeObj; - }; - - V8_DESTRUCTOR(V8DOMImplementationPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> hasFeatureCallback(const v8::Arguments&); - static v8::Handle<v8::Value> createDocumentTypeCallback(const v8::Arguments&); - static v8::Handle<v8::Value> createDocumentCallback(const v8::Arguments&); - - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("DOMImplementation")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - - prototype->Set(v8::String::NewSymbol("hasFeature"), - v8::FunctionTemplate::New(V8DOMImplementation::hasFeatureCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("createDocumentType"), - v8::FunctionTemplate::New(V8DOMImplementation::createDocumentTypeCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("createDocument"), - v8::FunctionTemplate::New(V8DOMImplementation::createDocumentCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8DOMImplementation_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DataView.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DataView.cpp deleted file mode 100644 index 1eaca4f..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DataView.cpp +++ /dev/null @@ -1,490 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8ArrayBuffer.h" -#include "V8ArrayBufferView.h" -#include "V8DataView.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8DataView::Tmpl; -v8::Persistent<v8::FunctionTemplate> V8DataView::Constr; - -v8::Handle<v8::Value> V8DataView::constructor(const v8::Arguments& args) { - if (!args.IsConstructCall()) - return v8::ThrowException(v8::String::New("Cannot call constructor as function")); - - uscxml::DataView* localInstance = NULL; - if (false) { - } else if (args.Length() == 3 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0]) && - args[1]->IsUint32() && - args[2]->IsUint32()) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localByteOffset = args[1]->ToNumber()->Uint32Value(); - unsigned long localByteLength = args[2]->ToNumber()->Uint32Value(); - localInstance = new uscxml::DataView(localBuffer, localByteOffset, localByteLength); - - } else if (args.Length() == 2 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0]) && - args[1]->IsUint32()) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localByteOffset = args[1]->ToNumber()->Uint32Value(); - localInstance = new uscxml::DataView(localBuffer, localByteOffset); - - } else if (args.Length() == 1 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0])) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - localInstance = new uscxml::DataView(localBuffer); - - } - if (!localInstance) { - throw V8Exception("Parameter mismatch while calling constructor for DataView"); - return v8::Undefined(); - } - - v8::Handle<v8::Function> retCtor = V8DataView::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8DataView::V8DataViewPrivate* retPrivData = new V8DataView::V8DataViewPrivate(); - retPrivData->nativeObj = localInstance; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8DataView::jsDestructor); - return retObj; -} - -v8::Handle<v8::Value> V8DataView::getInt8Callback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DataViewPrivate* privData = V8DOM::toClassPtr<V8DataViewPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - - char retVal = privData->nativeObj->getInt8(localByteOffset); - - return v8::Number::New(retVal); - } - throw V8Exception("Parameter mismatch while calling getInt8"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8DataView::getUint8Callback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DataViewPrivate* privData = V8DOM::toClassPtr<V8DataViewPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - - unsigned char retVal = privData->nativeObj->getUint8(localByteOffset); - - return v8::Number::New(retVal); - } - throw V8Exception("Parameter mismatch while calling getUint8"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8DataView::getInt16Callback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DataViewPrivate* privData = V8DOM::toClassPtr<V8DataViewPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsBoolean()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - bool localLittleEndian = args[1]->ToBoolean()->BooleanValue(); - - short retVal = privData->nativeObj->getInt16(localByteOffset, localLittleEndian); - - return v8::Number::New(retVal); - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - - short retVal = privData->nativeObj->getInt16(localByteOffset); - - return v8::Number::New(retVal); - } - throw V8Exception("Parameter mismatch while calling getInt16"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8DataView::getUint16Callback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DataViewPrivate* privData = V8DOM::toClassPtr<V8DataViewPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsBoolean()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - bool localLittleEndian = args[1]->ToBoolean()->BooleanValue(); - - unsigned short retVal = privData->nativeObj->getUint16(localByteOffset, localLittleEndian); - - return v8::Number::New(retVal); - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - - unsigned short retVal = privData->nativeObj->getUint16(localByteOffset); - - return v8::Number::New(retVal); - } - throw V8Exception("Parameter mismatch while calling getUint16"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8DataView::getInt32Callback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DataViewPrivate* privData = V8DOM::toClassPtr<V8DataViewPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsBoolean()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - bool localLittleEndian = args[1]->ToBoolean()->BooleanValue(); - - long retVal = privData->nativeObj->getInt32(localByteOffset, localLittleEndian); - - return v8::Number::New(retVal); - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - - long retVal = privData->nativeObj->getInt32(localByteOffset); - - return v8::Number::New(retVal); - } - throw V8Exception("Parameter mismatch while calling getInt32"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8DataView::getUint32Callback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DataViewPrivate* privData = V8DOM::toClassPtr<V8DataViewPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsBoolean()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - bool localLittleEndian = args[1]->ToBoolean()->BooleanValue(); - - unsigned long retVal = privData->nativeObj->getUint32(localByteOffset, localLittleEndian); - - return v8::Number::New(retVal); - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - - unsigned long retVal = privData->nativeObj->getUint32(localByteOffset); - - return v8::Number::New(retVal); - } - throw V8Exception("Parameter mismatch while calling getUint32"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8DataView::getFloat32Callback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DataViewPrivate* privData = V8DOM::toClassPtr<V8DataViewPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsBoolean()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - bool localLittleEndian = args[1]->ToBoolean()->BooleanValue(); - - float retVal = privData->nativeObj->getFloat32(localByteOffset, localLittleEndian); - - return v8::Number::New(retVal); - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - - float retVal = privData->nativeObj->getFloat32(localByteOffset); - - return v8::Number::New(retVal); - } - throw V8Exception("Parameter mismatch while calling getFloat32"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8DataView::getFloat64Callback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DataViewPrivate* privData = V8DOM::toClassPtr<V8DataViewPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsBoolean()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - bool localLittleEndian = args[1]->ToBoolean()->BooleanValue(); - - double retVal = privData->nativeObj->getFloat64(localByteOffset, localLittleEndian); - - return v8::Number::New(retVal); - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - - double retVal = privData->nativeObj->getFloat64(localByteOffset); - - return v8::Number::New(retVal); - } - throw V8Exception("Parameter mismatch while calling getFloat64"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8DataView::setInt8Callback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DataViewPrivate* privData = V8DOM::toClassPtr<V8DataViewPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsInt32()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - char localValue = args[1]->ToNumber()->Int32Value(); - - privData->nativeObj->setInt8(localByteOffset, localValue); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling setInt8"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8DataView::setUint8Callback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DataViewPrivate* privData = V8DOM::toClassPtr<V8DataViewPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsUint32()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - unsigned char localValue = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->setUint8(localByteOffset, localValue); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling setUint8"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8DataView::setInt16Callback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DataViewPrivate* privData = V8DOM::toClassPtr<V8DataViewPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 3 && - args[0]->IsUint32() && - args[1]->IsInt32() && - args[2]->IsBoolean()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - short localValue = args[1]->ToNumber()->Int32Value(); - bool localLittleEndian = args[2]->ToBoolean()->BooleanValue(); - - privData->nativeObj->setInt16(localByteOffset, localValue, localLittleEndian); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsInt32()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - short localValue = args[1]->ToNumber()->Int32Value(); - - privData->nativeObj->setInt16(localByteOffset, localValue); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling setInt16"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8DataView::setUint16Callback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DataViewPrivate* privData = V8DOM::toClassPtr<V8DataViewPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 3 && - args[0]->IsUint32() && - args[1]->IsUint32() && - args[2]->IsBoolean()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - unsigned short localValue = args[1]->ToNumber()->Uint32Value(); - bool localLittleEndian = args[2]->ToBoolean()->BooleanValue(); - - privData->nativeObj->setUint16(localByteOffset, localValue, localLittleEndian); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsUint32()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - unsigned short localValue = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->setUint16(localByteOffset, localValue); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling setUint16"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8DataView::setInt32Callback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DataViewPrivate* privData = V8DOM::toClassPtr<V8DataViewPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 3 && - args[0]->IsUint32() && - args[1]->IsInt32() && - args[2]->IsBoolean()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - long localValue = args[1]->ToNumber()->Int32Value(); - bool localLittleEndian = args[2]->ToBoolean()->BooleanValue(); - - privData->nativeObj->setInt32(localByteOffset, localValue, localLittleEndian); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsInt32()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - long localValue = args[1]->ToNumber()->Int32Value(); - - privData->nativeObj->setInt32(localByteOffset, localValue); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling setInt32"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8DataView::setUint32Callback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DataViewPrivate* privData = V8DOM::toClassPtr<V8DataViewPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 3 && - args[0]->IsUint32() && - args[1]->IsUint32() && - args[2]->IsBoolean()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - unsigned long localValue = args[1]->ToNumber()->Uint32Value(); - bool localLittleEndian = args[2]->ToBoolean()->BooleanValue(); - - privData->nativeObj->setUint32(localByteOffset, localValue, localLittleEndian); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsUint32()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - unsigned long localValue = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->setUint32(localByteOffset, localValue); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling setUint32"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8DataView::setFloat32Callback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DataViewPrivate* privData = V8DOM::toClassPtr<V8DataViewPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 3 && - args[0]->IsUint32() && - args[1]->IsNumber() && - args[2]->IsBoolean()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - float localValue = args[1]->ToNumber()->Value(); - bool localLittleEndian = args[2]->ToBoolean()->BooleanValue(); - - privData->nativeObj->setFloat32(localByteOffset, localValue, localLittleEndian); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsNumber()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - float localValue = args[1]->ToNumber()->Value(); - - privData->nativeObj->setFloat32(localByteOffset, localValue); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling setFloat32"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8DataView::setFloat64Callback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DataViewPrivate* privData = V8DOM::toClassPtr<V8DataViewPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 3 && - args[0]->IsUint32() && - args[1]->IsNumber() && - args[2]->IsBoolean()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - double localValue = args[1]->ToNumber()->Value(); - bool localLittleEndian = args[2]->ToBoolean()->BooleanValue(); - - privData->nativeObj->setFloat64(localByteOffset, localValue, localLittleEndian); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsNumber()) { - unsigned long localByteOffset = args[0]->ToNumber()->Uint32Value(); - double localValue = args[1]->ToNumber()->Value(); - - privData->nativeObj->setFloat64(localByteOffset, localValue); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling setFloat64"); - return v8::Undefined(); -} -bool V8DataView::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DataView.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DataView.h deleted file mode 100644 index aa19473..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DataView.h +++ /dev/null @@ -1,133 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8DataView_h -#define V8DataView_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "V8ArrayBufferView.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8DataView { -public: - struct V8DataViewPrivate { - V8DOM* dom; - uscxml::DataView* nativeObj; - }; - - V8_DESTRUCTOR(V8DataViewPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> getInt8Callback(const v8::Arguments&); - static v8::Handle<v8::Value> getUint8Callback(const v8::Arguments&); - static v8::Handle<v8::Value> getInt16Callback(const v8::Arguments&); - static v8::Handle<v8::Value> getUint16Callback(const v8::Arguments&); - static v8::Handle<v8::Value> getInt32Callback(const v8::Arguments&); - static v8::Handle<v8::Value> getUint32Callback(const v8::Arguments&); - static v8::Handle<v8::Value> getFloat32Callback(const v8::Arguments&); - static v8::Handle<v8::Value> getFloat64Callback(const v8::Arguments&); - static v8::Handle<v8::Value> setInt8Callback(const v8::Arguments&); - static v8::Handle<v8::Value> setUint8Callback(const v8::Arguments&); - static v8::Handle<v8::Value> setInt16Callback(const v8::Arguments&); - static v8::Handle<v8::Value> setUint16Callback(const v8::Arguments&); - static v8::Handle<v8::Value> setInt32Callback(const v8::Arguments&); - static v8::Handle<v8::Value> setUint32Callback(const v8::Arguments&); - static v8::Handle<v8::Value> setFloat32Callback(const v8::Arguments&); - static v8::Handle<v8::Value> setFloat64Callback(const v8::Arguments&); - - - static v8::Handle<v8::Value> constructor(const v8::Arguments&); - static v8::Persistent<v8::FunctionTemplate> Constr; - static v8::Handle<v8::FunctionTemplate> getConstructor() { - if (Constr.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> constr = v8::FunctionTemplate::New(constructor); - Constr = v8::Persistent<v8::FunctionTemplate>::New(constr); - } - return Constr; - } - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("DataView")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - - prototype->Set(v8::String::NewSymbol("getInt8"), - v8::FunctionTemplate::New(V8DataView::getInt8Callback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("getUint8"), - v8::FunctionTemplate::New(V8DataView::getUint8Callback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("getInt16"), - v8::FunctionTemplate::New(V8DataView::getInt16Callback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("getUint16"), - v8::FunctionTemplate::New(V8DataView::getUint16Callback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("getInt32"), - v8::FunctionTemplate::New(V8DataView::getInt32Callback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("getUint32"), - v8::FunctionTemplate::New(V8DataView::getUint32Callback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("getFloat32"), - v8::FunctionTemplate::New(V8DataView::getFloat32Callback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("getFloat64"), - v8::FunctionTemplate::New(V8DataView::getFloat64Callback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("setInt8"), - v8::FunctionTemplate::New(V8DataView::setInt8Callback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("setUint8"), - v8::FunctionTemplate::New(V8DataView::setUint8Callback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("setInt16"), - v8::FunctionTemplate::New(V8DataView::setInt16Callback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("setUint16"), - v8::FunctionTemplate::New(V8DataView::setUint16Callback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("setInt32"), - v8::FunctionTemplate::New(V8DataView::setInt32Callback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("setUint32"), - v8::FunctionTemplate::New(V8DataView::setUint32Callback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("setFloat32"), - v8::FunctionTemplate::New(V8DataView::setFloat32Callback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("setFloat64"), - v8::FunctionTemplate::New(V8DataView::setFloat64Callback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - - tmpl->Inherit(V8ArrayBufferView::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8DataView_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.cpp deleted file mode 100644 index 226cd26..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.cpp +++ /dev/null @@ -1,431 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8Attr.h" -#include "V8CDATASection.h" -#include "V8Comment.h" -#include "V8DOMImplementation.h" -#include "V8Document.h" -#include "V8DocumentFragment.h" -#include "V8DocumentType.h" -#include "V8Element.h" -#include "V8EntityReference.h" -#include "V8Node.h" -#include "V8NodeList.h" -#include "V8ProcessingInstruction.h" -#include "V8Text.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8Document::Tmpl; - -v8::Handle<v8::Value> V8Document::doctypeAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - - if (!privData->nativeObj->getDoctype()) return v8::Undefined(); - Arabica::DOM::DocumentType<std::string>* arbaicaRet = new Arabica::DOM::DocumentType<std::string>(privData->nativeObj->getDoctype()); - - v8::Handle<v8::Function> arbaicaRetCtor = V8DocumentType::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> arbaicaRetObj = v8::Persistent<v8::Object>::New(arbaicaRetCtor->NewInstance()); - - struct V8DocumentType::V8DocumentTypePrivate* retPrivData = new V8DocumentType::V8DocumentTypePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arbaicaRet; - - arbaicaRetObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - arbaicaRetObj.MakeWeak(0, V8DocumentType::jsDestructor); - return arbaicaRetObj; - -} - -v8::Handle<v8::Value> V8Document::implementationAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - - if (!privData->nativeObj->getImplementation()) return v8::Undefined(); - Arabica::DOM::DOMImplementation<std::string>* arbaicaRet = new Arabica::DOM::DOMImplementation<std::string>(privData->nativeObj->getImplementation()); - - v8::Handle<v8::Function> arbaicaRetCtor = V8DOMImplementation::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> arbaicaRetObj = v8::Persistent<v8::Object>::New(arbaicaRetCtor->NewInstance()); - - struct V8DOMImplementation::V8DOMImplementationPrivate* retPrivData = new V8DOMImplementation::V8DOMImplementationPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arbaicaRet; - - arbaicaRetObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - arbaicaRetObj.MakeWeak(0, V8DOMImplementation::jsDestructor); - return arbaicaRetObj; - -} - -v8::Handle<v8::Value> V8Document::documentElementAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - - if (!privData->nativeObj->getDocumentElement()) return v8::Undefined(); - Arabica::DOM::Element<std::string>* arbaicaRet = new Arabica::DOM::Element<std::string>(privData->nativeObj->getDocumentElement()); - - v8::Handle<v8::Function> arbaicaRetCtor = V8Element::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> arbaicaRetObj = v8::Persistent<v8::Object>::New(arbaicaRetCtor->NewInstance()); - - struct V8Element::V8ElementPrivate* retPrivData = new V8Element::V8ElementPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arbaicaRet; - - arbaicaRetObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - arbaicaRetObj.MakeWeak(0, V8Element::jsDestructor); - return arbaicaRetObj; - -} - -v8::Handle<v8::Value> V8Document::createElementCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localTagName(args[0]); - - Arabica::DOM::Element<std::string>* retVal = new Arabica::DOM::Element<std::string>(privData->nativeObj->createElement(*localTagName)); - v8::Handle<v8::Function> retCtor = V8Element::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Element::V8ElementPrivate* retPrivData = new V8Element::V8ElementPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Element::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling createElement"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Document::createDocumentFragmentCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 0) { - - Arabica::DOM::DocumentFragment<std::string>* retVal = new Arabica::DOM::DocumentFragment<std::string>(privData->nativeObj->createDocumentFragment()); - v8::Handle<v8::Function> retCtor = V8DocumentFragment::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8DocumentFragment::V8DocumentFragmentPrivate* retPrivData = new V8DocumentFragment::V8DocumentFragmentPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8DocumentFragment::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling createDocumentFragment"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Document::createTextNodeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localData(args[0]); - - Arabica::DOM::Text<std::string>* retVal = new Arabica::DOM::Text<std::string>(privData->nativeObj->createTextNode(*localData)); - v8::Handle<v8::Function> retCtor = V8Text::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Text::V8TextPrivate* retPrivData = new V8Text::V8TextPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Text::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling createTextNode"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Document::createCommentCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localData(args[0]); - - Arabica::DOM::Comment<std::string>* retVal = new Arabica::DOM::Comment<std::string>(privData->nativeObj->createComment(*localData)); - v8::Handle<v8::Function> retCtor = V8Comment::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Comment::V8CommentPrivate* retPrivData = new V8Comment::V8CommentPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Comment::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling createComment"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Document::createCDATASectionCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localData(args[0]); - - Arabica::DOM::CDATASection<std::string>* retVal = new Arabica::DOM::CDATASection<std::string>(privData->nativeObj->createCDATASection(*localData)); - v8::Handle<v8::Function> retCtor = V8CDATASection::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8CDATASection::V8CDATASectionPrivate* retPrivData = new V8CDATASection::V8CDATASectionPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8CDATASection::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling createCDATASection"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Document::createProcessingInstructionCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localTarget(args[0]); - v8::String::AsciiValue localData(args[1]); - - Arabica::DOM::ProcessingInstruction<std::string>* retVal = new Arabica::DOM::ProcessingInstruction<std::string>(privData->nativeObj->createProcessingInstruction(*localTarget, *localData)); - v8::Handle<v8::Function> retCtor = V8ProcessingInstruction::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8ProcessingInstruction::V8ProcessingInstructionPrivate* retPrivData = new V8ProcessingInstruction::V8ProcessingInstructionPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8ProcessingInstruction::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling createProcessingInstruction"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Document::createAttributeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localName(args[0]); - - Arabica::DOM::Attr<std::string>* retVal = new Arabica::DOM::Attr<std::string>(privData->nativeObj->createAttribute(*localName)); - v8::Handle<v8::Function> retCtor = V8Attr::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Attr::V8AttrPrivate* retPrivData = new V8Attr::V8AttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Attr::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling createAttribute"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Document::createEntityReferenceCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localName(args[0]); - - Arabica::DOM::EntityReference<std::string>* retVal = new Arabica::DOM::EntityReference<std::string>(privData->nativeObj->createEntityReference(*localName)); - v8::Handle<v8::Function> retCtor = V8EntityReference::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8EntityReference::V8EntityReferencePrivate* retPrivData = new V8EntityReference::V8EntityReferencePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8EntityReference::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling createEntityReference"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Document::getElementsByTagNameCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localTagname(args[0]); - - Arabica::DOM::NodeList<std::string>* retVal = new Arabica::DOM::NodeList<std::string>(privData->nativeObj->getElementsByTagName(*localTagname)); - v8::Handle<v8::Function> retCtor = V8NodeList::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8NodeList::V8NodeListPrivate* retPrivData = new V8NodeList::V8NodeListPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8NodeList::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling getElementsByTagName"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Document::importNodeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsObject() && V8Node::hasInstance(args[0]) && - args[1]->IsBoolean()) { - Arabica::DOM::Node<std::string>* localImportedNode = V8DOM::toClassPtr<V8Node::V8NodePrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - bool localDeep = args[1]->ToBoolean()->BooleanValue(); - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->importNode(*localImportedNode, localDeep)); - v8::Handle<v8::Function> retCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Node::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling importNode"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Document::getElementsByTagNameNSCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localNamespaceURI(args[0]); - v8::String::AsciiValue localLocalName(args[1]); - - Arabica::DOM::NodeList<std::string>* retVal = new Arabica::DOM::NodeList<std::string>(privData->nativeObj->getElementsByTagNameNS(*localNamespaceURI, *localLocalName)); - v8::Handle<v8::Function> retCtor = V8NodeList::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8NodeList::V8NodeListPrivate* retPrivData = new V8NodeList::V8NodeListPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8NodeList::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling getElementsByTagNameNS"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Document::getElementByIdCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localElementId(args[0]); - - Arabica::DOM::Element<std::string>* retVal = new Arabica::DOM::Element<std::string>(privData->nativeObj->getElementById(*localElementId)); - v8::Handle<v8::Function> retCtor = V8Element::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Element::V8ElementPrivate* retPrivData = new V8Element::V8ElementPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Element::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling getElementById"); - return v8::Undefined(); -} -bool V8Document::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.h deleted file mode 100644 index 373d18a..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Document.h +++ /dev/null @@ -1,131 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8Document_h -#define V8Document_h - -#include <string> -#include "DOM/Node.hpp" -#include "V8Node.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8Document { -public: - struct V8DocumentPrivate { - V8DOM* dom; - Arabica::DOM::Document<std::string>* nativeObj; - }; - - V8_DESTRUCTOR(V8DocumentPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> createElementCallback(const v8::Arguments&); - static v8::Handle<v8::Value> createDocumentFragmentCallback(const v8::Arguments&); - static v8::Handle<v8::Value> createTextNodeCallback(const v8::Arguments&); - static v8::Handle<v8::Value> createCommentCallback(const v8::Arguments&); - static v8::Handle<v8::Value> createCDATASectionCallback(const v8::Arguments&); - static v8::Handle<v8::Value> createProcessingInstructionCallback(const v8::Arguments&); - static v8::Handle<v8::Value> createAttributeCallback(const v8::Arguments&); - static v8::Handle<v8::Value> createEntityReferenceCallback(const v8::Arguments&); - static v8::Handle<v8::Value> getElementsByTagNameCallback(const v8::Arguments&); - static v8::Handle<v8::Value> importNodeCallback(const v8::Arguments&); - static v8::Handle<v8::Value> createElementNSCustomCallback(const v8::Arguments&); - static v8::Handle<v8::Value> createAttributeNSCustomCallback(const v8::Arguments&); - static v8::Handle<v8::Value> getElementsByTagNameNSCallback(const v8::Arguments&); - static v8::Handle<v8::Value> getElementByIdCallback(const v8::Arguments&); - static v8::Handle<v8::Value> evaluateCustomCallback(const v8::Arguments&); - - static v8::Handle<v8::Value> doctypeAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> implementationAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> documentElementAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> localStorageCustomAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("Document")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("doctype"), V8Document::doctypeAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("implementation"), V8Document::implementationAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("documentElement"), V8Document::documentElementAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("localStorage"), V8Document::localStorageCustomAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - prototype->Set(v8::String::NewSymbol("createElement"), - v8::FunctionTemplate::New(V8Document::createElementCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("createDocumentFragment"), - v8::FunctionTemplate::New(V8Document::createDocumentFragmentCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("createTextNode"), - v8::FunctionTemplate::New(V8Document::createTextNodeCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("createComment"), - v8::FunctionTemplate::New(V8Document::createCommentCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("createCDATASection"), - v8::FunctionTemplate::New(V8Document::createCDATASectionCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("createProcessingInstruction"), - v8::FunctionTemplate::New(V8Document::createProcessingInstructionCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("createAttribute"), - v8::FunctionTemplate::New(V8Document::createAttributeCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("createEntityReference"), - v8::FunctionTemplate::New(V8Document::createEntityReferenceCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("getElementsByTagName"), - v8::FunctionTemplate::New(V8Document::getElementsByTagNameCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("importNode"), - v8::FunctionTemplate::New(V8Document::importNodeCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("createElementNS"), - v8::FunctionTemplate::New(V8Document::createElementNSCustomCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("createAttributeNS"), - v8::FunctionTemplate::New(V8Document::createAttributeNSCustomCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("getElementsByTagNameNS"), - v8::FunctionTemplate::New(V8Document::getElementsByTagNameNSCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("getElementById"), - v8::FunctionTemplate::New(V8Document::getElementByIdCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("evaluate"), - v8::FunctionTemplate::New(V8Document::evaluateCustomCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - - tmpl->Inherit(V8Node::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8Document_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentCustom.cpp deleted file mode 100644 index f9882f0..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentCustom.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8Document.h" -#include "V8XPathResult.h" -#include "V8Storage.h" -#include "V8Attr.h" -#include "V8Element.h" - -namespace Arabica { -namespace DOM { - -v8::Handle<v8::Value> V8Document::localStorageCustomAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - - v8::Handle<v8::Function> retCtor = V8Storage::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - V8Storage::V8StoragePrivate* retPrivData = new V8Storage::V8StoragePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = privData->dom->storage; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8XPathResult::jsDestructor); - return retObj; - -} - - -v8::Handle<v8::Value> V8Document::evaluateCustomCallback(const v8::Arguments& args) { - if (args.Length() < 1) - throw V8Exception("Wrong number of arguments in evaluate"); -// if (!((V8Node::hasInstance(args[1])) && (V8XPathResult::hasInstance(args[3])))) -// throw V8Exception("Parameter mismatch while calling evaluate"); - - v8::Local<v8::Object> self = args.Holder(); - V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - - v8::String::AsciiValue localExpression(args[0]); - - XPath::XPathValue<std::string>* retVal; - try { - if (args.Length() > 1) { - V8Node::V8NodePrivate* otherNodePrivate = V8DOM::toClassPtr<V8Node::V8NodePrivate>(args[1]->ToObject()->GetInternalField(0)); - Arabica::DOM::Node<std::string>* localContextNode = otherNodePrivate->nativeObj; - retVal = new XPath::XPathValue<std::string>(privData->dom->xpath->evaluate(*localExpression, *localContextNode)); - } else { - retVal = new XPath::XPathValue<std::string>(privData->dom->xpath->evaluate(*localExpression, *privData->nativeObj)); - } - } catch (std::runtime_error e) { - std::cout << e.what() << std::endl; - return v8::Undefined(); - } - - v8::Handle<v8::Function> retCtor = V8XPathResult::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - V8XPathResult::V8XPathResultPrivate* retPrivData = new V8XPathResult::V8XPathResultPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8XPathResult::jsDestructor); - return retObj; - -} - -v8::Handle<v8::Value> V8Document::createElementNSCustomCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localNamespaceURI(args[0]); - v8::String::AsciiValue localQualifiedName(args[1]); - - Arabica::DOM::Element<std::string>* retVal = new Arabica::DOM::Element<std::string>(privData->nativeObj->createElementNS(*localNamespaceURI, *localQualifiedName)); - if (privData->dom->nsInfo->nsToPrefix.find(*localNamespaceURI) != privData->dom->nsInfo->nsToPrefix.end()) - retVal->setPrefix(privData->dom->nsInfo->nsToPrefix[*localNamespaceURI]); - - v8::Handle<v8::Function> retCtor = V8Element::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Element::V8ElementPrivate* retPrivData = new V8Element::V8ElementPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Element::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling createElementNS"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Document::createAttributeNSCustomCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8DocumentPrivate* privData = V8DOM::toClassPtr<V8DocumentPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localNamespaceURI(args[0]); - v8::String::AsciiValue localQualifiedName(args[1]); - - Arabica::DOM::Attr<std::string>* retVal = new Arabica::DOM::Attr<std::string>(privData->nativeObj->createAttributeNS(*localNamespaceURI, *localQualifiedName)); - if (privData->dom->nsInfo->nsToPrefix.find(*localNamespaceURI) != privData->dom->nsInfo->nsToPrefix.end()) - retVal->setPrefix(privData->dom->nsInfo->nsToPrefix[*localNamespaceURI]); - - v8::Handle<v8::Function> retCtor = V8Attr::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Attr::V8AttrPrivate* retPrivData = new V8Attr::V8AttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Attr::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling createAttributeNS"); - return v8::Undefined(); -} - -} -}
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentFragment.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentFragment.cpp deleted file mode 100644 index 359f6e5..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentFragment.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8DocumentFragment.h" -#include "V8Node.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8DocumentFragment::Tmpl; -bool V8DocumentFragment::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentFragment.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentFragment.h deleted file mode 100644 index 89d19d3..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentFragment.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8DocumentFragment_h -#define V8DocumentFragment_h - -#include <string> -#include "DOM/Node.hpp" -#include "V8Node.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8DocumentFragment { -public: - struct V8DocumentFragmentPrivate { - V8DOM* dom; - Arabica::DOM::DocumentFragment<std::string>* nativeObj; - }; - - V8_DESTRUCTOR(V8DocumentFragmentPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("DocumentFragment")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - - - - tmpl->Inherit(V8Node::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8DocumentFragment_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentType.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentType.cpp deleted file mode 100644 index a8839a4..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentType.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8DocumentType.h" -#include "V8NamedNodeMap.h" -#include "V8Node.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8DocumentType::Tmpl; - -v8::Handle<v8::Value> V8DocumentType::nameAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8DocumentTypePrivate* privData = V8DOM::toClassPtr<V8DocumentTypePrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getName().c_str()); -} - -v8::Handle<v8::Value> V8DocumentType::entitiesAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8DocumentTypePrivate* privData = V8DOM::toClassPtr<V8DocumentTypePrivate >(self->GetInternalField(0)); - - - Arabica::DOM::NamedNodeMap<std::string>* arbaicaRet = new Arabica::DOM::NamedNodeMap<std::string>(privData->nativeObj->getEntities()); - - v8::Handle<v8::Function> arbaicaRetCtor = V8NamedNodeMap::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> arbaicaRetObj = v8::Persistent<v8::Object>::New(arbaicaRetCtor->NewInstance()); - - struct V8NamedNodeMap::V8NamedNodeMapPrivate* retPrivData = new V8NamedNodeMap::V8NamedNodeMapPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arbaicaRet; - - arbaicaRetObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - arbaicaRetObj.MakeWeak(0, V8NamedNodeMap::jsDestructor); - return arbaicaRetObj; - -} - -v8::Handle<v8::Value> V8DocumentType::notationsAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8DocumentTypePrivate* privData = V8DOM::toClassPtr<V8DocumentTypePrivate >(self->GetInternalField(0)); - - - Arabica::DOM::NamedNodeMap<std::string>* arbaicaRet = new Arabica::DOM::NamedNodeMap<std::string>(privData->nativeObj->getNotations()); - - v8::Handle<v8::Function> arbaicaRetCtor = V8NamedNodeMap::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> arbaicaRetObj = v8::Persistent<v8::Object>::New(arbaicaRetCtor->NewInstance()); - - struct V8NamedNodeMap::V8NamedNodeMapPrivate* retPrivData = new V8NamedNodeMap::V8NamedNodeMapPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arbaicaRet; - - arbaicaRetObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - arbaicaRetObj.MakeWeak(0, V8NamedNodeMap::jsDestructor); - return arbaicaRetObj; - -} - -v8::Handle<v8::Value> V8DocumentType::publicIdAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8DocumentTypePrivate* privData = V8DOM::toClassPtr<V8DocumentTypePrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getPublicId().c_str()); -} - -v8::Handle<v8::Value> V8DocumentType::systemIdAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8DocumentTypePrivate* privData = V8DOM::toClassPtr<V8DocumentTypePrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getSystemId().c_str()); -} - -v8::Handle<v8::Value> V8DocumentType::internalSubsetAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8DocumentTypePrivate* privData = V8DOM::toClassPtr<V8DocumentTypePrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getInternalSubset().c_str()); -} -bool V8DocumentType::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentType.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentType.h deleted file mode 100644 index 9aec676..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8DocumentType.h +++ /dev/null @@ -1,92 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8DocumentType_h -#define V8DocumentType_h - -#include <string> -#include "DOM/Node.hpp" -#include "V8Node.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8DocumentType { -public: - struct V8DocumentTypePrivate { - V8DOM* dom; - Arabica::DOM::DocumentType<std::string>* nativeObj; - }; - - V8_DESTRUCTOR(V8DocumentTypePrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - - static v8::Handle<v8::Value> nameAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> entitiesAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> notationsAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> publicIdAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> systemIdAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> internalSubsetAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("DocumentType")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("name"), V8DocumentType::nameAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("entities"), V8DocumentType::entitiesAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("notations"), V8DocumentType::notationsAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("publicId"), V8DocumentType::publicIdAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("systemId"), V8DocumentType::systemIdAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("internalSubset"), V8DocumentType::internalSubsetAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - - - tmpl->Inherit(V8Node::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8DocumentType_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Element.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Element.cpp deleted file mode 100644 index 15d4c94..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Element.cpp +++ /dev/null @@ -1,382 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8Attr.h" -#include "V8Element.h" -#include "V8Node.h" -#include "V8NodeList.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8Element::Tmpl; - -v8::Handle<v8::Value> V8Element::tagNameAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getTagName().c_str()); -} - -v8::Handle<v8::Value> V8Element::getAttributeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localName(args[0]); - - std::string retVal = privData->nativeObj->getAttribute(*localName); - - return v8::String::New(retVal.c_str()); - } - throw V8Exception("Parameter mismatch while calling getAttribute"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::setAttributeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localName(args[0]); - v8::String::AsciiValue localValue(args[1]); - - privData->nativeObj->setAttribute(*localName, *localValue); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling setAttribute"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::removeAttributeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localName(args[0]); - - privData->nativeObj->removeAttribute(*localName); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling removeAttribute"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::getAttributeNodeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localName(args[0]); - - Arabica::DOM::Attr<std::string>* retVal = new Arabica::DOM::Attr<std::string>(privData->nativeObj->getAttributeNode(*localName)); - v8::Handle<v8::Function> retCtor = V8Attr::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Attr::V8AttrPrivate* retPrivData = new V8Attr::V8AttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Attr::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling getAttributeNode"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::setAttributeNodeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Attr::hasInstance(args[0])) { - Arabica::DOM::Attr<std::string>* localNewAttr = V8DOM::toClassPtr<V8Attr::V8AttrPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - - Arabica::DOM::Attr<std::string>* retVal = new Arabica::DOM::Attr<std::string>(privData->nativeObj->setAttributeNode(*localNewAttr)); - v8::Handle<v8::Function> retCtor = V8Attr::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Attr::V8AttrPrivate* retPrivData = new V8Attr::V8AttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Attr::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling setAttributeNode"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::removeAttributeNodeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Attr::hasInstance(args[0])) { - Arabica::DOM::Attr<std::string>* localOldAttr = V8DOM::toClassPtr<V8Attr::V8AttrPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - - Arabica::DOM::Attr<std::string>* retVal = new Arabica::DOM::Attr<std::string>(privData->nativeObj->removeAttributeNode(*localOldAttr)); - v8::Handle<v8::Function> retCtor = V8Attr::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Attr::V8AttrPrivate* retPrivData = new V8Attr::V8AttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Attr::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling removeAttributeNode"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::getElementsByTagNameCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localName(args[0]); - - Arabica::DOM::NodeList<std::string>* retVal = new Arabica::DOM::NodeList<std::string>(privData->nativeObj->getElementsByTagName(*localName)); - v8::Handle<v8::Function> retCtor = V8NodeList::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8NodeList::V8NodeListPrivate* retPrivData = new V8NodeList::V8NodeListPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8NodeList::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling getElementsByTagName"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::getAttributeNSCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localNamespaceURI(args[0]); - v8::String::AsciiValue localLocalName(args[1]); - - std::string retVal = privData->nativeObj->getAttributeNS(*localNamespaceURI, *localLocalName); - - return v8::String::New(retVal.c_str()); - } - throw V8Exception("Parameter mismatch while calling getAttributeNS"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::setAttributeNSCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 3 && - args[0]->IsString() && - args[1]->IsString() && - args[2]->IsString()) { - v8::String::AsciiValue localNamespaceURI(args[0]); - v8::String::AsciiValue localQualifiedName(args[1]); - v8::String::AsciiValue localValue(args[2]); - - privData->nativeObj->setAttributeNS(*localNamespaceURI, *localQualifiedName, *localValue); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling setAttributeNS"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::removeAttributeNSCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localNamespaceURI(args[0]); - v8::String::AsciiValue localLocalName(args[1]); - - privData->nativeObj->removeAttributeNS(*localNamespaceURI, *localLocalName); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling removeAttributeNS"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::getAttributeNodeNSCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localNamespaceURI(args[0]); - v8::String::AsciiValue localLocalName(args[1]); - - Arabica::DOM::Attr<std::string>* retVal = new Arabica::DOM::Attr<std::string>(privData->nativeObj->getAttributeNodeNS(*localNamespaceURI, *localLocalName)); - v8::Handle<v8::Function> retCtor = V8Attr::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Attr::V8AttrPrivate* retPrivData = new V8Attr::V8AttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Attr::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling getAttributeNodeNS"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::setAttributeNodeNSCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Attr::hasInstance(args[0])) { - Arabica::DOM::Attr<std::string>* localNewAttr = V8DOM::toClassPtr<V8Attr::V8AttrPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - - Arabica::DOM::Attr<std::string>* retVal = new Arabica::DOM::Attr<std::string>(privData->nativeObj->setAttributeNodeNS(*localNewAttr)); - v8::Handle<v8::Function> retCtor = V8Attr::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Attr::V8AttrPrivate* retPrivData = new V8Attr::V8AttrPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Attr::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling setAttributeNodeNS"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::getElementsByTagNameNSCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localNamespaceURI(args[0]); - v8::String::AsciiValue localLocalName(args[1]); - - Arabica::DOM::NodeList<std::string>* retVal = new Arabica::DOM::NodeList<std::string>(privData->nativeObj->getElementsByTagNameNS(*localNamespaceURI, *localLocalName)); - v8::Handle<v8::Function> retCtor = V8NodeList::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8NodeList::V8NodeListPrivate* retPrivData = new V8NodeList::V8NodeListPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8NodeList::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling getElementsByTagNameNS"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::hasAttributeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localName(args[0]); - - bool retVal = privData->nativeObj->hasAttribute(*localName); - - return v8::Boolean::New(retVal); - } - throw V8Exception("Parameter mismatch while calling hasAttribute"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Element::hasAttributeNSCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8ElementPrivate* privData = V8DOM::toClassPtr<V8ElementPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localNamespaceURI(args[0]); - v8::String::AsciiValue localLocalName(args[1]); - - bool retVal = privData->nativeObj->hasAttributeNS(*localNamespaceURI, *localLocalName); - - return v8::Boolean::New(retVal); - } - throw V8Exception("Parameter mismatch while calling hasAttributeNS"); - return v8::Undefined(); -} -bool V8Element::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Element.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Element.h deleted file mode 100644 index ec87070..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Element.h +++ /dev/null @@ -1,122 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8Element_h -#define V8Element_h - -#include <string> -#include "DOM/Node.hpp" -#include "V8Node.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8Element { -public: - struct V8ElementPrivate { - V8DOM* dom; - Arabica::DOM::Element<std::string>* nativeObj; - }; - - V8_DESTRUCTOR(V8ElementPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> getAttributeCallback(const v8::Arguments&); - static v8::Handle<v8::Value> setAttributeCallback(const v8::Arguments&); - static v8::Handle<v8::Value> removeAttributeCallback(const v8::Arguments&); - static v8::Handle<v8::Value> getAttributeNodeCallback(const v8::Arguments&); - static v8::Handle<v8::Value> setAttributeNodeCallback(const v8::Arguments&); - static v8::Handle<v8::Value> removeAttributeNodeCallback(const v8::Arguments&); - static v8::Handle<v8::Value> getElementsByTagNameCallback(const v8::Arguments&); - static v8::Handle<v8::Value> getAttributeNSCallback(const v8::Arguments&); - static v8::Handle<v8::Value> setAttributeNSCallback(const v8::Arguments&); - static v8::Handle<v8::Value> removeAttributeNSCallback(const v8::Arguments&); - static v8::Handle<v8::Value> getAttributeNodeNSCallback(const v8::Arguments&); - static v8::Handle<v8::Value> setAttributeNodeNSCallback(const v8::Arguments&); - static v8::Handle<v8::Value> getElementsByTagNameNSCallback(const v8::Arguments&); - static v8::Handle<v8::Value> hasAttributeCallback(const v8::Arguments&); - static v8::Handle<v8::Value> hasAttributeNSCallback(const v8::Arguments&); - - static v8::Handle<v8::Value> tagNameAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("Element")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("tagName"), V8Element::tagNameAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - prototype->Set(v8::String::NewSymbol("getAttribute"), - v8::FunctionTemplate::New(V8Element::getAttributeCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("setAttribute"), - v8::FunctionTemplate::New(V8Element::setAttributeCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("removeAttribute"), - v8::FunctionTemplate::New(V8Element::removeAttributeCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("getAttributeNode"), - v8::FunctionTemplate::New(V8Element::getAttributeNodeCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("setAttributeNode"), - v8::FunctionTemplate::New(V8Element::setAttributeNodeCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("removeAttributeNode"), - v8::FunctionTemplate::New(V8Element::removeAttributeNodeCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("getElementsByTagName"), - v8::FunctionTemplate::New(V8Element::getElementsByTagNameCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("getAttributeNS"), - v8::FunctionTemplate::New(V8Element::getAttributeNSCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("setAttributeNS"), - v8::FunctionTemplate::New(V8Element::setAttributeNSCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("removeAttributeNS"), - v8::FunctionTemplate::New(V8Element::removeAttributeNSCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("getAttributeNodeNS"), - v8::FunctionTemplate::New(V8Element::getAttributeNodeNSCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("setAttributeNodeNS"), - v8::FunctionTemplate::New(V8Element::setAttributeNodeNSCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("getElementsByTagNameNS"), - v8::FunctionTemplate::New(V8Element::getElementsByTagNameNSCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("hasAttribute"), - v8::FunctionTemplate::New(V8Element::hasAttributeCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("hasAttributeNS"), - v8::FunctionTemplate::New(V8Element::hasAttributeNSCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - - tmpl->Inherit(V8Node::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8Element_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Entity.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Entity.cpp deleted file mode 100644 index e26bdb6..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Entity.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8Entity.h" -#include "V8Node.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8Entity::Tmpl; - -v8::Handle<v8::Value> V8Entity::publicIdAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8EntityPrivate* privData = V8DOM::toClassPtr<V8EntityPrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getPublicId().c_str()); -} - -v8::Handle<v8::Value> V8Entity::systemIdAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8EntityPrivate* privData = V8DOM::toClassPtr<V8EntityPrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getSystemId().c_str()); -} - -v8::Handle<v8::Value> V8Entity::notationNameAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8EntityPrivate* privData = V8DOM::toClassPtr<V8EntityPrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getNotationName().c_str()); -} -bool V8Entity::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Entity.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Entity.h deleted file mode 100644 index f6947b0..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Entity.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8Entity_h -#define V8Entity_h - -#include <string> -#include "DOM/Node.hpp" -#include "V8Node.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8Entity { -public: - struct V8EntityPrivate { - V8DOM* dom; - Arabica::DOM::Entity<std::string>* nativeObj; - }; - - V8_DESTRUCTOR(V8EntityPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - - static v8::Handle<v8::Value> publicIdAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> systemIdAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> notationNameAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("Entity")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("publicId"), V8Entity::publicIdAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("systemId"), V8Entity::systemIdAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("notationName"), V8Entity::notationNameAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - - - tmpl->Inherit(V8Node::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8Entity_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8EntityReference.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8EntityReference.cpp deleted file mode 100644 index eb12655..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8EntityReference.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8EntityReference.h" -#include "V8Node.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8EntityReference::Tmpl; -bool V8EntityReference::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8EntityReference.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8EntityReference.h deleted file mode 100644 index 47b4430..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8EntityReference.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8EntityReference_h -#define V8EntityReference_h - -#include <string> -#include "DOM/Node.hpp" -#include "V8Node.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8EntityReference { -public: - struct V8EntityReferencePrivate { - V8DOM* dom; - Arabica::DOM::EntityReference<std::string>* nativeObj; - }; - - V8_DESTRUCTOR(V8EntityReferencePrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("EntityReference")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - - - - tmpl->Inherit(V8Node::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8EntityReference_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float32Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float32Array.cpp deleted file mode 100644 index e49c2dc..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float32Array.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8ArrayBuffer.h" -#include "V8ArrayBufferView.h" -#include "V8Float32Array.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8Float32Array::Tmpl; -v8::Persistent<v8::FunctionTemplate> V8Float32Array::Constr; - -v8::Handle<v8::Value> V8Float32Array::constructor(const v8::Arguments& args) { - if (!args.IsConstructCall()) - return v8::ThrowException(v8::String::New("Cannot call constructor as function")); - - uscxml::Float32Array* localInstance = NULL; - if (false) { - } else if (args.Length() == 3 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0]) && - args[1]->IsUint32() && - args[2]->IsUint32()) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localByteOffset = args[1]->ToNumber()->Uint32Value(); - unsigned long localLength = args[2]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Float32Array(localBuffer, localByteOffset, localLength); - - } else if (args.Length() == 2 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0]) && - args[1]->IsUint32()) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localByteOffset = args[1]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Float32Array(localBuffer, localByteOffset); - - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Float32Array::hasInstance(args[0])) { - - uscxml::Float32Array* localArray = V8DOM::toClassPtr<V8Float32Array::V8Float32ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - localInstance = new uscxml::Float32Array(localArray); - - } else if (args.Length() == 1 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0])) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - localInstance = new uscxml::Float32Array(localBuffer); - - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - - unsigned long localLength = args[0]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Float32Array(localLength); - - } else if (args.Length() == 1 && - args[0]->IsArray()) { - - std::vector<float> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToNumber()->Value()); - } - localInstance = new uscxml::Float32Array(localArray); - - } - if (!localInstance) { - throw V8Exception("Parameter mismatch while calling constructor for Float32Array"); - return v8::Undefined(); - } - - v8::Handle<v8::Function> retCtor = V8Float32Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Float32Array::V8Float32ArrayPrivate* retPrivData = new V8Float32Array::V8Float32ArrayPrivate(); - retPrivData->nativeObj = localInstance; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Float32Array::jsDestructor); - return retObj; -} - -v8::Handle<v8::Value> V8Float32Array::lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8Float32ArrayPrivate* privData = V8DOM::toClassPtr<V8Float32ArrayPrivate >(self->GetInternalField(0)); - - return v8::Integer::New(privData->nativeObj->getLength()); -} - -v8::Handle<v8::Value> V8Float32Array::getCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Float32ArrayPrivate* privData = V8DOM::toClassPtr<V8Float32ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - - float retVal = privData->nativeObj->get(localIndex); - - return v8::Number::New(retVal); - } - throw V8Exception("Parameter mismatch while calling get"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Float32Array::setCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Float32ArrayPrivate* privData = V8DOM::toClassPtr<V8Float32ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsObject() && V8Float32Array::hasInstance(args[0]) && - args[1]->IsUint32()) { - uscxml::Float32Array* localArray = V8DOM::toClassPtr<V8Float32Array::V8Float32ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localOffset = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localArray, localOffset); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsNumber()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - float localValue = args[1]->ToNumber()->Value(); - - privData->nativeObj->set(localIndex, localValue); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsArray() && - args[1]->IsUint32()) { - std::vector<float> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToNumber()->Value()); - } - unsigned long localOffset = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localArray, localOffset); - - return v8::Undefined(); - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Float32Array::hasInstance(args[0])) { - uscxml::Float32Array* localArray = V8DOM::toClassPtr<V8Float32Array::V8Float32ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - - privData->nativeObj->set(localArray); - - return v8::Undefined(); - } else if (args.Length() == 1 && - args[0]->IsArray()) { - std::vector<float> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToNumber()->Value()); - } - - privData->nativeObj->set(localArray); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling set"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Float32Array::subarrayCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Float32ArrayPrivate* privData = V8DOM::toClassPtr<V8Float32ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsInt32() && - args[1]->IsInt32()) { - long localStart = args[0]->ToNumber()->Int32Value(); - long localEnd = args[1]->ToNumber()->Int32Value(); - - uscxml::Float32Array* retVal = new uscxml::Float32Array(privData->nativeObj->subarray(localStart, localEnd)); - v8::Handle<v8::Function> retCtor = V8Float32Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Float32Array::V8Float32ArrayPrivate* retPrivData = new V8Float32Array::V8Float32ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Float32Array::jsDestructor); - return retObj; - - } else if (args.Length() == 1 && - args[0]->IsInt32()) { - long localStart = args[0]->ToNumber()->Int32Value(); - - uscxml::Float32Array* retVal = new uscxml::Float32Array(privData->nativeObj->subarray(localStart)); - v8::Handle<v8::Function> retCtor = V8Float32Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Float32Array::V8Float32ArrayPrivate* retPrivData = new V8Float32Array::V8Float32ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Float32Array::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling subarray"); - return v8::Undefined(); -} -bool V8Float32Array::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float32Array.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float32Array.h deleted file mode 100644 index 6684b58..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float32Array.h +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8Float32Array_h -#define V8Float32Array_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "V8ArrayBufferView.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8Float32Array { -public: - struct V8Float32ArrayPrivate { - V8DOM* dom; - uscxml::Float32Array* nativeObj; - }; - - V8_DESTRUCTOR(V8Float32ArrayPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> getCallback(const v8::Arguments&); - static v8::Handle<v8::Value> setCallback(const v8::Arguments&); - static v8::Handle<v8::Value> subarrayCallback(const v8::Arguments&); - - static v8::Handle<v8::Value> lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> indexedPropertyCustomGetter(uint32_t, const v8::AccessorInfo&); - static v8::Handle<v8::Value> indexedPropertyCustomSetter(uint32_t, v8::Local<v8::Value>, const v8::AccessorInfo&); - - static v8::Handle<v8::Value> constructor(const v8::Arguments&); - static v8::Persistent<v8::FunctionTemplate> Constr; - static v8::Handle<v8::FunctionTemplate> getConstructor() { - if (Constr.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> constr = v8::FunctionTemplate::New(constructor); - Constr = v8::Persistent<v8::FunctionTemplate>::New(constr); - } - return Constr; - } - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("Float32Array")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("length"), V8Float32Array::lengthAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - instance->SetIndexedPropertyHandler(V8Float32Array::indexedPropertyCustomGetter, V8Float32Array::indexedPropertyCustomSetter); - prototype->Set(v8::String::NewSymbol("get"), - v8::FunctionTemplate::New(V8Float32Array::getCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("set"), - v8::FunctionTemplate::New(V8Float32Array::setCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("subarray"), - v8::FunctionTemplate::New(V8Float32Array::subarrayCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - tmpl->Set(v8::String::NewSymbol("BYTES_PER_ELEMENT"), v8::Integer::New(4), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("BYTES_PER_ELEMENT"), v8::Integer::New(4), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - - tmpl->Inherit(V8ArrayBufferView::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8Float32Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float64Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float64Array.cpp deleted file mode 100644 index 3b844b5..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float64Array.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8ArrayBuffer.h" -#include "V8ArrayBufferView.h" -#include "V8Float64Array.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8Float64Array::Tmpl; -v8::Persistent<v8::FunctionTemplate> V8Float64Array::Constr; - -v8::Handle<v8::Value> V8Float64Array::constructor(const v8::Arguments& args) { - if (!args.IsConstructCall()) - return v8::ThrowException(v8::String::New("Cannot call constructor as function")); - - uscxml::Float64Array* localInstance = NULL; - if (false) { - } else if (args.Length() == 3 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0]) && - args[1]->IsUint32() && - args[2]->IsUint32()) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localByteOffset = args[1]->ToNumber()->Uint32Value(); - unsigned long localLength = args[2]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Float64Array(localBuffer, localByteOffset, localLength); - - } else if (args.Length() == 2 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0]) && - args[1]->IsUint32()) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localByteOffset = args[1]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Float64Array(localBuffer, localByteOffset); - - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Float64Array::hasInstance(args[0])) { - - uscxml::Float64Array* localArray = V8DOM::toClassPtr<V8Float64Array::V8Float64ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - localInstance = new uscxml::Float64Array(localArray); - - } else if (args.Length() == 1 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0])) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - localInstance = new uscxml::Float64Array(localBuffer); - - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - - unsigned long localLength = args[0]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Float64Array(localLength); - - } else if (args.Length() == 1 && - args[0]->IsArray()) { - - std::vector<double> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToNumber()->Value()); - } - localInstance = new uscxml::Float64Array(localArray); - - } - if (!localInstance) { - throw V8Exception("Parameter mismatch while calling constructor for Float64Array"); - return v8::Undefined(); - } - - v8::Handle<v8::Function> retCtor = V8Float64Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Float64Array::V8Float64ArrayPrivate* retPrivData = new V8Float64Array::V8Float64ArrayPrivate(); - retPrivData->nativeObj = localInstance; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Float64Array::jsDestructor); - return retObj; -} - -v8::Handle<v8::Value> V8Float64Array::lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8Float64ArrayPrivate* privData = V8DOM::toClassPtr<V8Float64ArrayPrivate >(self->GetInternalField(0)); - - return v8::Integer::New(privData->nativeObj->getLength()); -} - -v8::Handle<v8::Value> V8Float64Array::getCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Float64ArrayPrivate* privData = V8DOM::toClassPtr<V8Float64ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - - double retVal = privData->nativeObj->get(localIndex); - - return v8::Number::New(retVal); - } - throw V8Exception("Parameter mismatch while calling get"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Float64Array::setCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Float64ArrayPrivate* privData = V8DOM::toClassPtr<V8Float64ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsObject() && V8Float64Array::hasInstance(args[0]) && - args[1]->IsUint32()) { - uscxml::Float64Array* localArray = V8DOM::toClassPtr<V8Float64Array::V8Float64ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localOffset = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localArray, localOffset); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsNumber()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - double localValue = args[1]->ToNumber()->Value(); - - privData->nativeObj->set(localIndex, localValue); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsArray() && - args[1]->IsUint32()) { - std::vector<double> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToNumber()->Value()); - } - unsigned long localOffset = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localArray, localOffset); - - return v8::Undefined(); - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Float64Array::hasInstance(args[0])) { - uscxml::Float64Array* localArray = V8DOM::toClassPtr<V8Float64Array::V8Float64ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - - privData->nativeObj->set(localArray); - - return v8::Undefined(); - } else if (args.Length() == 1 && - args[0]->IsArray()) { - std::vector<double> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToNumber()->Value()); - } - - privData->nativeObj->set(localArray); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling set"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Float64Array::subarrayCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Float64ArrayPrivate* privData = V8DOM::toClassPtr<V8Float64ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsInt32() && - args[1]->IsInt32()) { - long localStart = args[0]->ToNumber()->Int32Value(); - long localEnd = args[1]->ToNumber()->Int32Value(); - - uscxml::Float64Array* retVal = new uscxml::Float64Array(privData->nativeObj->subarray(localStart, localEnd)); - v8::Handle<v8::Function> retCtor = V8Float64Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Float64Array::V8Float64ArrayPrivate* retPrivData = new V8Float64Array::V8Float64ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Float64Array::jsDestructor); - return retObj; - - } else if (args.Length() == 1 && - args[0]->IsInt32()) { - long localStart = args[0]->ToNumber()->Int32Value(); - - uscxml::Float64Array* retVal = new uscxml::Float64Array(privData->nativeObj->subarray(localStart)); - v8::Handle<v8::Function> retCtor = V8Float64Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Float64Array::V8Float64ArrayPrivate* retPrivData = new V8Float64Array::V8Float64ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Float64Array::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling subarray"); - return v8::Undefined(); -} -bool V8Float64Array::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float64Array.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float64Array.h deleted file mode 100644 index 0aa54a8..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Float64Array.h +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8Float64Array_h -#define V8Float64Array_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "V8ArrayBufferView.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8Float64Array { -public: - struct V8Float64ArrayPrivate { - V8DOM* dom; - uscxml::Float64Array* nativeObj; - }; - - V8_DESTRUCTOR(V8Float64ArrayPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> getCallback(const v8::Arguments&); - static v8::Handle<v8::Value> setCallback(const v8::Arguments&); - static v8::Handle<v8::Value> subarrayCallback(const v8::Arguments&); - - static v8::Handle<v8::Value> lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> indexedPropertyCustomGetter(uint32_t, const v8::AccessorInfo&); - static v8::Handle<v8::Value> indexedPropertyCustomSetter(uint32_t, v8::Local<v8::Value>, const v8::AccessorInfo&); - - static v8::Handle<v8::Value> constructor(const v8::Arguments&); - static v8::Persistent<v8::FunctionTemplate> Constr; - static v8::Handle<v8::FunctionTemplate> getConstructor() { - if (Constr.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> constr = v8::FunctionTemplate::New(constructor); - Constr = v8::Persistent<v8::FunctionTemplate>::New(constr); - } - return Constr; - } - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("Float64Array")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("length"), V8Float64Array::lengthAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - instance->SetIndexedPropertyHandler(V8Float64Array::indexedPropertyCustomGetter, V8Float64Array::indexedPropertyCustomSetter); - prototype->Set(v8::String::NewSymbol("get"), - v8::FunctionTemplate::New(V8Float64Array::getCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("set"), - v8::FunctionTemplate::New(V8Float64Array::setCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("subarray"), - v8::FunctionTemplate::New(V8Float64Array::subarrayCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - tmpl->Set(v8::String::NewSymbol("BYTES_PER_ELEMENT"), v8::Integer::New(8), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("BYTES_PER_ELEMENT"), v8::Integer::New(8), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - - tmpl->Inherit(V8ArrayBufferView::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8Float64Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int16Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int16Array.cpp deleted file mode 100644 index 6a7e136..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int16Array.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8ArrayBuffer.h" -#include "V8ArrayBufferView.h" -#include "V8Int16Array.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8Int16Array::Tmpl; -v8::Persistent<v8::FunctionTemplate> V8Int16Array::Constr; - -v8::Handle<v8::Value> V8Int16Array::constructor(const v8::Arguments& args) { - if (!args.IsConstructCall()) - return v8::ThrowException(v8::String::New("Cannot call constructor as function")); - - uscxml::Int16Array* localInstance = NULL; - if (false) { - } else if (args.Length() == 3 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0]) && - args[1]->IsUint32() && - args[2]->IsUint32()) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localByteOffset = args[1]->ToNumber()->Uint32Value(); - unsigned long localLength = args[2]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Int16Array(localBuffer, localByteOffset, localLength); - - } else if (args.Length() == 2 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0]) && - args[1]->IsUint32()) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localByteOffset = args[1]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Int16Array(localBuffer, localByteOffset); - - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Int16Array::hasInstance(args[0])) { - - uscxml::Int16Array* localArray = V8DOM::toClassPtr<V8Int16Array::V8Int16ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - localInstance = new uscxml::Int16Array(localArray); - - } else if (args.Length() == 1 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0])) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - localInstance = new uscxml::Int16Array(localBuffer); - - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - - unsigned long localLength = args[0]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Int16Array(localLength); - - } else if (args.Length() == 1 && - args[0]->IsArray()) { - - std::vector<short> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToInt32()->Value()); - } - localInstance = new uscxml::Int16Array(localArray); - - } - if (!localInstance) { - throw V8Exception("Parameter mismatch while calling constructor for Int16Array"); - return v8::Undefined(); - } - - v8::Handle<v8::Function> retCtor = V8Int16Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Int16Array::V8Int16ArrayPrivate* retPrivData = new V8Int16Array::V8Int16ArrayPrivate(); - retPrivData->nativeObj = localInstance; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Int16Array::jsDestructor); - return retObj; -} - -v8::Handle<v8::Value> V8Int16Array::lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8Int16ArrayPrivate* privData = V8DOM::toClassPtr<V8Int16ArrayPrivate >(self->GetInternalField(0)); - - return v8::Integer::New(privData->nativeObj->getLength()); -} - -v8::Handle<v8::Value> V8Int16Array::getCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Int16ArrayPrivate* privData = V8DOM::toClassPtr<V8Int16ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - - short retVal = privData->nativeObj->get(localIndex); - - return v8::Number::New(retVal); - } - throw V8Exception("Parameter mismatch while calling get"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Int16Array::setCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Int16ArrayPrivate* privData = V8DOM::toClassPtr<V8Int16ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsObject() && V8Int16Array::hasInstance(args[0]) && - args[1]->IsUint32()) { - uscxml::Int16Array* localArray = V8DOM::toClassPtr<V8Int16Array::V8Int16ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localOffset = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localArray, localOffset); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsInt32()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - short localValue = args[1]->ToNumber()->Int32Value(); - - privData->nativeObj->set(localIndex, localValue); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsArray() && - args[1]->IsUint32()) { - std::vector<short> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToInt32()->Value()); - } - unsigned long localOffset = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localArray, localOffset); - - return v8::Undefined(); - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Int16Array::hasInstance(args[0])) { - uscxml::Int16Array* localArray = V8DOM::toClassPtr<V8Int16Array::V8Int16ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - - privData->nativeObj->set(localArray); - - return v8::Undefined(); - } else if (args.Length() == 1 && - args[0]->IsArray()) { - std::vector<short> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToInt32()->Value()); - } - - privData->nativeObj->set(localArray); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling set"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Int16Array::subarrayCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Int16ArrayPrivate* privData = V8DOM::toClassPtr<V8Int16ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsInt32() && - args[1]->IsInt32()) { - long localStart = args[0]->ToNumber()->Int32Value(); - long localEnd = args[1]->ToNumber()->Int32Value(); - - uscxml::Int16Array* retVal = new uscxml::Int16Array(privData->nativeObj->subarray(localStart, localEnd)); - v8::Handle<v8::Function> retCtor = V8Int16Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Int16Array::V8Int16ArrayPrivate* retPrivData = new V8Int16Array::V8Int16ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Int16Array::jsDestructor); - return retObj; - - } else if (args.Length() == 1 && - args[0]->IsInt32()) { - long localStart = args[0]->ToNumber()->Int32Value(); - - uscxml::Int16Array* retVal = new uscxml::Int16Array(privData->nativeObj->subarray(localStart)); - v8::Handle<v8::Function> retCtor = V8Int16Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Int16Array::V8Int16ArrayPrivate* retPrivData = new V8Int16Array::V8Int16ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Int16Array::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling subarray"); - return v8::Undefined(); -} -bool V8Int16Array::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int16Array.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int16Array.h deleted file mode 100644 index 0de8d89..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int16Array.h +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8Int16Array_h -#define V8Int16Array_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "V8ArrayBufferView.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8Int16Array { -public: - struct V8Int16ArrayPrivate { - V8DOM* dom; - uscxml::Int16Array* nativeObj; - }; - - V8_DESTRUCTOR(V8Int16ArrayPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> getCallback(const v8::Arguments&); - static v8::Handle<v8::Value> setCallback(const v8::Arguments&); - static v8::Handle<v8::Value> subarrayCallback(const v8::Arguments&); - - static v8::Handle<v8::Value> lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> indexedPropertyCustomGetter(uint32_t, const v8::AccessorInfo&); - static v8::Handle<v8::Value> indexedPropertyCustomSetter(uint32_t, v8::Local<v8::Value>, const v8::AccessorInfo&); - - static v8::Handle<v8::Value> constructor(const v8::Arguments&); - static v8::Persistent<v8::FunctionTemplate> Constr; - static v8::Handle<v8::FunctionTemplate> getConstructor() { - if (Constr.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> constr = v8::FunctionTemplate::New(constructor); - Constr = v8::Persistent<v8::FunctionTemplate>::New(constr); - } - return Constr; - } - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("Int16Array")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("length"), V8Int16Array::lengthAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - instance->SetIndexedPropertyHandler(V8Int16Array::indexedPropertyCustomGetter, V8Int16Array::indexedPropertyCustomSetter); - prototype->Set(v8::String::NewSymbol("get"), - v8::FunctionTemplate::New(V8Int16Array::getCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("set"), - v8::FunctionTemplate::New(V8Int16Array::setCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("subarray"), - v8::FunctionTemplate::New(V8Int16Array::subarrayCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - tmpl->Set(v8::String::NewSymbol("BYTES_PER_ELEMENT"), v8::Integer::New(2), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("BYTES_PER_ELEMENT"), v8::Integer::New(2), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - - tmpl->Inherit(V8ArrayBufferView::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8Int16Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.cpp deleted file mode 100644 index c4055ca..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8ArrayBuffer.h" -#include "V8ArrayBufferView.h" -#include "V8Int32Array.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8Int32Array::Tmpl; -v8::Persistent<v8::FunctionTemplate> V8Int32Array::Constr; - -v8::Handle<v8::Value> V8Int32Array::constructor(const v8::Arguments& args) { - if (!args.IsConstructCall()) - return v8::ThrowException(v8::String::New("Cannot call constructor as function")); - - uscxml::Int32Array* localInstance = NULL; - if (false) { - } else if (args.Length() == 3 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0]) && - args[1]->IsUint32() && - args[2]->IsUint32()) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localByteOffset = args[1]->ToNumber()->Uint32Value(); - unsigned long localLength = args[2]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Int32Array(localBuffer, localByteOffset, localLength); - - } else if (args.Length() == 2 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0]) && - args[1]->IsUint32()) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localByteOffset = args[1]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Int32Array(localBuffer, localByteOffset); - - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Int32Array::hasInstance(args[0])) { - - uscxml::Int32Array* localArray = V8DOM::toClassPtr<V8Int32Array::V8Int32ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - localInstance = new uscxml::Int32Array(localArray); - - } else if (args.Length() == 1 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0])) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - localInstance = new uscxml::Int32Array(localBuffer); - - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - - unsigned long localLength = args[0]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Int32Array(localLength); - - } else if (args.Length() == 1 && - args[0]->IsArray()) { - - std::vector<long> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToInteger()->Value()); - } - localInstance = new uscxml::Int32Array(localArray); - - } - if (!localInstance) { - throw V8Exception("Parameter mismatch while calling constructor for Int32Array"); - return v8::Undefined(); - } - - v8::Handle<v8::Function> retCtor = V8Int32Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Int32Array::V8Int32ArrayPrivate* retPrivData = new V8Int32Array::V8Int32ArrayPrivate(); - retPrivData->nativeObj = localInstance; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Int32Array::jsDestructor); - return retObj; -} - -v8::Handle<v8::Value> V8Int32Array::lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8Int32ArrayPrivate* privData = V8DOM::toClassPtr<V8Int32ArrayPrivate >(self->GetInternalField(0)); - - return v8::Integer::New(privData->nativeObj->getLength()); -} - -v8::Handle<v8::Value> V8Int32Array::getCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Int32ArrayPrivate* privData = V8DOM::toClassPtr<V8Int32ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - - long retVal = privData->nativeObj->get(localIndex); - - return v8::Number::New(retVal); - } - throw V8Exception("Parameter mismatch while calling get"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Int32Array::setCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Int32ArrayPrivate* privData = V8DOM::toClassPtr<V8Int32ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsObject() && V8Int32Array::hasInstance(args[0]) && - args[1]->IsUint32()) { - uscxml::Int32Array* localArray = V8DOM::toClassPtr<V8Int32Array::V8Int32ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localOffset = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localArray, localOffset); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsInt32()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - long localValue = args[1]->ToNumber()->Int32Value(); - - privData->nativeObj->set(localIndex, localValue); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsArray() && - args[1]->IsUint32()) { - std::vector<long> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToInteger()->Value()); - } - unsigned long localOffset = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localArray, localOffset); - - return v8::Undefined(); - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Int32Array::hasInstance(args[0])) { - uscxml::Int32Array* localArray = V8DOM::toClassPtr<V8Int32Array::V8Int32ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - - privData->nativeObj->set(localArray); - - return v8::Undefined(); - } else if (args.Length() == 1 && - args[0]->IsArray()) { - std::vector<long> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToInteger()->Value()); - } - - privData->nativeObj->set(localArray); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling set"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Int32Array::subarrayCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Int32ArrayPrivate* privData = V8DOM::toClassPtr<V8Int32ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsInt32() && - args[1]->IsInt32()) { - long localStart = args[0]->ToNumber()->Int32Value(); - long localEnd = args[1]->ToNumber()->Int32Value(); - - uscxml::Int32Array* retVal = new uscxml::Int32Array(privData->nativeObj->subarray(localStart, localEnd)); - v8::Handle<v8::Function> retCtor = V8Int32Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Int32Array::V8Int32ArrayPrivate* retPrivData = new V8Int32Array::V8Int32ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Int32Array::jsDestructor); - return retObj; - - } else if (args.Length() == 1 && - args[0]->IsInt32()) { - long localStart = args[0]->ToNumber()->Int32Value(); - - uscxml::Int32Array* retVal = new uscxml::Int32Array(privData->nativeObj->subarray(localStart)); - v8::Handle<v8::Function> retCtor = V8Int32Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Int32Array::V8Int32ArrayPrivate* retPrivData = new V8Int32Array::V8Int32ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Int32Array::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling subarray"); - return v8::Undefined(); -} -bool V8Int32Array::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.h deleted file mode 100644 index 431c355..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.h +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8Int32Array_h -#define V8Int32Array_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "V8ArrayBufferView.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8Int32Array { -public: - struct V8Int32ArrayPrivate { - V8DOM* dom; - uscxml::Int32Array* nativeObj; - }; - - V8_DESTRUCTOR(V8Int32ArrayPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> getCallback(const v8::Arguments&); - static v8::Handle<v8::Value> setCallback(const v8::Arguments&); - static v8::Handle<v8::Value> subarrayCallback(const v8::Arguments&); - - static v8::Handle<v8::Value> lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> indexedPropertyCustomGetter(uint32_t, const v8::AccessorInfo&); - static v8::Handle<v8::Value> indexedPropertyCustomSetter(uint32_t, v8::Local<v8::Value>, const v8::AccessorInfo&); - - static v8::Handle<v8::Value> constructor(const v8::Arguments&); - static v8::Persistent<v8::FunctionTemplate> Constr; - static v8::Handle<v8::FunctionTemplate> getConstructor() { - if (Constr.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> constr = v8::FunctionTemplate::New(constructor); - Constr = v8::Persistent<v8::FunctionTemplate>::New(constr); - } - return Constr; - } - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("Int32Array")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("length"), V8Int32Array::lengthAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - instance->SetIndexedPropertyHandler(V8Int32Array::indexedPropertyCustomGetter, V8Int32Array::indexedPropertyCustomSetter); - prototype->Set(v8::String::NewSymbol("get"), - v8::FunctionTemplate::New(V8Int32Array::getCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("set"), - v8::FunctionTemplate::New(V8Int32Array::setCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("subarray"), - v8::FunctionTemplate::New(V8Int32Array::subarrayCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - tmpl->Set(v8::String::NewSymbol("BYTES_PER_ELEMENT"), v8::Integer::New(4), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("BYTES_PER_ELEMENT"), v8::Integer::New(4), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - - tmpl->Inherit(V8ArrayBufferView::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8Int32Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int8Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int8Array.cpp deleted file mode 100644 index 9698414..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int8Array.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8ArrayBuffer.h" -#include "V8ArrayBufferView.h" -#include "V8Int8Array.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8Int8Array::Tmpl; -v8::Persistent<v8::FunctionTemplate> V8Int8Array::Constr; - -v8::Handle<v8::Value> V8Int8Array::constructor(const v8::Arguments& args) { - if (!args.IsConstructCall()) - return v8::ThrowException(v8::String::New("Cannot call constructor as function")); - - uscxml::Int8Array* localInstance = NULL; - if (false) { - } else if (args.Length() == 3 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0]) && - args[1]->IsUint32() && - args[2]->IsUint32()) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localByteOffset = args[1]->ToNumber()->Uint32Value(); - unsigned long localLength = args[2]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Int8Array(localBuffer, localByteOffset, localLength); - - } else if (args.Length() == 2 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0]) && - args[1]->IsUint32()) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localByteOffset = args[1]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Int8Array(localBuffer, localByteOffset); - - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Int8Array::hasInstance(args[0])) { - - uscxml::Int8Array* localArray = V8DOM::toClassPtr<V8Int8Array::V8Int8ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - localInstance = new uscxml::Int8Array(localArray); - - } else if (args.Length() == 1 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0])) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - localInstance = new uscxml::Int8Array(localBuffer); - - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - - unsigned long localLength = args[0]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Int8Array(localLength); - - } else if (args.Length() == 1 && - args[0]->IsArray()) { - - std::vector<char> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToInt32()->Value()); - } - localInstance = new uscxml::Int8Array(localArray); - - } - if (!localInstance) { - throw V8Exception("Parameter mismatch while calling constructor for Int8Array"); - return v8::Undefined(); - } - - v8::Handle<v8::Function> retCtor = V8Int8Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Int8Array::V8Int8ArrayPrivate* retPrivData = new V8Int8Array::V8Int8ArrayPrivate(); - retPrivData->nativeObj = localInstance; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Int8Array::jsDestructor); - return retObj; -} - -v8::Handle<v8::Value> V8Int8Array::lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8Int8ArrayPrivate* privData = V8DOM::toClassPtr<V8Int8ArrayPrivate >(self->GetInternalField(0)); - - return v8::Integer::New(privData->nativeObj->getLength()); -} - -v8::Handle<v8::Value> V8Int8Array::getCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Int8ArrayPrivate* privData = V8DOM::toClassPtr<V8Int8ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - - char retVal = privData->nativeObj->get(localIndex); - - return v8::Number::New(retVal); - } - throw V8Exception("Parameter mismatch while calling get"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Int8Array::setCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Int8ArrayPrivate* privData = V8DOM::toClassPtr<V8Int8ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsObject() && V8Int8Array::hasInstance(args[0]) && - args[1]->IsUint32()) { - uscxml::Int8Array* localArray = V8DOM::toClassPtr<V8Int8Array::V8Int8ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localOffset = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localArray, localOffset); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsInt32()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - char localValue = args[1]->ToNumber()->Int32Value(); - - privData->nativeObj->set(localIndex, localValue); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsArray() && - args[1]->IsUint32()) { - std::vector<char> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToInt32()->Value()); - } - unsigned long localOffset = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localArray, localOffset); - - return v8::Undefined(); - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Int8Array::hasInstance(args[0])) { - uscxml::Int8Array* localArray = V8DOM::toClassPtr<V8Int8Array::V8Int8ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - - privData->nativeObj->set(localArray); - - return v8::Undefined(); - } else if (args.Length() == 1 && - args[0]->IsArray()) { - std::vector<char> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToInt32()->Value()); - } - - privData->nativeObj->set(localArray); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling set"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Int8Array::subarrayCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Int8ArrayPrivate* privData = V8DOM::toClassPtr<V8Int8ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsInt32() && - args[1]->IsInt32()) { - long localStart = args[0]->ToNumber()->Int32Value(); - long localEnd = args[1]->ToNumber()->Int32Value(); - - uscxml::Int8Array* retVal = new uscxml::Int8Array(privData->nativeObj->subarray(localStart, localEnd)); - v8::Handle<v8::Function> retCtor = V8Int8Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Int8Array::V8Int8ArrayPrivate* retPrivData = new V8Int8Array::V8Int8ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Int8Array::jsDestructor); - return retObj; - - } else if (args.Length() == 1 && - args[0]->IsInt32()) { - long localStart = args[0]->ToNumber()->Int32Value(); - - uscxml::Int8Array* retVal = new uscxml::Int8Array(privData->nativeObj->subarray(localStart)); - v8::Handle<v8::Function> retCtor = V8Int8Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Int8Array::V8Int8ArrayPrivate* retPrivData = new V8Int8Array::V8Int8ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Int8Array::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling subarray"); - return v8::Undefined(); -} -bool V8Int8Array::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int8Array.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int8Array.h deleted file mode 100644 index 396139d..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int8Array.h +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8Int8Array_h -#define V8Int8Array_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "V8ArrayBufferView.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8Int8Array { -public: - struct V8Int8ArrayPrivate { - V8DOM* dom; - uscxml::Int8Array* nativeObj; - }; - - V8_DESTRUCTOR(V8Int8ArrayPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> getCallback(const v8::Arguments&); - static v8::Handle<v8::Value> setCallback(const v8::Arguments&); - static v8::Handle<v8::Value> subarrayCallback(const v8::Arguments&); - - static v8::Handle<v8::Value> lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> indexedPropertyCustomGetter(uint32_t, const v8::AccessorInfo&); - static v8::Handle<v8::Value> indexedPropertyCustomSetter(uint32_t, v8::Local<v8::Value>, const v8::AccessorInfo&); - - static v8::Handle<v8::Value> constructor(const v8::Arguments&); - static v8::Persistent<v8::FunctionTemplate> Constr; - static v8::Handle<v8::FunctionTemplate> getConstructor() { - if (Constr.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> constr = v8::FunctionTemplate::New(constructor); - Constr = v8::Persistent<v8::FunctionTemplate>::New(constr); - } - return Constr; - } - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("Int8Array")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("length"), V8Int8Array::lengthAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - instance->SetIndexedPropertyHandler(V8Int8Array::indexedPropertyCustomGetter, V8Int8Array::indexedPropertyCustomSetter); - prototype->Set(v8::String::NewSymbol("get"), - v8::FunctionTemplate::New(V8Int8Array::getCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("set"), - v8::FunctionTemplate::New(V8Int8Array::setCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("subarray"), - v8::FunctionTemplate::New(V8Int8Array::subarrayCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - tmpl->Set(v8::String::NewSymbol("BYTES_PER_ELEMENT"), v8::Integer::New(1), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("BYTES_PER_ELEMENT"), v8::Integer::New(1), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - - tmpl->Inherit(V8ArrayBufferView::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8Int8Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NamedNodeMap.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NamedNodeMap.cpp deleted file mode 100644 index b55b9d1..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NamedNodeMap.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8NamedNodeMap.h" -#include "V8Node.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8NamedNodeMap::Tmpl; - -v8::Handle<v8::Value> V8NamedNodeMap::lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NamedNodeMapPrivate* privData = V8DOM::toClassPtr<V8NamedNodeMapPrivate >(self->GetInternalField(0)); - - return v8::Integer::New(privData->nativeObj->getLength()); -} - -v8::Handle<v8::Value> V8NamedNodeMap::getNamedItemCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8NamedNodeMapPrivate* privData = V8DOM::toClassPtr<V8NamedNodeMapPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localName(args[0]); - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->getNamedItem(*localName)); - v8::Handle<v8::Function> retCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Node::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling getNamedItem"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8NamedNodeMap::setNamedItemCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8NamedNodeMapPrivate* privData = V8DOM::toClassPtr<V8NamedNodeMapPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Node::hasInstance(args[0])) { - Arabica::DOM::Node<std::string>* localArg = V8DOM::toClassPtr<V8Node::V8NodePrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->setNamedItem(*localArg)); - v8::Handle<v8::Function> retCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Node::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling setNamedItem"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8NamedNodeMap::removeNamedItemCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8NamedNodeMapPrivate* privData = V8DOM::toClassPtr<V8NamedNodeMapPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localName(args[0]); - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->removeNamedItem(*localName)); - v8::Handle<v8::Function> retCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Node::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling removeNamedItem"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8NamedNodeMap::itemCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8NamedNodeMapPrivate* privData = V8DOM::toClassPtr<V8NamedNodeMapPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->item(localIndex)); - v8::Handle<v8::Function> retCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Node::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling item"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8NamedNodeMap::getNamedItemNSCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8NamedNodeMapPrivate* privData = V8DOM::toClassPtr<V8NamedNodeMapPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localNamespaceURI(args[0]); - v8::String::AsciiValue localLocalName(args[1]); - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->getNamedItemNS(*localNamespaceURI, *localLocalName)); - v8::Handle<v8::Function> retCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Node::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling getNamedItemNS"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8NamedNodeMap::setNamedItemNSCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8NamedNodeMapPrivate* privData = V8DOM::toClassPtr<V8NamedNodeMapPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Node::hasInstance(args[0])) { - Arabica::DOM::Node<std::string>* localArg = V8DOM::toClassPtr<V8Node::V8NodePrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->setNamedItemNS(*localArg)); - v8::Handle<v8::Function> retCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Node::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling setNamedItemNS"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8NamedNodeMap::removeNamedItemNSCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8NamedNodeMapPrivate* privData = V8DOM::toClassPtr<V8NamedNodeMapPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localNamespaceURI(args[0]); - v8::String::AsciiValue localLocalName(args[1]); - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->removeNamedItemNS(*localNamespaceURI, *localLocalName)); - v8::Handle<v8::Function> retCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Node::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling removeNamedItemNS"); - return v8::Undefined(); -} -bool V8NamedNodeMap::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NamedNodeMap.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NamedNodeMap.h deleted file mode 100644 index 71e501b..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NamedNodeMap.h +++ /dev/null @@ -1,96 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8NamedNodeMap_h -#define V8NamedNodeMap_h - -#include <string> -#include "DOM/Node.hpp" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8NamedNodeMap { -public: - struct V8NamedNodeMapPrivate { - V8DOM* dom; - Arabica::DOM::NamedNodeMap<std::string>* nativeObj; - }; - - V8_DESTRUCTOR(V8NamedNodeMapPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> getNamedItemCallback(const v8::Arguments&); - static v8::Handle<v8::Value> setNamedItemCallback(const v8::Arguments&); - static v8::Handle<v8::Value> removeNamedItemCallback(const v8::Arguments&); - static v8::Handle<v8::Value> itemCallback(const v8::Arguments&); - static v8::Handle<v8::Value> getNamedItemNSCallback(const v8::Arguments&); - static v8::Handle<v8::Value> setNamedItemNSCallback(const v8::Arguments&); - static v8::Handle<v8::Value> removeNamedItemNSCallback(const v8::Arguments&); - - static v8::Handle<v8::Value> lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("NamedNodeMap")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("length"), V8NamedNodeMap::lengthAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - prototype->Set(v8::String::NewSymbol("getNamedItem"), - v8::FunctionTemplate::New(V8NamedNodeMap::getNamedItemCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("setNamedItem"), - v8::FunctionTemplate::New(V8NamedNodeMap::setNamedItemCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("removeNamedItem"), - v8::FunctionTemplate::New(V8NamedNodeMap::removeNamedItemCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("item"), - v8::FunctionTemplate::New(V8NamedNodeMap::itemCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("getNamedItemNS"), - v8::FunctionTemplate::New(V8NamedNodeMap::getNamedItemNSCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("setNamedItemNS"), - v8::FunctionTemplate::New(V8NamedNodeMap::setNamedItemNSCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("removeNamedItemNS"), - v8::FunctionTemplate::New(V8NamedNodeMap::removeNamedItemNSCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8NamedNodeMap_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Node.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Node.cpp deleted file mode 100644 index ec66b15..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Node.cpp +++ /dev/null @@ -1,432 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8Document.h" -#include "V8Node.h" -#include "V8NodeList.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8Node::Tmpl; - -v8::Handle<v8::Value> V8Node::nodeNameAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getNodeName().c_str()); -} - -v8::Handle<v8::Value> V8Node::nodeValueAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getNodeValue().c_str()); -} - -void V8Node::nodeValueAttrSetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - v8::String::AsciiValue localNodeValue(value); - privData->nativeObj->setNodeValue(*localNodeValue); -} - -v8::Handle<v8::Value> V8Node::nodeTypeAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - - return v8::Integer::New(privData->nativeObj->getNodeType()); -} - -v8::Handle<v8::Value> V8Node::parentNodeAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - - if (!privData->nativeObj->getParentNode()) return v8::Undefined(); - Arabica::DOM::Node<std::string>* arbaicaRet = new Arabica::DOM::Node<std::string>(privData->nativeObj->getParentNode()); - - v8::Handle<v8::Function> arbaicaRetCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> arbaicaRetObj = v8::Persistent<v8::Object>::New(arbaicaRetCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arbaicaRet; - - arbaicaRetObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - arbaicaRetObj.MakeWeak(0, V8Node::jsDestructor); - return arbaicaRetObj; - -} - -v8::Handle<v8::Value> V8Node::childNodesAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - - - Arabica::DOM::NodeList<std::string>* arbaicaRet = new Arabica::DOM::NodeList<std::string>(privData->nativeObj->getChildNodes()); - - v8::Handle<v8::Function> arbaicaRetCtor = V8NodeList::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> arbaicaRetObj = v8::Persistent<v8::Object>::New(arbaicaRetCtor->NewInstance()); - - struct V8NodeList::V8NodeListPrivate* retPrivData = new V8NodeList::V8NodeListPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arbaicaRet; - - arbaicaRetObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - arbaicaRetObj.MakeWeak(0, V8NodeList::jsDestructor); - return arbaicaRetObj; - -} - -v8::Handle<v8::Value> V8Node::firstChildAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - - if (!privData->nativeObj->getFirstChild()) return v8::Undefined(); - Arabica::DOM::Node<std::string>* arbaicaRet = new Arabica::DOM::Node<std::string>(privData->nativeObj->getFirstChild()); - - v8::Handle<v8::Function> arbaicaRetCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> arbaicaRetObj = v8::Persistent<v8::Object>::New(arbaicaRetCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arbaicaRet; - - arbaicaRetObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - arbaicaRetObj.MakeWeak(0, V8Node::jsDestructor); - return arbaicaRetObj; - -} - -v8::Handle<v8::Value> V8Node::lastChildAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - - if (!privData->nativeObj->getLastChild()) return v8::Undefined(); - Arabica::DOM::Node<std::string>* arbaicaRet = new Arabica::DOM::Node<std::string>(privData->nativeObj->getLastChild()); - - v8::Handle<v8::Function> arbaicaRetCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> arbaicaRetObj = v8::Persistent<v8::Object>::New(arbaicaRetCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arbaicaRet; - - arbaicaRetObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - arbaicaRetObj.MakeWeak(0, V8Node::jsDestructor); - return arbaicaRetObj; - -} - -v8::Handle<v8::Value> V8Node::previousSiblingAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - - if (!privData->nativeObj->getPreviousSibling()) return v8::Undefined(); - Arabica::DOM::Node<std::string>* arbaicaRet = new Arabica::DOM::Node<std::string>(privData->nativeObj->getPreviousSibling()); - - v8::Handle<v8::Function> arbaicaRetCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> arbaicaRetObj = v8::Persistent<v8::Object>::New(arbaicaRetCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arbaicaRet; - - arbaicaRetObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - arbaicaRetObj.MakeWeak(0, V8Node::jsDestructor); - return arbaicaRetObj; - -} - -v8::Handle<v8::Value> V8Node::nextSiblingAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - - if (!privData->nativeObj->getNextSibling()) return v8::Undefined(); - Arabica::DOM::Node<std::string>* arbaicaRet = new Arabica::DOM::Node<std::string>(privData->nativeObj->getNextSibling()); - - v8::Handle<v8::Function> arbaicaRetCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> arbaicaRetObj = v8::Persistent<v8::Object>::New(arbaicaRetCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arbaicaRet; - - arbaicaRetObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - arbaicaRetObj.MakeWeak(0, V8Node::jsDestructor); - return arbaicaRetObj; - -} - -v8::Handle<v8::Value> V8Node::ownerDocumentAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - - if (!privData->nativeObj->getOwnerDocument()) return v8::Undefined(); - Arabica::DOM::Document<std::string>* arbaicaRet = new Arabica::DOM::Document<std::string>(privData->nativeObj->getOwnerDocument()); - - v8::Handle<v8::Function> arbaicaRetCtor = V8Document::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> arbaicaRetObj = v8::Persistent<v8::Object>::New(arbaicaRetCtor->NewInstance()); - - struct V8Document::V8DocumentPrivate* retPrivData = new V8Document::V8DocumentPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arbaicaRet; - - arbaicaRetObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - arbaicaRetObj.MakeWeak(0, V8Document::jsDestructor); - return arbaicaRetObj; - -} - -v8::Handle<v8::Value> V8Node::namespaceURIAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getNamespaceURI().c_str()); -} - -v8::Handle<v8::Value> V8Node::prefixAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getPrefix().c_str()); -} - -void V8Node::prefixAttrSetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - v8::String::AsciiValue localPrefix(value); - privData->nativeObj->setPrefix(*localPrefix); -} - -v8::Handle<v8::Value> V8Node::localNameAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getLocalName().c_str()); -} - -v8::Handle<v8::Value> V8Node::insertBeforeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsObject() && V8Node::hasInstance(args[0]) && - args[1]->IsObject() && V8Node::hasInstance(args[1])) { - Arabica::DOM::Node<std::string>* localNewChild = V8DOM::toClassPtr<V8Node::V8NodePrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - Arabica::DOM::Node<std::string>* localRefChild = V8DOM::toClassPtr<V8Node::V8NodePrivate >(args[1]->ToObject()->GetInternalField(0))->nativeObj; - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->insertBefore(*localNewChild, *localRefChild)); - v8::Handle<v8::Function> retCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Node::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling insertBefore"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Node::replaceChildCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsObject() && V8Node::hasInstance(args[0]) && - args[1]->IsObject() && V8Node::hasInstance(args[1])) { - Arabica::DOM::Node<std::string>* localNewChild = V8DOM::toClassPtr<V8Node::V8NodePrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - Arabica::DOM::Node<std::string>* localOldChild = V8DOM::toClassPtr<V8Node::V8NodePrivate >(args[1]->ToObject()->GetInternalField(0))->nativeObj; - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->replaceChild(*localNewChild, *localOldChild)); - v8::Handle<v8::Function> retCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Node::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling replaceChild"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Node::removeChildCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Node::hasInstance(args[0])) { - Arabica::DOM::Node<std::string>* localOldChild = V8DOM::toClassPtr<V8Node::V8NodePrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->removeChild(*localOldChild)); - v8::Handle<v8::Function> retCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Node::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling removeChild"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Node::appendChildCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Node::hasInstance(args[0])) { - Arabica::DOM::Node<std::string>* localNewChild = V8DOM::toClassPtr<V8Node::V8NodePrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->appendChild(*localNewChild)); - v8::Handle<v8::Function> retCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Node::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling appendChild"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Node::hasChildNodesCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 0) { - - bool retVal = privData->nativeObj->hasChildNodes(); - - return v8::Boolean::New(retVal); - } - throw V8Exception("Parameter mismatch while calling hasChildNodes"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Node::cloneNodeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsBoolean()) { - bool localDeep = args[0]->ToBoolean()->BooleanValue(); - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->cloneNode(localDeep)); - v8::Handle<v8::Function> retCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Node::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling cloneNode"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Node::normalizeCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 0) { - - privData->nativeObj->normalize(); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling normalize"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Node::isSupportedCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localFeature(args[0]); - v8::String::AsciiValue localVersion(args[1]); - - bool retVal = privData->nativeObj->isSupported(*localFeature, *localVersion); - - return v8::Boolean::New(retVal); - } - throw V8Exception("Parameter mismatch while calling isSupported"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Node::hasAttributesCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 0) { - - bool retVal = privData->nativeObj->hasAttributes(); - - return v8::Boolean::New(retVal); - } - throw V8Exception("Parameter mismatch while calling hasAttributes"); - return v8::Undefined(); -} -bool V8Node::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Node.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Node.h deleted file mode 100644 index 5a512ef..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Node.h +++ /dev/null @@ -1,167 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8Node_h -#define V8Node_h - -#include <string> -#include "DOM/Node.hpp" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8Node { -public: - struct V8NodePrivate { - V8DOM* dom; - Arabica::DOM::Node<std::string>* nativeObj; - }; - - V8_DESTRUCTOR(V8NodePrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> insertBeforeCallback(const v8::Arguments&); - static v8::Handle<v8::Value> replaceChildCallback(const v8::Arguments&); - static v8::Handle<v8::Value> removeChildCallback(const v8::Arguments&); - static v8::Handle<v8::Value> appendChildCallback(const v8::Arguments&); - static v8::Handle<v8::Value> hasChildNodesCallback(const v8::Arguments&); - static v8::Handle<v8::Value> cloneNodeCallback(const v8::Arguments&); - static v8::Handle<v8::Value> normalizeCallback(const v8::Arguments&); - static v8::Handle<v8::Value> isSupportedCallback(const v8::Arguments&); - static v8::Handle<v8::Value> hasAttributesCallback(const v8::Arguments&); - - static v8::Handle<v8::Value> nodeNameAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> nodeValueAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static void nodeValueAttrSetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> nodeTypeAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> parentNodeAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> childNodesAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> firstChildAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> lastChildAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> previousSiblingAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> nextSiblingAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> attributesCustomAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> ownerDocumentAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> namespaceURIAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> prefixAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static void prefixAttrSetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> localNameAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("Node")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("nodeName"), V8Node::nodeNameAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("nodeValue"), V8Node::nodeValueAttrGetter, V8Node::nodeValueAttrSetter, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("nodeType"), V8Node::nodeTypeAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("parentNode"), V8Node::parentNodeAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("childNodes"), V8Node::childNodesAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("firstChild"), V8Node::firstChildAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("lastChild"), V8Node::lastChildAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("previousSibling"), V8Node::previousSiblingAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("nextSibling"), V8Node::nextSiblingAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("attributes"), V8Node::attributesCustomAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("ownerDocument"), V8Node::ownerDocumentAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("namespaceURI"), V8Node::namespaceURIAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("prefix"), V8Node::prefixAttrGetter, V8Node::prefixAttrSetter, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("localName"), V8Node::localNameAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - prototype->Set(v8::String::NewSymbol("insertBefore"), - v8::FunctionTemplate::New(V8Node::insertBeforeCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("replaceChild"), - v8::FunctionTemplate::New(V8Node::replaceChildCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("removeChild"), - v8::FunctionTemplate::New(V8Node::removeChildCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("appendChild"), - v8::FunctionTemplate::New(V8Node::appendChildCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("hasChildNodes"), - v8::FunctionTemplate::New(V8Node::hasChildNodesCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("cloneNode"), - v8::FunctionTemplate::New(V8Node::cloneNodeCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("normalize"), - v8::FunctionTemplate::New(V8Node::normalizeCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("isSupported"), - v8::FunctionTemplate::New(V8Node::isSupportedCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("hasAttributes"), - v8::FunctionTemplate::New(V8Node::hasAttributesCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - tmpl->Set(v8::String::NewSymbol("ELEMENT_NODE"), v8::Integer::New(1), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("ELEMENT_NODE"), v8::Integer::New(1), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - tmpl->Set(v8::String::NewSymbol("ATTRIBUTE_NODE"), v8::Integer::New(2), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("ATTRIBUTE_NODE"), v8::Integer::New(2), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - tmpl->Set(v8::String::NewSymbol("TEXT_NODE"), v8::Integer::New(3), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("TEXT_NODE"), v8::Integer::New(3), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - tmpl->Set(v8::String::NewSymbol("CDATA_SECTION_NODE"), v8::Integer::New(4), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("CDATA_SECTION_NODE"), v8::Integer::New(4), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - tmpl->Set(v8::String::NewSymbol("ENTITY_REFERENCE_NODE"), v8::Integer::New(5), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("ENTITY_REFERENCE_NODE"), v8::Integer::New(5), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - tmpl->Set(v8::String::NewSymbol("ENTITY_NODE"), v8::Integer::New(6), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("ENTITY_NODE"), v8::Integer::New(6), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - tmpl->Set(v8::String::NewSymbol("PROCESSING_INSTRUCTION_NODE"), v8::Integer::New(7), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("PROCESSING_INSTRUCTION_NODE"), v8::Integer::New(7), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - tmpl->Set(v8::String::NewSymbol("COMMENT_NODE"), v8::Integer::New(8), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("COMMENT_NODE"), v8::Integer::New(8), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - tmpl->Set(v8::String::NewSymbol("DOCUMENT_NODE"), v8::Integer::New(9), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("DOCUMENT_NODE"), v8::Integer::New(9), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - tmpl->Set(v8::String::NewSymbol("DOCUMENT_TYPE_NODE"), v8::Integer::New(10), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("DOCUMENT_TYPE_NODE"), v8::Integer::New(10), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - tmpl->Set(v8::String::NewSymbol("DOCUMENT_FRAGMENT_NODE"), v8::Integer::New(11), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("DOCUMENT_FRAGMENT_NODE"), v8::Integer::New(11), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - tmpl->Set(v8::String::NewSymbol("NOTATION_NODE"), v8::Integer::New(12), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("NOTATION_NODE"), v8::Integer::New(12), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8Node_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeCustom.cpp deleted file mode 100644 index af43e20..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeCustom.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8Node.h" -#include "V8NamedNodeMap.h" - -namespace Arabica { -namespace DOM { - -v8::Handle<v8::Value> V8Node::attributesCustomAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NodePrivate* privData = V8DOM::toClassPtr<V8NodePrivate >(self->GetInternalField(0)); - - if (!privData->nativeObj->hasAttributes()) { - return v8::Undefined(); - } - - Arabica::DOM::NamedNodeMap<std::string>* arbaicaRet = new Arabica::DOM::NamedNodeMap<std::string>(privData->nativeObj->getAttributes()); - - v8::Handle<v8::Function> arbaicaRetCtor = V8NamedNodeMap::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> arbaicaRetObj = v8::Persistent<v8::Object>::New(arbaicaRetCtor->NewInstance()); - - struct V8NamedNodeMap::V8NamedNodeMapPrivate* retPrivData = new V8NamedNodeMap::V8NamedNodeMapPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arbaicaRet; - - arbaicaRetObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - arbaicaRetObj.MakeWeak(0, V8NamedNodeMap::jsDestructor); - return arbaicaRetObj; - -} - -} -}
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeList.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeList.cpp deleted file mode 100644 index efe5fa8..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeList.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8Node.h" -#include "V8NodeList.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8NodeList::Tmpl; - -v8::Handle<v8::Value> V8NodeList::lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NodeListPrivate* privData = V8DOM::toClassPtr<V8NodeListPrivate >(self->GetInternalField(0)); - - return v8::Integer::New(privData->nativeObj->getLength()); -} - -v8::Handle<v8::Value> V8NodeList::itemCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8NodeListPrivate* privData = V8DOM::toClassPtr<V8NodeListPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->item(localIndex)); - v8::Handle<v8::Function> retCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Node::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling item"); - return v8::Undefined(); -} -bool V8NodeList::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeList.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeList.h deleted file mode 100644 index 570ad66..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeList.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8NodeList_h -#define V8NodeList_h - -#include <string> -#include "DOM/Node.hpp" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8NodeList { -public: - struct V8NodeListPrivate { - V8DOM* dom; - Arabica::DOM::NodeList<std::string>* nativeObj; - }; - - V8_DESTRUCTOR(V8NodeListPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> itemCallback(const v8::Arguments&); - - static v8::Handle<v8::Value> lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> indexedPropertyCustomGetter(uint32_t, const v8::AccessorInfo&); - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("NodeList")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("length"), V8NodeList::lengthAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - instance->SetIndexedPropertyHandler(V8NodeList::indexedPropertyCustomGetter, 0); - prototype->Set(v8::String::NewSymbol("item"), - v8::FunctionTemplate::New(V8NodeList::itemCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8NodeList_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeListCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeListCustom.cpp deleted file mode 100644 index 69af5b0..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeListCustom.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8NodeList.h" -#include "V8Element.h" -#include "V8Node.h" - -namespace Arabica { -namespace DOM { - -v8::Handle<v8::Value> V8NodeList::indexedPropertyCustomGetter(uint32_t index, const v8::AccessorInfo &info) { - v8::Local<v8::Object> self = info.Holder(); - V8NodeListPrivate* privData = V8DOM::toClassPtr<V8NodeListPrivate >(self->GetInternalField(0)); - - if (privData->nativeObj->getLength() >= index) { - switch(privData->nativeObj->item(index).getNodeType()) { - case Node_base::ELEMENT_NODE: { - Arabica::DOM::Element<std::string>* retVal = new Arabica::DOM::Element<std::string>(privData->nativeObj->item(index)); - - v8::Handle<v8::Function> retCtor = V8Element::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Element::V8ElementPrivate* retPrivData = new V8Element::V8ElementPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Element::jsDestructor); - return retObj; - } - default: { - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->item(index)); - - v8::Handle<v8::Function> retCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Node::jsDestructor); - return retObj; - } - } - } - - return v8::Undefined(); - -} - -} -}
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSet.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSet.cpp deleted file mode 100644 index a011465..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSet.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8NodeSet.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8NodeSet::Tmpl; - -v8::Handle<v8::Value> V8NodeSet::sizeAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NodeSetPrivate* privData = V8DOM::toClassPtr<V8NodeSetPrivate >(self->GetInternalField(0)); - - return v8::Integer::New(privData->nativeObj->size()); -} - -v8::Handle<v8::Value> V8NodeSet::emptyAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NodeSetPrivate* privData = V8DOM::toClassPtr<V8NodeSetPrivate >(self->GetInternalField(0)); - - return v8::Boolean::New(privData->nativeObj->empty()); -} - -v8::Handle<v8::Value> V8NodeSet::toDocumentOrderCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8NodeSetPrivate* privData = V8DOM::toClassPtr<V8NodeSetPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 0) { - - privData->nativeObj->to_document_order(); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling toDocumentOrder"); - return v8::Undefined(); -} -bool V8NodeSet::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSet.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSet.h deleted file mode 100644 index 85254d5..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSet.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8NodeSet_h -#define V8NodeSet_h - -#include <string> -#include "DOM/Node.hpp" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8NodeSet { -public: - struct V8NodeSetPrivate { - V8DOM* dom; - Arabica::XPath::NodeSet<std::string>* nativeObj; - }; - - V8_DESTRUCTOR(V8NodeSetPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> toDocumentOrderCallback(const v8::Arguments&); - - static v8::Handle<v8::Value> sizeAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> emptyAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> indexedPropertyCustomGetter(uint32_t, const v8::AccessorInfo&); - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("NodeSet")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("size"), V8NodeSet::sizeAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("empty"), V8NodeSet::emptyAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - instance->SetIndexedPropertyHandler(V8NodeSet::indexedPropertyCustomGetter, 0); - prototype->Set(v8::String::NewSymbol("toDocumentOrder"), - v8::FunctionTemplate::New(V8NodeSet::toDocumentOrderCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8NodeSet_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSetCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSetCustom.cpp deleted file mode 100644 index 31298f0..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8NodeSetCustom.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8NodeSet.h" -#include "V8Element.h" -#include "V8Node.h" - -namespace Arabica { -namespace DOM { - -v8::Handle<v8::Value> V8NodeSet::indexedPropertyCustomGetter(uint32_t index, const v8::AccessorInfo &info) { - v8::Local<v8::Object> self = info.Holder(); - V8NodeSetPrivate* privData = V8DOM::toClassPtr<V8NodeSetPrivate >(self->GetInternalField(0)); - - if (privData->nativeObj->size() >= index) { - switch((*privData->nativeObj)[index].getNodeType()) { - case Node_base::ELEMENT_NODE: { - Arabica::DOM::Element<std::string>* retVal = new Arabica::DOM::Element<std::string>((*privData->nativeObj)[index]); - - v8::Handle<v8::Function> retCtor = V8Element::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Element::V8ElementPrivate* retPrivData = new V8Element::V8ElementPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Element::jsDestructor); - return retObj; - } - default: { - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>((*privData->nativeObj)[index]); - - v8::Handle<v8::Function> retCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Node::jsDestructor); - return retObj; - } - } - } - - return v8::Undefined(); - -} - -} -}
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Notation.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Notation.cpp deleted file mode 100644 index 1ec9b88..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Notation.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8Node.h" -#include "V8Notation.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8Notation::Tmpl; - -v8::Handle<v8::Value> V8Notation::publicIdAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NotationPrivate* privData = V8DOM::toClassPtr<V8NotationPrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getPublicId().c_str()); -} - -v8::Handle<v8::Value> V8Notation::systemIdAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8NotationPrivate* privData = V8DOM::toClassPtr<V8NotationPrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getSystemId().c_str()); -} -bool V8Notation::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Notation.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Notation.h deleted file mode 100644 index 9c574bd..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Notation.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8Notation_h -#define V8Notation_h - -#include <string> -#include "DOM/Node.hpp" -#include "V8Node.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8Notation { -public: - struct V8NotationPrivate { - V8DOM* dom; - Arabica::DOM::Notation<std::string>* nativeObj; - }; - - V8_DESTRUCTOR(V8NotationPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - - static v8::Handle<v8::Value> publicIdAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> systemIdAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("Notation")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("publicId"), V8Notation::publicIdAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("systemId"), V8Notation::systemIdAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - - - tmpl->Inherit(V8Node::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8Notation_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ProcessingInstruction.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ProcessingInstruction.cpp deleted file mode 100644 index 06fdc7a..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ProcessingInstruction.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8Node.h" -#include "V8ProcessingInstruction.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8ProcessingInstruction::Tmpl; - -v8::Handle<v8::Value> V8ProcessingInstruction::targetAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8ProcessingInstructionPrivate* privData = V8DOM::toClassPtr<V8ProcessingInstructionPrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getTarget().c_str()); -} - -v8::Handle<v8::Value> V8ProcessingInstruction::dataAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8ProcessingInstructionPrivate* privData = V8DOM::toClassPtr<V8ProcessingInstructionPrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->getData().c_str()); -} - -void V8ProcessingInstruction::dataAttrSetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8ProcessingInstructionPrivate* privData = V8DOM::toClassPtr<V8ProcessingInstructionPrivate >(self->GetInternalField(0)); - v8::String::AsciiValue localData(value); - privData->nativeObj->setData(*localData); -} -bool V8ProcessingInstruction::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ProcessingInstruction.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ProcessingInstruction.h deleted file mode 100644 index 20700d2..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ProcessingInstruction.h +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8ProcessingInstruction_h -#define V8ProcessingInstruction_h - -#include <string> -#include "DOM/Node.hpp" -#include "V8Node.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8ProcessingInstruction { -public: - struct V8ProcessingInstructionPrivate { - V8DOM* dom; - Arabica::DOM::ProcessingInstruction<std::string>* nativeObj; - }; - - V8_DESTRUCTOR(V8ProcessingInstructionPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - - static v8::Handle<v8::Value> targetAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> dataAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static void dataAttrSetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info); - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("ProcessingInstruction")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("target"), V8ProcessingInstruction::targetAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("data"), V8ProcessingInstruction::dataAttrGetter, V8ProcessingInstruction::dataAttrSetter, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - - - tmpl->Inherit(V8Node::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8ProcessingInstruction_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.cpp deleted file mode 100644 index d459bc2..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8Node.h" -#include "V8SCXMLEvent.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8SCXMLEvent::Tmpl; - -v8::Handle<v8::Value> V8SCXMLEvent::nameAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8SCXMLEventPrivate* privData = V8DOM::toClassPtr<V8SCXMLEventPrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->name.c_str()); -} - -v8::Handle<v8::Value> V8SCXMLEvent::originAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8SCXMLEventPrivate* privData = V8DOM::toClassPtr<V8SCXMLEventPrivate >(self->GetInternalField(0)); - - if (privData->nativeObj->origin.length() == 0) - return v8::Undefined(); - return v8::String::New(privData->nativeObj->origin.c_str()); -} - -v8::Handle<v8::Value> V8SCXMLEvent::origintypeAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8SCXMLEventPrivate* privData = V8DOM::toClassPtr<V8SCXMLEventPrivate >(self->GetInternalField(0)); - - if (privData->nativeObj->origintype.length() == 0) - return v8::Undefined(); - return v8::String::New(privData->nativeObj->origintype.c_str()); -} - -v8::Handle<v8::Value> V8SCXMLEvent::rawAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8SCXMLEventPrivate* privData = V8DOM::toClassPtr<V8SCXMLEventPrivate >(self->GetInternalField(0)); - - if (privData->nativeObj->raw.length() == 0) - return v8::Undefined(); - return v8::String::New(privData->nativeObj->raw.c_str()); -} - -v8::Handle<v8::Value> V8SCXMLEvent::domAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8SCXMLEventPrivate* privData = V8DOM::toClassPtr<V8SCXMLEventPrivate >(self->GetInternalField(0)); - - if (!privData->nativeObj->dom) return v8::Undefined(); - Arabica::DOM::Node<std::string>* arbaicaRet = new Arabica::DOM::Node<std::string>(privData->nativeObj->dom); - - v8::Handle<v8::Function> arbaicaRetCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> arbaicaRetObj = v8::Persistent<v8::Object>::New(arbaicaRetCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = arbaicaRet; - - arbaicaRetObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - arbaicaRetObj.MakeWeak(0, V8Node::jsDestructor); - return arbaicaRetObj; - -} - -v8::Handle<v8::Value> V8SCXMLEvent::invokeidAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8SCXMLEventPrivate* privData = V8DOM::toClassPtr<V8SCXMLEventPrivate >(self->GetInternalField(0)); - - if (privData->nativeObj->invokeid.length() == 0) - return v8::Undefined(); - return v8::String::New(privData->nativeObj->invokeid.c_str()); -} -bool V8SCXMLEvent::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.h deleted file mode 100644 index 72f85c6..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEvent.h +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8SCXMLEvent_h -#define V8SCXMLEvent_h - -#include <string> -#include "DOM/Node.hpp" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8SCXMLEvent { -public: - struct V8SCXMLEventPrivate { - V8DOM* dom; - uscxml::Event* nativeObj; - }; - - V8_DESTRUCTOR(V8SCXMLEventPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - - static v8::Handle<v8::Value> typeCustomAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> nameAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> originAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> origintypeAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> rawAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> domAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> sendidCustomAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> invokeidAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("SCXMLEvent")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("type"), V8SCXMLEvent::typeCustomAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("name"), V8SCXMLEvent::nameAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("origin"), V8SCXMLEvent::originAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("origintype"), V8SCXMLEvent::origintypeAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("raw"), V8SCXMLEvent::rawAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("dom"), V8SCXMLEvent::domAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("sendid"), V8SCXMLEvent::sendidCustomAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("invokeid"), V8SCXMLEvent::invokeidAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - - tmpl->Set(v8::String::NewSymbol("INTERNAL"), v8::Integer::New(1), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("INTERNAL"), v8::Integer::New(1), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - tmpl->Set(v8::String::NewSymbol("EXTERNAL"), v8::Integer::New(2), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("EXTERNAL"), v8::Integer::New(2), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - tmpl->Set(v8::String::NewSymbol("PLATFORM"), v8::Integer::New(3), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("PLATFORM"), v8::Integer::New(3), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8SCXMLEvent_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEventCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEventCustom.cpp deleted file mode 100644 index 0876f81..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8SCXMLEventCustom.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8SCXMLEvent.h" - -namespace Arabica { -namespace DOM { - -v8::Handle<v8::Value> V8SCXMLEvent::typeCustomAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - V8SCXMLEventPrivate* privData = V8DOM::toClassPtr<V8SCXMLEventPrivate >(self->GetInternalField(0)); - - switch (privData->nativeObj->eventType) { - case uscxml::Event::INTERNAL: - return v8::String::New("internal"); - break; - case uscxml::Event::EXTERNAL: - return v8::String::New("external"); - break; - case uscxml::Event::PLATFORM: - return v8::String::New("platform"); - break; - default: - break; - } - return v8::String::New("unknown"); -} - -v8::Handle<v8::Value> V8SCXMLEvent::sendidCustomAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - V8SCXMLEventPrivate* privData = V8DOM::toClassPtr<V8SCXMLEventPrivate >(self->GetInternalField(0)); - - if (privData->nativeObj->sendid.length() == 0 || privData->nativeObj->hideSendId) - return v8::Undefined(); - return v8::String::New(privData->nativeObj->sendid.c_str()); -} - -} -}
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Storage.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Storage.cpp deleted file mode 100644 index f1fb9b6..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Storage.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8Storage.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8Storage::Tmpl; - -v8::Handle<v8::Value> V8Storage::lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8StoragePrivate* privData = V8DOM::toClassPtr<V8StoragePrivate >(self->GetInternalField(0)); - - return v8::Integer::New(privData->nativeObj->getLength()); -} - -v8::Handle<v8::Value> V8Storage::keyCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8StoragePrivate* privData = V8DOM::toClassPtr<V8StoragePrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - - std::string retVal = privData->nativeObj->key(localIndex); - - return v8::String::New(retVal.c_str()); - } - throw V8Exception("Parameter mismatch while calling key"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Storage::getItemCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8StoragePrivate* privData = V8DOM::toClassPtr<V8StoragePrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localKey(args[0]); - - std::string retVal = privData->nativeObj->getItem(*localKey); - - return v8::String::New(retVal.c_str()); - } - throw V8Exception("Parameter mismatch while calling getItem"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Storage::setItemCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8StoragePrivate* privData = V8DOM::toClassPtr<V8StoragePrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsString() && - args[1]->IsString()) { - v8::String::AsciiValue localKey(args[0]); - v8::String::AsciiValue localValue(args[1]); - - privData->nativeObj->setItem(*localKey, *localValue); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling setItem"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Storage::removeItemCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8StoragePrivate* privData = V8DOM::toClassPtr<V8StoragePrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsString()) { - v8::String::AsciiValue localKey(args[0]); - - privData->nativeObj->removeItem(*localKey); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling removeItem"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Storage::clearCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8StoragePrivate* privData = V8DOM::toClassPtr<V8StoragePrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 0) { - - privData->nativeObj->clear(); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling clear"); - return v8::Undefined(); -} -bool V8Storage::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Storage.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Storage.h deleted file mode 100644 index b3d4c53..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Storage.h +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8Storage_h -#define V8Storage_h - -#include <string> -#include "DOM/Node.hpp" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8Storage { -public: - struct V8StoragePrivate { - V8DOM* dom; - uscxml::Storage* nativeObj; - }; - - V8_DESTRUCTOR_KEEP_WRAPPED(V8StoragePrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> keyCallback(const v8::Arguments&); - static v8::Handle<v8::Value> getItemCallback(const v8::Arguments&); - static v8::Handle<v8::Value> setItemCallback(const v8::Arguments&); - static v8::Handle<v8::Value> removeItemCallback(const v8::Arguments&); - static v8::Handle<v8::Value> clearCallback(const v8::Arguments&); - - static v8::Handle<v8::Value> lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("Storage")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("length"), V8Storage::lengthAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - prototype->Set(v8::String::NewSymbol("key"), - v8::FunctionTemplate::New(V8Storage::keyCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("getItem"), - v8::FunctionTemplate::New(V8Storage::getItemCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("setItem"), - v8::FunctionTemplate::New(V8Storage::setItemCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("removeItem"), - v8::FunctionTemplate::New(V8Storage::removeItemCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("clear"), - v8::FunctionTemplate::New(V8Storage::clearCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8Storage_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Text.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Text.cpp deleted file mode 100644 index ec06237..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Text.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8CharacterData.h" -#include "V8Text.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8Text::Tmpl; - -v8::Handle<v8::Value> V8Text::splitTextCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8TextPrivate* privData = V8DOM::toClassPtr<V8TextPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localOffset = args[0]->ToNumber()->Uint32Value(); - - Arabica::DOM::Text<std::string>* retVal = new Arabica::DOM::Text<std::string>(privData->nativeObj->splitText(localOffset)); - v8::Handle<v8::Function> retCtor = V8Text::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Text::V8TextPrivate* retPrivData = new V8Text::V8TextPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Text::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling splitText"); - return v8::Undefined(); -} -bool V8Text::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Text.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Text.h deleted file mode 100644 index 1151311..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Text.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8Text_h -#define V8Text_h - -#include <string> -#include "DOM/Node.hpp" -#include "V8CharacterData.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8Text { -public: - struct V8TextPrivate { - V8DOM* dom; - Arabica::DOM::Text<std::string>* nativeObj; - }; - - V8_DESTRUCTOR(V8TextPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> splitTextCallback(const v8::Arguments&); - - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("Text")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - - prototype->Set(v8::String::NewSymbol("splitText"), - v8::FunctionTemplate::New(V8Text::splitTextCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - - tmpl->Inherit(V8CharacterData::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8Text_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8TypedArrayCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8TypedArrayCustom.cpp deleted file mode 100644 index dc25a4f..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8TypedArrayCustom.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "../../TypedArray.h" -#include "V8ArrayBuffer.h" -#include "V8Int8Array.h" -#include "V8Uint8Array.h" -#include "V8Uint8ClampedArray.h" -#include "V8Int16Array.h" -#include "V8Uint16Array.h" -#include "V8Int32Array.h" -#include "V8Uint32Array.h" -#include "V8Float32Array.h" -#include "V8Float64Array.h" -#include "V8DataView.h" - -#define V8_TYPED_ARRAY_GET_PRIVATE(type) \ -v8::Local<v8::Object> self = info.Holder(); \ -uscxml::type* array = V8DOM::toClassPtr<V8##type##Private >(self->GetInternalField(0))->nativeObj; \ -if (index > array->getLength()) \ - return v8::Undefined(); - - -namespace Arabica { -namespace DOM { - -v8::Handle<v8::Value> V8Int8Array::indexedPropertyCustomSetter(unsigned int index, v8::Local<v8::Value> value, const v8::AccessorInfo &info) { - V8_TYPED_ARRAY_GET_PRIVATE(Int8Array); - array->set(index, value->ToInt32()->Value()); - return value; -} - -v8::Handle<v8::Value> V8Int16Array::indexedPropertyCustomSetter(unsigned int index, v8::Local<v8::Value> value, const v8::AccessorInfo &info) { - V8_TYPED_ARRAY_GET_PRIVATE(Int16Array); - array->set(index, value->ToInt32()->Value()); - return value; -} - -v8::Handle<v8::Value> V8Int32Array::indexedPropertyCustomSetter(unsigned int index, v8::Local<v8::Value> value, const v8::AccessorInfo &info) { - V8_TYPED_ARRAY_GET_PRIVATE(Int32Array); - array->set(index, value->ToInt32()->Value()); - return value; -} - -v8::Handle<v8::Value> V8Uint8Array::indexedPropertyCustomSetter(unsigned int index, v8::Local<v8::Value> value, const v8::AccessorInfo &info) { - V8_TYPED_ARRAY_GET_PRIVATE(Uint8Array); - array->set(index, value->ToUint32()->Value()); - return value; -} - -v8::Handle<v8::Value> V8Uint16Array::indexedPropertyCustomSetter(unsigned int index, v8::Local<v8::Value> value, const v8::AccessorInfo &info) { - V8_TYPED_ARRAY_GET_PRIVATE(Uint16Array); - array->set(index, value->ToUint32()->Value()); - return value; -} - -v8::Handle<v8::Value> V8Uint32Array::indexedPropertyCustomSetter(unsigned int index, v8::Local<v8::Value> value, const v8::AccessorInfo &info) { - V8_TYPED_ARRAY_GET_PRIVATE(Uint32Array); - array->set(index, value->ToUint32()->Value()); - return value; -} - -v8::Handle<v8::Value> V8Float32Array::indexedPropertyCustomSetter(unsigned int index, v8::Local<v8::Value> value, const v8::AccessorInfo &info) { - V8_TYPED_ARRAY_GET_PRIVATE(Float32Array); - array->set(index, value->ToNumber()->Value()); - return value; -} - -v8::Handle<v8::Value> V8Float64Array::indexedPropertyCustomSetter(unsigned int index, v8::Local<v8::Value> value, const v8::AccessorInfo &info) { - V8_TYPED_ARRAY_GET_PRIVATE(Float64Array); - array->set(index, value->ToNumber()->Value()); - return value; -} - -v8::Handle<v8::Value> V8Uint8ClampedArray::indexedPropertyCustomSetter(unsigned int index, v8::Local<v8::Value> value, const v8::AccessorInfo &info) { - V8_TYPED_ARRAY_GET_PRIVATE(Uint8ClampedArray); - array->set(index, value->ToUint32()->Value() & 0xff); - return value; -} - -// ---------------- - -v8::Handle<v8::Value> V8Int8Array::indexedPropertyCustomGetter(unsigned int index, const v8::AccessorInfo &info) { - V8_TYPED_ARRAY_GET_PRIVATE(Int8Array); - return v8::Int32::New(array->get(index)); -} - -v8::Handle<v8::Value> V8Int16Array::indexedPropertyCustomGetter(unsigned int index, const v8::AccessorInfo &info) { - V8_TYPED_ARRAY_GET_PRIVATE(Int16Array); - return v8::Int32::New(array->get(index)); -} - -v8::Handle<v8::Value> V8Int32Array::indexedPropertyCustomGetter(unsigned int index, const v8::AccessorInfo &info) { - V8_TYPED_ARRAY_GET_PRIVATE(Int32Array); - return v8::Int32::New(array->get(index)); -} - -v8::Handle<v8::Value> V8Uint8Array::indexedPropertyCustomGetter(unsigned int index, const v8::AccessorInfo &info) { - V8_TYPED_ARRAY_GET_PRIVATE(Uint8Array); - return v8::Uint32::New(array->get(index)); -} - -v8::Handle<v8::Value> V8Uint16Array::indexedPropertyCustomGetter(unsigned int index, const v8::AccessorInfo &info) { - V8_TYPED_ARRAY_GET_PRIVATE(Uint16Array); - return v8::Uint32::New(array->get(index)); -} - -v8::Handle<v8::Value> V8Uint32Array::indexedPropertyCustomGetter(unsigned int index, const v8::AccessorInfo &info) { - V8_TYPED_ARRAY_GET_PRIVATE(Uint32Array); - return v8::Uint32::New(array->get(index)); -} - -v8::Handle<v8::Value> V8Float32Array::indexedPropertyCustomGetter(unsigned int index, const v8::AccessorInfo &info) { - V8_TYPED_ARRAY_GET_PRIVATE(Float32Array); - return v8::Number::New(array->get(index)); -} - -v8::Handle<v8::Value> V8Float64Array::indexedPropertyCustomGetter(unsigned int index, const v8::AccessorInfo &info) { - V8_TYPED_ARRAY_GET_PRIVATE(Float64Array); - return v8::Number::New(array->get(index)); -} - -v8::Handle<v8::Value> V8Uint8ClampedArray::indexedPropertyCustomGetter(unsigned int index, const v8::AccessorInfo &info) { - V8_TYPED_ARRAY_GET_PRIVATE(Uint8ClampedArray); - return v8::Uint32::New(array->get(index)); -} - -} -}
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint16Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint16Array.cpp deleted file mode 100644 index 1fbe1d5..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint16Array.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8ArrayBuffer.h" -#include "V8ArrayBufferView.h" -#include "V8Uint16Array.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8Uint16Array::Tmpl; -v8::Persistent<v8::FunctionTemplate> V8Uint16Array::Constr; - -v8::Handle<v8::Value> V8Uint16Array::constructor(const v8::Arguments& args) { - if (!args.IsConstructCall()) - return v8::ThrowException(v8::String::New("Cannot call constructor as function")); - - uscxml::Uint16Array* localInstance = NULL; - if (false) { - } else if (args.Length() == 3 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0]) && - args[1]->IsUint32() && - args[2]->IsUint32()) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localByteOffset = args[1]->ToNumber()->Uint32Value(); - unsigned long localLength = args[2]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Uint16Array(localBuffer, localByteOffset, localLength); - - } else if (args.Length() == 2 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0]) && - args[1]->IsUint32()) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localByteOffset = args[1]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Uint16Array(localBuffer, localByteOffset); - - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Uint16Array::hasInstance(args[0])) { - - uscxml::Uint16Array* localArray = V8DOM::toClassPtr<V8Uint16Array::V8Uint16ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - localInstance = new uscxml::Uint16Array(localArray); - - } else if (args.Length() == 1 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0])) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - localInstance = new uscxml::Uint16Array(localBuffer); - - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - - unsigned long localLength = args[0]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Uint16Array(localLength); - - } else if (args.Length() == 1 && - args[0]->IsArray()) { - - std::vector<unsigned short> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToUint32()->Value()); - } - localInstance = new uscxml::Uint16Array(localArray); - - } - if (!localInstance) { - throw V8Exception("Parameter mismatch while calling constructor for Uint16Array"); - return v8::Undefined(); - } - - v8::Handle<v8::Function> retCtor = V8Uint16Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Uint16Array::V8Uint16ArrayPrivate* retPrivData = new V8Uint16Array::V8Uint16ArrayPrivate(); - retPrivData->nativeObj = localInstance; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Uint16Array::jsDestructor); - return retObj; -} - -v8::Handle<v8::Value> V8Uint16Array::lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8Uint16ArrayPrivate* privData = V8DOM::toClassPtr<V8Uint16ArrayPrivate >(self->GetInternalField(0)); - - return v8::Integer::New(privData->nativeObj->getLength()); -} - -v8::Handle<v8::Value> V8Uint16Array::getCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Uint16ArrayPrivate* privData = V8DOM::toClassPtr<V8Uint16ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - - unsigned short retVal = privData->nativeObj->get(localIndex); - - return v8::Number::New(retVal); - } - throw V8Exception("Parameter mismatch while calling get"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Uint16Array::setCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Uint16ArrayPrivate* privData = V8DOM::toClassPtr<V8Uint16ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsObject() && V8Uint16Array::hasInstance(args[0]) && - args[1]->IsUint32()) { - uscxml::Uint16Array* localArray = V8DOM::toClassPtr<V8Uint16Array::V8Uint16ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localOffset = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localArray, localOffset); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsUint32()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - unsigned short localValue = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localIndex, localValue); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsArray() && - args[1]->IsUint32()) { - std::vector<unsigned short> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToUint32()->Value()); - } - unsigned long localOffset = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localArray, localOffset); - - return v8::Undefined(); - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Uint16Array::hasInstance(args[0])) { - uscxml::Uint16Array* localArray = V8DOM::toClassPtr<V8Uint16Array::V8Uint16ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - - privData->nativeObj->set(localArray); - - return v8::Undefined(); - } else if (args.Length() == 1 && - args[0]->IsArray()) { - std::vector<unsigned short> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToUint32()->Value()); - } - - privData->nativeObj->set(localArray); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling set"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Uint16Array::subarrayCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Uint16ArrayPrivate* privData = V8DOM::toClassPtr<V8Uint16ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsInt32() && - args[1]->IsInt32()) { - long localStart = args[0]->ToNumber()->Int32Value(); - long localEnd = args[1]->ToNumber()->Int32Value(); - - uscxml::Uint16Array* retVal = new uscxml::Uint16Array(privData->nativeObj->subarray(localStart, localEnd)); - v8::Handle<v8::Function> retCtor = V8Uint16Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Uint16Array::V8Uint16ArrayPrivate* retPrivData = new V8Uint16Array::V8Uint16ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Uint16Array::jsDestructor); - return retObj; - - } else if (args.Length() == 1 && - args[0]->IsInt32()) { - long localStart = args[0]->ToNumber()->Int32Value(); - - uscxml::Uint16Array* retVal = new uscxml::Uint16Array(privData->nativeObj->subarray(localStart)); - v8::Handle<v8::Function> retCtor = V8Uint16Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Uint16Array::V8Uint16ArrayPrivate* retPrivData = new V8Uint16Array::V8Uint16ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Uint16Array::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling subarray"); - return v8::Undefined(); -} -bool V8Uint16Array::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint16Array.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint16Array.h deleted file mode 100644 index 3f94ab8..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint16Array.h +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8Uint16Array_h -#define V8Uint16Array_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "V8ArrayBufferView.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8Uint16Array { -public: - struct V8Uint16ArrayPrivate { - V8DOM* dom; - uscxml::Uint16Array* nativeObj; - }; - - V8_DESTRUCTOR(V8Uint16ArrayPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> getCallback(const v8::Arguments&); - static v8::Handle<v8::Value> setCallback(const v8::Arguments&); - static v8::Handle<v8::Value> subarrayCallback(const v8::Arguments&); - - static v8::Handle<v8::Value> lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> indexedPropertyCustomGetter(uint32_t, const v8::AccessorInfo&); - static v8::Handle<v8::Value> indexedPropertyCustomSetter(uint32_t, v8::Local<v8::Value>, const v8::AccessorInfo&); - - static v8::Handle<v8::Value> constructor(const v8::Arguments&); - static v8::Persistent<v8::FunctionTemplate> Constr; - static v8::Handle<v8::FunctionTemplate> getConstructor() { - if (Constr.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> constr = v8::FunctionTemplate::New(constructor); - Constr = v8::Persistent<v8::FunctionTemplate>::New(constr); - } - return Constr; - } - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("Uint16Array")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("length"), V8Uint16Array::lengthAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - instance->SetIndexedPropertyHandler(V8Uint16Array::indexedPropertyCustomGetter, V8Uint16Array::indexedPropertyCustomSetter); - prototype->Set(v8::String::NewSymbol("get"), - v8::FunctionTemplate::New(V8Uint16Array::getCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("set"), - v8::FunctionTemplate::New(V8Uint16Array::setCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("subarray"), - v8::FunctionTemplate::New(V8Uint16Array::subarrayCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - tmpl->Set(v8::String::NewSymbol("BYTES_PER_ELEMENT"), v8::Integer::New(2), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("BYTES_PER_ELEMENT"), v8::Integer::New(2), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - - tmpl->Inherit(V8ArrayBufferView::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8Uint16Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint32Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint32Array.cpp deleted file mode 100644 index 10f3b3c..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint32Array.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8ArrayBuffer.h" -#include "V8ArrayBufferView.h" -#include "V8Uint32Array.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8Uint32Array::Tmpl; -v8::Persistent<v8::FunctionTemplate> V8Uint32Array::Constr; - -v8::Handle<v8::Value> V8Uint32Array::constructor(const v8::Arguments& args) { - if (!args.IsConstructCall()) - return v8::ThrowException(v8::String::New("Cannot call constructor as function")); - - uscxml::Uint32Array* localInstance = NULL; - if (false) { - } else if (args.Length() == 3 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0]) && - args[1]->IsUint32() && - args[2]->IsUint32()) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localByteOffset = args[1]->ToNumber()->Uint32Value(); - unsigned long localLength = args[2]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Uint32Array(localBuffer, localByteOffset, localLength); - - } else if (args.Length() == 2 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0]) && - args[1]->IsUint32()) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localByteOffset = args[1]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Uint32Array(localBuffer, localByteOffset); - - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Uint32Array::hasInstance(args[0])) { - - uscxml::Uint32Array* localArray = V8DOM::toClassPtr<V8Uint32Array::V8Uint32ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - localInstance = new uscxml::Uint32Array(localArray); - - } else if (args.Length() == 1 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0])) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - localInstance = new uscxml::Uint32Array(localBuffer); - - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - - unsigned long localLength = args[0]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Uint32Array(localLength); - - } else if (args.Length() == 1 && - args[0]->IsArray()) { - - std::vector<unsigned long> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToUint32()->Value()); - } - localInstance = new uscxml::Uint32Array(localArray); - - } - if (!localInstance) { - throw V8Exception("Parameter mismatch while calling constructor for Uint32Array"); - return v8::Undefined(); - } - - v8::Handle<v8::Function> retCtor = V8Uint32Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Uint32Array::V8Uint32ArrayPrivate* retPrivData = new V8Uint32Array::V8Uint32ArrayPrivate(); - retPrivData->nativeObj = localInstance; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Uint32Array::jsDestructor); - return retObj; -} - -v8::Handle<v8::Value> V8Uint32Array::lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8Uint32ArrayPrivate* privData = V8DOM::toClassPtr<V8Uint32ArrayPrivate >(self->GetInternalField(0)); - - return v8::Integer::New(privData->nativeObj->getLength()); -} - -v8::Handle<v8::Value> V8Uint32Array::getCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Uint32ArrayPrivate* privData = V8DOM::toClassPtr<V8Uint32ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - - unsigned long retVal = privData->nativeObj->get(localIndex); - - return v8::Number::New(retVal); - } - throw V8Exception("Parameter mismatch while calling get"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Uint32Array::setCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Uint32ArrayPrivate* privData = V8DOM::toClassPtr<V8Uint32ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsObject() && V8Uint32Array::hasInstance(args[0]) && - args[1]->IsUint32()) { - uscxml::Uint32Array* localArray = V8DOM::toClassPtr<V8Uint32Array::V8Uint32ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localOffset = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localArray, localOffset); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsUint32()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - unsigned long localValue = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localIndex, localValue); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsArray() && - args[1]->IsUint32()) { - std::vector<unsigned long> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToUint32()->Value()); - } - unsigned long localOffset = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localArray, localOffset); - - return v8::Undefined(); - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Uint32Array::hasInstance(args[0])) { - uscxml::Uint32Array* localArray = V8DOM::toClassPtr<V8Uint32Array::V8Uint32ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - - privData->nativeObj->set(localArray); - - return v8::Undefined(); - } else if (args.Length() == 1 && - args[0]->IsArray()) { - std::vector<unsigned long> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToUint32()->Value()); - } - - privData->nativeObj->set(localArray); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling set"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Uint32Array::subarrayCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Uint32ArrayPrivate* privData = V8DOM::toClassPtr<V8Uint32ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsInt32() && - args[1]->IsInt32()) { - long localStart = args[0]->ToNumber()->Int32Value(); - long localEnd = args[1]->ToNumber()->Int32Value(); - - uscxml::Uint32Array* retVal = new uscxml::Uint32Array(privData->nativeObj->subarray(localStart, localEnd)); - v8::Handle<v8::Function> retCtor = V8Uint32Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Uint32Array::V8Uint32ArrayPrivate* retPrivData = new V8Uint32Array::V8Uint32ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Uint32Array::jsDestructor); - return retObj; - - } else if (args.Length() == 1 && - args[0]->IsInt32()) { - long localStart = args[0]->ToNumber()->Int32Value(); - - uscxml::Uint32Array* retVal = new uscxml::Uint32Array(privData->nativeObj->subarray(localStart)); - v8::Handle<v8::Function> retCtor = V8Uint32Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Uint32Array::V8Uint32ArrayPrivate* retPrivData = new V8Uint32Array::V8Uint32ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Uint32Array::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling subarray"); - return v8::Undefined(); -} -bool V8Uint32Array::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint32Array.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint32Array.h deleted file mode 100644 index 2ecaa9e..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint32Array.h +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8Uint32Array_h -#define V8Uint32Array_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "V8ArrayBufferView.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8Uint32Array { -public: - struct V8Uint32ArrayPrivate { - V8DOM* dom; - uscxml::Uint32Array* nativeObj; - }; - - V8_DESTRUCTOR(V8Uint32ArrayPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> getCallback(const v8::Arguments&); - static v8::Handle<v8::Value> setCallback(const v8::Arguments&); - static v8::Handle<v8::Value> subarrayCallback(const v8::Arguments&); - - static v8::Handle<v8::Value> lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> indexedPropertyCustomGetter(uint32_t, const v8::AccessorInfo&); - static v8::Handle<v8::Value> indexedPropertyCustomSetter(uint32_t, v8::Local<v8::Value>, const v8::AccessorInfo&); - - static v8::Handle<v8::Value> constructor(const v8::Arguments&); - static v8::Persistent<v8::FunctionTemplate> Constr; - static v8::Handle<v8::FunctionTemplate> getConstructor() { - if (Constr.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> constr = v8::FunctionTemplate::New(constructor); - Constr = v8::Persistent<v8::FunctionTemplate>::New(constr); - } - return Constr; - } - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("Uint32Array")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("length"), V8Uint32Array::lengthAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - instance->SetIndexedPropertyHandler(V8Uint32Array::indexedPropertyCustomGetter, V8Uint32Array::indexedPropertyCustomSetter); - prototype->Set(v8::String::NewSymbol("get"), - v8::FunctionTemplate::New(V8Uint32Array::getCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("set"), - v8::FunctionTemplate::New(V8Uint32Array::setCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("subarray"), - v8::FunctionTemplate::New(V8Uint32Array::subarrayCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - tmpl->Set(v8::String::NewSymbol("BYTES_PER_ELEMENT"), v8::Integer::New(4), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("BYTES_PER_ELEMENT"), v8::Integer::New(4), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - - tmpl->Inherit(V8ArrayBufferView::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8Uint32Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8Array.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8Array.cpp deleted file mode 100644 index 3a8248a..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8Array.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8ArrayBuffer.h" -#include "V8ArrayBufferView.h" -#include "V8Uint8Array.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8Uint8Array::Tmpl; -v8::Persistent<v8::FunctionTemplate> V8Uint8Array::Constr; - -v8::Handle<v8::Value> V8Uint8Array::constructor(const v8::Arguments& args) { - if (!args.IsConstructCall()) - return v8::ThrowException(v8::String::New("Cannot call constructor as function")); - - uscxml::Uint8Array* localInstance = NULL; - if (false) { - } else if (args.Length() == 3 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0]) && - args[1]->IsUint32() && - args[2]->IsUint32()) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localByteOffset = args[1]->ToNumber()->Uint32Value(); - unsigned long localLength = args[2]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Uint8Array(localBuffer, localByteOffset, localLength); - - } else if (args.Length() == 2 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0]) && - args[1]->IsUint32()) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localByteOffset = args[1]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Uint8Array(localBuffer, localByteOffset); - - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Uint8Array::hasInstance(args[0])) { - - uscxml::Uint8Array* localArray = V8DOM::toClassPtr<V8Uint8Array::V8Uint8ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - localInstance = new uscxml::Uint8Array(localArray); - - } else if (args.Length() == 1 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0])) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - localInstance = new uscxml::Uint8Array(localBuffer); - - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - - unsigned long localLength = args[0]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Uint8Array(localLength); - - } else if (args.Length() == 1 && - args[0]->IsArray()) { - - std::vector<unsigned char> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToUint32()->Value()); - } - localInstance = new uscxml::Uint8Array(localArray); - - } - if (!localInstance) { - throw V8Exception("Parameter mismatch while calling constructor for Uint8Array"); - return v8::Undefined(); - } - - v8::Handle<v8::Function> retCtor = V8Uint8Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Uint8Array::V8Uint8ArrayPrivate* retPrivData = new V8Uint8Array::V8Uint8ArrayPrivate(); - retPrivData->nativeObj = localInstance; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Uint8Array::jsDestructor); - return retObj; -} - -v8::Handle<v8::Value> V8Uint8Array::lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8Uint8ArrayPrivate* privData = V8DOM::toClassPtr<V8Uint8ArrayPrivate >(self->GetInternalField(0)); - - return v8::Integer::New(privData->nativeObj->getLength()); -} - -v8::Handle<v8::Value> V8Uint8Array::getCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Uint8ArrayPrivate* privData = V8DOM::toClassPtr<V8Uint8ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - - unsigned char retVal = privData->nativeObj->get(localIndex); - - return v8::Number::New(retVal); - } - throw V8Exception("Parameter mismatch while calling get"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Uint8Array::setCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Uint8ArrayPrivate* privData = V8DOM::toClassPtr<V8Uint8ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsObject() && V8Uint8Array::hasInstance(args[0]) && - args[1]->IsUint32()) { - uscxml::Uint8Array* localArray = V8DOM::toClassPtr<V8Uint8Array::V8Uint8ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localOffset = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localArray, localOffset); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsUint32()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - unsigned char localValue = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localIndex, localValue); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsArray() && - args[1]->IsUint32()) { - std::vector<unsigned char> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToUint32()->Value()); - } - unsigned long localOffset = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localArray, localOffset); - - return v8::Undefined(); - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Uint8Array::hasInstance(args[0])) { - uscxml::Uint8Array* localArray = V8DOM::toClassPtr<V8Uint8Array::V8Uint8ArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - - privData->nativeObj->set(localArray); - - return v8::Undefined(); - } else if (args.Length() == 1 && - args[0]->IsArray()) { - std::vector<unsigned char> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToUint32()->Value()); - } - - privData->nativeObj->set(localArray); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling set"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Uint8Array::subarrayCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Uint8ArrayPrivate* privData = V8DOM::toClassPtr<V8Uint8ArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsInt32() && - args[1]->IsInt32()) { - long localStart = args[0]->ToNumber()->Int32Value(); - long localEnd = args[1]->ToNumber()->Int32Value(); - - uscxml::Uint8Array* retVal = new uscxml::Uint8Array(privData->nativeObj->subarray(localStart, localEnd)); - v8::Handle<v8::Function> retCtor = V8Uint8Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Uint8Array::V8Uint8ArrayPrivate* retPrivData = new V8Uint8Array::V8Uint8ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Uint8Array::jsDestructor); - return retObj; - - } else if (args.Length() == 1 && - args[0]->IsInt32()) { - long localStart = args[0]->ToNumber()->Int32Value(); - - uscxml::Uint8Array* retVal = new uscxml::Uint8Array(privData->nativeObj->subarray(localStart)); - v8::Handle<v8::Function> retCtor = V8Uint8Array::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Uint8Array::V8Uint8ArrayPrivate* retPrivData = new V8Uint8Array::V8Uint8ArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Uint8Array::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling subarray"); - return v8::Undefined(); -} -bool V8Uint8Array::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8Array.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8Array.h deleted file mode 100644 index 9ecc219..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8Array.h +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8Uint8Array_h -#define V8Uint8Array_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "V8ArrayBufferView.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8Uint8Array { -public: - struct V8Uint8ArrayPrivate { - V8DOM* dom; - uscxml::Uint8Array* nativeObj; - }; - - V8_DESTRUCTOR(V8Uint8ArrayPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> getCallback(const v8::Arguments&); - static v8::Handle<v8::Value> setCallback(const v8::Arguments&); - static v8::Handle<v8::Value> subarrayCallback(const v8::Arguments&); - - static v8::Handle<v8::Value> lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> indexedPropertyCustomGetter(uint32_t, const v8::AccessorInfo&); - static v8::Handle<v8::Value> indexedPropertyCustomSetter(uint32_t, v8::Local<v8::Value>, const v8::AccessorInfo&); - - static v8::Handle<v8::Value> constructor(const v8::Arguments&); - static v8::Persistent<v8::FunctionTemplate> Constr; - static v8::Handle<v8::FunctionTemplate> getConstructor() { - if (Constr.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> constr = v8::FunctionTemplate::New(constructor); - Constr = v8::Persistent<v8::FunctionTemplate>::New(constr); - } - return Constr; - } - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("Uint8Array")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("length"), V8Uint8Array::lengthAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - instance->SetIndexedPropertyHandler(V8Uint8Array::indexedPropertyCustomGetter, V8Uint8Array::indexedPropertyCustomSetter); - prototype->Set(v8::String::NewSymbol("get"), - v8::FunctionTemplate::New(V8Uint8Array::getCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("set"), - v8::FunctionTemplate::New(V8Uint8Array::setCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("subarray"), - v8::FunctionTemplate::New(V8Uint8Array::subarrayCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - tmpl->Set(v8::String::NewSymbol("BYTES_PER_ELEMENT"), v8::Integer::New(1), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("BYTES_PER_ELEMENT"), v8::Integer::New(1), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - - tmpl->Inherit(V8ArrayBufferView::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8Uint8Array_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8ClampedArray.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8ClampedArray.cpp deleted file mode 100644 index e05c8a8..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8ClampedArray.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8ArrayBuffer.h" -#include "V8ArrayBufferView.h" -#include "V8Uint8ClampedArray.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8Uint8ClampedArray::Tmpl; -v8::Persistent<v8::FunctionTemplate> V8Uint8ClampedArray::Constr; - -v8::Handle<v8::Value> V8Uint8ClampedArray::constructor(const v8::Arguments& args) { - if (!args.IsConstructCall()) - return v8::ThrowException(v8::String::New("Cannot call constructor as function")); - - uscxml::Uint8ClampedArray* localInstance = NULL; - if (false) { - } else if (args.Length() == 3 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0]) && - args[1]->IsUint32() && - args[2]->IsUint32()) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localByteOffset = args[1]->ToNumber()->Uint32Value(); - unsigned long localLength = args[2]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Uint8ClampedArray(localBuffer, localByteOffset, localLength); - - } else if (args.Length() == 2 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0]) && - args[1]->IsUint32()) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localByteOffset = args[1]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Uint8ClampedArray(localBuffer, localByteOffset); - - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Uint8ClampedArray::hasInstance(args[0])) { - - uscxml::Uint8ClampedArray* localArray = V8DOM::toClassPtr<V8Uint8ClampedArray::V8Uint8ClampedArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - localInstance = new uscxml::Uint8ClampedArray(localArray); - - } else if (args.Length() == 1 && - args[0]->IsObject() && V8ArrayBuffer::hasInstance(args[0])) { - - uscxml::ArrayBuffer* localBuffer = V8DOM::toClassPtr<V8ArrayBuffer::V8ArrayBufferPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - localInstance = new uscxml::Uint8ClampedArray(localBuffer); - - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - - unsigned long localLength = args[0]->ToNumber()->Uint32Value(); - localInstance = new uscxml::Uint8ClampedArray(localLength); - - } else if (args.Length() == 1 && - args[0]->IsArray()) { - - std::vector<unsigned char> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToUint32()->Value()); - } - localInstance = new uscxml::Uint8ClampedArray(localArray); - - } - if (!localInstance) { - throw V8Exception("Parameter mismatch while calling constructor for Uint8ClampedArray"); - return v8::Undefined(); - } - - v8::Handle<v8::Function> retCtor = V8Uint8ClampedArray::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Uint8ClampedArray::V8Uint8ClampedArrayPrivate* retPrivData = new V8Uint8ClampedArray::V8Uint8ClampedArrayPrivate(); - retPrivData->nativeObj = localInstance; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Uint8ClampedArray::jsDestructor); - return retObj; -} - -v8::Handle<v8::Value> V8Uint8ClampedArray::lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8Uint8ClampedArrayPrivate* privData = V8DOM::toClassPtr<V8Uint8ClampedArrayPrivate >(self->GetInternalField(0)); - - return v8::Integer::New(privData->nativeObj->getLength()); -} - -v8::Handle<v8::Value> V8Uint8ClampedArray::getCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Uint8ClampedArrayPrivate* privData = V8DOM::toClassPtr<V8Uint8ClampedArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 1 && - args[0]->IsUint32()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - - unsigned char retVal = privData->nativeObj->get(localIndex); - - return v8::Number::New(retVal); - } - throw V8Exception("Parameter mismatch while calling get"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Uint8ClampedArray::setCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Uint8ClampedArrayPrivate* privData = V8DOM::toClassPtr<V8Uint8ClampedArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsObject() && V8Uint8ClampedArray::hasInstance(args[0]) && - args[1]->IsUint32()) { - uscxml::Uint8ClampedArray* localArray = V8DOM::toClassPtr<V8Uint8ClampedArray::V8Uint8ClampedArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - unsigned long localOffset = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localArray, localOffset); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsUint32() && - args[1]->IsUint32()) { - unsigned long localIndex = args[0]->ToNumber()->Uint32Value(); - unsigned char localValue = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localIndex, localValue); - - return v8::Undefined(); - } else if (args.Length() == 2 && - args[0]->IsArray() && - args[1]->IsUint32()) { - std::vector<unsigned char> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToUint32()->Value()); - } - unsigned long localOffset = args[1]->ToNumber()->Uint32Value(); - - privData->nativeObj->set(localArray, localOffset); - - return v8::Undefined(); - } else if (args.Length() == 1 && - args[0]->IsObject() && V8Uint8ClampedArray::hasInstance(args[0])) { - uscxml::Uint8ClampedArray* localArray = V8DOM::toClassPtr<V8Uint8ClampedArray::V8Uint8ClampedArrayPrivate >(args[0]->ToObject()->GetInternalField(0))->nativeObj; - - privData->nativeObj->set(localArray); - - return v8::Undefined(); - } else if (args.Length() == 1 && - args[0]->IsArray()) { - std::vector<unsigned char> localArray; - v8::Handle<v8::Array> localArrayArray(v8::Array::Cast(*args[0])); - for (int i = 0; i < localArrayArray->Length(); i++) { - localArray.push_back(localArrayArray->Get(i)->ToUint32()->Value()); - } - - privData->nativeObj->set(localArray); - - return v8::Undefined(); - } - throw V8Exception("Parameter mismatch while calling set"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8Uint8ClampedArray::subarrayCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8Uint8ClampedArrayPrivate* privData = V8DOM::toClassPtr<V8Uint8ClampedArrayPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 2 && - args[0]->IsInt32() && - args[1]->IsInt32()) { - long localStart = args[0]->ToNumber()->Int32Value(); - long localEnd = args[1]->ToNumber()->Int32Value(); - - uscxml::Uint8ClampedArray* retVal = new uscxml::Uint8ClampedArray(privData->nativeObj->subarray(localStart, localEnd)); - v8::Handle<v8::Function> retCtor = V8Uint8ClampedArray::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Uint8ClampedArray::V8Uint8ClampedArrayPrivate* retPrivData = new V8Uint8ClampedArray::V8Uint8ClampedArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Uint8ClampedArray::jsDestructor); - return retObj; - - } else if (args.Length() == 1 && - args[0]->IsInt32()) { - long localStart = args[0]->ToNumber()->Int32Value(); - - uscxml::Uint8ClampedArray* retVal = new uscxml::Uint8ClampedArray(privData->nativeObj->subarray(localStart)); - v8::Handle<v8::Function> retCtor = V8Uint8ClampedArray::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Uint8ClampedArray::V8Uint8ClampedArrayPrivate* retPrivData = new V8Uint8ClampedArray::V8Uint8ClampedArrayPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Uint8ClampedArray::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling subarray"); - return v8::Undefined(); -} -bool V8Uint8ClampedArray::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8ClampedArray.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8ClampedArray.h deleted file mode 100644 index 3fa08de..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Uint8ClampedArray.h +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8Uint8ClampedArray_h -#define V8Uint8ClampedArray_h - -#include <string> -#include "../../TypedArray.h" -#include "DOM/Node.hpp" -#include "V8ArrayBufferView.h" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8Uint8ClampedArray { -public: - struct V8Uint8ClampedArrayPrivate { - V8DOM* dom; - uscxml::Uint8ClampedArray* nativeObj; - }; - - V8_DESTRUCTOR(V8Uint8ClampedArrayPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> getCallback(const v8::Arguments&); - static v8::Handle<v8::Value> setCallback(const v8::Arguments&); - static v8::Handle<v8::Value> subarrayCallback(const v8::Arguments&); - - static v8::Handle<v8::Value> lengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> indexedPropertyCustomGetter(uint32_t, const v8::AccessorInfo&); - static v8::Handle<v8::Value> indexedPropertyCustomSetter(uint32_t, v8::Local<v8::Value>, const v8::AccessorInfo&); - - static v8::Handle<v8::Value> constructor(const v8::Arguments&); - static v8::Persistent<v8::FunctionTemplate> Constr; - static v8::Handle<v8::FunctionTemplate> getConstructor() { - if (Constr.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> constr = v8::FunctionTemplate::New(constructor); - Constr = v8::Persistent<v8::FunctionTemplate>::New(constr); - } - return Constr; - } - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("Uint8ClampedArray")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("length"), V8Uint8ClampedArray::lengthAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - instance->SetIndexedPropertyHandler(V8Uint8ClampedArray::indexedPropertyCustomGetter, V8Uint8ClampedArray::indexedPropertyCustomSetter); - prototype->Set(v8::String::NewSymbol("get"), - v8::FunctionTemplate::New(V8Uint8ClampedArray::getCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("set"), - v8::FunctionTemplate::New(V8Uint8ClampedArray::setCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("subarray"), - v8::FunctionTemplate::New(V8Uint8ClampedArray::subarrayCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - tmpl->Set(v8::String::NewSymbol("BYTES_PER_ELEMENT"), v8::Integer::New(1), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - prototype->Set(v8::String::NewSymbol("BYTES_PER_ELEMENT"), v8::Integer::New(1), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum)); - - tmpl->Inherit(V8ArrayBufferView::getTmpl()); - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8Uint8ClampedArray_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResult.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResult.cpp deleted file mode 100644 index 8bfd883..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResult.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8NodeSet.h" -#include "V8XPathResult.h" - -namespace Arabica { -namespace DOM { - -v8::Persistent<v8::FunctionTemplate> V8XPathResult::Tmpl; - -v8::Handle<v8::Value> V8XPathResult::numberValueAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8XPathResultPrivate* privData = V8DOM::toClassPtr<V8XPathResultPrivate >(self->GetInternalField(0)); - - return v8::Number::New(privData->nativeObj->asNumber()); -} - -v8::Handle<v8::Value> V8XPathResult::stringValueAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8XPathResultPrivate* privData = V8DOM::toClassPtr<V8XPathResultPrivate >(self->GetInternalField(0)); - - return v8::String::New(privData->nativeObj->asString().c_str()); -} - -v8::Handle<v8::Value> V8XPathResult::booleanValueAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - struct V8XPathResultPrivate* privData = V8DOM::toClassPtr<V8XPathResultPrivate >(self->GetInternalField(0)); - - return v8::Boolean::New(privData->nativeObj->asBool()); -} - -v8::Handle<v8::Value> V8XPathResult::asNodeSetCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8XPathResultPrivate* privData = V8DOM::toClassPtr<V8XPathResultPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 0) { - - Arabica::XPath::NodeSet<std::string>* retVal = new Arabica::XPath::NodeSet<std::string>(privData->nativeObj->asNodeSet()); - v8::Handle<v8::Function> retCtor = V8NodeSet::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8NodeSet::V8NodeSetPrivate* retPrivData = new V8NodeSet::V8NodeSetPrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8NodeSet::jsDestructor); - return retObj; - - } - throw V8Exception("Parameter mismatch while calling asNodeSet"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8XPathResult::asBoolCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8XPathResultPrivate* privData = V8DOM::toClassPtr<V8XPathResultPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 0) { - - bool retVal = privData->nativeObj->asBool(); - - return v8::Boolean::New(retVal); - } - throw V8Exception("Parameter mismatch while calling asBool"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8XPathResult::asStringCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8XPathResultPrivate* privData = V8DOM::toClassPtr<V8XPathResultPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 0) { - - std::string retVal = privData->nativeObj->asString(); - - return v8::String::New(retVal.c_str()); - } - throw V8Exception("Parameter mismatch while calling asString"); - return v8::Undefined(); -} - -v8::Handle<v8::Value> V8XPathResult::asNumberCallback(const v8::Arguments& args) { - - v8::Local<v8::Object> self = args.Holder(); - struct V8XPathResultPrivate* privData = V8DOM::toClassPtr<V8XPathResultPrivate >(self->GetInternalField(0)); - if (false) { - } else if (args.Length() == 0) { - - double retVal = privData->nativeObj->asNumber(); - - return v8::Number::New(retVal); - } - throw V8Exception("Parameter mismatch while calling asNumber"); - return v8::Undefined(); -} -bool V8XPathResult::hasInstance(v8::Handle<v8::Value> value) { - return getTmpl()->HasInstance(value); -} - -} -} diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResult.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResult.h deleted file mode 100644 index 3aab7b0..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResult.h +++ /dev/null @@ -1,96 +0,0 @@ -/** - * @file - * @author This file has been generated by generate-bindings.pl. DO NOT MODIFY! - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - - -#ifndef V8XPathResult_h -#define V8XPathResult_h - -#include <string> -#include "DOM/Node.hpp" -#include "string" -#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h" -#include <v8.h> - -namespace Arabica { -namespace DOM { - -class V8XPathResult { -public: - struct V8XPathResultPrivate { - V8DOM* dom; - Arabica::XPath::XPathValue<std::string>* nativeObj; - }; - - V8_DESTRUCTOR(V8XPathResultPrivate); - static bool hasInstance(v8::Handle<v8::Value>); - - static v8::Handle<v8::Value> asNodeSetCallback(const v8::Arguments&); - static v8::Handle<v8::Value> asBoolCallback(const v8::Arguments&); - static v8::Handle<v8::Value> asStringCallback(const v8::Arguments&); - static v8::Handle<v8::Value> asNumberCallback(const v8::Arguments&); - - static v8::Handle<v8::Value> numberValueAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> stringValueAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> booleanValueAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - static v8::Handle<v8::Value> singleNodeValueCustomAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info); - - static v8::Persistent<v8::FunctionTemplate> Tmpl; - static v8::Handle<v8::FunctionTemplate> getTmpl() { - if (Tmpl.IsEmpty()) { - v8::Handle<v8::FunctionTemplate> tmpl = v8::FunctionTemplate::New(); - tmpl->SetClassName(v8::String::New("XPathResult")); - tmpl->ReadOnlyPrototype(); - - v8::Local<v8::ObjectTemplate> instance = tmpl->InstanceTemplate(); - v8::Local<v8::ObjectTemplate> prototype = tmpl->PrototypeTemplate(); - (void)prototype; // surpress unused warnings - - instance->SetInternalFieldCount(1); - - instance->SetAccessor(v8::String::NewSymbol("numberValue"), V8XPathResult::numberValueAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("stringValue"), V8XPathResult::stringValueAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("booleanValue"), V8XPathResult::booleanValueAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - instance->SetAccessor(v8::String::NewSymbol("singleNodeValue"), V8XPathResult::singleNodeValueCustomAttrGetter, 0, - v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)); - - prototype->Set(v8::String::NewSymbol("asNodeSet"), - v8::FunctionTemplate::New(V8XPathResult::asNodeSetCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("asBool"), - v8::FunctionTemplate::New(V8XPathResult::asBoolCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("asString"), - v8::FunctionTemplate::New(V8XPathResult::asStringCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - prototype->Set(v8::String::NewSymbol("asNumber"), - v8::FunctionTemplate::New(V8XPathResult::asNumberCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete)); - - - Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl); - } - return Tmpl; - } - - -}; - -} -} - -#endif // V8XPathResult_h diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResultCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResultCustom.cpp deleted file mode 100644 index 3e4063f..0000000 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8XPathResultCustom.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "V8XPathResult.h" -#include "V8Node.h" - -namespace Arabica { -namespace DOM { - -v8::Handle<v8::Value> V8XPathResult::singleNodeValueCustomAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info) { - v8::Local<v8::Object> self = info.Holder(); - V8XPathResultPrivate* privData = V8DOM::toClassPtr<V8XPathResultPrivate >(self->GetInternalField(0)); - - Arabica::DOM::Node<std::string>* retVal = new Arabica::DOM::Node<std::string>(privData->nativeObj->asNodeSet()[0]); - - v8::Handle<v8::Function> retCtor = V8Node::getTmpl()->GetFunction(); - v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance()); - - struct V8Node::V8NodePrivate* retPrivData = new V8Node::V8NodePrivate(); - retPrivData->dom = privData->dom; - retPrivData->nativeObj = retVal; - - retObj->SetInternalField(0, V8DOM::toExternal(retPrivData)); - - retObj.MakeWeak(0, V8Node::jsDestructor); - return retObj; -} - -} -}
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/lua/LuaDOM.cpp.inc b/src/uscxml/plugins/datamodel/lua/LuaDOM.cpp.inc new file mode 100644 index 0000000..5a256b6 --- /dev/null +++ b/src/uscxml/plugins/datamodel/lua/LuaDOM.cpp.inc @@ -0,0 +1,8969 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 3.0.8 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + + +#ifndef SWIGLUA +#define SWIGLUA +#endif + +#define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA +#define SWIG_LUA_MODULE_GLOBAL + + +#ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ +template<typename T> class SwigValueWrapper { + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs); + SwigValueWrapper(const SwigValueWrapper<T>& rhs); +public: + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } +}; + +template <typename T> T SwigValueInit() { + return T(); +} +#endif + +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + +/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ +#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) +# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#endif + +/* Intel's compiler complains if a variable which was never initialised is + * cast to void, which is a common idiom which we use to indicate that we + * are aware a variable isn't used. So we just silence that warning. + * See: https://github.com/swig/swig/issues/192 for more discussion. + */ +#ifdef __INTEL_COMPILER +# pragma warning disable 592 +#endif + +/* ----------------------------------------------------------------------------- + * swigrun.swg + * + * This file contains generic C API SWIG runtime support for pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +/* This should only be incremented when either the layout of swig_type_info changes, + or for whatever reason, the runtime changes incompatibly */ +#define SWIG_RUNTIME_VERSION "4" + +/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ +#ifdef SWIG_TYPE_TABLE +# define SWIG_QUOTE_STRING(x) #x +# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) +# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) +#else +# define SWIG_TYPE_TABLE_NAME +#endif + +/* + You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. + + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. +*/ + +#ifndef SWIGRUNTIME +# define SWIGRUNTIME SWIGINTERN +#endif + +#ifndef SWIGRUNTIMEINLINE +# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE +#endif + +/* Generic buffer size */ +#ifndef SWIG_BUFFER_SIZE +# define SWIG_BUFFER_SIZE 1024 +#endif + +/* Flags for pointer conversions */ +#define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 + +/* Flags for new pointer objects */ +#define SWIG_POINTER_OWN 0x1 + + +/* + Flags/methods for returning states. + + The SWIG conversion methods, as ConvertPtr, return an integer + that tells if the conversion was successful or not. And if not, + an error code can be returned (see swigerrors.swg for the codes). + + Use the following macros/flags to set or process the returning + states. + + In old versions of SWIG, code such as the following was usually written: + + if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { + // success code + } else { + //fail code + } + + Now you can be more explicit: + + int res = SWIG_ConvertPtr(obj,vptr,ty.flags); + if (SWIG_IsOK(res)) { + // success code + } else { + // fail code + } + + which is the same really, but now you can also do + + Type *ptr; + int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); + if (SWIG_IsOK(res)) { + // success code + if (SWIG_IsNewObj(res) { + ... + delete *ptr; + } else { + ... + } + } else { + // fail code + } + + I.e., now SWIG_ConvertPtr can return new objects and you can + identify the case and take care of the deallocation. Of course that + also requires SWIG_ConvertPtr to return new result values, such as + + int SWIG_ConvertPtr(obj, ptr,...) { + if (<obj is ok>) { + if (<need new object>) { + *ptr = <ptr to new allocated object>; + return SWIG_NEWOBJ; + } else { + *ptr = <ptr to old object>; + return SWIG_OLDOBJ; + } + } else { + return SWIG_BADOBJ; + } + } + + Of course, returning the plain '0(success)/-1(fail)' still works, but you can be + more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the + SWIG errors code. + + Finally, if the SWIG_CASTRANK_MODE is enabled, the result code + allows to return the 'cast rank', for example, if you have this + + int food(double) + int fooi(int); + + and you call + + food(1) // cast rank '1' (1 -> 1.0) + fooi(1) // cast rank '0' + + just use the SWIG_AddCast()/SWIG_CheckState() +*/ + +#define SWIG_OK (0) +#define SWIG_ERROR (-1) +#define SWIG_IsOK(r) (r >= 0) +#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) + +/* The CastRankLimit says how many bits are used for the cast rank */ +#define SWIG_CASTRANKLIMIT (1 << 8) +/* The NewMask denotes the object was created (using new/malloc) */ +#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) +/* The TmpMask is for in/out typemaps that use temporal objects */ +#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) +/* Simple returning values */ +#define SWIG_BADOBJ (SWIG_ERROR) +#define SWIG_OLDOBJ (SWIG_OK) +#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) +#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) +/* Check, add and del mask methods */ +#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) +#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) +#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) +#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) +#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) +#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) + +/* Cast-Rank Mode */ +#if defined(SWIG_CASTRANK_MODE) +# ifndef SWIG_TypeRank +# define SWIG_TypeRank unsigned long +# endif +# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ +# define SWIG_MAXCASTRANK (2) +# endif +# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) +# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) +SWIGINTERNINLINE int SWIG_AddCast(int r) { + return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; +} +SWIGINTERNINLINE int SWIG_CheckState(int r) { + return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; +} +#else /* no cast-rank mode */ +# define SWIG_AddCast(r) (r) +# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) +#endif + + +#include <string.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *(*swig_converter_func)(void *, int *); +typedef struct swig_type_info *(*swig_dycast_func)(void **); + +/* Structure to store information on one type */ +typedef struct swig_type_info { + const char *name; /* mangled name of this type */ + const char *str; /* human readable name of this type */ + swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ + struct swig_cast_info *cast; /* linked list of types that can cast into this type */ + void *clientdata; /* language specific type data */ + int owndata; /* flag if the structure owns the clientdata */ +} swig_type_info; + +/* Structure to store a type and conversion function used for casting */ +typedef struct swig_cast_info { + swig_type_info *type; /* pointer to type that is equivalent to this type */ + swig_converter_func converter; /* function to cast the void pointers */ + struct swig_cast_info *next; /* pointer to next cast in linked list */ + struct swig_cast_info *prev; /* pointer to the previous cast */ +} swig_cast_info; + +/* Structure used to store module information + * Each module generates one structure like this, and the runtime collects + * all of these structures and stores them in a circularly linked list.*/ +typedef struct swig_module_info { + swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ + size_t size; /* Number of types in this module */ + struct swig_module_info *next; /* Pointer to next element in circularly linked list */ + swig_type_info **type_initial; /* Array of initially generated type structures */ + swig_cast_info **cast_initial; /* Array of initially generated casting structures */ + void *clientdata; /* Language specific module data */ +} swig_module_info; + +/* + Compare two type names skipping the space characters, therefore + "char*" == "char *" and "Class<int>" == "Class<int >", etc. + + Return 0 when the two name types are equivalent, as in + strncmp, but skipping ' '. +*/ +SWIGRUNTIME int +SWIG_TypeNameComp(const char *f1, const char *l1, + const char *f2, const char *l2) { + for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { + while ((*f1 == ' ') && (f1 != l1)) ++f1; + while ((*f2 == ' ') && (f2 != l2)) ++f2; + if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; + } + return (int)((l1 - f1) - (l2 - f2)); +} + +/* + Check type equivalence in a name list like <name1>|<name2>|... + Return 0 if equal, -1 if nb < tb, 1 if nb > tb +*/ +SWIGRUNTIME int +SWIG_TypeCmp(const char *nb, const char *tb) { + int equiv = 1; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (equiv != 0 && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = SWIG_TypeNameComp(nb, ne, tb, te); + if (*ne) ++ne; + } + return equiv; +} + +/* + Check type equivalence in a name list like <name1>|<name2>|... + Return 0 if not equal, 1 if equal +*/ +SWIGRUNTIME int +SWIG_TypeEquiv(const char *nb, const char *tb) { + return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; +} + +/* + Check the typename +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheck(const char *c, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Cast a pointer up an inheritance hierarchy +*/ +SWIGRUNTIMEINLINE void * +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); +} + +/* + Dynamic pointer casting. Down an inheritance hierarchy +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { + swig_type_info *lastty = ty; + if (!ty || !ty->dcast) return ty; + while (ty && (ty->dcast)) { + ty = (*ty->dcast)(ptr); + if (ty) lastty = ty; + } + return lastty; +} + +/* + Return the name associated with this type +*/ +SWIGRUNTIMEINLINE const char * +SWIG_TypeName(const swig_type_info *ty) { + return ty->name; +} + +/* + Return the pretty name associated with this type, + that is an unmangled type name in a form presentable to the user. +*/ +SWIGRUNTIME const char * +SWIG_TypePrettyName(const swig_type_info *type) { + /* The "str" field contains the equivalent pretty names of the + type, separated by vertical-bar characters. We choose + to print the last name, as it is often (?) the most + specific. */ + if (!type) return NULL; + if (type->str != NULL) { + const char *last_name = type->str; + const char *s; + for (s = type->str; *s; s++) + if (*s == '|') last_name = s+1; + return last_name; + } + else + return type->name; +} + +/* + Set the clientdata field for a type +*/ +SWIGRUNTIME void +SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { + swig_cast_info *cast = ti->cast; + /* if (ti->clientdata == clientdata) return; */ + ti->clientdata = clientdata; + + while (cast) { + if (!cast->converter) { + swig_type_info *tc = cast->type; + if (!tc->clientdata) { + SWIG_TypeClientData(tc, clientdata); + } + } + cast = cast->next; + } +} +SWIGRUNTIME void +SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { + SWIG_TypeClientData(ti, clientdata); + ti->owndata = 1; +} + +/* + Search for a swig_type_info structure only by mangled name + Search is a O(log #types) + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_MangledTypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + swig_module_info *iter = start; + do { + if (iter->size) { + size_t l = 0; + size_t r = iter->size - 1; + do { + /* since l+r >= 0, we can (>> 1) instead (/ 2) */ + size_t i = (l + r) >> 1; + const char *iname = iter->types[i]->name; + if (iname) { + int compare = strcmp(name, iname); + if (compare == 0) { + return iter->types[i]; + } else if (compare < 0) { + if (i) { + r = i - 1; + } else { + break; + } + } else if (compare > 0) { + l = i + 1; + } + } else { + break; /* should never happen */ + } + } while (l <= r); + } + iter = iter->next; + } while (iter != end); + return 0; +} + +/* + Search for a swig_type_info structure for either a mangled name or a human readable name. + It first searches the mangled names of the types, which is a O(log #types) + If a type is not found it then searches the human readable names, which is O(#types). + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + /* STEP 1: Search the name field using binary search */ + swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); + if (ret) { + return ret; + } else { + /* STEP 2: If the type hasn't been found, do a complete search + of the str field (the human readable name) */ + swig_module_info *iter = start; + do { + size_t i = 0; + for (; i < iter->size; ++i) { + if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) + return iter->types[i]; + } + iter = iter->next; + } while (iter != end); + } + + /* neither found a match */ + return 0; +} + +/* + Pack binary data into a string +*/ +SWIGRUNTIME char * +SWIG_PackData(char *c, void *ptr, size_t sz) { + static const char hex[17] = "0123456789abcdef"; + const unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + unsigned char uu = *u; + *(c++) = hex[(uu & 0xf0) >> 4]; + *(c++) = hex[uu & 0xf]; + } + return c; +} + +/* + Unpack binary data from a string +*/ +SWIGRUNTIME const char * +SWIG_UnpackData(const char *c, void *ptr, size_t sz) { + unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + char d = *(c++); + unsigned char uu; + if ((d >= '0') && (d <= '9')) + uu = ((d - '0') << 4); + else if ((d >= 'a') && (d <= 'f')) + uu = ((d - ('a'-10)) << 4); + else + return (char *) 0; + d = *(c++); + if ((d >= '0') && (d <= '9')) + uu |= (d - '0'); + else if ((d >= 'a') && (d <= 'f')) + uu |= (d - ('a'-10)); + else + return (char *) 0; + *u = uu; + } + return c; +} + +/* + Pack 'void *' into a string buffer. +*/ +SWIGRUNTIME char * +SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { + char *r = buff; + if ((2*sizeof(void *) + 2) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,&ptr,sizeof(void *)); + if (strlen(name) + 1 > (bsz - (r - buff))) return 0; + strcpy(r,name); + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + *ptr = (void *) 0; + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sizeof(void *)); +} + +SWIGRUNTIME char * +SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { + char *r = buff; + size_t lname = (name ? strlen(name) : 0); + if ((2*sz + 2 + lname) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + if (lname) { + strncpy(r,name,lname+1); + } else { + *r = 0; + } + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + memset(ptr,0,sz); + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sz); +} + +#ifdef __cplusplus +} +#endif + +/* ----------------------------------------------------------------------------- + * luarun.swg + * + * This file contains the runtime support for Lua modules + * and includes code for managing global variables and pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "lua.h" +#include "lauxlib.h" +#include <stdlib.h> /* for malloc */ +#include <assert.h> /* for a few sanity tests */ + +/* ----------------------------------------------------------------------------- + * Lua flavors + * ----------------------------------------------------------------------------- */ + +#define SWIG_LUA_FLAVOR_LUA 1 +#define SWIG_LUA_FLAVOR_ELUA 2 +#define SWIG_LUA_FLAVOR_ELUAC 3 + +#if !defined(SWIG_LUA_TARGET) +# error SWIG_LUA_TARGET not defined +#endif + +#if defined(SWIG_LUA_ELUA_EMULATE) + +struct swig_elua_entry; + +typedef struct swig_elua_key { + int type; + union { + const char* strkey; + lua_Number numkey; + } key; +} swig_elua_key; + +typedef struct swig_elua_val { + int type; + union { + lua_Number number; + const struct swig_elua_entry *table; + const char *string; + lua_CFunction function; + struct { + char member; + long lvalue; + void *pvalue; + swig_type_info **ptype; + } userdata; + } value; +} swig_elua_val; + +typedef struct swig_elua_entry { + swig_elua_key key; + swig_elua_val value; +} swig_elua_entry; + +#define LSTRKEY(x) {LUA_TSTRING, {.strkey = x} } +#define LNUMKEY(x) {LUA_TNUMBER, {.numkey = x} } +#define LNILKEY {LUA_TNIL, {.strkey = 0} } + +#define LNUMVAL(x) {LUA_TNUMBER, {.number = x} } +#define LFUNCVAL(x) {LUA_TFUNCTION, {.function = x} } +#define LROVAL(x) {LUA_TTABLE, {.table = x} } +#define LNILVAL {LUA_TNIL, {.string = 0} } +#define LSTRVAL(x) {LUA_TSTRING, {.string = x} } + +#define LUA_REG_TYPE swig_elua_entry + +#define SWIG_LUA_ELUA_EMUL_METATABLE_KEY "__metatable" + +#define lua_pushrotable(L,p)\ + lua_newtable(L);\ + assert(p);\ + SWIG_Lua_elua_emulate_register(L,(swig_elua_entry*)(p)); + +#define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\ + LSTRKEY(B), {LUA_TUSERDATA, { .userdata={0,0,(void*)(C),&D} } } + +#define SWIG_LUA_CONSTTAB_BINARY(B,S,C,D)\ + LSTRKEY(B), {LUA_TUSERDATA, { .userdata={1,S,(void*)(C),&D} } } +#endif + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) +# define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C) +# define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C) +# define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C) +# define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C) + /* Those two types of constants are not supported in elua */ + +#ifndef SWIG_LUA_CONSTTAB_POINTER +#warning eLua does not support pointers as constants. By default, nil will be used as value +#define SWIG_LUA_CONSTTAB_POINTER(B,C,D) LSTRKEY(B), LNILVAL +#endif + +#ifndef SWIG_LUA_CONSTTAB_BINARY +#warning eLua does not support pointers to member as constants. By default, nil will be used as value +#define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D) LSTRKEY(B), LNILVAL +#endif +#else /* SWIG_LUA_FLAVOR_LUA */ +# define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0 +# define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0 +# define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0 +# define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0 +# define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\ + SWIG_LUA_POINTER, (char *)B, 0, 0, (void *)C, &D +# define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D)\ + SWIG_LUA_BINARY, (char *)B, S, 0, (void *)C, &D +#endif + +#ifndef SWIG_LUA_ELUA_EMULATE +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) +# define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING} +# define LSTRVAL LRO_STRVAL +#endif +#endif /* SWIG_LUA_ELUA_EMULATE*/ + +#ifndef SWIG_LUA_ELUA_EMULATE +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) + +#ifndef MIN_OPT_LEVEL +#define MIN_OPT_LEVEL 2 +#endif + +#include "lrodefs.h" +#include "lrotable.h" +#endif +#endif /* SWIG_LUA_ELUA_EMULATE*/ +/* ----------------------------------------------------------------------------- + * compatibility defines + * ----------------------------------------------------------------------------- */ + +/* History of Lua C API length functions: In Lua 5.0 (and before?) + there was "lua_strlen". In Lua 5.1, this was renamed "lua_objlen", + but a compatibility define of "lua_strlen" was added. In Lua 5.2, + this function was again renamed, to "lua_rawlen" (to emphasize that + it doesn't call the "__len" metamethod), and the compatibility + define of lua_strlen was removed. All SWIG uses have been updated + to "lua_rawlen", and we add our own defines of that here for older + versions of Lua. */ +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 +# define lua_rawlen lua_strlen +#elif LUA_VERSION_NUM == 501 +# define lua_rawlen lua_objlen +#endif + + +/* lua_pushglobaltable is the recommended "future-proof" way to get + the global table for Lua 5.2 and later. Here we define + lua_pushglobaltable ourselves for Lua versions before 5.2. */ +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 +# define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX) +#endif + +/* lua_absindex was introduced in Lua 5.2 */ +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 +# define lua_absindex(L,i) ((i)>0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1) +#endif + +/* lua_rawsetp was introduced in Lua 5.2 */ +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 +#define lua_rawsetp(L,index,ptr)\ + lua_pushlightuserdata(L,(void*)(ptr));\ + lua_insert(L,-2);\ + lua_rawset(L,index); + +#define lua_rawgetp(L,index,ptr)\ + lua_pushlightuserdata(L,(void*)(ptr));\ + lua_rawget(L,index); + +#endif + +/* -------------------------------------------------------------------------- + * Helper functions for error handling + * -------------------------------------------------------------------------- */ + +/* Push the string STR on the Lua stack, like lua_pushstring, but + prefixed with the the location of the innermost Lua call-point + (as formated by luaL_where). */ +SWIGRUNTIME void +SWIG_Lua_pusherrstring (lua_State *L, const char *str) +{ + luaL_where (L, 1); + lua_pushstring (L, str); + lua_concat (L, 2); +} + +/* Push a formatted string generated from FMT and following args on + the Lua stack, like lua_pushfstring, but prefixed with the the + location of the innermost Lua call-point (as formated by luaL_where). */ +SWIGRUNTIME void +SWIG_Lua_pushferrstring (lua_State *L, const char *fmt, ...) +{ + va_list argp; + va_start(argp, fmt); + luaL_where(L, 1); + lua_pushvfstring(L, fmt, argp); + va_end(argp); + lua_concat(L, 2); +} + + +/* ----------------------------------------------------------------------------- + * global swig types + * ----------------------------------------------------------------------------- */ +/* Constant table */ +#define SWIG_LUA_INT 1 +#define SWIG_LUA_FLOAT 2 +#define SWIG_LUA_STRING 3 +#define SWIG_LUA_POINTER 4 +#define SWIG_LUA_BINARY 5 +#define SWIG_LUA_CHAR 6 + +/* Structure for variable linking table */ +typedef struct { + const char *name; + lua_CFunction get; + lua_CFunction set; +} swig_lua_var_info; + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) +typedef const LUA_REG_TYPE swig_lua_method; +typedef const LUA_REG_TYPE swig_lua_const_info; +#else /* Normal lua */ +typedef luaL_Reg swig_lua_method; + +/* Constant information structure */ +typedef struct { + int type; + char *name; + long lvalue; + double dvalue; + void *pvalue; + swig_type_info **ptype; +} swig_lua_const_info; + +#endif + +typedef struct { + const char *name; + lua_CFunction getmethod; + lua_CFunction setmethod; +} swig_lua_attribute; + + +struct swig_lua_class; +/* Can be used to create namespaces. Currently used to wrap class static methods/variables/constants */ +typedef struct swig_lua_namespace { + const char *name; + swig_lua_method *ns_methods; + swig_lua_attribute *ns_attributes; + swig_lua_const_info *ns_constants; + struct swig_lua_class **ns_classes; + struct swig_lua_namespace **ns_namespaces; +} swig_lua_namespace; + +typedef struct swig_lua_class { + const char *name; /* Name that this class has in Lua */ + const char *fqname; /* Fully qualified name - Scope + class name */ + swig_type_info **type; + lua_CFunction constructor; + void (*destructor)(void *); + swig_lua_method *methods; + swig_lua_attribute *attributes; + swig_lua_namespace *cls_static; + swig_lua_method *metatable; /* 0 for -eluac */ + struct swig_lua_class **bases; + const char **base_names; +} swig_lua_class; + +/* this is the struct for wrapping all pointers in SwigLua +*/ +typedef struct { + swig_type_info *type; + int own; /* 1 if owned & must be destroyed */ + void *ptr; +} swig_lua_userdata; + +/* this is the struct for wrapping arbitrary packed binary data +(currently it is only used for member function pointers) +the data ordering is similar to swig_lua_userdata, but it is currently not possible +to tell the two structures apart within SWIG, other than by looking at the type +*/ +typedef struct { + swig_type_info *type; + int own; /* 1 if owned & must be destroyed */ + char data[1]; /* arbitary amount of data */ +} swig_lua_rawdata; + +/* Common SWIG API */ +#define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner) +#define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags) +#define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname) +/* for C++ member pointers, ie, member methods */ +#define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty) +#define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type) + +/* Runtime API */ +#define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata)) +#define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer) +#define SWIG_MODULE_CLIENTDATA_TYPE lua_State* + +/* Contract support */ +#define SWIG_contract_assert(expr, msg) \ + if (!(expr)) { SWIG_Lua_pusherrstring(L, (char *) msg); goto fail; } else + + +/* helper #defines */ +#define SWIG_fail {goto fail;} +#define SWIG_fail_arg(func_name,argnum,type) \ + {SWIG_Lua_pushferrstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\ + func_name,argnum,type,SWIG_Lua_typename(L,argnum));\ + goto fail;} +#define SWIG_fail_ptr(func_name,argnum,type) \ + SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*") +#define SWIG_check_num_args(func_name,a,b) \ + if (lua_gettop(L)<a || lua_gettop(L)>b) \ + {SWIG_Lua_pushferrstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\ + goto fail;} + + +#define SWIG_Lua_get_table(L,n) \ + (lua_pushstring(L, n), lua_rawget(L,-2)) + +#define SWIG_Lua_add_function(L,n,f) \ + (lua_pushstring(L, n), \ + lua_pushcfunction(L, f), \ + lua_rawset(L,-3)) + +#define SWIG_Lua_add_boolean(L,n,b) \ + (lua_pushstring(L, n), \ + lua_pushboolean(L, b), \ + lua_rawset(L,-3)) + +/* special helper for allowing 'nil' for usertypes */ +#define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I)) + +#ifdef __cplusplus +/* Special helper for member function pointers +it gets the address, casts it, then dereferences it */ +/*#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a))) */ +#endif + +/* storing/access of swig_module_info */ +SWIGRUNTIME swig_module_info * +SWIG_Lua_GetModule(lua_State *L) { + swig_module_info *ret = 0; + lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); + lua_rawget(L,LUA_REGISTRYINDEX); + if (lua_islightuserdata(L,-1)) + ret=(swig_module_info*)lua_touserdata(L,-1); + lua_pop(L,1); /* tidy */ + return ret; +} + +SWIGRUNTIME void +SWIG_Lua_SetModule(lua_State *L, swig_module_info *module) { + /* add this all into the Lua registry: */ + lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); + lua_pushlightuserdata(L,(void*)module); + lua_rawset(L,LUA_REGISTRYINDEX); +} + +/* ----------------------------------------------------------------------------- + * global variable support code: modules + * ----------------------------------------------------------------------------- */ + +/* this function is called when trying to set an immutable. +default action is to print an error. +This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */ +SWIGINTERN int SWIG_Lua_set_immutable(lua_State *L) +{ +/* there should be 1 param passed in: the new value */ +#ifndef SWIGLUA_IGNORE_SET_IMMUTABLE + lua_pop(L,1); /* remove it */ + luaL_error(L,"This variable is immutable"); +#endif + return 0; /* should not return anything */ +} + +#ifdef SWIG_LUA_ELUA_EMULATE + +SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own); +SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type); +static int swig_lua_elua_emulate_unique_key; + +/* This function emulates eLua rotables behaviour. It loads a rotable definition into the usual lua table. */ +SWIGINTERN void SWIG_Lua_elua_emulate_register(lua_State *L, const swig_elua_entry *table) +{ + int i, table_parsed, parsed_tables_array, target_table; + assert(lua_istable(L,-1)); + target_table = lua_gettop(L); + /* Get the registry where we put all parsed tables to avoid loops */ + lua_rawgetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key); + if(lua_isnil(L,-1)) { + lua_pop(L,1); + lua_newtable(L); + lua_pushvalue(L,-1); + lua_rawsetp(L,LUA_REGISTRYINDEX,(void*)(&swig_lua_elua_emulate_unique_key)); + } + parsed_tables_array = lua_gettop(L); + lua_pushvalue(L,target_table); + lua_rawsetp(L, parsed_tables_array, table); + table_parsed = 0; + const int SWIGUNUSED pairs_start = lua_gettop(L); + for(i = 0;table[i].key.type != LUA_TNIL || table[i].value.type != LUA_TNIL;i++) + { + const swig_elua_entry *entry = table + i; + int is_metatable = 0; + switch(entry->key.type) { + case LUA_TSTRING: + lua_pushstring(L,entry->key.key.strkey); + if(strcmp(entry->key.key.strkey, SWIG_LUA_ELUA_EMUL_METATABLE_KEY) == 0) + is_metatable = 1; + break; + case LUA_TNUMBER: + lua_pushnumber(L,entry->key.key.numkey); + break; + case LUA_TNIL: + lua_pushnil(L); + break; + default: + assert(0); + } + switch(entry->value.type) { + case LUA_TSTRING: + lua_pushstring(L,entry->value.value.string); + break; + case LUA_TNUMBER: + lua_pushnumber(L,entry->value.value.number); + break; + case LUA_TFUNCTION: + lua_pushcfunction(L,entry->value.value.function); + break; + case LUA_TTABLE: + lua_rawgetp(L,parsed_tables_array, entry->value.value.table); + table_parsed = !lua_isnil(L,-1); + if(!table_parsed) { + lua_pop(L,1); /*remove nil */ + lua_newtable(L); + SWIG_Lua_elua_emulate_register(L,entry->value.value.table); + } + if(is_metatable) { + assert(lua_istable(L,-1)); + lua_pushvalue(L,-1); + lua_setmetatable(L,target_table); + } + + break; + case LUA_TUSERDATA: + if(entry->value.value.userdata.member) + SWIG_NewMemberObj(L,entry->value.value.userdata.pvalue, + entry->value.value.userdata.lvalue, + *(entry->value.value.userdata.ptype)); + else + SWIG_NewPointerObj(L,entry->value.value.userdata.pvalue, + *(entry->value.value.userdata.ptype),0); + break; + case LUA_TNIL: + lua_pushnil(L); + break; + default: + assert(0); + } + assert(lua_gettop(L) == pairs_start + 2); + lua_rawset(L,target_table); + } + lua_pop(L,1); /* Removing parsed tables storage */ + assert(lua_gettop(L) == target_table); +} + +SWIGINTERN void SWIG_Lua_elua_emulate_register_clear(lua_State *L) +{ + lua_pushnil(L); + lua_rawsetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key); +} + +SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L); + +SWIGINTERN int SWIG_Lua_emulate_elua_getmetatable(lua_State *L) +{ + SWIG_check_num_args("getmetatable(SWIG eLua emulation)", 1, 1); + SWIG_Lua_get_class_registry(L); + lua_getfield(L,-1,"lua_getmetatable"); + lua_remove(L,-2); /* remove the registry*/ + assert(!lua_isnil(L,-1)); + lua_pushvalue(L,1); + assert(lua_gettop(L) == 3); /* object | function | object again */ + lua_call(L,1,1); + if(!lua_isnil(L,-1)) /*There is an ordinary metatable */ + return 1; + /*if it is a table, then emulate elua behaviour - check for __metatable attribute of a table*/ + assert(lua_gettop(L) == 2); + if(lua_istable(L,-2)) { + lua_pop(L,1); /*remove the nil*/ + lua_getfield(L,-1, SWIG_LUA_ELUA_EMUL_METATABLE_KEY); + } + assert(lua_gettop(L) == 2); + return 1; + +fail: + lua_error(L); + return 0; +} + +SWIGINTERN void SWIG_Lua_emulate_elua_swap_getmetatable(lua_State *L) +{ + SWIG_Lua_get_class_registry(L); + lua_pushglobaltable(L); + lua_pushstring(L,"lua_getmetatable"); + lua_getfield(L,-2,"getmetatable"); + assert(!lua_isnil(L,-1)); + lua_rawset(L,-4); + lua_pushstring(L, "getmetatable"); + lua_pushcfunction(L, SWIG_Lua_emulate_elua_getmetatable); + lua_rawset(L,-3); + lua_pop(L,2); + +} +/* END OF REMOVE */ + +#endif +/* ----------------------------------------------------------------------------- + * global variable support code: namespaces and modules (which are the same thing) + * ----------------------------------------------------------------------------- */ + +SWIGINTERN int SWIG_Lua_namespace_get(lua_State *L) +{ +/* there should be 2 params passed in + (1) table (not the meta table) + (2) string name of the attribute +*/ + assert(lua_istable(L,-2)); /* just in case */ + lua_getmetatable(L,-2); + assert(lua_istable(L,-1)); + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); + /* look for the key in the .get table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + lua_remove(L,-2); /* stack tidy, remove .get table */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_call(L,0,1); /* 1 value in (userdata),1 out (result) */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + lua_pop(L,1); /* remove whatever was there */ + /* ok, so try the .fn table */ + SWIG_Lua_get_table(L,".fn"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); /* look for the fn */ + lua_remove(L,-2); /* stack tidy, remove .fn table */ + if (lua_isfunction(L,-1)) /* note: whether it's a C function or lua function */ + { /* found it so return the fn & let lua call it */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + lua_pop(L,1); /* remove whatever was there */ + return 0; +} + +SWIGINTERN int SWIG_Lua_namespace_set(lua_State *L) +{ +/* there should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value +*/ + + assert(lua_istable(L,1)); + lua_getmetatable(L,1); /* get the meta table */ + assert(lua_istable(L,-1)); + + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + if (lua_istable(L,-1)) + { + /* look for the key in the .set table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,3); /* value */ + lua_call(L,1,0); + return 0; + } + lua_pop(L,1); /* remove the value */ + } + lua_pop(L,1); /* remove the value .set table */ + lua_pop(L,1); /* remote metatable */ + lua_rawset(L,-3); + return 0; +} + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */ +SWIGINTERN void SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]); /* forward declaration */ +SWIGINTERN void SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn); /* forward declaration */ +SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss); + +/* helper function - register namespace methods and attributes into namespace */ +SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State *L, swig_lua_namespace *ns) +{ + int i; + /* There must be namespace table (not metatable) at the top of the stack */ + assert(lua_istable(L,-1)); + SWIG_Lua_InstallConstants(L, ns->ns_constants); + + /* add methods to the namespace/module table */ + for(i=0;ns->ns_methods[i].name;i++){ + SWIG_Lua_add_function(L,ns->ns_methods[i].name,ns->ns_methods[i].func); + } + lua_getmetatable(L,-1); + + /* add fns */ + for(i=0;ns->ns_attributes[i].name;i++){ + SWIG_Lua_add_variable(L,ns->ns_attributes[i].name,ns->ns_attributes[i].getmethod,ns->ns_attributes[i].setmethod); + } + + /* clear stack - remove metatble */ + lua_pop(L,1); + return 0; +} + +/* Register all classes in the namespace */ +SWIGINTERN void SWIG_Lua_add_namespace_classes(lua_State *L, swig_lua_namespace *ns) +{ + swig_lua_class **classes; + + /* There must be a module/namespace table at the top of the stack */ + assert(lua_istable(L,-1)); + + classes = ns->ns_classes; + + if( classes != 0 ) { + while(*classes != 0) { + SWIG_Lua_class_register(L, *classes); + classes++; + } + } +} + +/* Helper function. Creates namespace table and adds it to module table + if 'reg' is true, then will register namespace table to parent one (must be on top of the stack + when function is called). + Function always returns newly registered table on top of the stack. +*/ +SWIGINTERN void SWIG_Lua_namespace_register(lua_State *L, swig_lua_namespace *ns, int reg) +{ + swig_lua_namespace **sub_namespace; + /* 1 argument - table on the top of the stack */ + const int SWIGUNUSED begin = lua_gettop(L); + assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table or parent namespace table */ + lua_checkstack(L,5); + lua_newtable(L); /* namespace itself */ + lua_newtable(L); /* metatable for namespace */ + + /* add a table called ".get" */ + lua_pushstring(L,".get"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".set" */ + lua_pushstring(L,".set"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".fn" */ + lua_pushstring(L,".fn"); + lua_newtable(L); + lua_rawset(L,-3); + + /* add accessor fns for using the .get,.set&.fn */ + SWIG_Lua_add_function(L,"__index",SWIG_Lua_namespace_get); + SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_namespace_set); + + lua_setmetatable(L,-2); /* set metatable */ + + /* Register all functions, variables etc */ + SWIG_Lua_add_namespace_details(L,ns); + /* Register classes */ + SWIG_Lua_add_namespace_classes(L,ns); + + sub_namespace = ns->ns_namespaces; + if( sub_namespace != 0) { + while(*sub_namespace != 0) { + SWIG_Lua_namespace_register(L, *sub_namespace, 1); + lua_pop(L,1); /* removing sub-namespace table */ + sub_namespace++; + } + } + + if (reg) { + lua_pushstring(L,ns->name); + lua_pushvalue(L,-2); + lua_rawset(L,-4); /* add namespace to module table */ + } + assert(lua_gettop(L) == begin+1); +} +#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */ + +/* ----------------------------------------------------------------------------- + * global variable support code: classes + * ----------------------------------------------------------------------------- */ + +SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L,const char *cname); + +typedef int (*swig_lua_base_iterator_func)(lua_State*,swig_type_info*, int, int *ret); + +SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info * SWIGUNUSED swig_type, + int first_arg, swig_lua_base_iterator_func func, int *const ret) +{ + /* first_arg - position of the object in stack. Everything that is above are arguments + * and is passed to every evocation of the func */ + int last_arg = lua_gettop(L);/* position of last argument */ + int original_metatable = last_arg + 1; + size_t bases_count; + int result = SWIG_ERROR; + int bases_table; + (void)swig_type; + lua_getmetatable(L,first_arg); + + /* initialise base search */ +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) + SWIG_Lua_get_table(L,".bases"); + assert(lua_istable(L,-1)); + bases_count = lua_rawlen(L,-1); + bases_table = lua_gettop(L); +#else + /* In elua .bases table doesn't exist. Use table from swig_lua_class */ + (void)bases_table; + assert(swig_type!=0); + swig_module_info *module=SWIG_GetModule(L); + swig_lua_class **bases= ((swig_lua_class*)(swig_type->clientdata))->bases; + const char **base_names= ((swig_lua_class*)(swig_type->clientdata))->base_names; + bases_count = 0; + for(;base_names[bases_count]; + bases_count++);/* get length of bases */ +#endif + + if(ret) + *ret = 0; + if(bases_count>0) + { + int to_remove; + size_t i; + int j; + int subcall_last_arg; + int subcall_first_arg = lua_gettop(L) + 1;/* Here a copy of first_arg and arguments begin */ + int valid = 1; + swig_type_info *base_swig_type = 0; + for(j=first_arg;j<=last_arg;j++) + lua_pushvalue(L,j); + subcall_last_arg = lua_gettop(L); + + /* Trick: temporarily replacing original metatable with metatable for base class and call getter */ + for(i=0;i<bases_count;i++) { + /* Iteration through class bases */ +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) + lua_rawgeti(L,bases_table,i+1); + base_swig_type = 0; + if(lua_isnil(L,-1)) { + valid = 0; + lua_pop(L,1); + } else { + valid = 1; + } +#else /* In elua .bases table doesn't exist. Use table from swig_lua_class */ + swig_lua_class *base_class = bases[i]; + if(!base_class) { + valid = 0; + } else { + valid = 1; + SWIG_Lua_get_class_metatable(L,base_class->fqname); + base_swig_type = SWIG_TypeQueryModule(module,module,base_names[i]); + assert(base_swig_type != 0); + } +#endif + + if(!valid) + continue; + assert(lua_isuserdata(L, subcall_first_arg)); + assert(lua_istable(L,-1)); + lua_setmetatable(L,subcall_first_arg); /* Set new metatable */ + assert(lua_gettop(L) == subcall_last_arg); + result = func(L, base_swig_type,subcall_first_arg, ret); /* Forward call */ + if(result != SWIG_ERROR) { + break; + } + } + /* Restore original metatable */ + lua_pushvalue(L,original_metatable); + lua_setmetatable(L,first_arg); + /* Clear - remove everything between last_arg and subcall_last_arg including */ + to_remove = subcall_last_arg - last_arg; + for(j=0;j<to_remove;j++) + lua_remove(L,last_arg+1); + } else { + /* Remove everything after last_arg */ + lua_pop(L, lua_gettop(L) - last_arg); + } + if(ret) assert(lua_gettop(L) == last_arg + *ret); + return result; +} + +/* The class.get method helper, performs the lookup of class attributes. + * It returns an error code. Number of function return values is passed inside 'ret'. + * first_arg is not used in this function because function always has 2 arguments. + */ +SWIGINTERN int SWIG_Lua_class_do_get(lua_State *L, swig_type_info *type, int SWIGUNUSED first_arg, int *ret) +{ +/* there should be 2 params passed in + (1) userdata (not the meta table) + (2) string name of the attribute +*/ + int bases_search_result; + int substack_start = lua_gettop(L)-2; + assert(first_arg == substack_start+1); + lua_checkstack(L,5); + assert(lua_isuserdata(L,-2)); /* just in case */ + lua_getmetatable(L,-2); /* get the meta table */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + /* look for the key in the .get table */ + lua_pushvalue(L,substack_start+2); /* key */ + lua_rawget(L,-2); + lua_remove(L,-2); /* stack tidy, remove .get table */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,substack_start+1); /* the userdata */ + lua_call(L,1,1); /* 1 value in (userdata),1 out (result) */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + if(ret) + *ret = 1; + return SWIG_OK; + } + lua_pop(L,1); /* remove whatever was there */ + /* ok, so try the .fn table */ + SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ + assert(lua_istable(L,-1)); /* just in case */ + lua_pushvalue(L,substack_start+2); /* key */ + lua_rawget(L,-2); /* look for the fn */ + lua_remove(L,-2); /* stack tidy, remove .fn table */ + if (lua_isfunction(L,-1)) /* note: if its a C function or lua function */ + { /* found it so return the fn & let lua call it */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + if(ret) + *ret = 1; + return SWIG_OK; + } + lua_pop(L,1); /* remove whatever was there */ + /* NEW: looks for the __getitem() fn + this is a user provided get fn */ + SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */ + if (lua_iscfunction(L,-1)) /* if its there */ + { /* found it so call the fn & return its value */ + lua_pushvalue(L,substack_start+1); /* the userdata */ + lua_pushvalue(L,substack_start+2); /* the parameter */ + lua_call(L,2,1); /* 2 value in (userdata),1 out (result) */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + if(ret) *ret = 1; + return SWIG_OK; + } + lua_pop(L,1); + /* Remove the metatable */ + lua_pop(L,1); + /* Search in base classes */ + bases_search_result = SWIG_Lua_iterate_bases(L,type,substack_start+1,SWIG_Lua_class_do_get,ret); + return bases_search_result; /* sorry not known */ +} + +/* the class.get method, performs the lookup of class attributes + */ +SWIGINTERN int SWIG_Lua_class_get(lua_State *L) +{ +/* there should be 2 params passed in + (1) userdata (not the meta table) + (2) string name of the attribute +*/ + int result; + swig_lua_userdata *usr; + swig_type_info *type; + int ret = 0; + assert(lua_isuserdata(L,1)); + usr=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ + type = usr->type; + result = SWIG_Lua_class_do_get(L,type,1,&ret); + if(result == SWIG_OK) + return ret; + + return 0; +} + +/* helper for the class.set method, performs the lookup of class attributes + * It returns error code. Number of function return values is passed inside 'ret' + */ +SWIGINTERN int SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int first_arg, int *ret) +{ +/* there should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value + */ + + int bases_search_result; + int substack_start = lua_gettop(L) - 3; + lua_checkstack(L,5); + assert(lua_isuserdata(L,substack_start+1)); /* just in case */ + lua_getmetatable(L,substack_start+1); /* get the meta table */ + assert(lua_istable(L,-1)); /* just in case */ + if(ret) + *ret = 0; /* it is setter - number of return values is always 0 */ + + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + if (lua_istable(L,-1)) + { + /* look for the key in the .set table */ + lua_pushvalue(L,substack_start+2); /* key */ + lua_rawget(L,-2); + lua_remove(L,-2); /* tidy stack, remove .set table */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,substack_start+1); /* userdata */ + lua_pushvalue(L,substack_start+3); /* value */ + lua_call(L,2,0); + lua_remove(L,substack_start+4); /*remove metatable*/ + return SWIG_OK; + } + lua_pop(L,1); /* remove the value */ + } else { + lua_pop(L,1); /* remove the answer for .set table request*/ + } + /* NEW: looks for the __setitem() fn + this is a user provided set fn */ + SWIG_Lua_get_table(L,"__setitem"); /* find the fn */ + if (lua_iscfunction(L,-1)) /* if its there */ + { /* found it so call the fn & return its value */ + lua_pushvalue(L,substack_start+1); /* the userdata */ + lua_pushvalue(L,substack_start+2); /* the parameter */ + lua_pushvalue(L,substack_start+3); /* the value */ + lua_call(L,3,0); /* 3 values in ,0 out */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return SWIG_OK; + } + lua_pop(L,1); /* remove value */ + + lua_pop(L,1); /* remove metatable */ + /* Search among bases */ + bases_search_result = SWIG_Lua_iterate_bases(L,type,first_arg,SWIG_Lua_class_do_set,ret); + if(ret) + assert(*ret == 0); + assert(lua_gettop(L) == substack_start + 3); + return bases_search_result; +} + +/* This is the actual method exported to Lua. It calls SWIG_Lua_class_do_set and correctly + * handles return values. + */ +SWIGINTERN int SWIG_Lua_class_set(lua_State *L) +{ +/* There should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value + */ + int ret = 0; + int result; + swig_lua_userdata *usr; + swig_type_info *type; + assert(lua_isuserdata(L,1)); + usr=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ + type = usr->type; + result = SWIG_Lua_class_do_set(L,type,1,&ret); + if(result != SWIG_OK) { + SWIG_Lua_pushferrstring(L,"Assignment not possible. No setter/member with this name. For custom assignments implement __setitem method."); + lua_error(L); + } else { + assert(ret==0); + } + return 0; +} + +/* the class.destruct method called by the interpreter */ +SWIGINTERN int SWIG_Lua_class_destruct(lua_State *L) +{ +/* there should be 1 params passed in + (1) userdata (not the meta table) */ + swig_lua_userdata *usr; + swig_lua_class *clss; + assert(lua_isuserdata(L,-1)); /* just in case */ + usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ + /* if must be destroyed & has a destructor */ + if (usr->own) /* if must be destroyed */ + { + clss=(swig_lua_class*)usr->type->clientdata; /* get the class */ + if (clss && clss->destructor) /* there is a destroy fn */ + { + clss->destructor(usr->ptr); /* bye bye */ + } + } + return 0; +} + +/* the class.__tostring method called by the interpreter and print */ +SWIGINTERN int SWIG_Lua_class_tostring(lua_State *L) +{ +/* there should be 1 param passed in + (1) userdata (not the metatable) */ + const char *className; + void* userData; + assert(lua_isuserdata(L,1)); /* just in case */ + userData = lua_touserdata(L,1); /* get the userdata address for later */ + lua_getmetatable(L,1); /* get the meta table */ + assert(lua_istable(L,-1)); /* just in case */ + + lua_getfield(L, -1, ".type"); + className = lua_tostring(L, -1); + + lua_pushfstring(L, "<%s userdata: %p>", className, userData); + return 1; +} + +/* to manually disown some userdata */ +SWIGINTERN int SWIG_Lua_class_disown(lua_State *L) +{ +/* there should be 1 params passed in + (1) userdata (not the meta table) */ + swig_lua_userdata *usr; + assert(lua_isuserdata(L,-1)); /* just in case */ + usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ + + usr->own = 0; /* clear our ownership */ + return 0; +} + +/* lua callable function to compare userdata's value +the issue is that two userdata may point to the same thing +but to lua, they are different objects */ +SWIGRUNTIME int SWIG_Lua_class_equal(lua_State *L) +{ + int result; + swig_lua_userdata *usr1,*usr2; + if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */ + return 0; /* nil reply */ + usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ + usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */ + /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/ + result=(usr1->ptr==usr2->ptr); + lua_pushboolean(L,result); + return 1; +} + +/* populate table at the top of the stack with metamethods that ought to be inherited */ +SWIGINTERN void SWIG_Lua_populate_inheritable_metamethods(lua_State *L) +{ + SWIG_Lua_add_boolean(L, "__add", 1); + SWIG_Lua_add_boolean(L, "__sub", 1); + SWIG_Lua_add_boolean(L, "__mul", 1); + SWIG_Lua_add_boolean(L, "__div", 1); + SWIG_Lua_add_boolean(L, "__mod", 1); + SWIG_Lua_add_boolean(L, "__pow", 1); + SWIG_Lua_add_boolean(L, "__unm", 1); + SWIG_Lua_add_boolean(L, "__len", 1 ); + SWIG_Lua_add_boolean(L, "__concat", 1 ); + SWIG_Lua_add_boolean(L, "__eq", 1); + SWIG_Lua_add_boolean(L, "__lt", 1); + SWIG_Lua_add_boolean(L, "__le", 1); + SWIG_Lua_add_boolean(L, "__call", 1); + SWIG_Lua_add_boolean(L, "__tostring", 1); + SWIG_Lua_add_boolean(L, "__gc", 0); +} + +/* creates the swig registry */ +SWIGINTERN void SWIG_Lua_create_class_registry(lua_State *L) +{ + /* create main SWIG registry table */ + lua_pushstring(L,"SWIG"); + lua_newtable(L); + /* populate it with some predefined data */ + + /* .library table. Placeholder */ + lua_pushstring(L,".library"); + lua_newtable(L); + { + /* list of metamethods that class inherits from its bases */ + lua_pushstring(L,"inheritable_metamethods"); + lua_newtable(L); + /* populate with list of metamethods */ + SWIG_Lua_populate_inheritable_metamethods(L); + lua_rawset(L,-3); + } + lua_rawset(L,-3); + + lua_rawset(L,LUA_REGISTRYINDEX); +} + +/* gets the swig registry (or creates it) */ +SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L) +{ + /* add this all into the swig registry: */ + lua_pushstring(L,"SWIG"); + lua_rawget(L,LUA_REGISTRYINDEX); /* get the registry */ + if (!lua_istable(L,-1)) /* not there */ + { /* must be first time, so add it */ + lua_pop(L,1); /* remove the result */ + SWIG_Lua_create_class_registry(L); + /* then get it */ + lua_pushstring(L,"SWIG"); + lua_rawget(L,LUA_REGISTRYINDEX); + } +} + +SWIGINTERN void SWIG_Lua_get_inheritable_metamethods(lua_State *L) +{ + SWIG_Lua_get_class_registry(L); + lua_pushstring(L, ".library"); + lua_rawget(L,-2); + assert( !lua_isnil(L,-1) ); + lua_pushstring(L, "inheritable_metamethods"); + lua_rawget(L,-2); + + /* Remove class registry and library table */ + lua_remove(L,-2); + lua_remove(L,-2); +} + +/* Helper function to get the classes metatable from the register */ +SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L,const char *cname) +{ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,cname); /* get the name */ + lua_rawget(L,-2); /* get it */ + lua_remove(L,-2); /* tidy up (remove registry) */ +} + +/* Set up the base classes pointers. +Each class structure has a list of pointers to the base class structures. +This function fills them. +It cannot be done at compile time, as this will not work with hireachies +spread over more than one swig file. +Therefore it must be done at runtime, querying the SWIG type system. +*/ +SWIGINTERN void SWIG_Lua_init_base_class(lua_State *L,swig_lua_class *clss) +{ + int i=0; + swig_module_info *module=SWIG_GetModule(L); + for(i=0;clss->base_names[i];i++) + { + if (clss->bases[i]==0) /* not found yet */ + { + /* lookup and cache the base class */ + swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]); + if (info) clss->bases[i] = (swig_lua_class *) info->clientdata; + } + } +} + +#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) +/* Merges two tables */ +SWIGINTERN void SWIG_Lua_merge_tables_by_index(lua_State *L, int target, int source) +{ + /* iterating */ + lua_pushnil(L); + while (lua_next(L,source) != 0) { + /* -1 - value, -2 - index */ + /* have to copy to assign */ + lua_pushvalue(L,-2); /* copy of index */ + lua_pushvalue(L,-2); /* copy of value */ + lua_rawset(L, target); + lua_pop(L,1); + /* only key is left */ + } +} + +/* Merges two tables with given name. original - index of target metatable, base - index of source metatable */ +SWIGINTERN void SWIG_Lua_merge_tables(lua_State *L, const char* name, int original, int base) +{ + /* push original[name], then base[name] */ + lua_pushstring(L,name); + lua_rawget(L,original); + int original_table = lua_gettop(L); + lua_pushstring(L,name); + lua_rawget(L,base); + int base_table = lua_gettop(L); + SWIG_Lua_merge_tables_by_index(L, original_table, base_table); + /* clearing stack */ + lua_pop(L,2); +} + +/* Function takes all symbols from base and adds it to derived class. It's just a helper. */ +SWIGINTERN void SWIG_Lua_class_squash_base(lua_State *L, swig_lua_class *base_cls) +{ + /* There is one parameter - original, i.e. 'derived' class metatable */ + assert(lua_istable(L,-1)); + int original = lua_gettop(L); + SWIG_Lua_get_class_metatable(L,base_cls->fqname); + int base = lua_gettop(L); + SWIG_Lua_merge_tables(L, ".fn", original, base ); + SWIG_Lua_merge_tables(L, ".set", original, base ); + SWIG_Lua_merge_tables(L, ".get", original, base ); + lua_pop(L,1); +} + +/* Function squashes all symbols from 'clss' bases into itself */ +SWIGINTERN void SWIG_Lua_class_squash_bases(lua_State *L, swig_lua_class *clss) +{ + int i; + SWIG_Lua_get_class_metatable(L,clss->fqname); + for(i=0;clss->base_names[i];i++) + { + if (clss->bases[i]==0) /* Somehow it's not found. Skip it */ + continue; + /* Thing is: all bases are already registered. Thus they have already executed + * this function. So we just need to squash them into us, because their bases + * are already squashed into them. No need for recursion here! + */ + SWIG_Lua_class_squash_base(L, clss->bases[i]); + } + lua_pop(L,1); /*tidy stack*/ +} +#endif + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */ +/* helper add a variable to a registered class */ +SWIGINTERN void SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn) +{ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_function(L,name,getFn); + lua_pop(L,1); /* tidy stack (remove table) */ + if (setFn) + { + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_function(L,name,setFn); + lua_pop(L,1); /* tidy stack (remove table) */ + } +} + +/* helper to recursively add class static details (static attributes, operations and constants) */ +SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State *L, swig_lua_class *clss) +{ + int i = 0; + /* The class namespace table must be on the top of the stack */ + assert(lua_istable(L,-1)); + /* call all the base classes first: we can then override these later: */ + for(i=0;clss->bases[i];i++) + { + SWIG_Lua_add_class_static_details(L,clss->bases[i]); + } + + SWIG_Lua_add_namespace_details(L, clss->cls_static); +} + +SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss); /* forward declaration */ + +/* helper to recursively add class details (attributes & operations) */ +SWIGINTERN void SWIG_Lua_add_class_instance_details(lua_State *L, swig_lua_class *clss) +{ + int i; + size_t bases_count = 0; + /* Add bases to .bases table */ + SWIG_Lua_get_table(L,".bases"); + assert(lua_istable(L,-1)); /* just in case */ + for(i=0;clss->bases[i];i++) + { + SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname); + /* Base class must be already registered */ + assert(lua_istable(L,-1)); + lua_rawseti(L,-2,i+1); /* In lua indexing starts from 1 */ + bases_count++; + } + assert(lua_rawlen(L,-1) == bases_count); + lua_pop(L,1); /* remove .bases table */ + /* add attributes */ + for(i=0;clss->attributes[i].name;i++){ + SWIG_Lua_add_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod); + } + /* add methods to the metatable */ + SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ + assert(lua_istable(L,-1)); /* just in case */ + for(i=0;clss->methods[i].name;i++){ + SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].func); + } + lua_pop(L,1); /* tidy stack (remove table) */ + /* add operator overloads + This adds methods from metatable array to metatable. Can mess up garbage + collectind if someone defines __gc method + */ + if(clss->metatable) { + for(i=0;clss->metatable[i].name;i++) { + SWIG_Lua_add_function(L,clss->metatable[i].name,clss->metatable[i].func); + } + } + +#if !defined(SWIG_LUA_SQUASH_BASES) + /* Adding metamethods that are defined in base classes. If bases were squashed + * then it is obviously unnecessary + */ + SWIG_Lua_add_class_user_metamethods(L, clss); +#endif +} + +/* Helpers to add user defined class metamedhods - __add, __sub etc. The helpers are needed + for the following issue: Lua runtime checks for metamethod existence with rawget function + ignoring our SWIG-provided __index and __newindex functions. Thus our inheritance-aware method + search algorithm doesn't work in such case. (Not to say that Lua runtime queries metamethod directly + in metatable and not in object). + Current solution is this: if somewhere in hierarchy metamethod __x is defined, then all descendants + are automatically given a special proxy __x that calls the real __x method. + Obvious idea - to copy __x instead of creating __x-proxy is wrong because if someone changes __x in runtime, + those changes must be reflected in all descendants. +*/ + +SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L); /*forward declaration*/ + +/* The real function that resolves a metamethod. + * Function searches given class and all it's bases(recursively) for first instance of something that is + * not equal to SWIG_Lua_resolve_metatmethod. (Almost always this 'something' is actual metamethod implementation + * and it is a SWIG-generated C function.). It returns value on the top of the L and there is no garbage below the + * answer. + * Returns 1 if found, 0 otherwise. + * clss is class which metatable we will search for method + * metamethod_name_idx is index in L where metamethod name (as string) lies + * skip_check allows to skip searching metamethod in givel clss and immideatelly go to searching in bases. skip_check + * is not caried to subsequent recursive calls - false is always passed. It is set to true only at first call from + * SWIG_Lua_resolve_metamethod + * */ +SWIGINTERN int SWIG_Lua_do_resolve_metamethod(lua_State *L, const swig_lua_class *clss, int metamethod_name_idx, + int skip_check) +{ + /* This function is called recursively */ + int result = 0; + int i = 0; + + if (!skip_check) { + SWIG_Lua_get_class_metatable(L, clss->fqname); + lua_pushvalue(L, metamethod_name_idx); + lua_rawget(L,-2); + /* If this is cfunction and it is equal to SWIG_Lua_resolve_metamethod then + * this isn't the function we are looking for :) + * lua_tocfunction will return NULL if not cfunction + */ + if (!lua_isnil(L,-1) && lua_tocfunction(L,-1) != SWIG_Lua_resolve_metamethod ) { + lua_remove(L,-2); /* removing class metatable */ + return 1; + } + lua_pop(L,2); /* remove class metatable and query result */ + } + + /* Forwarding calls to bases */ + for(i=0;clss->bases[i];i++) + { + result = SWIG_Lua_do_resolve_metamethod(L, clss->bases[i], metamethod_name_idx, 0); + if (result) + break; + } + + return result; +} + +/* The proxy function for metamethod. All parameters are passed as cclosure. Searches for actual method + * and calls it */ +SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L) +{ + int numargs; + int metamethod_name_idx; + const swig_lua_class* clss; + int result; + + lua_checkstack(L,5); + numargs = lua_gettop(L); /* number of arguments to pass to actual metamethod */ + + /* Get upvalues from closure */ + lua_pushvalue(L, lua_upvalueindex(1)); /*Get function name*/ + metamethod_name_idx = lua_gettop(L); + + lua_pushvalue(L, lua_upvalueindex(2)); + clss = (const swig_lua_class*)(lua_touserdata(L,-1)); + lua_pop(L,1); /* remove lightuserdata with clss from stack */ + + /* Actual work */ + result = SWIG_Lua_do_resolve_metamethod(L, clss, metamethod_name_idx, 1); + if (!result) { + SWIG_Lua_pushferrstring(L,"The metamethod proxy is set, but it failed to find actual metamethod. Memory corruption is most likely explanation."); + lua_error(L); + return 0; + } + + lua_remove(L,-2); /* remove metamethod key */ + lua_insert(L,1); /* move function to correct position */ + lua_call(L, numargs, LUA_MULTRET); + return lua_gettop(L); /* return all results */ +} + + +/* If given metamethod must be present in given class, then creates appropriate proxy + * Returns 1 if successfully added, 0 if not added because no base class has it, -1 + * if method is defined in the class metatable itself + */ +SWIGINTERN int SWIG_Lua_add_class_user_metamethod(lua_State *L, swig_lua_class *clss, const int metatable_index) +{ + int key_index; + int success = 0; + int i = 0; + + /* metamethod name - on the top of the stack */ + assert(lua_isstring(L,-1)); + + key_index = lua_gettop(L); + + /* Check whether method is already defined in metatable */ + lua_pushvalue(L,key_index); /* copy of the key */ + lua_gettable(L,metatable_index); + if( !lua_isnil(L,-1) ) { + lua_pop(L,1); + return -1; + } + lua_pop(L,1); + + /* Iterating over immediate bases */ + for(i=0;clss->bases[i];i++) + { + const swig_lua_class *base = clss->bases[i]; + SWIG_Lua_get_class_metatable(L, base->fqname); + lua_pushvalue(L, key_index); + lua_rawget(L, -2); + if( !lua_isnil(L,-1) ) { + lua_pushvalue(L, key_index); + + /* Add proxy function */ + lua_pushvalue(L, key_index); /* first closure value is function name */ + lua_pushlightuserdata(L, clss); /* second closure value is swig_lua_class structure */ + lua_pushcclosure(L, SWIG_Lua_resolve_metamethod, 2); + + lua_rawset(L, metatable_index); + success = 1; + } + lua_pop(L,1); /* remove function or nil */ + lua_pop(L,1); /* remove base class metatable */ + + if( success ) + break; + } + + return success; +} + +SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss) +{ + int metatable_index; + int metamethods_info_index; + int tostring_undefined; + int eq_undefined = 0; + + SWIG_Lua_get_class_metatable(L, clss->fqname); + metatable_index = lua_gettop(L); + SWIG_Lua_get_inheritable_metamethods(L); + assert(lua_istable(L,-1)); + metamethods_info_index = lua_gettop(L); + lua_pushnil(L); /* first key */ + while(lua_next(L, metamethods_info_index) != 0 ) { + /* key at index -2, value at index -1 */ + const int is_inheritable = lua_toboolean(L,-2); + lua_pop(L,1); /* remove value - we don't need it anymore */ + + if(is_inheritable) { /* if metamethod is inheritable */ + SWIG_Lua_add_class_user_metamethod(L,clss,metatable_index); + } + } + + lua_pop(L,1); /* remove inheritable metatmethods table */ + + /* Special handling for __tostring method */ + lua_pushstring(L, "__tostring"); + lua_pushvalue(L,-1); + lua_rawget(L,metatable_index); + tostring_undefined = lua_isnil(L,-1); + lua_pop(L,1); + if( tostring_undefined ) { + lua_pushcfunction(L, SWIG_Lua_class_tostring); + lua_rawset(L, metatable_index); + } else { + lua_pop(L,1); /* remove copy of the key */ + } + + /* Special handling for __eq method */ + lua_pushstring(L, "__eq"); + lua_pushvalue(L,-1); + lua_rawget(L,metatable_index); + eq_undefined = lua_isnil(L,-1); + lua_pop(L,1); + if( eq_undefined ) { + lua_pushcfunction(L, SWIG_Lua_class_equal); + lua_rawset(L, metatable_index); + } else { + lua_pop(L,1); /* remove copy of the key */ + } + /* Warning: __index and __newindex are SWIG-defined. For user-defined operator[] + * a __getitem/__setitem method should be defined + */ + lua_pop(L,1); /* pop class metatable */ +} + +/* Register class static methods,attributes etc as well as constructor proxy */ +SWIGINTERN void SWIG_Lua_class_register_static(lua_State *L, swig_lua_class *clss) +{ + const int SWIGUNUSED begin = lua_gettop(L); + lua_checkstack(L,5); /* just in case */ + assert(lua_istable(L,-1)); /* just in case */ + assert(strcmp(clss->name, clss->cls_static->name) == 0); /* in class those 2 must be equal */ + + SWIG_Lua_namespace_register(L,clss->cls_static, 1); + + assert(lua_istable(L,-1)); /* just in case */ + + /* add its constructor to module with the name of the class + so you can do MyClass(...) as well as new_MyClass(...) + BUT only if a constructor is defined + (this overcomes the problem of pure virtual classes without constructors)*/ + if (clss->constructor) + { + lua_getmetatable(L,-1); + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_function(L,"__call", clss->constructor); + lua_pop(L,1); + } + + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_class_static_details(L, clss); + + /* clear stack */ + lua_pop(L,1); + assert( lua_gettop(L) == begin ); +} + +/* Performs the instance (non-static) class registration process. Metatable for class is created + * and added to the class registry. + */ +SWIGINTERN void SWIG_Lua_class_register_instance(lua_State *L,swig_lua_class *clss) +{ + const int SWIGUNUSED begin = lua_gettop(L); + int i; + /* if name already there (class is already registered) then do nothing */ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,clss->fqname); /* get the name */ + lua_rawget(L,-2); + if(!lua_isnil(L,-1)) { + lua_pop(L,2); + assert(lua_gettop(L)==begin); + return; + } + lua_pop(L,2); /* tidy stack */ + /* Recursively initialize all bases */ + for(i=0;clss->bases[i];i++) + { + SWIG_Lua_class_register_instance(L,clss->bases[i]); + } + /* Again, get registry and push name */ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,clss->fqname); /* get the name */ + lua_newtable(L); /* create the metatable */ +#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) + /* If squashing is requested, then merges all bases metatable into this one. + * It would get us all special methods: __getitem, __add etc. + * This would set .fn, .type, and other .xxx incorrectly, but we will overwrite it right away + */ + { + int new_metatable_index = lua_absindex(L,-1); + for(i=0;clss->bases[i];i++) + { + int base_metatable; + SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname); + base_metatable = lua_absindex(L,-1); + SWIG_Lua_merge_tables_by_index(L,new_metatable_index, base_metatable); + lua_pop(L,1); + } + } + /* And now we will overwrite all incorrectly set data */ +#endif + /* add string of class name called ".type" */ + lua_pushstring(L,".type"); + lua_pushstring(L,clss->fqname); + lua_rawset(L,-3); + /* add a table called bases */ + lua_pushstring(L,".bases"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".get" */ + lua_pushstring(L,".get"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".set" */ + lua_pushstring(L,".set"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".fn" */ + lua_pushstring(L,".fn"); + lua_newtable(L); + /* add manual disown method */ + SWIG_Lua_add_function(L,"__disown",SWIG_Lua_class_disown); + lua_rawset(L,-3); + /* add accessor fns for using the .get,.set&.fn */ + SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get); + SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set); + SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct); + /* add it */ + lua_rawset(L,-3); /* metatable into registry */ + lua_pop(L,1); /* tidy stack (remove registry) */ + assert(lua_gettop(L) == begin); + +#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) + /* Now merge all symbols from .fn, .set, .get etc from bases to our tables */ + SWIG_Lua_class_squash_bases(L,clss); +#endif + SWIG_Lua_get_class_metatable(L,clss->fqname); + SWIG_Lua_add_class_instance_details(L,clss); /* recursive adding of details (atts & ops) */ + lua_pop(L,1); /* tidy stack (remove class metatable) */ + assert( lua_gettop(L) == begin ); +} + +SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss) +{ + int SWIGUNUSED begin; + assert(lua_istable(L,-1)); /* This is a table (module or namespace) where classes will be added */ + SWIG_Lua_class_register_instance(L,clss); + SWIG_Lua_class_register_static(L,clss); + + /* Add links from static part to instance part and vice versa */ + /* [SWIG registry] [Module] + * "MyClass" ----> [MyClass metatable] <===== "MyClass" -+> [static part] + * ".get" ----> ... | | getmetatable()----| + * ".set" ----> ... | | | + * ".static" --------------)----------------/ [static part metatable] + * | ".get" --> ... + * | ".set" --> .... + * |=============================== ".instance" + */ + begin = lua_gettop(L); + lua_pushstring(L,clss->cls_static->name); + lua_rawget(L,-2); /* get class static table */ + assert(lua_istable(L,-1)); + lua_getmetatable(L,-1); + assert(lua_istable(L,-1)); /* get class static metatable */ + lua_pushstring(L,".instance"); /* prepare key */ + + SWIG_Lua_get_class_metatable(L,clss->fqname); /* get class metatable */ + assert(lua_istable(L,-1)); + lua_pushstring(L,".static"); /* prepare key */ + lua_pushvalue(L, -4); /* push static class TABLE */ + assert(lua_istable(L,-1)); + lua_rawset(L,-3); /* assign static class table(!NOT metatable) as ".static" member of class metatable */ + lua_rawset(L,-3); /* assign class metatable as ".instance" member of class static METATABLE */ + lua_pop(L,2); + assert(lua_gettop(L) == begin); +} +#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */ + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) +SWIGINTERN void SWIG_Lua_elua_class_register_instance(lua_State *L, swig_lua_class *clss) +{ + const int SWIGUNUSED begin = lua_gettop(L); + int i; + /* if name already there (class is already registered) then do nothing */ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,clss->fqname); /* get the name */ + lua_rawget(L,-2); + if(!lua_isnil(L,-1)) { + lua_pop(L,2); + assert(lua_gettop(L)==begin); + return; + } + lua_pop(L,2); /* tidy stack */ + /* Recursively initialize all bases */ + for(i=0;clss->bases[i];i++) + { + SWIG_Lua_elua_class_register_instance(L,clss->bases[i]); + } + /* Again, get registry and push name */ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,clss->fqname); /* get the name */ + assert(clss->metatable); + lua_pushrotable(L, (void*)(clss->metatable)); /* create the metatable */ + lua_rawset(L,-3); + lua_pop(L,1); + assert(lua_gettop(L) == begin); +} +#endif /* elua && eluac */ + +/* ----------------------------------------------------------------------------- + * Class/structure conversion fns + * ----------------------------------------------------------------------------- */ + +/* helper to add metatable to new lua object */ +SWIGINTERN void SWIG_Lua_AddMetatable(lua_State *L,swig_type_info *type) +{ + if (type->clientdata) /* there is clientdata: so add the metatable */ + { + SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->fqname); + if (lua_istable(L,-1)) + { + lua_setmetatable(L,-2); + } + else + { + lua_pop(L,1); + } + } +} + +/* pushes a new object into the lua stack */ +SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own) +{ + swig_lua_userdata *usr; + if (!ptr){ + lua_pushnil(L); + return; + } + usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata)); /* get data */ + usr->ptr=ptr; /* set the ptr */ + usr->type=type; + usr->own=own; +#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) + SWIG_Lua_AddMetatable(L,type); /* add metatable */ +#endif +} + +/* takes a object from the lua stack & converts it into an object of the correct type + (if possible) */ +SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State *L,int index,void **ptr,swig_type_info *type,int flags) +{ + swig_lua_userdata *usr; + swig_cast_info *cast; + if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;} /* special case: lua nil => NULL pointer */ + usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */ + if (usr) + { + if (flags & SWIG_POINTER_DISOWN) /* must disown the object */ + { + usr->own=0; + } + if (!type) /* special cast void*, no casting fn */ + { + *ptr=usr->ptr; + return SWIG_OK; /* ok */ + } + cast=SWIG_TypeCheckStruct(usr->type,type); /* performs normal type checking */ + if (cast) + { + int newmemory = 0; + *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + return SWIG_OK; /* ok */ + } + } + return SWIG_ERROR; /* error */ +} + +SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State *L,int index,swig_type_info *type,int flags, + int argnum,const char *func_name){ + void *result; + if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){ + luaL_error (L,"Error in %s, expected a %s at argument number %d\n", + func_name,(type && type->str)?type->str:"void*",argnum); + } + return result; +} + +/* pushes a packed userdata. user for member fn pointers only */ +SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type) +{ + swig_lua_rawdata *raw; + assert(ptr); /* not acceptable to pass in a NULL value */ + raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size); /* alloc data */ + raw->type=type; + raw->own=0; + memcpy(raw->data,ptr,size); /* copy the data */ + SWIG_Lua_AddMetatable(L,type); /* add metatable */ +} + +/* converts a packed userdata. user for member fn pointers only */ +SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State *L,int index,void *ptr,size_t size,swig_type_info *type) +{ + swig_lua_rawdata *raw; + raw=(swig_lua_rawdata*)lua_touserdata(L,index); /* get data */ + if (!raw) return SWIG_ERROR; /* error */ + if (type==0 || type==raw->type) /* void* or identical type */ + { + memcpy(ptr,raw->data,size); /* copy it */ + return SWIG_OK; /* ok */ + } + return SWIG_ERROR; /* error */ +} + +/* a function to get the typestring of a piece of data */ +SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp) +{ + swig_lua_userdata *usr; + if (lua_isuserdata(L,tp)) + { + usr=(swig_lua_userdata*)lua_touserdata(L,tp); /* get data */ + if (usr && usr->type && usr->type->str) + return usr->type->str; + return "userdata (unknown type)"; + } + return lua_typename(L,lua_type(L,tp)); +} + +/* lua callable function to get the userdata's type */ +SWIGRUNTIME int SWIG_Lua_type(lua_State *L) +{ + lua_pushstring(L,SWIG_Lua_typename(L,1)); + return 1; +} + +/* ----------------------------------------------------------------------------- + * global variable support code: class/struct typemap functions + * ----------------------------------------------------------------------------- */ + +#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) +/* Install Constants */ +SWIGINTERN void +SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]) { + int i; + for (i = 0; constants[i].type; i++) { + switch(constants[i].type) { + case SWIG_LUA_INT: + lua_pushstring(L,constants[i].name); + lua_pushinteger(L,(lua_Number)constants[i].lvalue); + lua_rawset(L,-3); + break; + case SWIG_LUA_FLOAT: + lua_pushstring(L,constants[i].name); + lua_pushnumber(L,(lua_Number)constants[i].dvalue); + lua_rawset(L,-3); + break; + case SWIG_LUA_CHAR: + lua_pushstring(L,constants[i].name); + { + char c = constants[i].lvalue; + lua_pushlstring(L,&c,1); + } + lua_rawset(L,-3); + break; + case SWIG_LUA_STRING: + lua_pushstring(L,constants[i].name); + lua_pushstring(L,(char *) constants[i].pvalue); + lua_rawset(L,-3); + break; + case SWIG_LUA_POINTER: + lua_pushstring(L,constants[i].name); + SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0); + lua_rawset(L,-3); + break; + case SWIG_LUA_BINARY: + lua_pushstring(L,constants[i].name); + SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype); + lua_rawset(L,-3); + break; + default: + break; + } + } +} +#endif + +/* ----------------------------------------------------------------------------- + * executing lua code from within the wrapper + * ----------------------------------------------------------------------------- */ + +#ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */ +#define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S) +#endif +/* Executes a C string in Lua which is a really simple way of calling lua from C +Unfortunately lua keeps changing its APIs, so we need a conditional compile +In lua 5.0.X it's lua_dostring() +In lua 5.1.X it's luaL_dostring() +*/ +SWIGINTERN int +SWIG_Lua_dostring(lua_State *L, const char *str) { + int ok,top; + if (str==0 || str[0]==0) return 0; /* nothing to do */ + top=lua_gettop(L); /* save stack */ +#if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501)) + ok=luaL_dostring(L,str); /* looks like this is lua 5.1.X or later, good */ +#else + ok=lua_dostring(L,str); /* might be lua 5.0.x, using lua_dostring */ +#endif + if (ok!=0) { + SWIG_DOSTRING_FAIL(lua_tostring(L,-1)); + } + lua_settop(L,top); /* restore the stack */ + return ok; +} + +#ifdef __cplusplus +} +#endif + +/* ------------------------------ end luarun.swg ------------------------------ */ + + +/* -------- TYPES TABLE (BEGIN) -------- */ + +#define SWIGTYPE_p_Data swig_types[0] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr swig_types[1] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCDATASection swig_types[2] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData swig_types[3] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMComment swig_types[4] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocument swig_types[5] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentFragment swig_types[6] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType swig_types[7] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement swig_types[8] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity swig_types[9] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntityReference swig_types[10] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException swig_types[11] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap swig_types[12] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode swig_types[13] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList swig_types[14] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNotation swig_types[15] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction swig_types[16] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText swig_types[17] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMTypeInfo swig_types[18] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMUserDataHandler swig_types[19] +#define SWIGTYPE_p_XERCES_CPP_NAMESPACE__MemoryManager swig_types[20] +#define SWIGTYPE_p_bool swig_types[21] +#define SWIGTYPE_p_int16_t swig_types[22] +#define SWIGTYPE_p_int32_t swig_types[23] +#define SWIGTYPE_p_int64_t swig_types[24] +#define SWIGTYPE_p_namelist_t swig_types[25] +#define SWIGTYPE_p_params_t swig_types[26] +#define SWIGTYPE_p_size_t swig_types[27] +#define SWIGTYPE_p_ssize_t swig_types[28] +#define SWIGTYPE_p_std__listT_Data_t swig_types[29] +#define SWIGTYPE_p_std__multimapT_std__string_Data_t swig_types[30] +#define SWIGTYPE_p_std__string swig_types[31] +#define SWIGTYPE_p_uint16_t swig_types[32] +#define SWIGTYPE_p_uint32_t swig_types[33] +#define SWIGTYPE_p_uint64_t swig_types[34] +#define SWIGTYPE_p_unsigned_char swig_types[35] +#define SWIGTYPE_p_uscxml__ErrorEvent swig_types[36] +#define SWIGTYPE_p_uscxml__Event swig_types[37] +#define SWIGTYPE_p_void swig_types[38] +static swig_type_info *swig_types[40]; +static swig_module_info swig_module = {swig_types, 39, 0, 0, 0, 0}; +#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) +#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) + +/* -------- TYPES TABLE (END) -------- */ + +#define SWIG_name "LuaDOM" +#define SWIG_init luaopen_LuaDOM +#define SWIG_init_user luaopen_LuaDOM_user + +#define SWIG_LUACODE luaopen_LuaDOM_luacode + +namespace swig { +typedef struct{} LANGUAGE_OBJ; +} + + +#include <string> + + +SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) { + int ret = lua_isstring(L, idx); + if (!ret) + ret = lua_isnil(L, idx); + return ret; +} + + +#include "xercesc/sax/InputSource.hpp" +#include "xercesc/sax/SAXException.hpp" +#include "xercesc/sax/SAXParseException.hpp" +#include "xercesc/sax/Locator.hpp" +#include "xercesc/sax/HandlerBase.hpp" +#include "xercesc/sax2/Attributes.hpp" +#include "xercesc/sax2/ContentHandler.hpp" +#include "xercesc/sax2/LexicalHandler.hpp" +#include "xercesc/sax2/DefaultHandler.hpp" +#include "xercesc/sax2/SAX2XMLReader.hpp" +#include "xercesc/sax2/XMLReaderFactory.hpp" +#include "xercesc/util/PlatformUtils.hpp" +#include "xercesc/util/TransService.hpp" +#include "xercesc/util/XMLString.hpp" +#include "xercesc/util/XMLUri.hpp" +#include "xercesc/util/QName.hpp" +#include "xercesc/util/HexBin.hpp" +#include "xercesc/util/Base64.hpp" +#include "xercesc/parsers/AbstractDOMParser.hpp" +#include "xercesc/parsers/XercesDOMParser.hpp" +#include "xercesc/parsers/SAXParser.hpp" +#include "xercesc/dom/DOM.hpp" +#include "xercesc/framework/LocalFileInputSource.hpp" +#include "xercesc/framework/MemBufInputSource.hpp" +#include "xercesc/framework/StdInInputSource.hpp" +#include "xercesc/framework/URLInputSource.hpp" +#include "xercesc/framework/XMLGrammarDescription.hpp" +#include "xercesc/framework/XMLDTDDescription.hpp" +#include "xercesc/framework/XMLSchemaDescription.hpp" +#include "xercesc/util/NameIdPool.hpp" +#include "xercesc/util/XMLEnumerator.hpp" +#include "xercesc/framework/XMLValidator.hpp" +#include "xercesc/validators/common/Grammar.hpp" +#include "xercesc/validators/DTD/DTDAttDef.hpp" +#include "xercesc/validators/DTD/DTDAttDefList.hpp" +#include "xercesc/validators/DTD/DTDGrammar.hpp" +#include "xercesc/validators/DTD/DTDValidator.hpp" +#include "xercesc/validators/schema/SchemaGrammar.hpp" +#include "xercesc/validators/schema/SchemaValidator.hpp" +#include "xercesc/validators/schema/SchemaAttDefList.hpp" +#include "xercesc/validators/schema/SchemaAttDef.hpp" +#include "xercesc/framework/XMLFormatter.hpp" +#include "xercesc/framework/MemBufFormatTarget.hpp" +#include "xercesc/framework/LocalFileFormatTarget.hpp" +#include "xercesc/framework/StdOutFormatTarget.hpp" +#include "xercesc/framework/Wrapper4InputSource.hpp" +#include "xercesc/framework/psvi/PSVIHandler.hpp" + +// for resolving XMLExceptions +#include "xercesc/util/ArrayIndexOutOfBoundsException.hpp" +#include "xercesc/util/EmptyStackException.hpp" +#include "xercesc/util/IllegalArgumentException.hpp" +#include "xercesc/util/InvalidCastException.hpp" +#include "xercesc/util/IOException.hpp" +#include "xercesc/util/NoSuchElementException.hpp" +#include "xercesc/util/NullPointerException.hpp" +#include "xercesc/util/NumberFormatException.hpp" +#include "xercesc/util/ParseException.hpp" +#include "xercesc/util/RuntimeException.hpp" +#include "xercesc/util/SchemaDateTimeException.hpp" +#include "xercesc/util/TranscodingException.hpp" +#include "xercesc/util/UnexpectedEOFException.hpp" +#include "xercesc/util/UnsupportedEncodingException.hpp" +#include "xercesc/util/UTFDataFormatException.hpp" +#include "xercesc/util/XMLNetAccessor.hpp" +#include "xercesc/internal/XSerializationException.hpp" +#include "xercesc/validators/datatype/InvalidDatatypeFacetException.hpp" +#include "xercesc/validators/datatype/InvalidDatatypeValueException.hpp" +#include "xercesc/validators/schema/identity/XPathException.hpp" + +XERCES_CPP_NAMESPACE_USE + +// we initialize the static UTF-8 transcoding info +// these are used by the typemaps to convert between +// Xerces internal UTF-16 and Perl's internal UTF-8 +static XMLCh* UTF8_ENCODING = NULL; +static XMLTranscoder* UTF8_TRANSCODER = NULL; + +static bool DEBUG_UTF8_OUT = 0; +static bool DEBUG_UTF8_IN = 0; + + + +static swig_type_info * +DOMNode_dynamic_cast(void **ptr) { + DOMNode **nptr = (DOMNode **) ptr; + if (*nptr == NULL) { + return NULL; + } + short int type = (*nptr)->getNodeType(); + if (type == DOMNode::TEXT_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText; + } + if (type == DOMNode::PROCESSING_INSTRUCTION_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction; + } + if (type == DOMNode::DOCUMENT_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocument; + } + if (type == DOMNode::ELEMENT_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement; + } + if (type == DOMNode::ENTITY_REFERENCE_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntityReference; + } + if (type == DOMNode::CDATA_SECTION_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCDATASection; + } + if (type == DOMNode::CDATA_SECTION_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCDATASection; + } + if (type == DOMNode::COMMENT_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMComment; + } + if (type == DOMNode::DOCUMENT_TYPE_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType; + } + if (type == DOMNode::ENTITY_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity; + } + if (type == DOMNode::ATTRIBUTE_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr; + } + if (type == DOMNode::NOTATION_NODE) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNotation; + } + return NULL; +} + +SWIGINTERN bool XERCES_CPP_NAMESPACE_DOMNode_operator_Se__Se_(XERCES_CPP_NAMESPACE::DOMNode *self,XERCES_CPP_NAMESPACE::DOMNode const *other){ + return self->isSameNode(other); + } + +using uscxml::Data; + +#ifdef __cplusplus +extern "C" { +#endif +static int _wrap_new_string__SWIG_0(lua_State* L) { + int SWIG_arg = 0; + std::string *result = 0 ; + + SWIG_check_num_args("std::string::string",0,0) + result = (std::string *)new std::string(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_std__string,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_string__SWIG_1(lua_State* L) { + int SWIG_arg = 0; + char *arg1 = (char *) 0 ; + std::string *result = 0 ; + + SWIG_check_num_args("std::string::string",1,1) + if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("std::string::string",1,"char const *"); + arg1 = (char *)lua_tostring(L, 1); + result = (std::string *)new std::string((char const *)arg1); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_std__string,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_string(lua_State* L) { + int argc; + int argv[2]={ + 1,2 + }; + + argc = lua_gettop(L); + if (argc == 0) { + return _wrap_new_string__SWIG_0(L); + } + if (argc == 1) { + int _v; + { + _v = SWIG_lua_isnilstring(L,argv[0]); + } + if (_v) { + return _wrap_new_string__SWIG_1(L); + } + } + + SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_string'\n" + " Possible C/C++ prototypes are:\n" + " std::string::string()\n" + " std::string::string(char const *)\n"); + lua_error(L);return 0; +} + + +static int _wrap_string_size(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = (std::string *) 0 ; + unsigned int result; + + SWIG_check_num_args("std::string::size",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::size",1,"std::string const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_size",1,SWIGTYPE_p_std__string); + } + + result = (unsigned int)((std::string const *)arg1)->size(); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_string_length(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = (std::string *) 0 ; + unsigned int result; + + SWIG_check_num_args("std::string::length",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::length",1,"std::string const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_length",1,SWIGTYPE_p_std__string); + } + + result = (unsigned int)((std::string const *)arg1)->length(); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_string_empty(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = (std::string *) 0 ; + bool result; + + SWIG_check_num_args("std::string::empty",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::empty",1,"std::string const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_empty",1,SWIGTYPE_p_std__string); + } + + result = (bool)((std::string const *)arg1)->empty(); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_string_c_str(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = (std::string *) 0 ; + char *result = 0 ; + + SWIG_check_num_args("std::string::c_str",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::c_str",1,"std::string const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_c_str",1,SWIGTYPE_p_std__string); + } + + result = (char *)((std::string const *)arg1)->c_str(); + lua_pushstring(L,(const char *)result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_string_data(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = (std::string *) 0 ; + char *result = 0 ; + + SWIG_check_num_args("std::string::data",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::data",1,"std::string const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_data",1,SWIGTYPE_p_std__string); + } + + result = (char *)((std::string const *)arg1)->data(); + lua_pushstring(L,(const char *)result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_string_assign(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = (std::string *) 0 ; + char *arg2 = (char *) 0 ; + + SWIG_check_num_args("std::string::assign",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::assign",1,"std::string *"); + if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("std::string::assign",2,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){ + SWIG_fail_ptr("string_assign",1,SWIGTYPE_p_std__string); + } + + arg2 = (char *)lua_tostring(L, 2); + (arg1)->assign((char const *)arg2); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_string(void *obj) { +std::string *arg1 = (std::string *) obj; +delete arg1; +} +static int _proxy__wrap_new_string(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_string); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} +static swig_lua_attribute swig_string_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_string_methods[]= { + { "size", _wrap_string_size}, + { "length", _wrap_string_length}, + { "empty", _wrap_string_empty}, + { "c_str", _wrap_string_c_str}, + { "data", _wrap_string_data}, + { "assign", _wrap_string_assign}, + {0,0} +}; +static swig_lua_method swig_string_meta[] = { + {0,0} +}; + +static swig_lua_attribute swig_string_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_string_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_string_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_string_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_string_Sf_SwigStatic = { + "string", + swig_string_Sf_SwigStatic_methods, + swig_string_Sf_SwigStatic_attributes, + swig_string_Sf_SwigStatic_constants, + swig_string_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_string_bases[] = {0}; +static const char *swig_string_base_names[] = {0}; +static swig_lua_class _wrap_class_string = { "string", "string", &SWIGTYPE_p_std__string,_proxy__wrap_new_string, swig_delete_string, swig_string_methods, swig_string_attributes, &swig_string_Sf_SwigStatic, swig_string_meta, swig_string_bases, swig_string_base_names }; + +static int _wrap_DEBUG_UTF8_OUT_set(lua_State* L) { + int SWIG_arg = 0; + bool arg1 ; + + SWIG_check_num_args("DEBUG_UTF8_OUT",1,1) + if(!lua_isboolean(L,1)) SWIG_fail_arg("DEBUG_UTF8_OUT",1,"bool"); + arg1 = (lua_toboolean(L, 1)!=0); + DEBUG_UTF8_OUT = arg1; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DEBUG_UTF8_OUT_get(lua_State* L) { + int SWIG_arg = 0; + bool result; + + SWIG_check_num_args("DEBUG_UTF8_OUT",0,0) + result = (bool)DEBUG_UTF8_OUT; + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DEBUG_UTF8_IN_set(lua_State* L) { + int SWIG_arg = 0; + bool arg1 ; + + SWIG_check_num_args("DEBUG_UTF8_IN",1,1) + if(!lua_isboolean(L,1)) SWIG_fail_arg("DEBUG_UTF8_IN",1,"bool"); + arg1 = (lua_toboolean(L, 1)!=0); + DEBUG_UTF8_IN = arg1; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DEBUG_UTF8_IN_get(lua_State* L) { + int SWIG_arg = 0; + bool result; + + SWIG_check_num_args("DEBUG_UTF8_IN",0,0) + result = (bool)DEBUG_UTF8_IN; + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_DOMException__SWIG_0(lua_State* L) { + int SWIG_arg = 0; + short arg1 ; + short arg2 ; + XERCES_CPP_NAMESPACE::MemoryManager *arg3 = (XERCES_CPP_NAMESPACE::MemoryManager *) (XERCES_CPP_NAMESPACE::MemoryManager *)0 ; + XERCES_CPP_NAMESPACE::DOMException *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMException::DOMException",3,3) + if(!lua_isnumber(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMException::DOMException",1,"short"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMException::DOMException",2,"short"); + if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMException::DOMException",3,"XERCES_CPP_NAMESPACE::MemoryManager *const"); + arg1 = (short)lua_tonumber(L, 1); + arg2 = (short)lua_tonumber(L, 2); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_XERCES_CPP_NAMESPACE__MemoryManager,0))){ + SWIG_fail_ptr("new_DOMException",3,SWIGTYPE_p_XERCES_CPP_NAMESPACE__MemoryManager); + } + + result = (XERCES_CPP_NAMESPACE::DOMException *)new XERCES_CPP_NAMESPACE::DOMException(arg1,arg2,arg3); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_DOMException__SWIG_1(lua_State* L) { + int SWIG_arg = 0; + short arg1 ; + short arg2 ; + XERCES_CPP_NAMESPACE::DOMException *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMException::DOMException",2,2) + if(!lua_isnumber(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMException::DOMException",1,"short"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMException::DOMException",2,"short"); + arg1 = (short)lua_tonumber(L, 1); + arg2 = (short)lua_tonumber(L, 2); + result = (XERCES_CPP_NAMESPACE::DOMException *)new XERCES_CPP_NAMESPACE::DOMException(arg1,arg2); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_DOMException__SWIG_2(lua_State* L) { + int SWIG_arg = 0; + short arg1 ; + XERCES_CPP_NAMESPACE::DOMException *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMException::DOMException",1,1) + if(!lua_isnumber(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMException::DOMException",1,"short"); + arg1 = (short)lua_tonumber(L, 1); + result = (XERCES_CPP_NAMESPACE::DOMException *)new XERCES_CPP_NAMESPACE::DOMException(arg1); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_DOMException(lua_State* L) { + int argc; + int argv[4]={ + 1,2,3,4 + }; + + argc = lua_gettop(L); + if (argc == 1) { + int _v; + { + _v = lua_isnumber(L,argv[0]); + } + if (_v) { + return _wrap_new_DOMException__SWIG_2(L); + } + } + if (argc == 2) { + int _v; + { + _v = lua_isnumber(L,argv[0]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[1]); + } + if (_v) { + return _wrap_new_DOMException__SWIG_1(L); + } + } + } + if (argc == 3) { + int _v; + { + _v = lua_isnumber(L,argv[0]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[1]); + } + if (_v) { + { + void *ptr; + if (SWIG_isptrtype(L,argv[2])==0 || SWIG_ConvertPtr(L,argv[2], (void **) &ptr, SWIGTYPE_p_XERCES_CPP_NAMESPACE__MemoryManager, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + return _wrap_new_DOMException__SWIG_0(L); + } + } + } + } + + SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_DOMException'\n" + " Possible C/C++ prototypes are:\n" + " XERCES_CPP_NAMESPACE::DOMException::DOMException(short,short,XERCES_CPP_NAMESPACE::MemoryManager *const)\n" + " XERCES_CPP_NAMESPACE::DOMException::DOMException(short,short)\n" + " XERCES_CPP_NAMESPACE::DOMException::DOMException(short)\n"); + lua_error(L);return 0; +} + + +static int _wrap_DOMException_getMessage(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMException *arg1 = (XERCES_CPP_NAMESPACE::DOMException *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMException::getMessage",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMException::getMessage",1,"XERCES_CPP_NAMESPACE::DOMException const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException,0))){ + SWIG_fail_ptr("DOMException_getMessage",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMException const *)arg1)->getMessage(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMException_code_set(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMException *arg1 = (XERCES_CPP_NAMESPACE::DOMException *) 0 ; + short arg2 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMException::code",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMException::code",1,"XERCES_CPP_NAMESPACE::DOMException *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMException::code",2,"short"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException,0))){ + SWIG_fail_ptr("DOMException_code_set",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException); + } + + arg2 = (short)lua_tonumber(L, 2); + if (arg1) (arg1)->code = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMException_code_get(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMException *arg1 = (XERCES_CPP_NAMESPACE::DOMException *) 0 ; + short result; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMException::code",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMException::code",1,"XERCES_CPP_NAMESPACE::DOMException *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException,0))){ + SWIG_fail_ptr("DOMException_code_get",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException); + } + + result = (short) ((arg1)->code); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMException_msg_set(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMException *arg1 = (XERCES_CPP_NAMESPACE::DOMException *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMException::msg",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMException::msg",1,"XERCES_CPP_NAMESPACE::DOMException *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException,0))){ + SWIG_fail_ptr("DOMException_msg_set",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException); + } + + + arg2 = Lua2XMLString(2); + + if (arg1) (arg1)->msg = (XMLCh const *)arg2; + + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMException_msg_get(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMException *arg1 = (XERCES_CPP_NAMESPACE::DOMException *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMException::msg",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMException::msg",1,"XERCES_CPP_NAMESPACE::DOMException *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException,0))){ + SWIG_fail_ptr("DOMException_msg_get",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException); + } + + result = (XMLCh *) ((arg1)->msg); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_DOMException(void *obj) { +XERCES_CPP_NAMESPACE::DOMException *arg1 = (XERCES_CPP_NAMESPACE::DOMException *) obj; +delete arg1; +} +static int _proxy__wrap_new_DOMException(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_DOMException); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} +static swig_lua_attribute swig_DOMException_attributes[] = { + { "code", _wrap_DOMException_code_get, _wrap_DOMException_code_set }, + { "msg", _wrap_DOMException_msg_get, _wrap_DOMException_msg_set }, + {0,0,0} +}; +static swig_lua_method swig_DOMException_methods[]= { + { "getMessage", _wrap_DOMException_getMessage}, + {0,0} +}; +static swig_lua_method swig_DOMException_meta[] = { + {0,0} +}; + +static swig_lua_attribute swig_DOMException_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_DOMException_Sf_SwigStatic_constants[]= { + {SWIG_LUA_CONSTTAB_INT("INDEX_SIZE_ERR", XERCES_CPP_NAMESPACE::DOMException::INDEX_SIZE_ERR)}, + {SWIG_LUA_CONSTTAB_INT("DOMSTRING_SIZE_ERR", XERCES_CPP_NAMESPACE::DOMException::DOMSTRING_SIZE_ERR)}, + {SWIG_LUA_CONSTTAB_INT("HIERARCHY_REQUEST_ERR", XERCES_CPP_NAMESPACE::DOMException::HIERARCHY_REQUEST_ERR)}, + {SWIG_LUA_CONSTTAB_INT("WRONG_DOCUMENT_ERR", XERCES_CPP_NAMESPACE::DOMException::WRONG_DOCUMENT_ERR)}, + {SWIG_LUA_CONSTTAB_INT("INVALID_CHARACTER_ERR", XERCES_CPP_NAMESPACE::DOMException::INVALID_CHARACTER_ERR)}, + {SWIG_LUA_CONSTTAB_INT("NO_DATA_ALLOWED_ERR", XERCES_CPP_NAMESPACE::DOMException::NO_DATA_ALLOWED_ERR)}, + {SWIG_LUA_CONSTTAB_INT("NO_MODIFICATION_ALLOWED_ERR", XERCES_CPP_NAMESPACE::DOMException::NO_MODIFICATION_ALLOWED_ERR)}, + {SWIG_LUA_CONSTTAB_INT("NOT_FOUND_ERR", XERCES_CPP_NAMESPACE::DOMException::NOT_FOUND_ERR)}, + {SWIG_LUA_CONSTTAB_INT("NOT_SUPPORTED_ERR", XERCES_CPP_NAMESPACE::DOMException::NOT_SUPPORTED_ERR)}, + {SWIG_LUA_CONSTTAB_INT("INUSE_ATTRIBUTE_ERR", XERCES_CPP_NAMESPACE::DOMException::INUSE_ATTRIBUTE_ERR)}, + {SWIG_LUA_CONSTTAB_INT("INVALID_STATE_ERR", XERCES_CPP_NAMESPACE::DOMException::INVALID_STATE_ERR)}, + {SWIG_LUA_CONSTTAB_INT("SYNTAX_ERR", XERCES_CPP_NAMESPACE::DOMException::SYNTAX_ERR)}, + {SWIG_LUA_CONSTTAB_INT("INVALID_MODIFICATION_ERR", XERCES_CPP_NAMESPACE::DOMException::INVALID_MODIFICATION_ERR)}, + {SWIG_LUA_CONSTTAB_INT("NAMESPACE_ERR", XERCES_CPP_NAMESPACE::DOMException::NAMESPACE_ERR)}, + {SWIG_LUA_CONSTTAB_INT("INVALID_ACCESS_ERR", XERCES_CPP_NAMESPACE::DOMException::INVALID_ACCESS_ERR)}, + {SWIG_LUA_CONSTTAB_INT("VALIDATION_ERR", XERCES_CPP_NAMESPACE::DOMException::VALIDATION_ERR)}, + {SWIG_LUA_CONSTTAB_INT("TYPE_MISMATCH_ERR", XERCES_CPP_NAMESPACE::DOMException::TYPE_MISMATCH_ERR)}, + {0,0,0,0,0,0} +}; +static swig_lua_method swig_DOMException_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_DOMException_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_DOMException_Sf_SwigStatic = { + "DOMException", + swig_DOMException_Sf_SwigStatic_methods, + swig_DOMException_Sf_SwigStatic_attributes, + swig_DOMException_Sf_SwigStatic_constants, + swig_DOMException_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_DOMException_bases[] = {0}; +static const char *swig_DOMException_base_names[] = {0}; +static swig_lua_class _wrap_class_DOMException = { "DOMException", "DOMException", &SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMException,_proxy__wrap_new_DOMException, swig_delete_DOMException, swig_DOMException_methods, swig_DOMException_attributes, &swig_DOMException_Sf_SwigStatic, swig_DOMException_meta, swig_DOMException_bases, swig_DOMException_base_names }; + +static int _wrap_DOMNode_getNodeName(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::getNodeName",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getNodeName",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_getNodeName",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getNodeName(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_getNodeValue(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::getNodeValue",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getNodeValue",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_getNodeValue",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getNodeValue(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_getNodeType(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode::NodeType result; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::getNodeType",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getNodeType",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_getNodeType",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XERCES_CPP_NAMESPACE::DOMNode::NodeType)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getNodeType(); + lua_pushnumber(L, (lua_Number)(int)(result)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_getParentNode(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::getParentNode",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getParentNode",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_getParentNode",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getParentNode(); + { + swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); + SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_getChildNodes(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNodeList *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::getChildNodes",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getChildNodes",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_getChildNodes",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XERCES_CPP_NAMESPACE::DOMNodeList *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getChildNodes(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_getFirstChild(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::getFirstChild",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getFirstChild",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_getFirstChild",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getFirstChild(); + { + swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); + SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_getLastChild(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::getLastChild",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getLastChild",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_getLastChild",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getLastChild(); + { + swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); + SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_getPreviousSibling(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::getPreviousSibling",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getPreviousSibling",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_getPreviousSibling",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getPreviousSibling(); + { + swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); + SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_getNextSibling(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::getNextSibling",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getNextSibling",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_getNextSibling",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getNextSibling(); + { + swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); + SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_getAttributes(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::getAttributes",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getAttributes",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_getAttributes",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getAttributes(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_getOwnerDocument(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMDocument *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::getOwnerDocument",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getOwnerDocument",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_getOwnerDocument",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XERCES_CPP_NAMESPACE::DOMDocument *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getOwnerDocument(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocument,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_cloneNode(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + bool arg2 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::cloneNode",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::cloneNode",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + if(!lua_isboolean(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::cloneNode",2,"bool"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_cloneNode",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + arg2 = (lua_toboolean(L, 2)!=0); + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->cloneNode(arg2); + { + swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); + SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_insertBefore(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg3 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::insertBefore",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::insertBefore",1,"XERCES_CPP_NAMESPACE::DOMNode *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::insertBefore",2,"XERCES_CPP_NAMESPACE::DOMNode *"); + if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::insertBefore",3,"XERCES_CPP_NAMESPACE::DOMNode *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_insertBefore",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_insertBefore",2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_insertBefore",3,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->insertBefore(arg2,arg3); + { + swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); + SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_replaceChild(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg3 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::replaceChild",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::replaceChild",1,"XERCES_CPP_NAMESPACE::DOMNode *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::replaceChild",2,"XERCES_CPP_NAMESPACE::DOMNode *"); + if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::replaceChild",3,"XERCES_CPP_NAMESPACE::DOMNode *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_replaceChild",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_replaceChild",2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_replaceChild",3,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->replaceChild(arg2,arg3); + { + swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); + SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_removeChild(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::removeChild",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::removeChild",1,"XERCES_CPP_NAMESPACE::DOMNode *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::removeChild",2,"XERCES_CPP_NAMESPACE::DOMNode *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_removeChild",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_removeChild",2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->removeChild(arg2); + { + swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); + SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_appendChild(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::appendChild",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::appendChild",1,"XERCES_CPP_NAMESPACE::DOMNode *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::appendChild",2,"XERCES_CPP_NAMESPACE::DOMNode *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_appendChild",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_appendChild",2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->appendChild(arg2); + { + swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); + SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_hasChildNodes(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + bool result; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::hasChildNodes",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::hasChildNodes",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_hasChildNodes",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (bool)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->hasChildNodes(); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_setNodeValue(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::setNodeValue",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::setNodeValue",1,"XERCES_CPP_NAMESPACE::DOMNode *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_setNodeValue",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + + arg2 = Lua2XMLString(2); + + (arg1)->setNodeValue((XMLCh const *)arg2); + + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_normalize(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::normalize",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::normalize",1,"XERCES_CPP_NAMESPACE::DOMNode *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_normalize",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + (arg1)->normalize(); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_isSupported(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + bool result; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::isSupported",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::isSupported",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_isSupported",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + + arg2 = Lua2XMLString(2); + + + arg3 = Lua2XMLString(3); + + result = (bool)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->isSupported((XMLCh const *)arg2,(XMLCh const *)arg3); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + + delete[] arg2; + + + delete[] arg3; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + + delete[] arg3; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_getNamespaceURI(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::getNamespaceURI",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getNamespaceURI",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_getNamespaceURI",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getNamespaceURI(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_getLocalName(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::getLocalName",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getLocalName",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_getLocalName",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getLocalName(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_setPrefix(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::setPrefix",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::setPrefix",1,"XERCES_CPP_NAMESPACE::DOMNode *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_setPrefix",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + + arg2 = Lua2XMLString(2); + + (arg1)->setPrefix((XMLCh const *)arg2); + + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_hasAttributes(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + bool result; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::hasAttributes",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::hasAttributes",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_hasAttributes",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (bool)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->hasAttributes(); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_isSameNode(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + bool result; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::isSameNode",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::isSameNode",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::isSameNode",2,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_isSameNode",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_isSameNode",2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (bool)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->isSameNode((XERCES_CPP_NAMESPACE::DOMNode const *)arg2); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_isEqualNode(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + bool result; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::isEqualNode",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::isEqualNode",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::isEqualNode",2,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_isEqualNode",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_isEqualNode",2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (bool)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->isEqualNode((XERCES_CPP_NAMESPACE::DOMNode const *)arg2); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_setUserData(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *arg3 = (void *) 0 ; + XERCES_CPP_NAMESPACE::DOMUserDataHandler *arg4 = (XERCES_CPP_NAMESPACE::DOMUserDataHandler *) 0 ; + void *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::setUserData",4,4) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::setUserData",1,"XERCES_CPP_NAMESPACE::DOMNode *"); + if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::setUserData",3,"void *"); + if(!SWIG_isptrtype(L,4)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::setUserData",4,"XERCES_CPP_NAMESPACE::DOMUserDataHandler *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_setUserData",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + + arg2 = Lua2XMLString(2); + + arg3=(void *)SWIG_MustGetPtr(L,3,0,0,3,"DOMNode_setUserData"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,4,(void**)&arg4,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMUserDataHandler,0))){ + SWIG_fail_ptr("DOMNode_setUserData",4,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMUserDataHandler); + } + + result = (void *)(arg1)->setUserData((XMLCh const *)arg2,arg3,arg4); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_getUserData(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + void *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::getUserData",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getUserData",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_getUserData",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + + arg2 = Lua2XMLString(2); + + result = (void *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getUserData((XMLCh const *)arg2); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_getBaseURI(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::getBaseURI",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getBaseURI",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_getBaseURI",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getBaseURI(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_compareDocumentPosition(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + short result; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::compareDocumentPosition",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::compareDocumentPosition",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::compareDocumentPosition",2,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_compareDocumentPosition",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_compareDocumentPosition",2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (short)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->compareDocumentPosition((XERCES_CPP_NAMESPACE::DOMNode const *)arg2); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_getTextContent(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::getTextContent",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getTextContent",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_getTextContent",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getTextContent(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_setTextContent(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::setTextContent",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::setTextContent",1,"XERCES_CPP_NAMESPACE::DOMNode *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_setTextContent",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + + arg2 = Lua2XMLString(2); + + (arg1)->setTextContent((XMLCh const *)arg2); + + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_lookupPrefix(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::lookupPrefix",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::lookupPrefix",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_lookupPrefix",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + + arg2 = Lua2XMLString(2); + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->lookupPrefix((XMLCh const *)arg2); + + result = XMLString2Lua(result); + + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_isDefaultNamespace(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + bool result; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::isDefaultNamespace",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::isDefaultNamespace",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_isDefaultNamespace",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + + arg2 = Lua2XMLString(2); + + result = (bool)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->isDefaultNamespace((XMLCh const *)arg2); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_lookupNamespaceURI(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::lookupNamespaceURI",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::lookupNamespaceURI",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_lookupNamespaceURI",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + + arg2 = Lua2XMLString(2); + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->lookupNamespaceURI((XMLCh const *)arg2); + + result = XMLString2Lua(result); + + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_getFeature(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + void *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::getFeature",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::getFeature",1,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_getFeature",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + + arg2 = Lua2XMLString(2); + + + arg3 = Lua2XMLString(3); + + result = (void *)((XERCES_CPP_NAMESPACE::DOMNode const *)arg1)->getFeature((XMLCh const *)arg2,(XMLCh const *)arg3); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; + + delete[] arg2; + + + delete[] arg3; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + + delete[] arg3; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode_release(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::release",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::release",1,"XERCES_CPP_NAMESPACE::DOMNode *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode_release",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + (arg1)->release(); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNode___eq(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + bool result; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNode::operator ==",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::operator ==",1,"XERCES_CPP_NAMESPACE::DOMNode *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNode::operator ==",2,"XERCES_CPP_NAMESPACE::DOMNode const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode___eq",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNode___eq",2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (bool)XERCES_CPP_NAMESPACE_DOMNode_operator_Se__Se_(arg1,(XERCES_CPP_NAMESPACE::DOMNode const *)arg2); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_DOMNode(void *obj) { +XERCES_CPP_NAMESPACE::DOMNode *arg1 = (XERCES_CPP_NAMESPACE::DOMNode *) obj; +delete arg1; +} +static swig_lua_attribute swig_DOMNode_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_DOMNode_methods[]= { + { "getNodeName", _wrap_DOMNode_getNodeName}, + { "getNodeValue", _wrap_DOMNode_getNodeValue}, + { "getNodeType", _wrap_DOMNode_getNodeType}, + { "getParentNode", _wrap_DOMNode_getParentNode}, + { "getChildNodes", _wrap_DOMNode_getChildNodes}, + { "getFirstChild", _wrap_DOMNode_getFirstChild}, + { "getLastChild", _wrap_DOMNode_getLastChild}, + { "getPreviousSibling", _wrap_DOMNode_getPreviousSibling}, + { "getNextSibling", _wrap_DOMNode_getNextSibling}, + { "getAttributes", _wrap_DOMNode_getAttributes}, + { "getOwnerDocument", _wrap_DOMNode_getOwnerDocument}, + { "cloneNode", _wrap_DOMNode_cloneNode}, + { "insertBefore", _wrap_DOMNode_insertBefore}, + { "replaceChild", _wrap_DOMNode_replaceChild}, + { "removeChild", _wrap_DOMNode_removeChild}, + { "appendChild", _wrap_DOMNode_appendChild}, + { "hasChildNodes", _wrap_DOMNode_hasChildNodes}, + { "setNodeValue", _wrap_DOMNode_setNodeValue}, + { "normalize", _wrap_DOMNode_normalize}, + { "isSupported", _wrap_DOMNode_isSupported}, + { "getNamespaceURI", _wrap_DOMNode_getNamespaceURI}, + { "getLocalName", _wrap_DOMNode_getLocalName}, + { "setPrefix", _wrap_DOMNode_setPrefix}, + { "hasAttributes", _wrap_DOMNode_hasAttributes}, + { "isSameNode", _wrap_DOMNode_isSameNode}, + { "isEqualNode", _wrap_DOMNode_isEqualNode}, + { "setUserData", _wrap_DOMNode_setUserData}, + { "getUserData", _wrap_DOMNode_getUserData}, + { "getBaseURI", _wrap_DOMNode_getBaseURI}, + { "compareDocumentPosition", _wrap_DOMNode_compareDocumentPosition}, + { "getTextContent", _wrap_DOMNode_getTextContent}, + { "setTextContent", _wrap_DOMNode_setTextContent}, + { "lookupPrefix", _wrap_DOMNode_lookupPrefix}, + { "isDefaultNamespace", _wrap_DOMNode_isDefaultNamespace}, + { "lookupNamespaceURI", _wrap_DOMNode_lookupNamespaceURI}, + { "getFeature", _wrap_DOMNode_getFeature}, + { "release", _wrap_DOMNode_release}, + { "__eq", _wrap_DOMNode___eq}, + {0,0} +}; +static swig_lua_method swig_DOMNode_meta[] = { + { "__eq", _wrap_DOMNode___eq}, + {0,0} +}; + +static swig_lua_attribute swig_DOMNode_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_DOMNode_Sf_SwigStatic_constants[]= { + {SWIG_LUA_CONSTTAB_INT("ELEMENT_NODE", XERCES_CPP_NAMESPACE::DOMNode::ELEMENT_NODE)}, + {SWIG_LUA_CONSTTAB_INT("ATTRIBUTE_NODE", XERCES_CPP_NAMESPACE::DOMNode::ATTRIBUTE_NODE)}, + {SWIG_LUA_CONSTTAB_INT("TEXT_NODE", XERCES_CPP_NAMESPACE::DOMNode::TEXT_NODE)}, + {SWIG_LUA_CONSTTAB_INT("CDATA_SECTION_NODE", XERCES_CPP_NAMESPACE::DOMNode::CDATA_SECTION_NODE)}, + {SWIG_LUA_CONSTTAB_INT("ENTITY_REFERENCE_NODE", XERCES_CPP_NAMESPACE::DOMNode::ENTITY_REFERENCE_NODE)}, + {SWIG_LUA_CONSTTAB_INT("ENTITY_NODE", XERCES_CPP_NAMESPACE::DOMNode::ENTITY_NODE)}, + {SWIG_LUA_CONSTTAB_INT("PROCESSING_INSTRUCTION_NODE", XERCES_CPP_NAMESPACE::DOMNode::PROCESSING_INSTRUCTION_NODE)}, + {SWIG_LUA_CONSTTAB_INT("COMMENT_NODE", XERCES_CPP_NAMESPACE::DOMNode::COMMENT_NODE)}, + {SWIG_LUA_CONSTTAB_INT("DOCUMENT_NODE", XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_NODE)}, + {SWIG_LUA_CONSTTAB_INT("DOCUMENT_TYPE_NODE", XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_TYPE_NODE)}, + {SWIG_LUA_CONSTTAB_INT("DOCUMENT_FRAGMENT_NODE", XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_FRAGMENT_NODE)}, + {SWIG_LUA_CONSTTAB_INT("NOTATION_NODE", XERCES_CPP_NAMESPACE::DOMNode::NOTATION_NODE)}, + {SWIG_LUA_CONSTTAB_INT("DOCUMENT_POSITION_DISCONNECTED", XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_DISCONNECTED)}, + {SWIG_LUA_CONSTTAB_INT("DOCUMENT_POSITION_PRECEDING", XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_PRECEDING)}, + {SWIG_LUA_CONSTTAB_INT("DOCUMENT_POSITION_FOLLOWING", XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_FOLLOWING)}, + {SWIG_LUA_CONSTTAB_INT("DOCUMENT_POSITION_CONTAINS", XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_CONTAINS)}, + {SWIG_LUA_CONSTTAB_INT("DOCUMENT_POSITION_CONTAINED_BY", XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_CONTAINED_BY)}, + {SWIG_LUA_CONSTTAB_INT("DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC", XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)}, + {0,0,0,0,0,0} +}; +static swig_lua_method swig_DOMNode_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_DOMNode_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_DOMNode_Sf_SwigStatic = { + "DOMNode", + swig_DOMNode_Sf_SwigStatic_methods, + swig_DOMNode_Sf_SwigStatic_attributes, + swig_DOMNode_Sf_SwigStatic_constants, + swig_DOMNode_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_DOMNode_bases[] = {0}; +static const char *swig_DOMNode_base_names[] = {0}; +static swig_lua_class _wrap_class_DOMNode = { "DOMNode", "DOMNode", &SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0, swig_delete_DOMNode, swig_DOMNode_methods, swig_DOMNode_attributes, &swig_DOMNode_Sf_SwigStatic, swig_DOMNode_meta, swig_DOMNode_bases, swig_DOMNode_base_names }; + +static int _wrap_DOMAttr_getName(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMAttr::getName",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMAttr::getName",1,"XERCES_CPP_NAMESPACE::DOMAttr const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr,0))){ + SWIG_fail_ptr("DOMAttr_getName",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMAttr const *)arg1)->getName(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMAttr_getSpecified(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + bool result; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMAttr::getSpecified",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMAttr::getSpecified",1,"XERCES_CPP_NAMESPACE::DOMAttr const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr,0))){ + SWIG_fail_ptr("DOMAttr_getSpecified",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr); + } + + result = (bool)((XERCES_CPP_NAMESPACE::DOMAttr const *)arg1)->getSpecified(); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMAttr_getValue(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMAttr::getValue",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMAttr::getValue",1,"XERCES_CPP_NAMESPACE::DOMAttr const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr,0))){ + SWIG_fail_ptr("DOMAttr_getValue",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMAttr const *)arg1)->getValue(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMAttr_setValue(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMAttr::setValue",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMAttr::setValue",1,"XERCES_CPP_NAMESPACE::DOMAttr *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr,0))){ + SWIG_fail_ptr("DOMAttr_setValue",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr); + } + + + arg2 = Lua2XMLString(2); + + (arg1)->setValue((XMLCh const *)arg2); + + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMAttr_getOwnerElement(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + XERCES_CPP_NAMESPACE::DOMElement *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMAttr::getOwnerElement",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMAttr::getOwnerElement",1,"XERCES_CPP_NAMESPACE::DOMAttr const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr,0))){ + SWIG_fail_ptr("DOMAttr_getOwnerElement",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr); + } + + result = (XERCES_CPP_NAMESPACE::DOMElement *)((XERCES_CPP_NAMESPACE::DOMAttr const *)arg1)->getOwnerElement(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMAttr_isId(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + bool result; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMAttr::isId",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMAttr::isId",1,"XERCES_CPP_NAMESPACE::DOMAttr const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr,0))){ + SWIG_fail_ptr("DOMAttr_isId",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr); + } + + result = (bool)((XERCES_CPP_NAMESPACE::DOMAttr const *)arg1)->isId(); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMAttr_getSchemaTypeInfo(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + XERCES_CPP_NAMESPACE::DOMTypeInfo *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMAttr::getSchemaTypeInfo",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMAttr::getSchemaTypeInfo",1,"XERCES_CPP_NAMESPACE::DOMAttr const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr,0))){ + SWIG_fail_ptr("DOMAttr_getSchemaTypeInfo",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr); + } + + result = (XERCES_CPP_NAMESPACE::DOMTypeInfo *)((XERCES_CPP_NAMESPACE::DOMAttr const *)arg1)->getSchemaTypeInfo(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMTypeInfo,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_DOMAttr(void *obj) { +XERCES_CPP_NAMESPACE::DOMAttr *arg1 = (XERCES_CPP_NAMESPACE::DOMAttr *) obj; +delete arg1; +} +static swig_lua_attribute swig_DOMAttr_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_DOMAttr_methods[]= { + { "getName", _wrap_DOMAttr_getName}, + { "getSpecified", _wrap_DOMAttr_getSpecified}, + { "getValue", _wrap_DOMAttr_getValue}, + { "setValue", _wrap_DOMAttr_setValue}, + { "getOwnerElement", _wrap_DOMAttr_getOwnerElement}, + { "isId", _wrap_DOMAttr_isId}, + { "getSchemaTypeInfo", _wrap_DOMAttr_getSchemaTypeInfo}, + {0,0} +}; +static swig_lua_method swig_DOMAttr_meta[] = { + {0,0} +}; + +static swig_lua_attribute swig_DOMAttr_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_DOMAttr_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_DOMAttr_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_DOMAttr_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_DOMAttr_Sf_SwigStatic = { + "DOMAttr", + swig_DOMAttr_Sf_SwigStatic_methods, + swig_DOMAttr_Sf_SwigStatic_attributes, + swig_DOMAttr_Sf_SwigStatic_constants, + swig_DOMAttr_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_DOMAttr_bases[] = {0,0}; +static const char *swig_DOMAttr_base_names[] = {"XERCES_CPP_NAMESPACE::DOMNode *",0}; +static swig_lua_class _wrap_class_DOMAttr = { "DOMAttr", "DOMAttr", &SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr,0, swig_delete_DOMAttr, swig_DOMAttr_methods, swig_DOMAttr_attributes, &swig_DOMAttr_Sf_SwigStatic, swig_DOMAttr_meta, swig_DOMAttr_bases, swig_DOMAttr_base_names }; + +static int _wrap_DOMElement_getTagName(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::getTagName",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getTagName",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_getTagName",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getTagName(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_getAttribute(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::getAttribute",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getAttribute",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_getAttribute",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + + arg2 = Lua2XMLString(2); + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getAttribute((XMLCh const *)arg2); + + result = XMLString2Lua(result); + + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_getAttributeNode(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::getAttributeNode",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getAttributeNode",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_getAttributeNode",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + + arg2 = Lua2XMLString(2); + + result = (XERCES_CPP_NAMESPACE::DOMAttr *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getAttributeNode((XMLCh const *)arg2); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr,0); SWIG_arg++; + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_getElementsByTagName(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XERCES_CPP_NAMESPACE::DOMNodeList *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::getElementsByTagName",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getElementsByTagName",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_getElementsByTagName",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + + arg2 = Lua2XMLString(2); + + result = (XERCES_CPP_NAMESPACE::DOMNodeList *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getElementsByTagName((XMLCh const *)arg2); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList,0); SWIG_arg++; + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_setAttribute(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::setAttribute",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setAttribute",1,"XERCES_CPP_NAMESPACE::DOMElement *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_setAttribute",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + + arg2 = Lua2XMLString(2); + + + arg3 = Lua2XMLString(3); + + (arg1)->setAttribute((XMLCh const *)arg2,(XMLCh const *)arg3); + + + delete[] arg2; + + + delete[] arg3; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + + delete[] arg3; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_setAttributeNode(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *arg2 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::setAttributeNode",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setAttributeNode",1,"XERCES_CPP_NAMESPACE::DOMElement *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setAttributeNode",2,"XERCES_CPP_NAMESPACE::DOMAttr *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_setAttributeNode",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr,0))){ + SWIG_fail_ptr("DOMElement_setAttributeNode",2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr); + } + + result = (XERCES_CPP_NAMESPACE::DOMAttr *)(arg1)->setAttributeNode(arg2); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_removeAttributeNode(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *arg2 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::removeAttributeNode",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::removeAttributeNode",1,"XERCES_CPP_NAMESPACE::DOMElement *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::removeAttributeNode",2,"XERCES_CPP_NAMESPACE::DOMAttr *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_removeAttributeNode",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr,0))){ + SWIG_fail_ptr("DOMElement_removeAttributeNode",2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr); + } + + result = (XERCES_CPP_NAMESPACE::DOMAttr *)(arg1)->removeAttributeNode(arg2); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_removeAttribute(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::removeAttribute",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::removeAttribute",1,"XERCES_CPP_NAMESPACE::DOMElement *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_removeAttribute",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + + arg2 = Lua2XMLString(2); + + (arg1)->removeAttribute((XMLCh const *)arg2); + + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_getAttributeNS(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::getAttributeNS",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getAttributeNS",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_getAttributeNS",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + + arg2 = Lua2XMLString(2); + + + arg3 = Lua2XMLString(3); + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getAttributeNS((XMLCh const *)arg2,(XMLCh const *)arg3); + + result = XMLString2Lua(result); + + + delete[] arg2; + + + delete[] arg3; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + + delete[] arg3; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_setAttributeNS(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + XMLCh *arg4 = (XMLCh *) 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::setAttributeNS",4,4) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setAttributeNS",1,"XERCES_CPP_NAMESPACE::DOMElement *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_setAttributeNS",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + + arg2 = Lua2XMLString(2); + + + arg3 = Lua2XMLString(3); + + + arg4 = Lua2XMLString(4); + + (arg1)->setAttributeNS((XMLCh const *)arg2,(XMLCh const *)arg3,(XMLCh const *)arg4); + + + delete[] arg2; + + + delete[] arg3; + + + delete[] arg4; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + + delete[] arg3; + + + delete[] arg4; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_removeAttributeNS(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::removeAttributeNS",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::removeAttributeNS",1,"XERCES_CPP_NAMESPACE::DOMElement *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_removeAttributeNS",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + + arg2 = Lua2XMLString(2); + + + arg3 = Lua2XMLString(3); + + (arg1)->removeAttributeNS((XMLCh const *)arg2,(XMLCh const *)arg3); + + + delete[] arg2; + + + delete[] arg3; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + + delete[] arg3; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_getAttributeNodeNS(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::getAttributeNodeNS",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getAttributeNodeNS",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_getAttributeNodeNS",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + + arg2 = Lua2XMLString(2); + + + arg3 = Lua2XMLString(3); + + result = (XERCES_CPP_NAMESPACE::DOMAttr *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getAttributeNodeNS((XMLCh const *)arg2,(XMLCh const *)arg3); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr,0); SWIG_arg++; + + delete[] arg2; + + + delete[] arg3; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + + delete[] arg3; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_setAttributeNodeNS(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *arg2 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::setAttributeNodeNS",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setAttributeNodeNS",1,"XERCES_CPP_NAMESPACE::DOMElement *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setAttributeNodeNS",2,"XERCES_CPP_NAMESPACE::DOMAttr *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_setAttributeNodeNS",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr,0))){ + SWIG_fail_ptr("DOMElement_setAttributeNodeNS",2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr); + } + + result = (XERCES_CPP_NAMESPACE::DOMAttr *)(arg1)->setAttributeNodeNS(arg2); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_getElementsByTagNameNS(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + XERCES_CPP_NAMESPACE::DOMNodeList *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::getElementsByTagNameNS",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getElementsByTagNameNS",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_getElementsByTagNameNS",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + + arg2 = Lua2XMLString(2); + + + arg3 = Lua2XMLString(3); + + result = (XERCES_CPP_NAMESPACE::DOMNodeList *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getElementsByTagNameNS((XMLCh const *)arg2,(XMLCh const *)arg3); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList,0); SWIG_arg++; + + delete[] arg2; + + + delete[] arg3; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + + delete[] arg3; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_hasAttribute(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + bool result; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::hasAttribute",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::hasAttribute",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_hasAttribute",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + + arg2 = Lua2XMLString(2); + + result = (bool)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->hasAttribute((XMLCh const *)arg2); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_hasAttributeNS(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + bool result; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::hasAttributeNS",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::hasAttributeNS",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_hasAttributeNS",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + + arg2 = Lua2XMLString(2); + + + arg3 = Lua2XMLString(3); + + result = (bool)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->hasAttributeNS((XMLCh const *)arg2,(XMLCh const *)arg3); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + + delete[] arg2; + + + delete[] arg3; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + + delete[] arg3; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_setIdAttribute(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + bool arg3 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::setIdAttribute",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setIdAttribute",1,"XERCES_CPP_NAMESPACE::DOMElement *"); + if(!lua_isboolean(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setIdAttribute",3,"bool"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_setIdAttribute",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + + arg2 = Lua2XMLString(2); + + arg3 = (lua_toboolean(L, 3)!=0); + (arg1)->setIdAttribute((XMLCh const *)arg2,arg3); + + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_setIdAttributeNS(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + bool arg4 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::setIdAttributeNS",4,4) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setIdAttributeNS",1,"XERCES_CPP_NAMESPACE::DOMElement *"); + if(!lua_isboolean(L,4)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setIdAttributeNS",4,"bool"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_setIdAttributeNS",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + + arg2 = Lua2XMLString(2); + + + arg3 = Lua2XMLString(3); + + arg4 = (lua_toboolean(L, 4)!=0); + (arg1)->setIdAttributeNS((XMLCh const *)arg2,(XMLCh const *)arg3,arg4); + + + delete[] arg2; + + + delete[] arg3; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + + delete[] arg3; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_setIdAttributeNode(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XERCES_CPP_NAMESPACE::DOMAttr *arg2 = (XERCES_CPP_NAMESPACE::DOMAttr *) 0 ; + bool arg3 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::setIdAttributeNode",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setIdAttributeNode",1,"XERCES_CPP_NAMESPACE::DOMElement *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setIdAttributeNode",2,"XERCES_CPP_NAMESPACE::DOMAttr const *"); + if(!lua_isboolean(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::setIdAttributeNode",3,"bool"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_setIdAttributeNode",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr,0))){ + SWIG_fail_ptr("DOMElement_setIdAttributeNode",2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMAttr); + } + + arg3 = (lua_toboolean(L, 3)!=0); + (arg1)->setIdAttributeNode((XERCES_CPP_NAMESPACE::DOMAttr const *)arg2,arg3); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_getSchemaTypeInfo(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XERCES_CPP_NAMESPACE::DOMTypeInfo *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::getSchemaTypeInfo",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getSchemaTypeInfo",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_getSchemaTypeInfo",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + result = (XERCES_CPP_NAMESPACE::DOMTypeInfo *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getSchemaTypeInfo(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMTypeInfo,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_getFirstElementChild(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XERCES_CPP_NAMESPACE::DOMElement *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::getFirstElementChild",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getFirstElementChild",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_getFirstElementChild",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + result = (XERCES_CPP_NAMESPACE::DOMElement *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getFirstElementChild(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_getLastElementChild(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XERCES_CPP_NAMESPACE::DOMElement *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::getLastElementChild",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getLastElementChild",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_getLastElementChild",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + result = (XERCES_CPP_NAMESPACE::DOMElement *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getLastElementChild(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_getPreviousElementSibling(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XERCES_CPP_NAMESPACE::DOMElement *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::getPreviousElementSibling",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getPreviousElementSibling",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_getPreviousElementSibling",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + result = (XERCES_CPP_NAMESPACE::DOMElement *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getPreviousElementSibling(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_getNextElementSibling(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XERCES_CPP_NAMESPACE::DOMElement *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::getNextElementSibling",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getNextElementSibling",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_getNextElementSibling",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + result = (XERCES_CPP_NAMESPACE::DOMElement *)((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getNextElementSibling(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMElement_getChildElementCount(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) 0 ; + XMLSize_t result; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMElement::getChildElementCount",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMElement::getChildElementCount",1,"XERCES_CPP_NAMESPACE::DOMElement const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0))){ + SWIG_fail_ptr("DOMElement_getChildElementCount",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement); + } + + result = ((XERCES_CPP_NAMESPACE::DOMElement const *)arg1)->getChildElementCount(); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_DOMElement(void *obj) { +XERCES_CPP_NAMESPACE::DOMElement *arg1 = (XERCES_CPP_NAMESPACE::DOMElement *) obj; +delete arg1; +} +static swig_lua_attribute swig_DOMElement_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_DOMElement_methods[]= { + { "getTagName", _wrap_DOMElement_getTagName}, + { "getAttribute", _wrap_DOMElement_getAttribute}, + { "getAttributeNode", _wrap_DOMElement_getAttributeNode}, + { "getElementsByTagName", _wrap_DOMElement_getElementsByTagName}, + { "setAttribute", _wrap_DOMElement_setAttribute}, + { "setAttributeNode", _wrap_DOMElement_setAttributeNode}, + { "removeAttributeNode", _wrap_DOMElement_removeAttributeNode}, + { "removeAttribute", _wrap_DOMElement_removeAttribute}, + { "getAttributeNS", _wrap_DOMElement_getAttributeNS}, + { "setAttributeNS", _wrap_DOMElement_setAttributeNS}, + { "removeAttributeNS", _wrap_DOMElement_removeAttributeNS}, + { "getAttributeNodeNS", _wrap_DOMElement_getAttributeNodeNS}, + { "setAttributeNodeNS", _wrap_DOMElement_setAttributeNodeNS}, + { "getElementsByTagNameNS", _wrap_DOMElement_getElementsByTagNameNS}, + { "hasAttribute", _wrap_DOMElement_hasAttribute}, + { "hasAttributeNS", _wrap_DOMElement_hasAttributeNS}, + { "setIdAttribute", _wrap_DOMElement_setIdAttribute}, + { "setIdAttributeNS", _wrap_DOMElement_setIdAttributeNS}, + { "setIdAttributeNode", _wrap_DOMElement_setIdAttributeNode}, + { "getSchemaTypeInfo", _wrap_DOMElement_getSchemaTypeInfo}, + { "getFirstElementChild", _wrap_DOMElement_getFirstElementChild}, + { "getLastElementChild", _wrap_DOMElement_getLastElementChild}, + { "getPreviousElementSibling", _wrap_DOMElement_getPreviousElementSibling}, + { "getNextElementSibling", _wrap_DOMElement_getNextElementSibling}, + { "getChildElementCount", _wrap_DOMElement_getChildElementCount}, + {0,0} +}; +static swig_lua_method swig_DOMElement_meta[] = { + {0,0} +}; + +static swig_lua_attribute swig_DOMElement_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_DOMElement_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_DOMElement_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_DOMElement_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_DOMElement_Sf_SwigStatic = { + "DOMElement", + swig_DOMElement_Sf_SwigStatic_methods, + swig_DOMElement_Sf_SwigStatic_attributes, + swig_DOMElement_Sf_SwigStatic_constants, + swig_DOMElement_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_DOMElement_bases[] = {0,0}; +static const char *swig_DOMElement_base_names[] = {"XERCES_CPP_NAMESPACE::DOMNode *",0}; +static swig_lua_class _wrap_class_DOMElement = { "DOMElement", "DOMElement", &SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMElement,0, swig_delete_DOMElement, swig_DOMElement_methods, swig_DOMElement_attributes, &swig_DOMElement_Sf_SwigStatic, swig_DOMElement_meta, swig_DOMElement_bases, swig_DOMElement_base_names }; + +static int _wrap_DOMEntity_getPublicId(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMEntity *arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMEntity::getPublicId",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMEntity::getPublicId",1,"XERCES_CPP_NAMESPACE::DOMEntity const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity,0))){ + SWIG_fail_ptr("DOMEntity_getPublicId",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getPublicId(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMEntity_getSystemId(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMEntity *arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMEntity::getSystemId",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMEntity::getSystemId",1,"XERCES_CPP_NAMESPACE::DOMEntity const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity,0))){ + SWIG_fail_ptr("DOMEntity_getSystemId",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getSystemId(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMEntity_getNotationName(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMEntity *arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMEntity::getNotationName",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMEntity::getNotationName",1,"XERCES_CPP_NAMESPACE::DOMEntity const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity,0))){ + SWIG_fail_ptr("DOMEntity_getNotationName",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getNotationName(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMEntity_getInputEncoding(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMEntity *arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMEntity::getInputEncoding",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMEntity::getInputEncoding",1,"XERCES_CPP_NAMESPACE::DOMEntity const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity,0))){ + SWIG_fail_ptr("DOMEntity_getInputEncoding",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getInputEncoding(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMEntity_getXmlEncoding(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMEntity *arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMEntity::getXmlEncoding",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMEntity::getXmlEncoding",1,"XERCES_CPP_NAMESPACE::DOMEntity const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity,0))){ + SWIG_fail_ptr("DOMEntity_getXmlEncoding",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getXmlEncoding(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMEntity_getXmlVersion(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMEntity *arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMEntity::getXmlVersion",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMEntity::getXmlVersion",1,"XERCES_CPP_NAMESPACE::DOMEntity const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity,0))){ + SWIG_fail_ptr("DOMEntity_getXmlVersion",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMEntity const *)arg1)->getXmlVersion(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_DOMEntity(void *obj) { +XERCES_CPP_NAMESPACE::DOMEntity *arg1 = (XERCES_CPP_NAMESPACE::DOMEntity *) obj; +delete arg1; +} +static swig_lua_attribute swig_DOMEntity_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_DOMEntity_methods[]= { + { "getPublicId", _wrap_DOMEntity_getPublicId}, + { "getSystemId", _wrap_DOMEntity_getSystemId}, + { "getNotationName", _wrap_DOMEntity_getNotationName}, + { "getInputEncoding", _wrap_DOMEntity_getInputEncoding}, + { "getXmlEncoding", _wrap_DOMEntity_getXmlEncoding}, + { "getXmlVersion", _wrap_DOMEntity_getXmlVersion}, + {0,0} +}; +static swig_lua_method swig_DOMEntity_meta[] = { + {0,0} +}; + +static swig_lua_attribute swig_DOMEntity_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_DOMEntity_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_DOMEntity_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_DOMEntity_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_DOMEntity_Sf_SwigStatic = { + "DOMEntity", + swig_DOMEntity_Sf_SwigStatic_methods, + swig_DOMEntity_Sf_SwigStatic_attributes, + swig_DOMEntity_Sf_SwigStatic_constants, + swig_DOMEntity_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_DOMEntity_bases[] = {0,0}; +static const char *swig_DOMEntity_base_names[] = {"XERCES_CPP_NAMESPACE::DOMNode *",0}; +static swig_lua_class _wrap_class_DOMEntity = { "DOMEntity", "DOMEntity", &SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntity,0, swig_delete_DOMEntity, swig_DOMEntity_methods, swig_DOMEntity_attributes, &swig_DOMEntity_Sf_SwigStatic, swig_DOMEntity_meta, swig_DOMEntity_bases, swig_DOMEntity_base_names }; + +static int _wrap_DOMDocumentType_getName(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMDocumentType *arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMDocumentType::getName",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMDocumentType::getName",1,"XERCES_CPP_NAMESPACE::DOMDocumentType const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType,0))){ + SWIG_fail_ptr("DOMDocumentType_getName",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getName(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMDocumentType_getEntities(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMDocumentType *arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *) 0 ; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMDocumentType::getEntities",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMDocumentType::getEntities",1,"XERCES_CPP_NAMESPACE::DOMDocumentType const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType,0))){ + SWIG_fail_ptr("DOMDocumentType_getEntities",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType); + } + + result = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getEntities(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMDocumentType_getNotations(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMDocumentType *arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *) 0 ; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMDocumentType::getNotations",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMDocumentType::getNotations",1,"XERCES_CPP_NAMESPACE::DOMDocumentType const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType,0))){ + SWIG_fail_ptr("DOMDocumentType_getNotations",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType); + } + + result = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getNotations(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMDocumentType_getPublicId(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMDocumentType *arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMDocumentType::getPublicId",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMDocumentType::getPublicId",1,"XERCES_CPP_NAMESPACE::DOMDocumentType const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType,0))){ + SWIG_fail_ptr("DOMDocumentType_getPublicId",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getPublicId(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMDocumentType_getSystemId(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMDocumentType *arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMDocumentType::getSystemId",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMDocumentType::getSystemId",1,"XERCES_CPP_NAMESPACE::DOMDocumentType const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType,0))){ + SWIG_fail_ptr("DOMDocumentType_getSystemId",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getSystemId(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMDocumentType_getInternalSubset(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMDocumentType *arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMDocumentType::getInternalSubset",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMDocumentType::getInternalSubset",1,"XERCES_CPP_NAMESPACE::DOMDocumentType const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType,0))){ + SWIG_fail_ptr("DOMDocumentType_getInternalSubset",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMDocumentType const *)arg1)->getInternalSubset(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_DOMDocumentType(void *obj) { +XERCES_CPP_NAMESPACE::DOMDocumentType *arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentType *) obj; +delete arg1; +} +static swig_lua_attribute swig_DOMDocumentType_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_DOMDocumentType_methods[]= { + { "getName", _wrap_DOMDocumentType_getName}, + { "getEntities", _wrap_DOMDocumentType_getEntities}, + { "getNotations", _wrap_DOMDocumentType_getNotations}, + { "getPublicId", _wrap_DOMDocumentType_getPublicId}, + { "getSystemId", _wrap_DOMDocumentType_getSystemId}, + { "getInternalSubset", _wrap_DOMDocumentType_getInternalSubset}, + {0,0} +}; +static swig_lua_method swig_DOMDocumentType_meta[] = { + {0,0} +}; + +static swig_lua_attribute swig_DOMDocumentType_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_DOMDocumentType_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_DOMDocumentType_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_DOMDocumentType_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_DOMDocumentType_Sf_SwigStatic = { + "DOMDocumentType", + swig_DOMDocumentType_Sf_SwigStatic_methods, + swig_DOMDocumentType_Sf_SwigStatic_attributes, + swig_DOMDocumentType_Sf_SwigStatic_constants, + swig_DOMDocumentType_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_DOMDocumentType_bases[] = {0,0}; +static const char *swig_DOMDocumentType_base_names[] = {"XERCES_CPP_NAMESPACE::DOMNode *",0}; +static swig_lua_class _wrap_class_DOMDocumentType = { "DOMDocumentType", "DOMDocumentType", &SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentType,0, swig_delete_DOMDocumentType, swig_DOMDocumentType_methods, swig_DOMDocumentType_attributes, &swig_DOMDocumentType_Sf_SwigStatic, swig_DOMDocumentType_meta, swig_DOMDocumentType_bases, swig_DOMDocumentType_base_names }; + +static int _wrap_DOMCharacterData_getData(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMCharacterData::getData",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::getData",1,"XERCES_CPP_NAMESPACE::DOMCharacterData const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData,0))){ + SWIG_fail_ptr("DOMCharacterData_getData",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMCharacterData const *)arg1)->getData(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMCharacterData_getLength(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + XMLSize_t result; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMCharacterData::getLength",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::getLength",1,"XERCES_CPP_NAMESPACE::DOMCharacterData const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData,0))){ + SWIG_fail_ptr("DOMCharacterData_getLength",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData); + } + + result = ((XERCES_CPP_NAMESPACE::DOMCharacterData const *)arg1)->getLength(); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMCharacterData_substringData(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + XMLSize_t arg2 ; + XMLSize_t arg3 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMCharacterData::substringData",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::substringData",1,"XERCES_CPP_NAMESPACE::DOMCharacterData const *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::substringData",2,"XMLSize_t"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::substringData",3,"XMLSize_t"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData,0))){ + SWIG_fail_ptr("DOMCharacterData_substringData",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData); + } + + SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative") + arg2 = (XMLSize_t)lua_tonumber(L, 2); + SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative") + arg3 = (XMLSize_t)lua_tonumber(L, 3); + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMCharacterData const *)arg1)->substringData(arg2,arg3); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMCharacterData_appendData(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMCharacterData::appendData",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::appendData",1,"XERCES_CPP_NAMESPACE::DOMCharacterData *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData,0))){ + SWIG_fail_ptr("DOMCharacterData_appendData",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData); + } + + + arg2 = Lua2XMLString(2); + + (arg1)->appendData((XMLCh const *)arg2); + + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMCharacterData_insertData(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + XMLSize_t arg2 ; + XMLCh *arg3 = (XMLCh *) 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMCharacterData::insertData",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::insertData",1,"XERCES_CPP_NAMESPACE::DOMCharacterData *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::insertData",2,"XMLSize_t"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData,0))){ + SWIG_fail_ptr("DOMCharacterData_insertData",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData); + } + + SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative") + arg2 = (XMLSize_t)lua_tonumber(L, 2); + + arg3 = Lua2XMLString(3); + + (arg1)->insertData(arg2,(XMLCh const *)arg3); + + + delete[] arg3; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg3; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMCharacterData_deleteData(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + XMLSize_t arg2 ; + XMLSize_t arg3 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMCharacterData::deleteData",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::deleteData",1,"XERCES_CPP_NAMESPACE::DOMCharacterData *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::deleteData",2,"XMLSize_t"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::deleteData",3,"XMLSize_t"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData,0))){ + SWIG_fail_ptr("DOMCharacterData_deleteData",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData); + } + + SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative") + arg2 = (XMLSize_t)lua_tonumber(L, 2); + SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative") + arg3 = (XMLSize_t)lua_tonumber(L, 3); + (arg1)->deleteData(arg2,arg3); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMCharacterData_replaceData(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + XMLSize_t arg2 ; + XMLSize_t arg3 ; + XMLCh *arg4 = (XMLCh *) 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMCharacterData::replaceData",4,4) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::replaceData",1,"XERCES_CPP_NAMESPACE::DOMCharacterData *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::replaceData",2,"XMLSize_t"); + if(!lua_isnumber(L,3)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::replaceData",3,"XMLSize_t"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData,0))){ + SWIG_fail_ptr("DOMCharacterData_replaceData",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData); + } + + SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative") + arg2 = (XMLSize_t)lua_tonumber(L, 2); + SWIG_contract_assert((lua_tonumber(L,3)>=0),"number must not be negative") + arg3 = (XMLSize_t)lua_tonumber(L, 3); + + arg4 = Lua2XMLString(4); + + (arg1)->replaceData(arg2,arg3,(XMLCh const *)arg4); + + + delete[] arg4; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg4; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMCharacterData_setData(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMCharacterData::setData",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMCharacterData::setData",1,"XERCES_CPP_NAMESPACE::DOMCharacterData *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData,0))){ + SWIG_fail_ptr("DOMCharacterData_setData",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData); + } + + + arg2 = Lua2XMLString(2); + + (arg1)->setData((XMLCh const *)arg2); + + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_DOMCharacterData(void *obj) { +XERCES_CPP_NAMESPACE::DOMCharacterData *arg1 = (XERCES_CPP_NAMESPACE::DOMCharacterData *) obj; +delete arg1; +} +static swig_lua_attribute swig_DOMCharacterData_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_DOMCharacterData_methods[]= { + { "getData", _wrap_DOMCharacterData_getData}, + { "getLength", _wrap_DOMCharacterData_getLength}, + { "substringData", _wrap_DOMCharacterData_substringData}, + { "appendData", _wrap_DOMCharacterData_appendData}, + { "insertData", _wrap_DOMCharacterData_insertData}, + { "deleteData", _wrap_DOMCharacterData_deleteData}, + { "replaceData", _wrap_DOMCharacterData_replaceData}, + { "setData", _wrap_DOMCharacterData_setData}, + {0,0} +}; +static swig_lua_method swig_DOMCharacterData_meta[] = { + {0,0} +}; + +static swig_lua_attribute swig_DOMCharacterData_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_DOMCharacterData_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_DOMCharacterData_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_DOMCharacterData_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_DOMCharacterData_Sf_SwigStatic = { + "DOMCharacterData", + swig_DOMCharacterData_Sf_SwigStatic_methods, + swig_DOMCharacterData_Sf_SwigStatic_attributes, + swig_DOMCharacterData_Sf_SwigStatic_constants, + swig_DOMCharacterData_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_DOMCharacterData_bases[] = {0,0}; +static const char *swig_DOMCharacterData_base_names[] = {"XERCES_CPP_NAMESPACE::DOMNode *",0}; +static swig_lua_class _wrap_class_DOMCharacterData = { "DOMCharacterData", "DOMCharacterData", &SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCharacterData,0, swig_delete_DOMCharacterData, swig_DOMCharacterData_methods, swig_DOMCharacterData_attributes, &swig_DOMCharacterData_Sf_SwigStatic, swig_DOMCharacterData_meta, swig_DOMCharacterData_bases, swig_DOMCharacterData_base_names }; + +static void swig_delete_DOMComment(void *obj) { +XERCES_CPP_NAMESPACE::DOMComment *arg1 = (XERCES_CPP_NAMESPACE::DOMComment *) obj; +delete arg1; +} +static swig_lua_attribute swig_DOMComment_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_DOMComment_methods[]= { + {0,0} +}; +static swig_lua_method swig_DOMComment_meta[] = { + {0,0} +}; + +static swig_lua_attribute swig_DOMComment_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_DOMComment_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_DOMComment_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_DOMComment_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_DOMComment_Sf_SwigStatic = { + "DOMComment", + swig_DOMComment_Sf_SwigStatic_methods, + swig_DOMComment_Sf_SwigStatic_attributes, + swig_DOMComment_Sf_SwigStatic_constants, + swig_DOMComment_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_DOMComment_bases[] = {0,0}; +static const char *swig_DOMComment_base_names[] = {"XERCES_CPP_NAMESPACE::DOMCharacterData *",0}; +static swig_lua_class _wrap_class_DOMComment = { "DOMComment", "DOMComment", &SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMComment,0, swig_delete_DOMComment, swig_DOMComment_methods, swig_DOMComment_attributes, &swig_DOMComment_Sf_SwigStatic, swig_DOMComment_meta, swig_DOMComment_bases, swig_DOMComment_base_names }; + +static int _wrap_DOMText_splitText(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMText *arg1 = (XERCES_CPP_NAMESPACE::DOMText *) 0 ; + XMLSize_t arg2 ; + XERCES_CPP_NAMESPACE::DOMText *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMText::splitText",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMText::splitText",1,"XERCES_CPP_NAMESPACE::DOMText *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMText::splitText",2,"XMLSize_t"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText,0))){ + SWIG_fail_ptr("DOMText_splitText",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText); + } + + SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative") + arg2 = (XMLSize_t)lua_tonumber(L, 2); + result = (XERCES_CPP_NAMESPACE::DOMText *)(arg1)->splitText(arg2); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText,0); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMText_getIsElementContentWhitespace(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMText *arg1 = (XERCES_CPP_NAMESPACE::DOMText *) 0 ; + bool result; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMText::getIsElementContentWhitespace",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMText::getIsElementContentWhitespace",1,"XERCES_CPP_NAMESPACE::DOMText const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText,0))){ + SWIG_fail_ptr("DOMText_getIsElementContentWhitespace",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText); + } + + result = (bool)((XERCES_CPP_NAMESPACE::DOMText const *)arg1)->getIsElementContentWhitespace(); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMText_getWholeText(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMText *arg1 = (XERCES_CPP_NAMESPACE::DOMText *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMText::getWholeText",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMText::getWholeText",1,"XERCES_CPP_NAMESPACE::DOMText const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText,0))){ + SWIG_fail_ptr("DOMText_getWholeText",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMText const *)arg1)->getWholeText(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMText_replaceWholeText(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMText *arg1 = (XERCES_CPP_NAMESPACE::DOMText *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XERCES_CPP_NAMESPACE::DOMText *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMText::replaceWholeText",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMText::replaceWholeText",1,"XERCES_CPP_NAMESPACE::DOMText *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText,0))){ + SWIG_fail_ptr("DOMText_replaceWholeText",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText); + } + + + arg2 = Lua2XMLString(2); + + result = (XERCES_CPP_NAMESPACE::DOMText *)(arg1)->replaceWholeText((XMLCh const *)arg2); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText,0); SWIG_arg++; + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMText_isIgnorableWhitespace(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMText *arg1 = (XERCES_CPP_NAMESPACE::DOMText *) 0 ; + bool result; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMText::isIgnorableWhitespace",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMText::isIgnorableWhitespace",1,"XERCES_CPP_NAMESPACE::DOMText const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText,0))){ + SWIG_fail_ptr("DOMText_isIgnorableWhitespace",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText); + } + + result = (bool)((XERCES_CPP_NAMESPACE::DOMText const *)arg1)->isIgnorableWhitespace(); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_DOMText(void *obj) { +XERCES_CPP_NAMESPACE::DOMText *arg1 = (XERCES_CPP_NAMESPACE::DOMText *) obj; +delete arg1; +} +static swig_lua_attribute swig_DOMText_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_DOMText_methods[]= { + { "splitText", _wrap_DOMText_splitText}, + { "getIsElementContentWhitespace", _wrap_DOMText_getIsElementContentWhitespace}, + { "getWholeText", _wrap_DOMText_getWholeText}, + { "replaceWholeText", _wrap_DOMText_replaceWholeText}, + { "isIgnorableWhitespace", _wrap_DOMText_isIgnorableWhitespace}, + {0,0} +}; +static swig_lua_method swig_DOMText_meta[] = { + {0,0} +}; + +static swig_lua_attribute swig_DOMText_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_DOMText_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_DOMText_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_DOMText_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_DOMText_Sf_SwigStatic = { + "DOMText", + swig_DOMText_Sf_SwigStatic_methods, + swig_DOMText_Sf_SwigStatic_attributes, + swig_DOMText_Sf_SwigStatic_constants, + swig_DOMText_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_DOMText_bases[] = {0,0}; +static const char *swig_DOMText_base_names[] = {"XERCES_CPP_NAMESPACE::DOMCharacterData *",0}; +static swig_lua_class _wrap_class_DOMText = { "DOMText", "DOMText", &SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMText,0, swig_delete_DOMText, swig_DOMText_methods, swig_DOMText_attributes, &swig_DOMText_Sf_SwigStatic, swig_DOMText_meta, swig_DOMText_bases, swig_DOMText_base_names }; + +static void swig_delete_DOMCDATASection(void *obj) { +XERCES_CPP_NAMESPACE::DOMCDATASection *arg1 = (XERCES_CPP_NAMESPACE::DOMCDATASection *) obj; +delete arg1; +} +static swig_lua_attribute swig_DOMCDATASection_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_DOMCDATASection_methods[]= { + {0,0} +}; +static swig_lua_method swig_DOMCDATASection_meta[] = { + {0,0} +}; + +static swig_lua_attribute swig_DOMCDATASection_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_DOMCDATASection_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_DOMCDATASection_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_DOMCDATASection_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_DOMCDATASection_Sf_SwigStatic = { + "DOMCDATASection", + swig_DOMCDATASection_Sf_SwigStatic_methods, + swig_DOMCDATASection_Sf_SwigStatic_attributes, + swig_DOMCDATASection_Sf_SwigStatic_constants, + swig_DOMCDATASection_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_DOMCDATASection_bases[] = {0,0}; +static const char *swig_DOMCDATASection_base_names[] = {"XERCES_CPP_NAMESPACE::DOMText *",0}; +static swig_lua_class _wrap_class_DOMCDATASection = { "DOMCDATASection", "DOMCDATASection", &SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMCDATASection,0, swig_delete_DOMCDATASection, swig_DOMCDATASection_methods, swig_DOMCDATASection_attributes, &swig_DOMCDATASection_Sf_SwigStatic, swig_DOMCDATASection_meta, swig_DOMCDATASection_bases, swig_DOMCDATASection_base_names }; + +static int _wrap_DOMNodeList_item(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNodeList *arg1 = (XERCES_CPP_NAMESPACE::DOMNodeList *) 0 ; + XMLSize_t arg2 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNodeList::item",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNodeList::item",1,"XERCES_CPP_NAMESPACE::DOMNodeList const *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNodeList::item",2,"XMLSize_t"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList,0))){ + SWIG_fail_ptr("DOMNodeList_item",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList); + } + + SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative") + arg2 = (XMLSize_t)lua_tonumber(L, 2); + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNodeList const *)arg1)->item(arg2); + { + swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); + SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNodeList_getLength(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNodeList *arg1 = (XERCES_CPP_NAMESPACE::DOMNodeList *) 0 ; + XMLSize_t result; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNodeList::getLength",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNodeList::getLength",1,"XERCES_CPP_NAMESPACE::DOMNodeList const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList,0))){ + SWIG_fail_ptr("DOMNodeList_getLength",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList); + } + + result = ((XERCES_CPP_NAMESPACE::DOMNodeList const *)arg1)->getLength(); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_DOMNodeList(void *obj) { +XERCES_CPP_NAMESPACE::DOMNodeList *arg1 = (XERCES_CPP_NAMESPACE::DOMNodeList *) obj; +delete arg1; +} +static swig_lua_attribute swig_DOMNodeList_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_DOMNodeList_methods[]= { + { "item", _wrap_DOMNodeList_item}, + { "getLength", _wrap_DOMNodeList_getLength}, + {0,0} +}; +static swig_lua_method swig_DOMNodeList_meta[] = { + {0,0} +}; + +static swig_lua_attribute swig_DOMNodeList_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_DOMNodeList_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_DOMNodeList_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_DOMNodeList_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_DOMNodeList_Sf_SwigStatic = { + "DOMNodeList", + swig_DOMNodeList_Sf_SwigStatic_methods, + swig_DOMNodeList_Sf_SwigStatic_attributes, + swig_DOMNodeList_Sf_SwigStatic_constants, + swig_DOMNodeList_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_DOMNodeList_bases[] = {0}; +static const char *swig_DOMNodeList_base_names[] = {0}; +static swig_lua_class _wrap_class_DOMNodeList = { "DOMNodeList", "DOMNodeList", &SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNodeList,0, swig_delete_DOMNodeList, swig_DOMNodeList_methods, swig_DOMNodeList_attributes, &swig_DOMNodeList_Sf_SwigStatic, swig_DOMNodeList_meta, swig_DOMNodeList_bases, swig_DOMNodeList_base_names }; + +static int _wrap_DOMNamedNodeMap_setNamedItem(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::setNamedItem",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::setNamedItem",1,"XERCES_CPP_NAMESPACE::DOMNamedNodeMap *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::setNamedItem",2,"XERCES_CPP_NAMESPACE::DOMNode *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap,0))){ + SWIG_fail_ptr("DOMNamedNodeMap_setNamedItem",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNamedNodeMap_setNamedItem",2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->setNamedItem(arg2); + { + swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); + SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNamedNodeMap_item(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XMLSize_t arg2 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::item",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::item",1,"XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::item",2,"XMLSize_t"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap,0))){ + SWIG_fail_ptr("DOMNamedNodeMap_item",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap); + } + + SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative") + arg2 = (XMLSize_t)lua_tonumber(L, 2); + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *)arg1)->item(arg2); + { + swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); + SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNamedNodeMap_getNamedItem(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::getNamedItem",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::getNamedItem",1,"XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap,0))){ + SWIG_fail_ptr("DOMNamedNodeMap_getNamedItem",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap); + } + + + arg2 = Lua2XMLString(2); + + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *)arg1)->getNamedItem((XMLCh const *)arg2); + { + swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); + SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; + } + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNamedNodeMap_getLength(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XMLSize_t result; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::getLength",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::getLength",1,"XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap,0))){ + SWIG_fail_ptr("DOMNamedNodeMap_getLength",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap); + } + + result = ((XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *)arg1)->getLength(); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNamedNodeMap_removeNamedItem(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::removeNamedItem",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::removeNamedItem",1,"XERCES_CPP_NAMESPACE::DOMNamedNodeMap *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap,0))){ + SWIG_fail_ptr("DOMNamedNodeMap_removeNamedItem",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap); + } + + + arg2 = Lua2XMLString(2); + + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->removeNamedItem((XMLCh const *)arg2); + { + swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); + SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; + } + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNamedNodeMap_getNamedItemNS(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::getNamedItemNS",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::getNamedItemNS",1,"XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap,0))){ + SWIG_fail_ptr("DOMNamedNodeMap_getNamedItemNS",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap); + } + + + arg2 = Lua2XMLString(2); + + + arg3 = Lua2XMLString(3); + + result = (XERCES_CPP_NAMESPACE::DOMNode *)((XERCES_CPP_NAMESPACE::DOMNamedNodeMap const *)arg1)->getNamedItemNS((XMLCh const *)arg2,(XMLCh const *)arg3); + { + swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); + SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; + } + + delete[] arg2; + + + delete[] arg3; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + + delete[] arg3; + + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNamedNodeMap_setNamedItemNS(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *arg2 = (XERCES_CPP_NAMESPACE::DOMNode *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::setNamedItemNS",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::setNamedItemNS",1,"XERCES_CPP_NAMESPACE::DOMNamedNodeMap *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::setNamedItemNS",2,"XERCES_CPP_NAMESPACE::DOMNode *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap,0))){ + SWIG_fail_ptr("DOMNamedNodeMap_setNamedItemNS",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode,0))){ + SWIG_fail_ptr("DOMNamedNodeMap_setNamedItemNS",2,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode); + } + + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->setNamedItemNS(arg2); + { + swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); + SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNamedNodeMap_removeNamedItemNS(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + XMLCh *arg3 = (XMLCh *) 0 ; + XERCES_CPP_NAMESPACE::DOMNode *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::removeNamedItemNS",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNamedNodeMap::removeNamedItemNS",1,"XERCES_CPP_NAMESPACE::DOMNamedNodeMap *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap,0))){ + SWIG_fail_ptr("DOMNamedNodeMap_removeNamedItemNS",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap); + } + + + arg2 = Lua2XMLString(2); + + + arg3 = Lua2XMLString(3); + + result = (XERCES_CPP_NAMESPACE::DOMNode *)(arg1)->removeNamedItemNS((XMLCh const *)arg2,(XMLCh const *)arg3); + { + swig_type_info *ty = SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, (void **) &result); + SWIG_NewPointerObj(L,(void*)result,ty,0); SWIG_arg++; + } + + delete[] arg2; + + + delete[] arg3; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + + delete[] arg3; + + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_DOMNamedNodeMap(void *obj) { +XERCES_CPP_NAMESPACE::DOMNamedNodeMap *arg1 = (XERCES_CPP_NAMESPACE::DOMNamedNodeMap *) obj; +delete arg1; +} +static swig_lua_attribute swig_DOMNamedNodeMap_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_DOMNamedNodeMap_methods[]= { + { "setNamedItem", _wrap_DOMNamedNodeMap_setNamedItem}, + { "item", _wrap_DOMNamedNodeMap_item}, + { "getNamedItem", _wrap_DOMNamedNodeMap_getNamedItem}, + { "getLength", _wrap_DOMNamedNodeMap_getLength}, + { "removeNamedItem", _wrap_DOMNamedNodeMap_removeNamedItem}, + { "getNamedItemNS", _wrap_DOMNamedNodeMap_getNamedItemNS}, + { "setNamedItemNS", _wrap_DOMNamedNodeMap_setNamedItemNS}, + { "removeNamedItemNS", _wrap_DOMNamedNodeMap_removeNamedItemNS}, + {0,0} +}; +static swig_lua_method swig_DOMNamedNodeMap_meta[] = { + {0,0} +}; + +static swig_lua_attribute swig_DOMNamedNodeMap_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_DOMNamedNodeMap_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_DOMNamedNodeMap_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_DOMNamedNodeMap_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_DOMNamedNodeMap_SwigStatic = { + "DOMNamedNodeMap", + swig_DOMNamedNodeMap_SwigStatic_methods, + swig_DOMNamedNodeMap_SwigStatic_attributes, + swig_DOMNamedNodeMap_SwigStatic_constants, + swig_DOMNamedNodeMap_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_DOMNamedNodeMap_bases[] = {0}; +static const char *swig_DOMNamedNodeMap_base_names[] = {0}; +static swig_lua_class _wrap_class_DOMNamedNodeMap = { "DOMNamedNodeMap", "DOMNamedNodeMap", &SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap,0, swig_delete_DOMNamedNodeMap, swig_DOMNamedNodeMap_methods, swig_DOMNamedNodeMap_attributes, &swig_DOMNamedNodeMap_SwigStatic, swig_DOMNamedNodeMap_meta, swig_DOMNamedNodeMap_bases, swig_DOMNamedNodeMap_base_names }; + +static void swig_delete_DOMDocumentFragment(void *obj) { +XERCES_CPP_NAMESPACE::DOMDocumentFragment *arg1 = (XERCES_CPP_NAMESPACE::DOMDocumentFragment *) obj; +delete arg1; +} +static swig_lua_attribute swig_DOMDocumentFragment_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_DOMDocumentFragment_methods[]= { + {0,0} +}; +static swig_lua_method swig_DOMDocumentFragment_meta[] = { + {0,0} +}; + +static swig_lua_attribute swig_DOMDocumentFragment_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_DOMDocumentFragment_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_DOMDocumentFragment_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_DOMDocumentFragment_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_DOMDocumentFragment_Sf_SwigStatic = { + "DOMDocumentFragment", + swig_DOMDocumentFragment_Sf_SwigStatic_methods, + swig_DOMDocumentFragment_Sf_SwigStatic_attributes, + swig_DOMDocumentFragment_Sf_SwigStatic_constants, + swig_DOMDocumentFragment_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_DOMDocumentFragment_bases[] = {0,0}; +static const char *swig_DOMDocumentFragment_base_names[] = {"XERCES_CPP_NAMESPACE::DOMNode *",0}; +static swig_lua_class _wrap_class_DOMDocumentFragment = { "DOMDocumentFragment", "DOMDocumentFragment", &SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMDocumentFragment,0, swig_delete_DOMDocumentFragment, swig_DOMDocumentFragment_methods, swig_DOMDocumentFragment_attributes, &swig_DOMDocumentFragment_Sf_SwigStatic, swig_DOMDocumentFragment_meta, swig_DOMDocumentFragment_bases, swig_DOMDocumentFragment_base_names }; + +static void swig_delete_DOMEntityReference(void *obj) { +XERCES_CPP_NAMESPACE::DOMEntityReference *arg1 = (XERCES_CPP_NAMESPACE::DOMEntityReference *) obj; +delete arg1; +} +static swig_lua_attribute swig_DOMEntityReference_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_DOMEntityReference_methods[]= { + {0,0} +}; +static swig_lua_method swig_DOMEntityReference_meta[] = { + {0,0} +}; + +static swig_lua_attribute swig_DOMEntityReference_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_DOMEntityReference_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_DOMEntityReference_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_DOMEntityReference_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_DOMEntityReference_Sf_SwigStatic = { + "DOMEntityReference", + swig_DOMEntityReference_Sf_SwigStatic_methods, + swig_DOMEntityReference_Sf_SwigStatic_attributes, + swig_DOMEntityReference_Sf_SwigStatic_constants, + swig_DOMEntityReference_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_DOMEntityReference_bases[] = {0,0}; +static const char *swig_DOMEntityReference_base_names[] = {"XERCES_CPP_NAMESPACE::DOMNode *",0}; +static swig_lua_class _wrap_class_DOMEntityReference = { "DOMEntityReference", "DOMEntityReference", &SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMEntityReference,0, swig_delete_DOMEntityReference, swig_DOMEntityReference_methods, swig_DOMEntityReference_attributes, &swig_DOMEntityReference_Sf_SwigStatic, swig_DOMEntityReference_meta, swig_DOMEntityReference_bases, swig_DOMEntityReference_base_names }; + +static int _wrap_DOMNotation_getPublicId(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNotation *arg1 = (XERCES_CPP_NAMESPACE::DOMNotation *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNotation::getPublicId",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNotation::getPublicId",1,"XERCES_CPP_NAMESPACE::DOMNotation const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNotation,0))){ + SWIG_fail_ptr("DOMNotation_getPublicId",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNotation); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNotation const *)arg1)->getPublicId(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMNotation_getSystemId(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMNotation *arg1 = (XERCES_CPP_NAMESPACE::DOMNotation *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMNotation::getSystemId",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMNotation::getSystemId",1,"XERCES_CPP_NAMESPACE::DOMNotation const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNotation,0))){ + SWIG_fail_ptr("DOMNotation_getSystemId",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNotation); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMNotation const *)arg1)->getSystemId(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_DOMNotation(void *obj) { +XERCES_CPP_NAMESPACE::DOMNotation *arg1 = (XERCES_CPP_NAMESPACE::DOMNotation *) obj; +delete arg1; +} +static swig_lua_attribute swig_DOMNotation_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_DOMNotation_methods[]= { + { "getPublicId", _wrap_DOMNotation_getPublicId}, + { "getSystemId", _wrap_DOMNotation_getSystemId}, + {0,0} +}; +static swig_lua_method swig_DOMNotation_meta[] = { + {0,0} +}; + +static swig_lua_attribute swig_DOMNotation_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_DOMNotation_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_DOMNotation_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_DOMNotation_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_DOMNotation_Sf_SwigStatic = { + "DOMNotation", + swig_DOMNotation_Sf_SwigStatic_methods, + swig_DOMNotation_Sf_SwigStatic_attributes, + swig_DOMNotation_Sf_SwigStatic_constants, + swig_DOMNotation_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_DOMNotation_bases[] = {0,0}; +static const char *swig_DOMNotation_base_names[] = {"XERCES_CPP_NAMESPACE::DOMNode *",0}; +static swig_lua_class _wrap_class_DOMNotation = { "DOMNotation", "DOMNotation", &SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNotation,0, swig_delete_DOMNotation, swig_DOMNotation_methods, swig_DOMNotation_attributes, &swig_DOMNotation_Sf_SwigStatic, swig_DOMNotation_meta, swig_DOMNotation_bases, swig_DOMNotation_base_names }; + +static int _wrap_DOMProcessingInstruction_getTarget(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMProcessingInstruction *arg1 = (XERCES_CPP_NAMESPACE::DOMProcessingInstruction *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMProcessingInstruction::getTarget",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMProcessingInstruction::getTarget",1,"XERCES_CPP_NAMESPACE::DOMProcessingInstruction const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction,0))){ + SWIG_fail_ptr("DOMProcessingInstruction_getTarget",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMProcessingInstruction const *)arg1)->getTarget(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMProcessingInstruction_getData(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMProcessingInstruction *arg1 = (XERCES_CPP_NAMESPACE::DOMProcessingInstruction *) 0 ; + XMLCh *result = 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMProcessingInstruction::getData",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMProcessingInstruction::getData",1,"XERCES_CPP_NAMESPACE::DOMProcessingInstruction const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction,0))){ + SWIG_fail_ptr("DOMProcessingInstruction_getData",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction); + } + + result = (XMLCh *)((XERCES_CPP_NAMESPACE::DOMProcessingInstruction const *)arg1)->getData(); + + result = XMLString2Lua(result); + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_DOMProcessingInstruction_setData(lua_State* L) { + int SWIG_arg = 0; + XERCES_CPP_NAMESPACE::DOMProcessingInstruction *arg1 = (XERCES_CPP_NAMESPACE::DOMProcessingInstruction *) 0 ; + XMLCh *arg2 = (XMLCh *) 0 ; + + SWIG_check_num_args("XERCES_CPP_NAMESPACE::DOMProcessingInstruction::setData",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("XERCES_CPP_NAMESPACE::DOMProcessingInstruction::setData",1,"XERCES_CPP_NAMESPACE::DOMProcessingInstruction *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction,0))){ + SWIG_fail_ptr("DOMProcessingInstruction_setData",1,SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction); + } + + + arg2 = Lua2XMLString(2); + + (arg1)->setData((XMLCh const *)arg2); + + + delete[] arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + + delete[] arg2; + + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_DOMProcessingInstruction(void *obj) { +XERCES_CPP_NAMESPACE::DOMProcessingInstruction *arg1 = (XERCES_CPP_NAMESPACE::DOMProcessingInstruction *) obj; +delete arg1; +} +static swig_lua_attribute swig_DOMProcessingInstruction_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_DOMProcessingInstruction_methods[]= { + { "getTarget", _wrap_DOMProcessingInstruction_getTarget}, + { "getData", _wrap_DOMProcessingInstruction_getData}, + { "setData", _wrap_DOMProcessingInstruction_setData}, + {0,0} +}; +static swig_lua_method swig_DOMProcessingInstruction_meta[] = { + {0,0} +}; + +static swig_lua_attribute swig_DOMProcessingInstruction_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_DOMProcessingInstruction_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_DOMProcessingInstruction_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_DOMProcessingInstruction_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_DOMProcessingInstruction_Sf_SwigStatic = { + "DOMProcessingInstruction", + swig_DOMProcessingInstruction_Sf_SwigStatic_methods, + swig_DOMProcessingInstruction_Sf_SwigStatic_attributes, + swig_DOMProcessingInstruction_Sf_SwigStatic_constants, + swig_DOMProcessingInstruction_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_DOMProcessingInstruction_bases[] = {0,0}; +static const char *swig_DOMProcessingInstruction_base_names[] = {"XERCES_CPP_NAMESPACE::DOMNode *",0}; +static swig_lua_class _wrap_class_DOMProcessingInstruction = { "DOMProcessingInstruction", "DOMProcessingInstruction", &SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction,0, swig_delete_DOMProcessingInstruction, swig_DOMProcessingInstruction_methods, swig_DOMProcessingInstruction_attributes, &swig_DOMProcessingInstruction_Sf_SwigStatic, swig_DOMProcessingInstruction_meta, swig_DOMProcessingInstruction_bases, swig_DOMProcessingInstruction_base_names }; + +static int _wrap_new_Event__SWIG_0(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event *result = 0 ; + + SWIG_check_num_args("uscxml::Event::Event",0,0) + result = (uscxml::Event *)new uscxml::Event(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uscxml__Event,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Event__SWIG_1(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = 0 ; + uscxml::Event::Type arg2 ; + std::string temp1 ; + uscxml::Event *result = 0 ; + + SWIG_check_num_args("uscxml::Event::Event",2,2) + if(!lua_isstring(L,1)) SWIG_fail_arg("uscxml::Event::Event",1,"std::string const &"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("uscxml::Event::Event",2,"uscxml::Event::Type"); + temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1; + arg2 = (uscxml::Event::Type)(int)lua_tonumber(L, 2); + result = (uscxml::Event *)new uscxml::Event((std::string const &)*arg1,arg2); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uscxml__Event,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Event__SWIG_2(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = 0 ; + std::string temp1 ; + uscxml::Event *result = 0 ; + + SWIG_check_num_args("uscxml::Event::Event",1,1) + if(!lua_isstring(L,1)) SWIG_fail_arg("uscxml::Event::Event",1,"std::string const &"); + temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1; + result = (uscxml::Event *)new uscxml::Event((std::string const &)*arg1); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uscxml__Event,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_Event(lua_State* L) { + int argc; + int argv[3]={ + 1,2,3 + }; + + argc = lua_gettop(L); + if (argc == 0) { + return _wrap_new_Event__SWIG_0(L); + } + if (argc == 1) { + int _v; + { + _v = lua_isstring(L,argv[0]); + } + if (_v) { + return _wrap_new_Event__SWIG_2(L); + } + } + if (argc == 2) { + int _v; + { + _v = lua_isstring(L,argv[0]); + } + if (_v) { + { + _v = lua_isnumber(L,argv[1]); + } + if (_v) { + return _wrap_new_Event__SWIG_1(L); + } + } + } + + SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Event'\n" + " Possible C/C++ prototypes are:\n" + " uscxml::Event::Event()\n" + " uscxml::Event::Event(std::string const &,uscxml::Event::Type)\n" + " uscxml::Event::Event(std::string const &)\n"); + lua_error(L);return 0; +} + + +static int _wrap_Event___lt(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + uscxml::Event *arg2 = 0 ; + bool result; + + SWIG_check_num_args("uscxml::Event::operator <",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uscxml::Event::operator <",1,"uscxml::Event const *"); + if(!lua_isuserdata(L,2)) SWIG_fail_arg("uscxml::Event::operator <",2,"uscxml::Event const &"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event___lt",1,SWIGTYPE_p_uscxml__Event); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event___lt",2,SWIGTYPE_p_uscxml__Event); + } + + result = (bool)((uscxml::Event const *)arg1)->operator <((uscxml::Event const &)*arg2); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event___eq(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + uscxml::Event *arg2 = 0 ; + bool result; + + SWIG_check_num_args("uscxml::Event::operator ==",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uscxml::Event::operator ==",1,"uscxml::Event const *"); + if(!lua_isuserdata(L,2)) SWIG_fail_arg("uscxml::Event::operator ==",2,"uscxml::Event const &"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event___eq",1,SWIGTYPE_p_uscxml__Event); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event___eq",2,SWIGTYPE_p_uscxml__Event); + } + + result = (bool)((uscxml::Event const *)arg1)->operator ==((uscxml::Event const &)*arg2); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event_getParam__SWIG_0(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event::params_t *arg1 = 0 ; + std::string *arg2 = 0 ; + Data *arg3 = 0 ; + std::string temp2 ; + bool result; + + SWIG_check_num_args("uscxml::Event::getParam",3,3) + if(!lua_isuserdata(L,1)) SWIG_fail_arg("uscxml::Event::getParam",1,"uscxml::Event::params_t const &"); + if(!lua_isstring(L,2)) SWIG_fail_arg("uscxml::Event::getParam",2,"std::string const &"); + if(!lua_isuserdata(L,3)) SWIG_fail_arg("uscxml::Event::getParam",3,"Data &"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__multimapT_std__string_Data_t,0))){ + SWIG_fail_ptr("Event_getParam",1,SWIGTYPE_p_std__multimapT_std__string_Data_t); + } + + temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2; + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Data,0))){ + SWIG_fail_ptr("Event_getParam",3,SWIGTYPE_p_Data); + } + + result = (bool)uscxml::Event::getParam((std::multimap< std::string,Data > const &)*arg1,(std::string const &)*arg2,*arg3); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event_getParam__SWIG_1(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event::params_t *arg1 = 0 ; + std::string *arg2 = 0 ; + std::list< Data > *arg3 = 0 ; + std::string temp2 ; + bool result; + + SWIG_check_num_args("uscxml::Event::getParam",3,3) + if(!lua_isuserdata(L,1)) SWIG_fail_arg("uscxml::Event::getParam",1,"uscxml::Event::params_t const &"); + if(!lua_isstring(L,2)) SWIG_fail_arg("uscxml::Event::getParam",2,"std::string const &"); + if(!lua_isuserdata(L,3)) SWIG_fail_arg("uscxml::Event::getParam",3,"std::list< Data > &"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__multimapT_std__string_Data_t,0))){ + SWIG_fail_ptr("Event_getParam",1,SWIGTYPE_p_std__multimapT_std__string_Data_t); + } + + temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2; + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_std__listT_Data_t,0))){ + SWIG_fail_ptr("Event_getParam",3,SWIGTYPE_p_std__listT_Data_t); + } + + result = (bool)uscxml::Event::getParam((std::multimap< std::string,Data > const &)*arg1,(std::string const &)*arg2,*arg3); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event_getParam__SWIG_3(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event::params_t *arg1 = 0 ; + std::string *arg2 = 0 ; + bool *arg3 = 0 ; + std::string temp2 ; + bool result; + + SWIG_check_num_args("uscxml::Event::getParam",3,3) + if(!lua_isuserdata(L,1)) SWIG_fail_arg("uscxml::Event::getParam",1,"uscxml::Event::params_t const &"); + if(!lua_isstring(L,2)) SWIG_fail_arg("uscxml::Event::getParam",2,"std::string const &"); + if(!lua_isuserdata(L,3)) SWIG_fail_arg("uscxml::Event::getParam",3,"bool &"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__multimapT_std__string_Data_t,0))){ + SWIG_fail_ptr("Event_getParam",1,SWIGTYPE_p_std__multimapT_std__string_Data_t); + } + + temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2; + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_bool,0))){ + SWIG_fail_ptr("Event_getParam",3,SWIGTYPE_p_bool); + } + + result = (bool)uscxml::Event::getParam((std::multimap< std::string,Data > const &)*arg1,(std::string const &)*arg2,*arg3); + lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event_getParam(lua_State* L) { + int argc; + int argv[4]={ + 1,2,3,4 + }; + + argc = lua_gettop(L); + if (argc == 3) { + int _v; + { + void *ptr; + if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_std__multimapT_std__string_Data_t, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + { + _v = lua_isstring(L,argv[1]); + } + if (_v) { + { + void *ptr; + if (lua_isuserdata(L,argv[2])==0 || SWIG_ConvertPtr(L,argv[2], (void **) &ptr, SWIGTYPE_p_Data, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + return _wrap_Event_getParam__SWIG_0(L); + } + } + } + } + if (argc == 3) { + int _v; + { + void *ptr; + if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_std__multimapT_std__string_Data_t, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + { + _v = lua_isstring(L,argv[1]); + } + if (_v) { + { + void *ptr; + if (lua_isuserdata(L,argv[2])==0 || SWIG_ConvertPtr(L,argv[2], (void **) &ptr, SWIGTYPE_p_std__listT_Data_t, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + return _wrap_Event_getParam__SWIG_1(L); + } + } + } + } + if (argc == 3) { + int _v; + { + void *ptr; + if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_std__multimapT_std__string_Data_t, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + { + _v = lua_isstring(L,argv[1]); + } + if (_v) { + { + void *ptr; + if (lua_isuserdata(L,argv[2])==0 || SWIG_ConvertPtr(L,argv[2], (void **) &ptr, SWIGTYPE_p_bool, 0)) { + _v = 0; + } else { + _v = 1; + } + } + if (_v) { + return _wrap_Event_getParam__SWIG_3(L); + } + } + } + } + + SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Event_getParam'\n" + " Possible C/C++ prototypes are:\n" + " uscxml::Event::getParam(uscxml::Event::params_t const &,std::string const &,Data &)\n" + " uscxml::Event::getParam(uscxml::Event::params_t const &,std::string const &,std::list< Data > &)\n" + " uscxml::Event::getParam(uscxml::Event::params_t const &,std::string const &,bool &)\n"); + lua_error(L);return 0; +} + + +static int _wrap_Event_raw_set(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + std::string *arg2 = 0 ; + std::string temp2 ; + + SWIG_check_num_args("uscxml::Event::raw",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uscxml::Event::raw",1,"uscxml::Event *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("uscxml::Event::raw",2,"std::string const &"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event_raw_set",1,SWIGTYPE_p_uscxml__Event); + } + + temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2; + if (arg1) (arg1)->raw = *arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event_raw_get(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + std::string *result = 0 ; + + SWIG_check_num_args("uscxml::Event::raw",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uscxml::Event::raw",1,"uscxml::Event *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event_raw_get",1,SWIGTYPE_p_uscxml__Event); + } + + result = (std::string *) & ((arg1)->raw); + lua_pushlstring(L,result->data(),result->size()); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event_name_set(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + std::string *arg2 = 0 ; + std::string temp2 ; + + SWIG_check_num_args("uscxml::Event::name",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uscxml::Event::name",1,"uscxml::Event *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("uscxml::Event::name",2,"std::string const &"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event_name_set",1,SWIGTYPE_p_uscxml__Event); + } + + temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2; + if (arg1) (arg1)->name = *arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event_name_get(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + std::string *result = 0 ; + + SWIG_check_num_args("uscxml::Event::name",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uscxml::Event::name",1,"uscxml::Event *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event_name_get",1,SWIGTYPE_p_uscxml__Event); + } + + result = (std::string *) & ((arg1)->name); + lua_pushlstring(L,result->data(),result->size()); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event_eventType_set(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + uscxml::Event::Type arg2 ; + + SWIG_check_num_args("uscxml::Event::eventType",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uscxml::Event::eventType",1,"uscxml::Event *"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("uscxml::Event::eventType",2,"uscxml::Event::Type"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event_eventType_set",1,SWIGTYPE_p_uscxml__Event); + } + + arg2 = (uscxml::Event::Type)(int)lua_tonumber(L, 2); + if (arg1) (arg1)->eventType = arg2; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Event_eventType_get(lua_State* L) { + int SWIG_arg = 0; + uscxml::Event *arg1 = (uscxml::Event *) 0 ; + uscxml::Event::Type result; + + SWIG_check_num_args("uscxml::Event::eventType",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("uscxml::Event::eventType",1,"uscxml::Event *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_uscxml__Event,0))){ + SWIG_fail_ptr("Event_eventType_get",1,SWIGTYPE_p_uscxml__Event); + } + + result = (uscxml::Event::Type) ((arg1)->eventType); + lua_pushnumber(L, (lua_Number)(int)(result)); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_Event(void *obj) { +uscxml::Event *arg1 = (uscxml::Event *) obj; +delete arg1; +} +static int _proxy__wrap_new_Event(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_Event); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} +static swig_lua_attribute swig_Event_attributes[] = { + { "raw", _wrap_Event_raw_get, _wrap_Event_raw_set }, + { "name", _wrap_Event_name_get, _wrap_Event_name_set }, + { "eventType", _wrap_Event_eventType_get, _wrap_Event_eventType_set }, + {0,0,0} +}; +static swig_lua_method swig_Event_methods[]= { + { "__lt", _wrap_Event___lt}, + { "__eq", _wrap_Event___eq}, + {0,0} +}; +static swig_lua_method swig_Event_meta[] = { + { "__lt", _wrap_Event___lt}, + { "__eq", _wrap_Event___eq}, + {0,0} +}; + +static swig_lua_attribute swig_Event_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_Event_Sf_SwigStatic_constants[]= { + {SWIG_LUA_CONSTTAB_INT("INTERNAL", uscxml::Event::INTERNAL)}, + {SWIG_LUA_CONSTTAB_INT("EXTERNAL", uscxml::Event::EXTERNAL)}, + {SWIG_LUA_CONSTTAB_INT("PLATFORM", uscxml::Event::PLATFORM)}, + {0,0,0,0,0,0} +}; +static swig_lua_method swig_Event_Sf_SwigStatic_methods[]= { + { "getParam", _wrap_Event_getParam}, + {0,0} +}; +static swig_lua_class* swig_Event_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_Event_Sf_SwigStatic = { + "Event", + swig_Event_Sf_SwigStatic_methods, + swig_Event_Sf_SwigStatic_attributes, + swig_Event_Sf_SwigStatic_constants, + swig_Event_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_Event_bases[] = {0}; +static const char *swig_Event_base_names[] = {0}; +static swig_lua_class _wrap_class_Event = { "Event", "Event", &SWIGTYPE_p_uscxml__Event,_proxy__wrap_new_Event, swig_delete_Event, swig_Event_methods, swig_Event_attributes, &swig_Event_Sf_SwigStatic, swig_Event_meta, swig_Event_bases, swig_Event_base_names }; + +static int _wrap_new_ErrorEvent__SWIG_0(lua_State* L) { + int SWIG_arg = 0; + uscxml::ErrorEvent *result = 0 ; + + SWIG_check_num_args("uscxml::ErrorEvent::ErrorEvent",0,0) + result = (uscxml::ErrorEvent *)new uscxml::ErrorEvent(); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uscxml__ErrorEvent,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_ErrorEvent__SWIG_1(lua_State* L) { + int SWIG_arg = 0; + std::string *arg1 = 0 ; + std::string temp1 ; + uscxml::ErrorEvent *result = 0 ; + + SWIG_check_num_args("uscxml::ErrorEvent::ErrorEvent",1,1) + if(!lua_isstring(L,1)) SWIG_fail_arg("uscxml::ErrorEvent::ErrorEvent",1,"std::string const &"); + temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1; + result = (uscxml::ErrorEvent *)new uscxml::ErrorEvent((std::string const &)*arg1); + SWIG_NewPointerObj(L,result,SWIGTYPE_p_uscxml__ErrorEvent,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_new_ErrorEvent(lua_State* L) { + int argc; + int argv[2]={ + 1,2 + }; + + argc = lua_gettop(L); + if (argc == 0) { + return _wrap_new_ErrorEvent__SWIG_0(L); + } + if (argc == 1) { + int _v; + { + _v = lua_isstring(L,argv[0]); + } + if (_v) { + return _wrap_new_ErrorEvent__SWIG_1(L); + } + } + + SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_ErrorEvent'\n" + " Possible C/C++ prototypes are:\n" + " uscxml::ErrorEvent::ErrorEvent()\n" + " uscxml::ErrorEvent::ErrorEvent(std::string const &)\n"); + lua_error(L);return 0; +} + + +static void swig_delete_ErrorEvent(void *obj) { +uscxml::ErrorEvent *arg1 = (uscxml::ErrorEvent *) obj; +delete arg1; +} +static int _proxy__wrap_new_ErrorEvent(lua_State *L) { + assert(lua_istable(L,1)); + lua_pushcfunction(L,_wrap_new_ErrorEvent); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} +static swig_lua_attribute swig_ErrorEvent_attributes[] = { + {0,0,0} +}; +static swig_lua_method swig_ErrorEvent_methods[]= { + {0,0} +}; +static swig_lua_method swig_ErrorEvent_meta[] = { + {0,0} +}; + +static swig_lua_attribute swig_ErrorEvent_Sf_SwigStatic_attributes[] = { + {0,0,0} +}; +static swig_lua_const_info swig_ErrorEvent_Sf_SwigStatic_constants[]= { + {0,0,0,0,0,0} +}; +static swig_lua_method swig_ErrorEvent_Sf_SwigStatic_methods[]= { + {0,0} +}; +static swig_lua_class* swig_ErrorEvent_Sf_SwigStatic_classes[]= { + 0 +}; + +static swig_lua_namespace swig_ErrorEvent_Sf_SwigStatic = { + "ErrorEvent", + swig_ErrorEvent_Sf_SwigStatic_methods, + swig_ErrorEvent_Sf_SwigStatic_attributes, + swig_ErrorEvent_Sf_SwigStatic_constants, + swig_ErrorEvent_Sf_SwigStatic_classes, + 0 +}; +static swig_lua_class *swig_ErrorEvent_bases[] = {0,0}; +static const char *swig_ErrorEvent_base_names[] = {"uscxml::Event *",0}; +static swig_lua_class _wrap_class_ErrorEvent = { "ErrorEvent", "ErrorEvent", &SWIGTYPE_p_uscxml__ErrorEvent,_proxy__wrap_new_ErrorEvent, swig_delete_ErrorEvent, swig_ErrorEvent_methods, swig_ErrorEvent_attributes, &swig_ErrorEvent_Sf_SwigStatic, swig_ErrorEvent_meta, swig_ErrorEvent_bases, swig_ErrorEvent_base_names }; + +static swig_lua_attribute swig_SwigModule_attributes[] = { + { "DEBUG_UTF8_OUT", _wrap_DEBUG_UTF8_OUT_get, _wrap_DEBUG_UTF8_OUT_set }, + { "DEBUG_UTF8_IN", _wrap_DEBUG_UTF8_IN_get, _wrap_DEBUG_UTF8_IN_set }, + {0,0,0} +}; +static swig_lua_const_info swig_SwigModule_constants[]= { + {SWIG_LUA_CONSTTAB_INT("XERCES_HAS_CPP_NAMESPACE", 1)}, + {SWIG_LUA_CONSTTAB_INT("DOMException_INDEX_SIZE_ERR", XERCES_CPP_NAMESPACE::DOMException::INDEX_SIZE_ERR)}, + {SWIG_LUA_CONSTTAB_INT("DOMException_DOMSTRING_SIZE_ERR", XERCES_CPP_NAMESPACE::DOMException::DOMSTRING_SIZE_ERR)}, + {SWIG_LUA_CONSTTAB_INT("DOMException_HIERARCHY_REQUEST_ERR", XERCES_CPP_NAMESPACE::DOMException::HIERARCHY_REQUEST_ERR)}, + {SWIG_LUA_CONSTTAB_INT("DOMException_WRONG_DOCUMENT_ERR", XERCES_CPP_NAMESPACE::DOMException::WRONG_DOCUMENT_ERR)}, + {SWIG_LUA_CONSTTAB_INT("DOMException_INVALID_CHARACTER_ERR", XERCES_CPP_NAMESPACE::DOMException::INVALID_CHARACTER_ERR)}, + {SWIG_LUA_CONSTTAB_INT("DOMException_NO_DATA_ALLOWED_ERR", XERCES_CPP_NAMESPACE::DOMException::NO_DATA_ALLOWED_ERR)}, + {SWIG_LUA_CONSTTAB_INT("DOMException_NO_MODIFICATION_ALLOWED_ERR", XERCES_CPP_NAMESPACE::DOMException::NO_MODIFICATION_ALLOWED_ERR)}, + {SWIG_LUA_CONSTTAB_INT("DOMException_NOT_FOUND_ERR", XERCES_CPP_NAMESPACE::DOMException::NOT_FOUND_ERR)}, + {SWIG_LUA_CONSTTAB_INT("DOMException_NOT_SUPPORTED_ERR", XERCES_CPP_NAMESPACE::DOMException::NOT_SUPPORTED_ERR)}, + {SWIG_LUA_CONSTTAB_INT("DOMException_INUSE_ATTRIBUTE_ERR", XERCES_CPP_NAMESPACE::DOMException::INUSE_ATTRIBUTE_ERR)}, + {SWIG_LUA_CONSTTAB_INT("DOMException_INVALID_STATE_ERR", XERCES_CPP_NAMESPACE::DOMException::INVALID_STATE_ERR)}, + {SWIG_LUA_CONSTTAB_INT("DOMException_SYNTAX_ERR", XERCES_CPP_NAMESPACE::DOMException::SYNTAX_ERR)}, + {SWIG_LUA_CONSTTAB_INT("DOMException_INVALID_MODIFICATION_ERR", XERCES_CPP_NAMESPACE::DOMException::INVALID_MODIFICATION_ERR)}, + {SWIG_LUA_CONSTTAB_INT("DOMException_NAMESPACE_ERR", XERCES_CPP_NAMESPACE::DOMException::NAMESPACE_ERR)}, + {SWIG_LUA_CONSTTAB_INT("DOMException_INVALID_ACCESS_ERR", XERCES_CPP_NAMESPACE::DOMException::INVALID_ACCESS_ERR)}, + {SWIG_LUA_CONSTTAB_INT("DOMException_VALIDATION_ERR", XERCES_CPP_NAMESPACE::DOMException::VALIDATION_ERR)}, + {SWIG_LUA_CONSTTAB_INT("DOMException_TYPE_MISMATCH_ERR", XERCES_CPP_NAMESPACE::DOMException::TYPE_MISMATCH_ERR)}, + {SWIG_LUA_CONSTTAB_INT("DOMNode_ELEMENT_NODE", XERCES_CPP_NAMESPACE::DOMNode::ELEMENT_NODE)}, + {SWIG_LUA_CONSTTAB_INT("DOMNode_ATTRIBUTE_NODE", XERCES_CPP_NAMESPACE::DOMNode::ATTRIBUTE_NODE)}, + {SWIG_LUA_CONSTTAB_INT("DOMNode_TEXT_NODE", XERCES_CPP_NAMESPACE::DOMNode::TEXT_NODE)}, + {SWIG_LUA_CONSTTAB_INT("DOMNode_CDATA_SECTION_NODE", XERCES_CPP_NAMESPACE::DOMNode::CDATA_SECTION_NODE)}, + {SWIG_LUA_CONSTTAB_INT("DOMNode_ENTITY_REFERENCE_NODE", XERCES_CPP_NAMESPACE::DOMNode::ENTITY_REFERENCE_NODE)}, + {SWIG_LUA_CONSTTAB_INT("DOMNode_ENTITY_NODE", XERCES_CPP_NAMESPACE::DOMNode::ENTITY_NODE)}, + {SWIG_LUA_CONSTTAB_INT("DOMNode_PROCESSING_INSTRUCTION_NODE", XERCES_CPP_NAMESPACE::DOMNode::PROCESSING_INSTRUCTION_NODE)}, + {SWIG_LUA_CONSTTAB_INT("DOMNode_COMMENT_NODE", XERCES_CPP_NAMESPACE::DOMNode::COMMENT_NODE)}, + {SWIG_LUA_CONSTTAB_INT("DOMNode_DOCUMENT_NODE", XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_NODE)}, + {SWIG_LUA_CONSTTAB_INT("DOMNode_DOCUMENT_TYPE_NODE", XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_TYPE_NODE)}, + {SWIG_LUA_CONSTTAB_INT("DOMNode_DOCUMENT_FRAGMENT_NODE", XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_FRAGMENT_NODE)}, + {SWIG_LUA_CONSTTAB_INT("DOMNode_NOTATION_NODE", XERCES_CPP_NAMESPACE::DOMNode::NOTATION_NODE)}, + {SWIG_LUA_CONSTTAB_INT("DOMNode_DOCUMENT_POSITION_DISCONNECTED", XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_DISCONNECTED)}, + {SWIG_LUA_CONSTTAB_INT("DOMNode_DOCUMENT_POSITION_PRECEDING", XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_PRECEDING)}, + {SWIG_LUA_CONSTTAB_INT("DOMNode_DOCUMENT_POSITION_FOLLOWING", XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_FOLLOWING)}, + {SWIG_LUA_CONSTTAB_INT("DOMNode_DOCUMENT_POSITION_CONTAINS", XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_CONTAINS)}, + {SWIG_LUA_CONSTTAB_INT("DOMNode_DOCUMENT_POSITION_CONTAINED_BY", XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_CONTAINED_BY)}, + {SWIG_LUA_CONSTTAB_INT("DOMNode_DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC", XERCES_CPP_NAMESPACE::DOMNode::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)}, + {SWIG_LUA_CONSTTAB_INT("Event_INTERNAL", uscxml::Event::INTERNAL)}, + {SWIG_LUA_CONSTTAB_INT("Event_EXTERNAL", uscxml::Event::EXTERNAL)}, + {SWIG_LUA_CONSTTAB_INT("Event_PLATFORM", uscxml::Event::PLATFORM)}, + {0,0,0,0,0,0} +}; +static swig_lua_method swig_SwigModule_methods[]= { + { "Event_getParam", _wrap_Event_getParam}, + {0,0} +}; +static swig_lua_class* swig_SwigModule_classes[]= { +&_wrap_class_string, +&_wrap_class_DOMException, +&_wrap_class_DOMNode, +&_wrap_class_DOMAttr, +&_wrap_class_DOMElement, +&_wrap_class_DOMEntity, +&_wrap_class_DOMDocumentType, +&_wrap_class_DOMCharacterData, +&_wrap_class_DOMComment, +&_wrap_class_DOMText, +&_wrap_class_DOMCDATASection, +&_wrap_class_DOMNodeList, +&_wrap_class_DOMNamedNodeMap, +&_wrap_class_DOMDocumentFragment, +&_wrap_class_DOMEntityReference, +&_wrap_class_DOMNotation, +&_wrap_class_DOMProcessingInstruction, +&_wrap_class_Event, +&_wrap_class_ErrorEvent, + 0 +}; +static swig_lua_namespace* swig_SwigModule_namespaces[] = { + 0 +}; + +static swig_lua_namespace swig_SwigModule = { + "LuaDOM", + swig_SwigModule_methods, + swig_SwigModule_attributes, + swig_SwigModule_constants, + swig_SwigModule_classes, + swig_SwigModule_namespaces +}; +#ifdef __cplusplus +} +#endif + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ + +static void *_p_XERCES_CPP_NAMESPACE__DOMCDATASectionTo_p_XERCES_CPP_NAMESPACE__DOMText(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMText *) ((XERCES_CPP_NAMESPACE::DOMCDATASection *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMTextTo_p_XERCES_CPP_NAMESPACE__DOMCharacterData(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMCharacterData *) ((XERCES_CPP_NAMESPACE::DOMText *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMCommentTo_p_XERCES_CPP_NAMESPACE__DOMCharacterData(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMCharacterData *) ((XERCES_CPP_NAMESPACE::DOMComment *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMCDATASectionTo_p_XERCES_CPP_NAMESPACE__DOMCharacterData(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMCharacterData *) (XERCES_CPP_NAMESPACE::DOMText *) ((XERCES_CPP_NAMESPACE::DOMCDATASection *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMElementTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMElement *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMDocumentFragmentTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMDocumentFragment *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMAttrTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMAttr *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMDocumentTypeTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMDocumentType *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMCharacterDataTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMCharacterData *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMTextTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) (XERCES_CPP_NAMESPACE::DOMCharacterData *) ((XERCES_CPP_NAMESPACE::DOMText *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMCommentTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) (XERCES_CPP_NAMESPACE::DOMCharacterData *) ((XERCES_CPP_NAMESPACE::DOMComment *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMProcessingInstructionTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMProcessingInstruction *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMEntityTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMEntity *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMEntityReferenceTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMEntityReference *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMCDATASectionTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) (XERCES_CPP_NAMESPACE::DOMCharacterData *)(XERCES_CPP_NAMESPACE::DOMText *) ((XERCES_CPP_NAMESPACE::DOMCDATASection *) x)); +} +static void *_p_XERCES_CPP_NAMESPACE__DOMNotationTo_p_XERCES_CPP_NAMESPACE__DOMNode(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((XERCES_CPP_NAMESPACE::DOMNode *) ((XERCES_CPP_NAMESPACE::DOMNotation *) x)); +} +static void *_p_uscxml__ErrorEventTo_p_uscxml__Event(void *x, int *SWIGUNUSEDPARM(newmemory)) { + return (void *)((uscxml::Event *) ((uscxml::ErrorEvent *) x)); +} +static swig_type_info _swigt__p_Data = {"_p_Data", "Data *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMAttr = {"_p_XERCES_CPP_NAMESPACE__DOMAttr", "XERCES_CPP_NAMESPACE::DOMAttr *", 0, 0, (void*)&_wrap_class_DOMAttr, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMCDATASection = {"_p_XERCES_CPP_NAMESPACE__DOMCDATASection", "XERCES_CPP_NAMESPACE::DOMCDATASection *", 0, 0, (void*)&_wrap_class_DOMCDATASection, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMCharacterData = {"_p_XERCES_CPP_NAMESPACE__DOMCharacterData", "XERCES_CPP_NAMESPACE::DOMCharacterData *", 0, 0, (void*)&_wrap_class_DOMCharacterData, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMComment = {"_p_XERCES_CPP_NAMESPACE__DOMComment", "XERCES_CPP_NAMESPACE::DOMComment *", 0, 0, (void*)&_wrap_class_DOMComment, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMDocument = {"_p_XERCES_CPP_NAMESPACE__DOMDocument", "XERCES_CPP_NAMESPACE::DOMDocument *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentFragment = {"_p_XERCES_CPP_NAMESPACE__DOMDocumentFragment", "XERCES_CPP_NAMESPACE::DOMDocumentFragment *", 0, 0, (void*)&_wrap_class_DOMDocumentFragment, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentType = {"_p_XERCES_CPP_NAMESPACE__DOMDocumentType", "XERCES_CPP_NAMESPACE::DOMDocumentType *", 0, 0, (void*)&_wrap_class_DOMDocumentType, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMElement = {"_p_XERCES_CPP_NAMESPACE__DOMElement", "XERCES_CPP_NAMESPACE::DOMElement *", 0, 0, (void*)&_wrap_class_DOMElement, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMEntity = {"_p_XERCES_CPP_NAMESPACE__DOMEntity", "XERCES_CPP_NAMESPACE::DOMEntity *", 0, 0, (void*)&_wrap_class_DOMEntity, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMEntityReference = {"_p_XERCES_CPP_NAMESPACE__DOMEntityReference", "XERCES_CPP_NAMESPACE::DOMEntityReference *", 0, 0, (void*)&_wrap_class_DOMEntityReference, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMException = {"_p_XERCES_CPP_NAMESPACE__DOMException", "XERCES_CPP_NAMESPACE::DOMException *", 0, 0, (void*)&_wrap_class_DOMException, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap = {"_p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap", "XERCES_CPP_NAMESPACE::DOMNamedNodeMap *", 0, 0, (void*)&_wrap_class_DOMNamedNodeMap, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMNode = {"_p_XERCES_CPP_NAMESPACE__DOMNode", "XERCES_CPP_NAMESPACE::DOMNode *", 0, 0, (void*)&_wrap_class_DOMNode, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMNodeList = {"_p_XERCES_CPP_NAMESPACE__DOMNodeList", "XERCES_CPP_NAMESPACE::DOMNodeList *", 0, 0, (void*)&_wrap_class_DOMNodeList, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMNotation = {"_p_XERCES_CPP_NAMESPACE__DOMNotation", "XERCES_CPP_NAMESPACE::DOMNotation *", 0, 0, (void*)&_wrap_class_DOMNotation, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction = {"_p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction", "XERCES_CPP_NAMESPACE::DOMProcessingInstruction *", 0, 0, (void*)&_wrap_class_DOMProcessingInstruction, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMText = {"_p_XERCES_CPP_NAMESPACE__DOMText", "XERCES_CPP_NAMESPACE::DOMText *", 0, 0, (void*)&_wrap_class_DOMText, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMTypeInfo = {"_p_XERCES_CPP_NAMESPACE__DOMTypeInfo", "XERCES_CPP_NAMESPACE::DOMTypeInfo *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__DOMUserDataHandler = {"_p_XERCES_CPP_NAMESPACE__DOMUserDataHandler", "XERCES_CPP_NAMESPACE::DOMUserDataHandler *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_XERCES_CPP_NAMESPACE__MemoryManager = {"_p_XERCES_CPP_NAMESPACE__MemoryManager", "XERCES_CPP_NAMESPACE::MemoryManager *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_bool = {"_p_bool", "bool *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int16_t = {"_p_int16_t", "XMLInt16 *|int16_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int32_t = {"_p_int32_t", "int32_t *|XMLInt32 *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int64_t = {"_p_int64_t", "int64_t *|XMLInt64 *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_namelist_t = {"_p_namelist_t", "namelist_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_params_t = {"_p_params_t", "params_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_size_t = {"_p_size_t", "size_t *|XMLSize_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_ssize_t = {"_p_ssize_t", "ssize_t *|XMLSSize_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__listT_Data_t = {"_p_std__listT_Data_t", "std::list< Data > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__multimapT_std__string_Data_t = {"_p_std__multimapT_std__string_Data_t", "uscxml::Event::params_t *|std::multimap< std::string,Data > *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)&_wrap_class_string, 0}; +static swig_type_info _swigt__p_uint16_t = {"_p_uint16_t", "XMLUInt16 *|UTF16Ch *|XMLCh *|uint16_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_uint32_t = {"_p_uint32_t", "uint32_t *|XMLUInt32 *|UCS4Ch *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_uint64_t = {"_p_uint64_t", "uint64_t *|XMLUInt64 *|XMLFilePos *|XMLFileLoc *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *|XMLByte *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_uscxml__ErrorEvent = {"_p_uscxml__ErrorEvent", "uscxml::ErrorEvent *", 0, 0, (void*)&_wrap_class_ErrorEvent, 0}; +static swig_type_info _swigt__p_uscxml__Event = {"_p_uscxml__Event", "uscxml::Event *", 0, 0, (void*)&_wrap_class_Event, 0}; +static swig_type_info _swigt__p_void = {"_p_void", "void *", 0, 0, (void*)0, 0}; + +static swig_type_info *swig_type_initial[] = { + &_swigt__p_Data, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMAttr, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMCDATASection, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMCharacterData, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMComment, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMDocument, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentFragment, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentType, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMElement, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMEntity, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMEntityReference, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMException, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMNode, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMNodeList, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMNotation, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMText, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMTypeInfo, + &_swigt__p_XERCES_CPP_NAMESPACE__DOMUserDataHandler, + &_swigt__p_XERCES_CPP_NAMESPACE__MemoryManager, + &_swigt__p_bool, + &_swigt__p_int16_t, + &_swigt__p_int32_t, + &_swigt__p_int64_t, + &_swigt__p_namelist_t, + &_swigt__p_params_t, + &_swigt__p_size_t, + &_swigt__p_ssize_t, + &_swigt__p_std__listT_Data_t, + &_swigt__p_std__multimapT_std__string_Data_t, + &_swigt__p_std__string, + &_swigt__p_uint16_t, + &_swigt__p_uint32_t, + &_swigt__p_uint64_t, + &_swigt__p_unsigned_char, + &_swigt__p_uscxml__ErrorEvent, + &_swigt__p_uscxml__Event, + &_swigt__p_void, +}; + +static swig_cast_info _swigc__p_Data[] = { {&_swigt__p_Data, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMAttr[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMAttr, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMCDATASection[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMCDATASection, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMCharacterData[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMText, _p_XERCES_CPP_NAMESPACE__DOMTextTo_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMComment, _p_XERCES_CPP_NAMESPACE__DOMCommentTo_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMCDATASection, _p_XERCES_CPP_NAMESPACE__DOMCDATASectionTo_p_XERCES_CPP_NAMESPACE__DOMCharacterData, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMComment[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMComment, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMDocument[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMDocument, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMDocumentFragment[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentFragment, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMDocumentType[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentType, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMElement[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMElement, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMEntity[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMEntity, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMEntityReference[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMEntityReference, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMException[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMException, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMNode[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMElement, _p_XERCES_CPP_NAMESPACE__DOMElementTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentFragment, _p_XERCES_CPP_NAMESPACE__DOMDocumentFragmentTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMAttr, _p_XERCES_CPP_NAMESPACE__DOMAttrTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMDocumentType, _p_XERCES_CPP_NAMESPACE__DOMDocumentTypeTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMCharacterData, _p_XERCES_CPP_NAMESPACE__DOMCharacterDataTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMText, _p_XERCES_CPP_NAMESPACE__DOMTextTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMComment, _p_XERCES_CPP_NAMESPACE__DOMCommentTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction, _p_XERCES_CPP_NAMESPACE__DOMProcessingInstructionTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMEntity, _p_XERCES_CPP_NAMESPACE__DOMEntityTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMEntityReference, _p_XERCES_CPP_NAMESPACE__DOMEntityReferenceTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMCDATASection, _p_XERCES_CPP_NAMESPACE__DOMCDATASectionTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMNotation, _p_XERCES_CPP_NAMESPACE__DOMNotationTo_p_XERCES_CPP_NAMESPACE__DOMNode, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMNodeList[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMNodeList, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMNotation[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMNotation, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMText[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMText, 0, 0, 0}, {&_swigt__p_XERCES_CPP_NAMESPACE__DOMCDATASection, _p_XERCES_CPP_NAMESPACE__DOMCDATASectionTo_p_XERCES_CPP_NAMESPACE__DOMText, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMTypeInfo[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMTypeInfo, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__DOMUserDataHandler[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__DOMUserDataHandler, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_XERCES_CPP_NAMESPACE__MemoryManager[] = { {&_swigt__p_XERCES_CPP_NAMESPACE__MemoryManager, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_bool[] = { {&_swigt__p_bool, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int16_t[] = { {&_swigt__p_int16_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int32_t[] = { {&_swigt__p_int32_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int64_t[] = { {&_swigt__p_int64_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_namelist_t[] = { {&_swigt__p_namelist_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_params_t[] = { {&_swigt__p_params_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_size_t[] = { {&_swigt__p_size_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_ssize_t[] = { {&_swigt__p_ssize_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__listT_Data_t[] = { {&_swigt__p_std__listT_Data_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__multimapT_std__string_Data_t[] = { {&_swigt__p_std__multimapT_std__string_Data_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__string[] = { {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_uint16_t[] = { {&_swigt__p_uint16_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_uint32_t[] = { {&_swigt__p_uint32_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_uint64_t[] = { {&_swigt__p_uint64_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_uscxml__ErrorEvent[] = { {&_swigt__p_uscxml__ErrorEvent, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_uscxml__Event[] = { {&_swigt__p_uscxml__Event, 0, 0, 0}, {&_swigt__p_uscxml__ErrorEvent, _p_uscxml__ErrorEventTo_p_uscxml__Event, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_void[] = { {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}}; + +static swig_cast_info *swig_cast_initial[] = { + _swigc__p_Data, + _swigc__p_XERCES_CPP_NAMESPACE__DOMAttr, + _swigc__p_XERCES_CPP_NAMESPACE__DOMCDATASection, + _swigc__p_XERCES_CPP_NAMESPACE__DOMCharacterData, + _swigc__p_XERCES_CPP_NAMESPACE__DOMComment, + _swigc__p_XERCES_CPP_NAMESPACE__DOMDocument, + _swigc__p_XERCES_CPP_NAMESPACE__DOMDocumentFragment, + _swigc__p_XERCES_CPP_NAMESPACE__DOMDocumentType, + _swigc__p_XERCES_CPP_NAMESPACE__DOMElement, + _swigc__p_XERCES_CPP_NAMESPACE__DOMEntity, + _swigc__p_XERCES_CPP_NAMESPACE__DOMEntityReference, + _swigc__p_XERCES_CPP_NAMESPACE__DOMException, + _swigc__p_XERCES_CPP_NAMESPACE__DOMNamedNodeMap, + _swigc__p_XERCES_CPP_NAMESPACE__DOMNode, + _swigc__p_XERCES_CPP_NAMESPACE__DOMNodeList, + _swigc__p_XERCES_CPP_NAMESPACE__DOMNotation, + _swigc__p_XERCES_CPP_NAMESPACE__DOMProcessingInstruction, + _swigc__p_XERCES_CPP_NAMESPACE__DOMText, + _swigc__p_XERCES_CPP_NAMESPACE__DOMTypeInfo, + _swigc__p_XERCES_CPP_NAMESPACE__DOMUserDataHandler, + _swigc__p_XERCES_CPP_NAMESPACE__MemoryManager, + _swigc__p_bool, + _swigc__p_int16_t, + _swigc__p_int32_t, + _swigc__p_int64_t, + _swigc__p_namelist_t, + _swigc__p_params_t, + _swigc__p_size_t, + _swigc__p_ssize_t, + _swigc__p_std__listT_Data_t, + _swigc__p_std__multimapT_std__string_Data_t, + _swigc__p_std__string, + _swigc__p_uint16_t, + _swigc__p_uint32_t, + _swigc__p_uint64_t, + _swigc__p_unsigned_char, + _swigc__p_uscxml__ErrorEvent, + _swigc__p_uscxml__Event, + _swigc__p_void, +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ + +/* ----------------------------------------------------------------------------- + * Type initialization: + * This problem is tough by the requirement that no dynamic + * memory is used. Also, since swig_type_info structures store pointers to + * swig_cast_info structures and swig_cast_info structures store pointers back + * to swig_type_info structures, we need some lookup code at initialization. + * The idea is that swig generates all the structures that are needed. + * The runtime then collects these partially filled structures. + * The SWIG_InitializeModule function takes these initial arrays out of + * swig_module, and does all the lookup, filling in the swig_module.types + * array with the correct data and linking the correct swig_cast_info + * structures together. + * + * The generated swig_type_info structures are assigned statically to an initial + * array. We just loop through that array, and handle each type individually. + * First we lookup if this type has been already loaded, and if so, use the + * loaded structure instead of the generated one. Then we have to fill in the + * cast linked list. The cast data is initially stored in something like a + * two-dimensional array. Each row corresponds to a type (there are the same + * number of rows as there are in the swig_type_initial array). Each entry in + * a column is one of the swig_cast_info structures for that type. + * The cast_initial array is actually an array of arrays, because each row has + * a variable number of columns. So to actually build the cast linked list, + * we find the array of casts associated with the type, and loop through it + * adding the casts to the list. The one last trick we need to do is making + * sure the type pointer in the swig_cast_info struct is correct. + * + * First off, we lookup the cast->type name to see if it is already loaded. + * There are three cases to handle: + * 1) If the cast->type has already been loaded AND the type we are adding + * casting info to has not been loaded (it is in this module), THEN we + * replace the cast->type pointer with the type pointer that has already + * been loaded. + * 2) If BOTH types (the one we are adding casting info to, and the + * cast->type) are loaded, THEN the cast info has already been loaded by + * the previous module so we just ignore it. + * 3) Finally, if cast->type has not already been loaded, then we add that + * swig_cast_info to the linked list (because the cast->type) pointer will + * be correct. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* c-mode */ +#endif +#endif + +#if 0 +#define SWIGRUNTIME_DEBUG +#endif + + +SWIGRUNTIME void +SWIG_InitializeModule(void *clientdata) { + size_t i; + swig_module_info *module_head, *iter; + int init; + + /* check to see if the circular list has been setup, if not, set it up */ + if (swig_module.next==0) { + /* Initialize the swig_module */ + swig_module.type_initial = swig_type_initial; + swig_module.cast_initial = swig_cast_initial; + swig_module.next = &swig_module; + init = 1; + } else { + init = 0; + } + + /* Try and load any already created modules */ + module_head = SWIG_GetModule(clientdata); + if (!module_head) { + /* This is the first module loaded for this interpreter */ + /* so set the swig module into the interpreter */ + SWIG_SetModule(clientdata, &swig_module); + } else { + /* the interpreter has loaded a SWIG module, but has it loaded this one? */ + iter=module_head; + do { + if (iter==&swig_module) { + /* Our module is already in the list, so there's nothing more to do. */ + return; + } + iter=iter->next; + } while (iter!= module_head); + + /* otherwise we must add our module into the list */ + swig_module.next = module_head->next; + module_head->next = &swig_module; + } + + /* When multiple interpreters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + + /* Now work on filling in swig_module.types */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: size %d\n", swig_module.size); +#endif + for (i = 0; i < swig_module.size; ++i) { + swig_type_info *type = 0; + swig_type_info *ret; + swig_cast_info *cast; + +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); +#endif + + /* if there is another module already loaded */ + if (swig_module.next != &swig_module) { + type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); + } + if (type) { + /* Overwrite clientdata field */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found type %s\n", type->name); +#endif + if (swig_module.type_initial[i]->clientdata) { + type->clientdata = swig_module.type_initial[i]->clientdata; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); +#endif + } + } else { + type = swig_module.type_initial[i]; + } + + /* Insert casting types */ + cast = swig_module.cast_initial[i]; + while (cast->type) { + + /* Don't need to add information already in the list */ + ret = 0; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); +#endif + if (swig_module.next != &swig_module) { + ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); +#ifdef SWIGRUNTIME_DEBUG + if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); +#endif + } + if (ret) { + if (type == swig_module.type_initial[i]) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: skip old type %s\n", ret->name); +#endif + cast->type = ret; + ret = 0; + } else { + /* Check for casting already in the list */ + swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); +#ifdef SWIGRUNTIME_DEBUG + if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); +#endif + if (!ocast) ret = 0; + } + } + + if (!ret) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); +#endif + if (type->cast) { + type->cast->prev = cast; + cast->next = type->cast; + } + type->cast = cast; + } + cast++; + } + /* Set entry in modules->types array equal to the type */ + swig_module.types[i] = type; + } + swig_module.types[i] = 0; + +#ifdef SWIGRUNTIME_DEBUG + printf("**** SWIG_InitializeModule: Cast List ******\n"); + for (i = 0; i < swig_module.size; ++i) { + int j = 0; + swig_cast_info *cast = swig_module.cast_initial[i]; + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + while (cast->type) { + printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); + cast++; + ++j; + } + printf("---- Total casts: %d\n",j); + } + printf("**** SWIG_InitializeModule: Cast List ******\n"); +#endif +} + +/* This function will propagate the clientdata field of type to +* any new swig_type_info structures that have been added into the list +* of equivalent types. It is like calling +* SWIG_TypeClientData(type, clientdata) a second time. +*/ +SWIGRUNTIME void +SWIG_PropagateClientData(void) { + size_t i; + swig_cast_info *equiv; + static int init_run = 0; + + if (init_run) return; + init_run = 1; + + for (i = 0; i < swig_module.size; i++) { + if (swig_module.types[i]->clientdata) { + equiv = swig_module.types[i]->cast; + while (equiv) { + if (!equiv->converter) { + if (equiv->type && !equiv->type->clientdata) + SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); + } + equiv = equiv->next; + } + } + } +} + +#ifdef __cplusplus +#if 0 +{ /* c-mode */ +#endif +} +#endif + + + +/* Forward declaration of where the user's %init{} gets inserted */ +void SWIG_init_user(lua_State* L ); + +#ifdef __cplusplus +extern "C" { +#endif +/* this is the initialization function + added at the very end of the code + the function is always called SWIG_init, but an earlier #define will rename it +*/ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) +LUALIB_API int SWIG_init(lua_State* L) +#else +SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */ +#endif +{ +#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */ + int i; + int globalRegister = 0; + /* start with global table */ + lua_pushglobaltable (L); + /* SWIG's internal initialisation */ + SWIG_InitializeModule((void*)L); + SWIG_PropagateClientData(); +#endif + +#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) || defined(SWIG_LUA_ELUA_EMULATE) + /* add a global fn */ + SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type); + SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_class_equal); +#endif + +#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) + /* set up base class pointers (the hierarchy) */ + for (i = 0; swig_types[i]; i++){ + if (swig_types[i]->clientdata){ + SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata)); + } + } +#ifdef SWIG_LUA_MODULE_GLOBAL + globalRegister = 1; +#endif + + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) + SWIG_Lua_namespace_register(L,&swig_SwigModule, globalRegister); +#endif + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) + for (i = 0; swig_types[i]; i++){ + if (swig_types[i]->clientdata){ + SWIG_Lua_elua_class_register_instance(L,(swig_lua_class*)(swig_types[i]->clientdata)); + } + } +#endif + +#if defined(SWIG_LUA_ELUA_EMULATE) + lua_newtable(L); + SWIG_Lua_elua_emulate_register(L,swig_SwigModule.ns_methods); + SWIG_Lua_elua_emulate_register_clear(L); + if(globalRegister) { + lua_pushstring(L,swig_SwigModule.name); + lua_pushvalue(L,-2); + lua_rawset(L,-4); + } +#endif + +#endif + +#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) + /* invoke user-specific initialization */ + SWIG_init_user(L); + /* end module */ + /* Note: We do not clean up the stack here (Lua will do this for us). At this + point, we have the globals table and out module table on the stack. Returning + one value makes the module table the result of the require command. */ + return 1; +#else + return 0; +#endif +} + +#ifdef __cplusplus +} +#endif + + +const char* SWIG_LUACODE= + ""; + +void SWIG_init_user(lua_State* L) +{ + SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode->dcast = (swig_dycast_func) DOMNode_dynamic_cast; + + /* exec Lua code if applicable */ + SWIG_Lua_dostring(L,SWIG_LUACODE); +} + diff --git a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp index f6cb570..6fc5ac4 100644 --- a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp +++ b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp @@ -17,10 +17,10 @@ * @endcond */ -#include <boost/algorithm/string.hpp> - #include "uscxml/Common.h" +#include "uscxml/util/URL.h" #include "uscxml/util/String.h" + #include "LuaDataModel.h" // disable forcing to bool performance warning @@ -29,31 +29,71 @@ #include "LuaBridge.h" #pragma warning(pop) -#include "uscxml/dom/DOMUtils.h" - -#include "uscxml/Message.h" -#include <glog/logging.h> +#include "uscxml/messages/Event.h" +#include "uscxml/util/DOM.h" +#include <easylogging++.h> +#include <boost/algorithm/string.hpp> -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif +//#include "LuaDOM.cpp.inc" namespace uscxml { -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new LuaDataModelProvider() ); - return true; -} -#endif - -static int luaInspect(lua_State * l) { - return 0; -} +//static int luaInspect(lua_State * l) { +// return 0; +//} bool _luaHasXMLParser = false; +static int luaEval(lua_State* luaState, const std::string& expr) { + int preStack = lua_gettop(luaState); + int error = luaL_loadstring(luaState, expr.c_str()) || lua_pcall(luaState, 0, LUA_MULTRET, 0); + if (error) { + std::string errMsg = lua_tostring(luaState, -1); + lua_pop(luaState, 1); /* pop error message from the stack */ + ERROR_EXECUTION_THROW(errMsg); + } + int postStack = lua_gettop(luaState); + return postStack - preStack; +} + +static Data getLuaAsData(lua_State* _luaState, const luabridge::LuaRef& lua) { + Data data; + if (lua.isFunction()) { + // TODO: this might lead to a stack-overflow + luabridge::LuaRef luaEvald = lua(); + return getLuaAsData(_luaState, luaEvald); + } else if(lua.isLightUserdata() || lua.isUserdata()) { + // not sure what to do + } else if(lua.isThread()) { + // not sure what to do + } else if(lua.isNil()) { + data.atom = "nil"; + data.type = Data::INTERPRETED; + } else if(lua.isNumber()) { + data.atom = toStr(lua.cast<int>()); + data.type = Data::INTERPRETED; + } else if(lua.isString()) { + data.atom = lua.tostring(); + data.type = Data::VERBATIM; + } else if(lua.isTable()) { + bool isArray = false; + bool isMap = false; + for (luabridge::Iterator iter (lua); !iter.isNil(); ++iter) { + luabridge::LuaRef luaKey = iter.key(); + luabridge::LuaRef luaVal = *iter; + if (luaKey.isString()) { + assert(!isArray); + isMap = true; + data.compound[luaKey.tostring()] = getLuaAsData(_luaState, luaVal); + } else { + assert(!isMap); + isArray = true; + data.array.push_back(getLuaAsData(_luaState, luaVal)); + } + } + } + return data; +} static luabridge::LuaRef getDataAsLua(lua_State* _luaState, const Data& data) { luabridge::LuaRef luaData (_luaState); @@ -80,24 +120,24 @@ static luabridge::LuaRef getDataAsLua(lua_State* _luaState, const Data& data) { luaData[compoundIter->first] = getDataAsLua(_luaState, compoundIter->second); compoundIter++; } - luaData["inspect"] = luaInspect; +// luaData["inspect"] = luaInspect; return luaData; } if (data.array.size() > 0) { luaData = luabridge::newTable(_luaState); std::list<Data>::const_iterator arrayIter = data.array.begin(); - uint32_t index = 0; +// uint32_t index = 0; while(arrayIter != data.array.end()) { - luaData[index++] = getDataAsLua(_luaState, *arrayIter); +// luaData[index++] = getDataAsLua(_luaState, *arrayIter); + luaData.append(getDataAsLua(_luaState, *arrayIter)); arrayIter++; } - luaData["inspect"] = luaInspect; +// luaData["inspect"] = luaInspect; return luaData; } if (data.atom.size() > 0) { switch (data.type) { case Data::VERBATIM: { -// luaData = "\"" + data.atom + "\""; luaData = data.atom; break; } @@ -109,29 +149,34 @@ static luabridge::LuaRef getDataAsLua(lua_State* _luaState, const Data& data) { luaData = strTo<long>(data.atom); } } else { - luaData = data.atom; + int retVals = luaEval(_luaState, "return(" + data.atom + ");"); + if (retVals == 1) { + luaData = luabridge::LuaRef::fromStack(_luaState, -1); + } + lua_pop(_luaState, retVals); } } } return luaData; } - return luaData; + // hopefully this is nil + return luabridge::LuaRef(_luaState); } LuaDataModel::LuaDataModel() { _luaState = NULL; } -static int luaInFunction(lua_State * l) { - luabridge::LuaRef ref = luabridge::getGlobal(l, "__interpreter"); - InterpreterInfo* interpreter = ref.cast<InterpreterInfo*>(); +int LuaDataModel::luaInFunction(lua_State * l) { + luabridge::LuaRef ref = luabridge::getGlobal(l, "__datamodel"); + LuaDataModel* dm = ref.cast<LuaDataModel*>(); int stackSize = lua_gettop(l); for (size_t i = 0; i < stackSize; i++) { if (!lua_isstring(l, -1 - i)) continue; std::string stateName = lua_tostring(l, -1 - i); - if (interpreter->isInState(stateName)) + if (dm->_callbacks->isInState(stateName)) continue; lua_pushboolean(l, 0); return 1; @@ -140,9 +185,9 @@ static int luaInFunction(lua_State * l) { return 1; } -boost::shared_ptr<DataModelImpl> LuaDataModel::create(InterpreterInfo* interpreter) { - boost::shared_ptr<LuaDataModel> dm = boost::shared_ptr<LuaDataModel>(new LuaDataModel()); - dm->_interpreter = interpreter; +std::shared_ptr<DataModelImpl> LuaDataModel::create(DataModelCallbacks* callbacks) { + std::shared_ptr<LuaDataModel> dm(new LuaDataModel()); + dm->_callbacks = callbacks; dm->_luaState = luaL_newstate(); luaL_openlibs(dm->_luaState); @@ -161,23 +206,33 @@ boost::shared_ptr<DataModelImpl> LuaDataModel::create(InterpreterInfo* interpret LOG(INFO) << e.what(); } - luabridge::getGlobalNamespace(dm->_luaState).beginClass<InterpreterInfo>("Interpreter").endClass(); - luabridge::setGlobal(dm->_luaState, dm->_interpreter, "__interpreter"); + luabridge::getGlobalNamespace(dm->_luaState).beginClass<LuaDataModel>("DataModel").endClass(); + luabridge::setGlobal(dm->_luaState, dm.get(), "__datamodel"); luabridge::getGlobalNamespace(dm->_luaState).addCFunction("In", luaInFunction); luabridge::LuaRef ioProcTable = luabridge::newTable(dm->_luaState); - - std::map<std::string, IOProcessor>::const_iterator ioProcIter = dm->_interpreter->getIOProcessors().begin(); - while(ioProcIter != dm->_interpreter->getIOProcessors().end()) { + std::map<std::string, IOProcessor> ioProcs = dm->_callbacks->getIOProcessors(); + std::map<std::string, IOProcessor>::const_iterator ioProcIter = ioProcs.begin(); + while(ioProcIter != ioProcs.end()) { Data ioProcData = ioProcIter->second.getDataModelVariables(); ioProcTable[ioProcIter->first] = getDataAsLua(dm->_luaState, ioProcData); ioProcIter++; } luabridge::setGlobal(dm->_luaState, ioProcTable, "_ioprocessors"); - luabridge::setGlobal(dm->_luaState, dm->_interpreter->getName(), "_name"); - luabridge::setGlobal(dm->_luaState, dm->_interpreter->getSessionId(), "_sessionid"); + luabridge::LuaRef invTable = luabridge::newTable(dm->_luaState); + std::map<std::string, Invoker> invokers = dm->_callbacks->getInvokers(); + std::map<std::string, Invoker>::const_iterator invIter = invokers.begin(); + while(invIter != invokers.end()) { + Data invData = invIter->second.getDataModelVariables(); + invTable[invIter->first] = getDataAsLua(dm->_luaState, invData); + invIter++; + } + luabridge::setGlobal(dm->_luaState, invTable, "_invokers"); + + luabridge::setGlobal(dm->_luaState, dm->_callbacks->getName(), "_name"); + luabridge::setGlobal(dm->_luaState, dm->_callbacks->getSessionId(), "_sessionid"); return dm; } @@ -187,42 +242,8 @@ LuaDataModel::~LuaDataModel() { lua_close(_luaState); } -void LuaDataModel::pushContext() { -} - -void LuaDataModel::popContext() { -} - -void LuaDataModel::initialize() { -} - -static Data getLuaAsData(const luabridge::LuaRef& lua) { - Data data; - if (lua.isFunction()) { - // TODO: this might lead to a stack-overflow - luabridge::LuaRef luaEvald = lua(); - return getLuaAsData(luaEvald); - } else if(lua.isLightUserdata() || lua.isUserdata()) { - // not sure what to do - } else if(lua.isThread()) { - // not sure what to do - } else if(lua.isNil()) { - data.atom = "undefined"; - data.type = Data::INTERPRETED; - } else if(lua.isString()) { - data.atom = lua.tostring(); - data.type = Data::VERBATIM; - } else if(lua.isNumber()) { - data.atom = lua.tostring(); - data.type = Data::INTERPRETED; - } else if(lua.isTable()) { - for (luabridge::Iterator iter (lua); !iter.isNil (); ++iter) { - luabridge::LuaRef luaKey = iter.key(); - luabridge::LuaRef luaVal = *iter; - data.compound[luaKey.tostring()] = getLuaAsData(luaVal); - } - } - return data; +void LuaDataModel::addExtension(DataModelExtension* ext) { + ERROR_EXECUTION_THROW("Extensions unimplemented in lua datamodel"); } void LuaDataModel::setEvent(const Event& event) { @@ -230,14 +251,17 @@ void LuaDataModel::setEvent(const Event& event) { luaEvent = luabridge::newTable(_luaState); luaEvent["name"] = event.name; - luaEvent["raw"] = event.raw; - luaEvent["xml"] = event.xml; - luaEvent["origin"] = event.origin; - luaEvent["origintype"] = event.origintype; - luaEvent["content"] = event.content; - luaEvent["invokeId"] = event.invokeid; - luaEvent["sendId"] = event.sendid; - luaEvent["inspect"] = luaInspect; + if (event.raw.size() > 0) + luaEvent["raw"] = event.raw; + if (event.origin.size() > 0) + luaEvent["origin"] = event.origin; + if (event.origintype.size() > 0) + luaEvent["origintype"] = event.origintype; + if (event.invokeid.size() > 0) + luaEvent["invokeid"] = event.invokeid; + if (!event.hideSendId) + luaEvent["sendid"] = event.sendid; +// luaEvent["inspect"] = luaInspect; switch (event.eventType) { case Event::INTERNAL: @@ -254,64 +278,44 @@ void LuaDataModel::setEvent(const Event& event) { break; } - if (event.dom) { + if (event.data.node) { if (_luaHasXMLParser) { const luabridge::LuaRef& luaLom = luabridge::getGlobal(_luaState, "lxp.lom"); const luabridge::LuaRef& luaLomParse = luaLom["parse"]; assert(luaLomParse.isFunction()); std::stringstream luaXMLSS; - luaXMLSS << event.dom; + luaXMLSS << event.data.node; try { luaEvent["data"] = luaLomParse(luaXMLSS.str()); } catch (luabridge::LuaException e) { ERROR_EXECUTION_THROW(e.what()); } } else { - // some error events have a dom node attached - do not throw for them - // issue65 - if (!nameMatch("error.*", event.name)) { - ERROR_EXECUTION_THROW("No DOM support in Lua datamodel"); - } - } - } else if (event.content.length() > 0) { - // _event.data is a string or JSON - Data json = Data::fromJSON(event.content); - if (!json.empty()) { - luaEvent["data"] = getDataAsLua(_luaState, json); - } else { - // test179 - std::string trimmed = boost::trim_copy(event.content); - if ((boost::starts_with(trimmed, "'") && boost::ends_with(trimmed, "'")) || - (boost::starts_with(trimmed, "\"") && boost::ends_with(trimmed, "\""))) { - luaEvent["data"] = spaceNormalize(event.content); - } else { - Data tmp(event.content, Data::INTERPRETED); - luaEvent["data"] = getDataAsLua(_luaState, tmp); - } + ERROR_EXECUTION_THROW("No DOM support in Lua datamodel"); } } else { // _event.data is KVP - Event eventCopy(event); + Data d = event.data; - if (!eventCopy.params.empty()) { - Event::params_t::iterator paramIter = eventCopy.params.begin(); - while(paramIter != eventCopy.params.end()) { - eventCopy.data.compound[paramIter->first] = paramIter->second; + if (!event.params.empty()) { + Event::params_t::const_iterator paramIter = event.params.begin(); + while(paramIter != event.params.end()) { + d.compound[paramIter->first] = paramIter->second; paramIter++; } } - if (!eventCopy.namelist.empty()) { - Event::namelist_t::iterator nameListIter = eventCopy.namelist.begin(); - while(nameListIter != eventCopy.namelist.end()) { - eventCopy.data.compound[nameListIter->first] = nameListIter->second; + if (!event.namelist.empty()) { + Event::namelist_t::const_iterator nameListIter = event.namelist.begin(); + while(nameListIter != event.namelist.end()) { + d.compound[nameListIter->first] = nameListIter->second; nameListIter++; } } - if (!eventCopy.data.empty()) { - luabridge::LuaRef luaData = getDataAsLua(_luaState, eventCopy.data); + if (!d.empty()) { + luabridge::LuaRef luaData = getDataAsLua(_luaState, d); assert(luaEvent.isTable()); - assert(luaData.isTable()); + // assert(luaData.isTable()); // not necessarily test179 luaEvent["data"] = luaData; } } @@ -319,31 +323,29 @@ void LuaDataModel::setEvent(const Event& event) { luabridge::setGlobal(_luaState, luaEvent, "_event"); } -Data LuaDataModel::getStringAsData(const std::string& content) { -// Data data = Data::fromJSON(content); +Data LuaDataModel::evalAsData(const std::string& content) { Data data; - if (data.empty()) { - std::string trimmedExpr = boost::trim_copy(content); - if (!boost::starts_with(trimmedExpr, "return")) { - trimmedExpr = "return(" + trimmedExpr + ");"; - } - int retVals = luaEval(Arabica::DOM::Element<std::string>(), trimmedExpr); + std::string trimmedExpr = boost::trim_copy(content); + + try { + int retVals = luaEval(_luaState, "return(" + trimmedExpr + ")"); if (retVals == 1) { - data = getLuaAsData(luabridge::LuaRef::fromStack(_luaState, -1)); + data = getLuaAsData(_luaState, luabridge::LuaRef::fromStack(_luaState, -1)); } lua_pop(_luaState, retVals); - + } catch (ErrorEvent e) { + int retVals = luaEval(_luaState, trimmedExpr); + if (retVals == 1) { + data = getLuaAsData(_luaState, luabridge::LuaRef::fromStack(_luaState, -1)); + lua_pop(_luaState, retVals); + } else { + lua_pop(_luaState, retVals); + throw e; // we will assume syntax error and throw + } } - return data; -} -bool LuaDataModel::validate(const std::string& location, const std::string& schema) { - return true; -} - -bool LuaDataModel::isLocation(const std::string& expr) { - return true; + return data; } bool LuaDataModel::isValidSyntax(const std::string& expr) { @@ -368,7 +370,9 @@ uint32_t LuaDataModel::getLength(const std::string& expr) { trimmedExpr = "return(#" + trimmedExpr + ")"; } - int retVals = luaEval(Arabica::DOM::Element<std::string>(), trimmedExpr); + int retVals = luaEval(_luaState, trimmedExpr); + +#if 1 if (retVals == 1 && lua_isnumber(_luaState, -1)) { int result = lua_tointeger(_luaState, -1); @@ -379,6 +383,21 @@ uint32_t LuaDataModel::getLength(const std::string& expr) { lua_pop(_luaState, retVals); ERROR_EXECUTION_THROW("'" + expr + "' does not evaluate to an array."); return 0; +#else + + if (retVals == 1) { + luabridge::LuaRef luaData = luabridge::LuaRef::fromStack(_luaState, -1); + if (luaData.isNumber()) { + lua_pop(_luaState, retVals); + return luaData.cast<int>(); + } + } + lua_pop(_luaState, retVals); + + ERROR_EXECUTION_THROW("'" + expr + "' does not evaluate to an array."); + return 0; + +#endif } void LuaDataModel::setForeach(const std::string& item, @@ -390,152 +409,110 @@ void LuaDataModel::setForeach(const std::string& item, const luabridge::LuaRef& arrRef = luabridge::getGlobal(_luaState, array.c_str()); if (arrRef.isTable()) { - // trigger syntax error for invalid items - int retVals = luaEval(Arabica::DOM::Element<std::string>(), "return(" + item + ");"); + // triggers syntax error for invalid items, test 152 + int retVals = luaEval(_luaState, item + " = " + array + "[" + toStr(iteration) + "]"); lua_pop(_luaState, retVals); - const luabridge::LuaRef& val = arrRef[iteration]; - luabridge::setGlobal(_luaState, val, item.c_str()); - if (index.length() > 0) { - // assign iteration element to index - luabridge::setGlobal(_luaState, iteration, index.c_str()); + int retVals = luaEval(_luaState, index + " = " + toStr(iteration)); + lua_pop(_luaState, retVals); } } } -void LuaDataModel::eval(const Arabica::DOM::Element<std::string>& scriptElem, - const std::string& expr) { - luaEval(scriptElem, expr); -} - -int LuaDataModel::luaEval(const Arabica::DOM::Element<std::string>& scriptElem, - const std::string& expr) { - int preStack = lua_gettop(_luaState); - int error = luaL_loadstring(_luaState, expr.c_str()) || lua_pcall(_luaState, 0, LUA_MULTRET, 0); - if (error) { - std::string errMsg = lua_tostring(_luaState, -1); - lua_pop(_luaState, 1); /* pop error message from the stack */ - ERROR_EXECUTION_THROW(errMsg); - } - int postStack = lua_gettop(_luaState); - return postStack - preStack; -} - bool LuaDataModel::isDeclared(const std::string& expr) { // see: http://lua-users.org/wiki/DetectingUndefinedVariables return true; } -void LuaDataModel::assign(const Arabica::DOM::Element<std::string>& assignElem, - const Arabica::DOM::Node<std::string>& node, - const std::string& content) { - std::string key; - if (HAS_ATTR(assignElem, "id")) { - key = ATTR(assignElem, "id"); - } else if (HAS_ATTR(assignElem, "location")) { - key = ATTR(assignElem, "location"); - } - if (key.length() == 0) { + +void LuaDataModel::assign(const std::string& location, const Data& data) { + if (location.length() == 0) { ERROR_EXECUTION_THROW("Assign element has neither id nor location"); } // flags on attribute are ignored? - if (key.compare("_sessionid") == 0) // test 322 + if (location.compare("_sessionid") == 0) // test 322 ERROR_EXECUTION_THROW("Cannot assign to _sessionId"); - if (key.compare("_name") == 0) + if (location.compare("_name") == 0) ERROR_EXECUTION_THROW("Cannot assign to _name"); - if (key.compare("_ioprocessors") == 0) // test 326 + if (location.compare("_ioprocessors") == 0) // test 326 ERROR_EXECUTION_THROW("Cannot assign to _ioprocessors"); - if (key.compare("_invokers") == 0) + if (location.compare("_invokers") == 0) ERROR_EXECUTION_THROW("Cannot assign to _invokers"); - if (key.compare("_event") == 0) + if (location.compare("_event") == 0) ERROR_EXECUTION_THROW("Cannot assign to _event"); -// lua_pushnil(_luaState); -// lua_setglobal(_luaState, key.c_str()); + if (data.node) { + ERROR_EXECUTION_THROW("Cannot assign xml nodes in lua datamodel"); -// luabridge::setGlobal(_luaState, luabridge::Nil(), key.c_str()); -// luabridge::LuaRef val = luabridge::getGlobal(_luaState, key.c_str()); -// std::cout << val.tostring() << std::endl; + // TODO: DOM is prepared by swig - int retVals = 0; +// return SWIG_JSC_NewPointerObj(_ctx, +// (void*)node, +// SWIG_TypeDynamicCast(SWIGTYPE_p_XERCES_CPP_NAMESPACE__DOMNode, +// SWIG_as_voidptrptr(&node)), +// 0); - if (HAS_ATTR(assignElem, "expr")) { - retVals = luaEval(Arabica::DOM::Element<std::string>(), key + " = " + ATTR(assignElem, "expr") + ";"); - } else if (node) { - ERROR_EXECUTION_THROW("Cannot assign xml nodes in lua datamodel"); - } else if (content.size() > 0) { - try { - eval(Arabica::DOM::Element<std::string>(), key + " = " + content + ";"); - } catch (...) { - eval(Arabica::DOM::Element<std::string>(), key + " = " + "\"" + spaceNormalize(content) + "\";"); - } + +// JSObjectSetProperty(_ctx, JSContextGetGlobalObject(_ctx), JSStringCreateWithUTF8CString(location.c_str()), getNodeAsValue(data.node), 0, &exception); } else { - eval(Arabica::DOM::Element<std::string>(), key + " = " + "nil;"); - } -// val = luabridge::getGlobal(_luaState, key.c_str()); -// std::cout << val.tostring() << std::endl; + // trigger error.execution for undefined locations, test286 test311 + int retVals = luaEval(_luaState, location + " = " + location); + lua_pop(_luaState, retVals); -} + luabridge::LuaRef lua = getDataAsLua(_luaState, data); + luabridge::setGlobal(_luaState, lua, location.c_str()); -void LuaDataModel::assign(const std::string& location, const Data& data) { - luabridge::setGlobal(_luaState, getDataAsLua(_luaState, data), location.c_str()); -} - -void LuaDataModel::init(const Arabica::DOM::Element<std::string>& dataElem, - const Arabica::DOM::Node<std::string>& node, - const std::string& content) { - assign(dataElem, node, content); +// std::cout << Data::toJSON(evalAsData(location)) << std::endl; + } } void LuaDataModel::init(const std::string& location, const Data& data) { + luabridge::setGlobal(_luaState, luabridge::Nil(), location.c_str()); assign(location, data); } -/** - * The boolean expression language consists of the In predicate only. It has the - * form 'In(id)', where id is the id of a state in the enclosing state machine. - * The predicate must return 'true' if and only if that state is in the current - * state configuration. - */ -bool LuaDataModel::evalAsBool(const Arabica::DOM::Element<std::string>& node, const std::string& expr) { +bool LuaDataModel::evalAsBool(const std::string& expr) { // we need the result of the expression on the lua stack -> has to "return"! std::string trimmedExpr = boost::trim_copy(expr); - if (!boost::starts_with(trimmedExpr, "return")) { - trimmedExpr = "return(" + trimmedExpr + ");"; - } - int retVals = luaEval(Arabica::DOM::Element<std::string>(), trimmedExpr); + int retVals = luaEval(_luaState, "return(" + trimmedExpr + ")"); - if (retVals == 1 && lua_isboolean(_luaState, -1)) { + if (retVals == 1) { bool result = lua_toboolean(_luaState, -1); lua_pop(_luaState, 1); return result; } lua_pop(_luaState, retVals); + return false; } +Data LuaDataModel::getAsData(const std::string& content) { + Data data; + std::string trimmedExpr = boost::trim_copy(content); -std::string LuaDataModel::evalAsString(const std::string& expr) { - std::string trimmedExpr = boost::trim_copy(expr); - if (!boost::starts_with(trimmedExpr, "return")) { - trimmedExpr = "return(" + trimmedExpr + ")"; + int retVals = luaEval(_luaState, "__tmp = " + content + "; return __tmp"); + if (retVals == 1) { + data = getLuaAsData(_luaState, luabridge::LuaRef::fromStack(_luaState, -1)); } + lua_pop(_luaState, retVals); - int retVals = luaEval(Arabica::DOM::Element<std::string>(), trimmedExpr); - - if (retVals == 1 && lua_isstring(_luaState, -1)) { - std::string result = lua_tostring(_luaState, -1); - lua_pop(_luaState, 1); - return result; + // escape as a string, this is sometimes the case with <content> + if (data.atom == "nil" && data.type == Data::INTERPRETED) { + int retVals = luaEval(_luaState, "__tmp = '" + content + "'; return __tmp"); + if (retVals == 1) { + data = getLuaAsData(_luaState, luabridge::LuaRef::fromStack(_luaState, -1)); + } + lua_pop(_luaState, retVals); } - lua_pop(_luaState, retVals); - return ""; + + return data; } + std::string LuaDataModel::andExpressions(std::list<std::string> exprs) { std::stringstream exprSS; std::list<std::string>::const_iterator listIter; diff --git a/src/uscxml/plugins/datamodel/lua/LuaDataModel.h b/src/uscxml/plugins/datamodel/lua/LuaDataModel.h index eb23815..4e2fd43 100644 --- a/src/uscxml/plugins/datamodel/lua/LuaDataModel.h +++ b/src/uscxml/plugins/datamodel/lua/LuaDataModel.h @@ -20,20 +20,20 @@ #ifndef LUADATAMODEL_H_113E014C #define LUADATAMODEL_H_113E014C -#include "uscxml/InterpreterInfo.h" #include "uscxml/plugins/DataModel.h" #include <list> -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - extern "C" { #include "lua.h" #include "lualib.h" #include "lauxlib.h" } +#ifdef BUILD_AS_PLUGINS +#include "uscxml/plugins/Plugins.h" +#endif + + namespace uscxml { class Event; class Data; @@ -45,7 +45,9 @@ class LuaDataModel : public DataModelImpl { public: LuaDataModel(); virtual ~LuaDataModel(); - virtual boost::shared_ptr<DataModelImpl> create(InterpreterInfo* interpreter); + virtual std::shared_ptr<DataModelImpl> create(DataModelCallbacks* callbacks); + + virtual void addExtension(DataModelExtension* ext); virtual std::list<std::string> getNames() { std::list<std::string> names; @@ -53,46 +55,31 @@ public: return names; } - virtual void initialize(); - virtual void setEvent(const Event& event); - - virtual bool validate(const std::string& location, const std::string& schema); - virtual bool isLocation(const std::string& expr); virtual bool isValidSyntax(const std::string& expr); + virtual void setEvent(const Event& event); + + // foreach virtual uint32_t getLength(const std::string& expr); virtual void setForeach(const std::string& item, const std::string& array, const std::string& index, uint32_t iteration); - virtual void pushContext(); - virtual void popContext(); - - virtual void assign(const Arabica::DOM::Element<std::string>& assignElem, - const Arabica::DOM::Node<std::string>& node, - const std::string& content); - virtual void assign(const std::string& location, const Data& data); - - virtual void init(const Arabica::DOM::Element<std::string>& dataElem, - const Arabica::DOM::Node<std::string>& node, - const std::string& content); - virtual void init(const std::string& location, const Data& data); + virtual bool evalAsBool(const std::string& expr); + virtual Data evalAsData(const std::string& expr); + virtual Data getAsData(const std::string& content); - virtual Data getStringAsData(const std::string& content); virtual bool isDeclared(const std::string& expr); - virtual void eval(const Arabica::DOM::Element<std::string>& scriptElem, - const std::string& expr); - virtual std::string evalAsString(const std::string& expr); - virtual bool evalAsBool(const Arabica::DOM::Element<std::string>& node, const std::string& expr); + virtual void assign(const std::string& location, const Data& data); + virtual void init(const std::string& location, const Data& data); virtual std::string andExpressions(std::list<std::string>); protected: - virtual int luaEval(const Arabica::DOM::Element<std::string>& scriptElem, - const std::string& expr); + static int luaInFunction(lua_State * l); lua_State* _luaState; }; diff --git a/src/uscxml/plugins/datamodel/lua/bindings.i b/src/uscxml/plugins/datamodel/lua/bindings.i new file mode 100644 index 0000000..24b756b --- /dev/null +++ b/src/uscxml/plugins/datamodel/lua/bindings.i @@ -0,0 +1,38 @@ +#define XERCES_HAS_CPP_NAMESPACE 1 + +%include <std_string.i> + +%module LuaDOM + +%import "uscxml/config.h" +%import "uscxml/Common.h" + +%import "xercesc/util/XercesDefs.hpp" +%import "xercesc/util/Xerces_autoconf_config.hpp" + +%include "../common/bindings/dom/ignore.i" +%include "../common/bindings/dom/defines.i" +%include "../common/bindings/dom/typemaps-general.i" + +// in typemap +%typemap(in) XMLCh * %{ + $1 = Lua2XMLString($input); +%} + +%typemap(freearg) XMLCh * %{ + delete[] $1; +%} + +// out typemap +%typemap(out) XMLCh * %{ + $result = XMLString2Lua($1); +%} + +%include "../common/bindings/dom/dom.i" + +// Operators we do want +// %rename(operator_assignment) operator=; +%rename(operator_equal_to) operator==; +%rename(operator_not_equal_to) operator!=; + +%include "../common/bindings/event.i" diff --git a/src/uscxml/plugins/datamodel/null/NULLDataModel.cpp b/src/uscxml/plugins/datamodel/null/NULLDataModel.cpp index 7211dc5..773a970 100644 --- a/src/uscxml/plugins/datamodel/null/NULLDataModel.cpp +++ b/src/uscxml/plugins/datamodel/null/NULLDataModel.cpp @@ -21,10 +21,7 @@ #include "uscxml/Common.h" #include "NULLDataModel.h" -#include "uscxml/dom/DOMUtils.h" - -#include "uscxml/Message.h" -#include <glog/logging.h> +#include "uscxml/util/DOM.h" #ifdef BUILD_AS_PLUGINS #include <Pluma/Connector.hpp> @@ -43,28 +40,16 @@ bool pluginConnect(pluma::Host& host) { NULLDataModel::NULLDataModel() { } -boost::shared_ptr<DataModelImpl> NULLDataModel::create(InterpreterInfo* interpreter) { - boost::shared_ptr<NULLDataModel> dm = boost::shared_ptr<NULLDataModel>(new NULLDataModel()); - dm->_interpreter = interpreter; +std::shared_ptr<DataModelImpl> NULLDataModel::create(DataModelCallbacks* callbacks) { + std::shared_ptr<NULLDataModel> dm(new NULLDataModel()); + dm->_callbacks = callbacks; return dm; } NULLDataModel::~NULLDataModel() { } -void NULLDataModel::pushContext() { -} - -void NULLDataModel::popContext() { -} - -void NULLDataModel::initialize() { -} - -void NULLDataModel::setEvent(const Event& event) { -} - -Data NULLDataModel::getStringAsData(const std::string& content) { +Data NULLDataModel::getAsData(const std::string& content) { Data data = Data::fromJSON(content); if (data.empty()) { data = Data(content, Data::VERBATIM); @@ -72,39 +57,13 @@ Data NULLDataModel::getStringAsData(const std::string& content) { return data; } -bool NULLDataModel::validate(const std::string& location, const std::string& schema) { - return true; -} - -bool NULLDataModel::isLocation(const std::string& expr) { - return true; -} - -uint32_t NULLDataModel::getLength(const std::string& expr) { - return 0; -} - -void NULLDataModel::setForeach(const std::string& item, - const std::string& array, - const std::string& index, - uint32_t iteration) { -} - -void NULLDataModel::eval(const Arabica::DOM::Element<std::string>& scriptElem, - const std::string& expr) { -} - -bool NULLDataModel::isDeclared(const std::string& expr) { - return true; -} - /** * The boolean expression language consists of the In predicate only. It has the * form 'In(id)', where id is the id of a state in the enclosing state machine. * The predicate must return 'true' if and only if that state is in the current * state configuration. */ -bool NULLDataModel::evalAsBool(const Arabica::DOM::Element<std::string>& node, const std::string& expr) { +bool NULLDataModel::evalAsBool(const xercesc::DOMElement* scriptNode, const std::string& expr) { std::string trimmedExpr = expr; boost::trim(trimmedExpr); if (!boost::istarts_with(trimmedExpr, "in")) @@ -138,7 +97,7 @@ bool NULLDataModel::evalAsBool(const Arabica::DOM::Element<std::string>& node, c stateName = *stateIter; } - if (_interpreter->isInState(stateName)) { + if (_callbacks->isInState(stateName)) { continue; } return false; @@ -146,9 +105,4 @@ bool NULLDataModel::evalAsBool(const Arabica::DOM::Element<std::string>& node, c return true; } -std::string NULLDataModel::evalAsString(const std::string& expr) { - return expr; -} - - }
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/null/NULLDataModel.h b/src/uscxml/plugins/datamodel/null/NULLDataModel.h index f813ae1..c584357 100644 --- a/src/uscxml/plugins/datamodel/null/NULLDataModel.h +++ b/src/uscxml/plugins/datamodel/null/NULLDataModel.h @@ -20,7 +20,6 @@ #ifndef NULLDATAMODEL_H_KN8TWG0V #define NULLDATAMODEL_H_KN8TWG0V -#include "uscxml/InterpreterInfo.h" #include "uscxml/plugins/DataModel.h" #include <list> @@ -39,7 +38,7 @@ class NULLDataModel : public DataModelImpl { public: NULLDataModel(); virtual ~NULLDataModel(); - virtual boost::shared_ptr<DataModelImpl> create(InterpreterInfo* interpreter); + virtual std::shared_ptr<DataModelImpl> create(DataModelCallbacks* callbacks); virtual std::list<std::string> getNames() { std::list<std::string> names; @@ -47,38 +46,64 @@ public: return names; } - virtual void initialize(); - virtual void setEvent(const Event& event); + virtual bool validate(const std::string& location, const std::string& schema) { + return true; + } + virtual bool isValidSyntax(const std::string& expr) { + return true; // overwrite when datamodel supports it + } + virtual void setEvent(const Event& event) {} - virtual bool validate(const std::string& location, const std::string& schema); - virtual bool isLocation(const std::string& expr); + size_t replaceExpressions(std::string& content) { + return 0; + } - virtual uint32_t getLength(const std::string& expr); + // foreach + virtual uint32_t getLength(const std::string& expr) { + return 0; + } virtual void setForeach(const std::string& item, const std::string& array, const std::string& index, - uint32_t iteration); + uint32_t iteration) {} - virtual void pushContext(); - virtual void popContext(); + virtual Data getAsData(const std::string& content); + + virtual Data evalAsData(const std::string& content) { + return getAsData(content); + } + virtual std::string evalAsString(const std::string& expr) { + return expr; + } - virtual void assign(const Arabica::DOM::Element<std::string>& assignElem, - const Arabica::DOM::Node<std::string>& node, + virtual bool evalAsBool(const xercesc::DOMElement* scriptNode, + const std::string& expr); + virtual bool evalAsBool(const std::string& expr) { + return evalAsBool(NULL, expr); + } + + virtual bool isDeclared(const std::string& expr) { + return true; + } + + virtual void assign(const xercesc::DOMElement* assignElem, + const xercesc::DOMNode* node, const std::string& content) {} virtual void assign(const std::string& location, const Data& data) {} - virtual void init(const Arabica::DOM::Element<std::string>& dataElem, - const Arabica::DOM::Node<std::string>& node, + virtual void init(const xercesc::DOMElement* dataElem, + const xercesc::DOMNode* node, const std::string& content) {} virtual void init(const std::string& location, const Data& data) {} - virtual Data getStringAsData(const std::string& content); - virtual bool isDeclared(const std::string& expr); + virtual void setCallbacks(DataModelCallbacks* callbacks) { + _callbacks = callbacks; + } - virtual void eval(const Arabica::DOM::Element<std::string>& scriptElem, - const std::string& expr); - virtual std::string evalAsString(const std::string& expr); - virtual bool evalAsBool(const Arabica::DOM::Element<std::string>& node, const std::string& expr); + virtual void addExtension(DataModelExtension* ext) {} + virtual std::string andExpressions(std::list<std::string>) { + return ""; + } protected: diff --git a/src/uscxml/plugins/datamodel/prolog/swi/SWIConfig.h.in b/src/uscxml/plugins/datamodel/prolog/swi/SWIConfig.h.in deleted file mode 100644 index e3127b0..0000000 --- a/src/uscxml/plugins/datamodel/prolog/swi/SWIConfig.h.in +++ /dev/null @@ -1,4 +0,0 @@ -#cmakedefine SWI_HAS_PL_NIL -#cmakedefine SWI_HAS_PL_DICT -#cmakedefine SWI_HAS_PL_LIST_PAIR -#cmakedefine SWI_REINTERPRET_FOREIGN
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp deleted file mode 100644 index 8b120c8..0000000 --- a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp +++ /dev/null @@ -1,891 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include <boost/algorithm/string.hpp> - -#include "uscxml/Common.h" -#include "uscxml/config.h" -#include "uscxml/util/String.h" -#include "uscxml/URL.h" -#include "SWIDataModel.h" -#include "uscxml/dom/DOMUtils.h" -#include "uscxml/Message.h" -#include <glog/logging.h> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -// these are defined but not exported by swi-prolog 7 -extern "C" { - PL_EXPORT(int) PL_is_dict(term_t t); - PL_EXPORT(int) PL_for_dict(term_t dict, int (*func)(term_t key, term_t value, int last, void *closure), void *closure, int flags); -} -#define RETHROW_PLEX_AS_EVENT \ -catch (PlException plex) { \ - ERROR_EXECUTION_THROW((char*)plex); \ -} \ - -#define PL_MODULE \ -_interpreter.getSessionId().c_str() \ - -#define SET_PL_ENGINE(dm) \ -assert(_swiEngines.find(dm) != _swiEngines.end()); \ -int rc = PL_set_engine(_swiEngines[dm], NULL); \ -assert(rc == PL_ENGINE_SET); \ -_dmPtr = dm; - -namespace uscxml { - -using namespace Arabica::XPath; -using namespace Arabica::DOM; - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new SWIDataModelProvider() ); - return true; -} -#endif - -// SWI prolog does not support passing user data -static SWIDataModel* _dmPtr; -static std::map<SWIDataModel*, PL_engine_t> _swiEngines; - -PL_blob_t SWIDataModel::blobType = { - PL_BLOB_MAGIC, - PL_BLOB_NOCOPY, - (char*)"blob", - releaseBlob, - compareBlob, - writeBlob, - acquireBlob -}; - -SWIDataModel::SWIDataModel() { -} - -SWIDataModel::~SWIDataModel() { - try { - if (_swiEngines.find(this) != _swiEngines.end()) { - PL_destroy_engine(_swiEngines[this]); - _swiEngines.erase(this); - } - } - RETHROW_PLEX_AS_EVENT; -} - -boost::shared_ptr<DataModelImpl> SWIDataModel::create(InterpreterInfo* interpreter) { - try { - boost::shared_ptr<SWIDataModel> dm = boost::shared_ptr<SWIDataModel>(new SWIDataModel()); - dm->_interpreter = interpreter; - - const char* swibin = getenv("SWI_BINARY"); - if (swibin == NULL) - swibin = SWI_BINARY; - const char* quiet = "--quiet"; - - int argc = 2; - static char * av[] = { - (char*)swibin, - (char*)quiet, - NULL - }; - - if (!PL_is_initialised(NULL, NULL)) { - if(!PL_initialise(argc,av)) { - LOG(ERROR) << "Error intializing prolog engine"; - PL_halt(1); - return boost::shared_ptr<DataModelImpl>(); - } - - PL_set_engine(PL_ENGINE_CURRENT, &_engine); - - // load SWI XML parser - try { - PlCall("use_module", PlCompound("library", PlTerm("sgml"))); - } catch (PlException plex) { - - LOG(ERROR) << "Cannot load prolog sgml module - make sure you have it installed in your prolog runtime: " << (char*)plex; - throw plex; - } - - // load json parser - try { - PlCall("use_module", PlCompound("library", PlTerm("http/json"))); - PlCall("use_module", PlCompound("library", PlTerm("http/json_convert"))); - } catch (PlException plex) { - LOG(ERROR) << "Cannot load prolog json module or json_convert - make sure you have it installed in your prolog runtime: " << (char*)plex; - throw plex; - } - - } else { - LOG(WARNING) << "Instantiating more than one SWI prolog datamodel will lead to weird effects as I cannot seperate the environments"; -// engine = PL_create_engine(NULL); - } - -// assert(engine); -// _swiEngines[dm.get()] = engine; - _dmPtr = dm.get(); - -// int rc = PL_set_engine(engine, NULL); -// assert(rc == PL_ENGINE_SET); -// (void)rc; - - _plModule = boost::replace_all_copy(interpreter->getSessionId(), "-", ""); - boost::replace_all(_plModule, "0", "g"); - boost::replace_all(_plModule, "1", "h"); - boost::replace_all(_plModule, "2", "i"); - boost::replace_all(_plModule, "3", "j"); - boost::replace_all(_plModule, "4", "k"); - boost::replace_all(_plModule, "5", "l"); - boost::replace_all(_plModule, "6", "m"); - boost::replace_all(_plModule, "7", "n"); - boost::replace_all(_plModule, "8", "o"); - boost::replace_all(_plModule, "9", "p"); - - // use atoms for double quoted - PlCall("set_prolog_flag(double_quotes,atom)."); - - // set system variables - PlCall("assert", PlCompound("sessionid", PlTerm(PlString(dm->_interpreter->getSessionId().c_str())))); - PlCall("assert", PlCompound("name", PlTerm(PlString(dm->_interpreter->getName().c_str())))); - - std::map<std::string, IOProcessor>::const_iterator ioProcIter = dm->_interpreter->getIOProcessors().begin(); - while(ioProcIter != dm->_interpreter->getIOProcessors().end()) { - Data ioProcData = ioProcIter->second.getDataModelVariables(); - - if (ioProcIter->first.find_first_of(":/'") == std::string::npos) { - std::stringstream ioProcShortCall; - ioProcShortCall << "assert(ioprocessors(" << ioProcIter->first << "(location('" << ioProcData.compound["location"].atom << "'))))"; - PlCall(ioProcShortCall.str().c_str()); - } - std::stringstream ioProcCall; - ioProcCall << "assert(ioprocessors(name('" << ioProcIter->first << "'), location('" << ioProcData.compound["location"].atom << "')))"; - PlCall(ioProcCall.str().c_str()); - - ioProcIter++; - } - - // the in predicate - PlRegister("user", "in", 1, SWIDataModel::inPredicate); - PL_set_engine(NULL, NULL); - return dm; - } - RETHROW_PLEX_AS_EVENT; -} - -foreign_t SWIDataModel::inPredicate(term_t a0, int arity, void* context) { - try { - char *s; - if ( PL_get_atom_chars(a0, &s) ) { - if (_dmPtr->_interpreter->isInState(s)) { - return true; - } - } - return FALSE; - } - RETHROW_PLEX_AS_EVENT; -} - -void SWIDataModel::registerIOProcessor(const std::string& name, const IOProcessor& ioprocessor) { -// std::cout << "SWIDataModel::registerIOProcessor" << std::endl; -} - -void SWIDataModel::setSessionId(const std::string& sessionId) { -// std::cout << "SWIDataModel::setSessionId" << std::endl; - _sessionId = sessionId; -} - -void SWIDataModel::setName(const std::string& name) { -// std::cout << "SWIDataModel::setName" << std::endl; - _name = name; -} - -void SWIDataModel::pushContext() { -// std::cout << "SWIDataModel::pushContext" << std::endl; -} - -void SWIDataModel::popContext() { -// std::cout << "SWIDataModel::popContext" << std::endl; -} - -void SWIDataModel::initialize() { -// std::cout << "SWIDataModel::initialize" << std::endl; -} - -void SWIDataModel::setEvent(const Event& event) { - SWIEngineLock engineLock; - - // remove old event - try { - PlCall("retractall(event(_))"); - - // simple values - PlCall("assert", PlCompound("event", PlCompound("name", PlTerm(event.name.c_str())))); - PlCall("assert", PlCompound("event", PlCompound("origin", PlString(event.origin.c_str())))); - PlCall("assert", PlCompound("event", PlCompound("origintype", PlString(event.invokeid.c_str())))); - PlCall("assert", PlCompound("event", PlCompound("invokeid", PlTerm(event.origintype.c_str())))); - PlCall("assert", PlCompound("event", PlCompound("raw", PlString(event.raw.c_str())))); - - // event.type - std::string type; - switch (event.eventType) { - case Event::PLATFORM: - type = "platform"; - break; - case Event::INTERNAL: - type = "internal"; - break; - case Event::EXTERNAL: - type = "external"; - break; - } - PlCall("assert", PlCompound("event", PlCompound("type", PlTerm(type.c_str())))); - - // event.sendid - if (!event.hideSendId) - PlCall("assert", PlCompound("event", PlCompound("sendid", PlTerm(event.sendid.c_str())))); - - // event.data - URL domUrl; - if (event.dom) { - std::stringstream dataInitStr; - std::stringstream xmlDoc; -// xmlDoc << event.getFirstDOMElement(); - xmlDoc << event.dom; - domUrl = URL::toLocalFile(xmlDoc.str(), ".pl"); - dataInitStr << "load_xml_file('" << domUrl.asLocalFile(".pl") << "', XML), copy_term(XML,DATA), assert(event(data(DATA)))"; - PlCall(dataInitStr.str().c_str()); - } else if (event.content.size() > 0) { - PlCall("assert", PlCompound("event", PlCompound("data", PlString(spaceNormalize(event.content).c_str())))); - } else if (!event.data.empty()) { - assertFromData(event.data, "event(data(", 2); - } - - Event::params_t::const_iterator paramIter = event.params.begin(); - while(paramIter != event.params.end()) { - assertFromData(paramIter->second, "event(param(" + paramIter->first + "(", 3); - paramIter++; - } - - Event::namelist_t::const_iterator namelistIter = event.namelist.begin(); - while(namelistIter != event.namelist.end()) { - assertFromData(paramIter->second, "event(param(" + namelistIter->first + "(", 3); - namelistIter++; - } - -#if 0 - // event.params - size_t uniqueKeys = 0; - Event::params_t::const_iterator paramIter = event.params.begin(); - while(paramIter != event.params.end()) { - uniqueKeys++; - paramIter = event.params.upper_bound(paramIter->first); - } - if (uniqueKeys > 0) { - paramIter = event.params.begin(); - for(int i = 0; paramIter != event.params.end(); i++) { - std::stringstream paramArray; - Event::params_t::const_iterator lastValueIter = event.params.upper_bound(paramIter->first); - - paramArray << paramIter->first << "(["; - std::string termSep = ""; - - for (size_t j = 0; paramIter != lastValueIter; j++) { - paramArray << termSep << "'" << paramIter->second << "'"; - termSep = ", "; - paramIter++; - } - paramArray << "])"; - std::stringstream paramExpr; - paramExpr << "assert(event(param(" << paramArray.str() << ")))"; - //std::cout << paramExpr.str() << std::endl; - PlCall(paramExpr.str().c_str()); - - paramIter = lastValueIter; - } - } -#endif - } - RETHROW_PLEX_AS_EVENT; -} - -void SWIDataModel::assertFromData(const Data& data, const std::string& expr, size_t nesting) { - if (data.atom.size() > 0) { - // terminal branch, this is where we assert - - std::stringstream ss; - ss << expr; -// nesting++; - - if (data.type == Data::VERBATIM) { - ss << "\"" << data.atom << "\""; - } else { - ss << data.atom; - } - - for (size_t i = 0; i < nesting; i++) { - ss << ")"; - } - -// std::cout << ss.str() << std::endl; - PlCall("assert", PlCompound(ss.str().c_str())); - return; - } - - if (data.compound.size() > 0) { - std::map<std::string, Data>::const_iterator compIter = data.compound.begin(); - while(compIter != data.compound.end()) { -// std::cout << compIter->first << std::endl; - std::stringstream prefix; - size_t prefixNesting = 0; - size_t oldPos = 0; - size_t pos = 0; - while((pos = compIter->first.find_first_of(",.(-", oldPos)) != std::string::npos) { - prefix << compIter->first.substr(oldPos, pos - oldPos) << "("; - prefixNesting++; - oldPos = pos + 1; - } - if (oldPos != compIter->first.size()) { - prefix << compIter->first.substr(oldPos, compIter->first.size() - oldPos) << "("; - prefixNesting++; - } - assertFromData(compIter->second, expr + prefix.str(), nesting + prefixNesting); - compIter++; - } - } - - if (data.array.size() > 0) { - std::list<Data>::const_iterator arrIter = data.array.begin(); - while(arrIter != data.array.end()) { - assertFromData(*arrIter, expr, nesting); - arrIter++; - } - } - - if (data.node) { - std::stringstream dataInitStr; - std::stringstream xmlDoc; - - xmlDoc << data.node; - URL domUrl = URL::toLocalFile(xmlDoc.str(), ".pl"); - dataInitStr << "load_xml_file('" << domUrl.asLocalFile(".pl") << "', XML), "; - dataInitStr << "copy_term(XML,DATA), "; - dataInitStr << "assert("; - dataInitStr << expr << "(DATA)"; - - for (size_t i = 0; i < nesting; i++) { - dataInitStr << ")"; - } - - PlCall(dataInitStr.str().c_str()); - return; - } -} - -#if 0 -std::list<PlCompound> SWIDataModel::getSolutions(PlCompound compound) { - std::list<PlCompound> solutions; - - PlTermv termv(compound.arity()); - for (size_t i = 0; i < compound.arity(); i++) { - termv[i] = compound[i + 1]; - } - PlQuery query(compound.name(), termv); - while(query.next_solution()) { -// std::cout << (char*)compound << std::endl; - solutions.push_back(compound); - } - return solutions; -} -#endif - -Data SWIDataModel::getStringAsData(const std::string& content) { - SWIEngineLock engineLock; - try { - PlCompound compound(content.c_str()); - PlCompound orig(content.c_str()); - Data data; - - PlTermv termv(compound.arity()); - for (size_t i = 0; i < compound.arity(); i++) { - termv[i] = compound[i + 1]; - } - PlQuery query(compound.name(), termv); - - while(query.next_solution()) { - std::map<std::string, PlTerm> vars = resolveAtoms(compound, orig); - std::map<std::string, PlTerm>::const_iterator varIter = vars.begin(); - - while(varIter != vars.end()) { - data.merge(termAsData(varIter->second)); - varIter++; - } - - } -// std::cout << Data::toJSON(data) << std::endl; - return data; - } catch (PlException plex) { - try { - // could not parse as compound, try term and type in termAsData - PlTerm term(content.c_str()); - return(termAsData(term)); - } - RETHROW_PLEX_AS_EVENT - } - return Data(); -} - -Data SWIDataModel::termAsData(PlTerm term) { - - Data data; -// std::cout << term.name() << (char*)term << std::endl; - - switch (term.type()) { - case PL_TERM: - for (size_t i = 1; i <= term.arity(); i++) { // arguments start at 1 - data.compound[term.name()] = termAsData(term[i]); - } - break; - case PL_VARIABLE: - case PL_INTEGER: - case PL_FLOAT: - case PL_SHORT: - case PL_INT: - case PL_LONG: - case PL_DOUBLE: - data.atom = std::string(term); - data.type = Data::INTERPRETED; - break; - case PL_STRING: - case PL_ATOM: - data.atom = std::string(term); - data.type = Data::VERBATIM; - break; -#ifdef SWI_HAS_PL_NIL - case PL_NIL: - data.array.push_back(Data("", Data::VERBATIM)); - break; -#endif -#ifdef SWI_HAS_PL_LIST_PAIR - case PL_LIST_PAIR: { - PlTail tail(term); - PlTerm item; - while(tail.next(item)) { - data.array.push_back(termAsData(item)); - } - break; - } -#endif -#ifdef SWI_HAS_DICT - case PL_DICT: { - std::string key(term); - size_t curlyPos = key.find_first_of("{"); - if (curlyPos == std::string::npos || curlyPos == 0) { - // no key given - PL_for_dict(term, SWIDataModel::dictCallBack, &data, 0); - } else { - // with key given - Data& tmp = data.compound[boost::trim_copy(key.substr(0, curlyPos))]; - PL_for_dict(term, SWIDataModel::dictCallBack, &tmp, 0); - } - break; - } -#endif - default: - LOG(ERROR) << "Prolog type " << term.type() << " at '" << (char*)term << "' not supported"; - break; - } - return data; -} - -int SWIDataModel::dictCallBack(term_t key, term_t value, int last, void *closure) { - Data* data = (Data*)closure; - PlTerm keyTerm(key); - data->compound[(char*)keyTerm] = termAsData(value); - return 0; -} - -PlTerm SWIDataModel::dataAsTerm(Data data) { - if (data.atom.length() > 0) { - return PlTerm(data.atom.c_str()); - } - if (data.array.size() > 0) { - PlTerm head; - PlTail list(head); - - std::list<Data>::const_iterator arrIter = data.array.begin(); - while(arrIter != data.array.end()) { - list.append(dataAsTerm(*arrIter)); - arrIter++; - } - list.close(); - return PlTail(head); - } - if (data.compound.size() > 0) { - if (data.compound.size() == 1 && data.compound.begin()->second.array.size() > 0) { - // this used to be a prolog compound - const Data& arr = data.compound.begin()->second; - PlTermv termv(arr.array.size()); - int index = 0; - - std::list<Data>::const_iterator arrIter = arr.array.begin(); - while(arrIter != arr.array.end()) { - termv[index] = dataAsTerm(*arrIter); - index++; - arrIter++; - } - return PlCompound(data.compound.begin()->first.c_str(), termv); - } else if (data.compound.size() == 1 && data.compound.begin()->second.compound.size() > 0) { - // this used to be a named dict - until we have dict support in C/C++ use PL_chars_to_term - std::stringstream dictSS; - std::string seperator; - dictSS << data.compound.begin()->first << "{"; - - std::map<std::string, Data>::const_iterator keyIter = data.compound.begin()->second.compound.begin(); - while(keyIter != data.compound.begin()->second.compound.end()) { - dictSS << seperator << keyIter->first << ":" << (char*)dataAsTerm(keyIter->second); - seperator = ","; - keyIter++; - } - dictSS << "}"; - return PlCompound(dictSS.str().c_str()); - - } else { - // an array of dicts - PlTermv termv(data.compound.size()); - int index = 0; - - std::map<std::string, Data>::const_iterator compIter = data.compound.begin(); - while(compIter != data.compound.end()) { - termv[index] = PlCompound(compIter->first.c_str(), dataAsTerm(compIter->second)); - index++; - compIter++; - } - return PlCompound(data.compound.begin()->first.c_str(), termv); - - } - } - if (data.binary) { - LOG(ERROR) << "Binary data with prolog datamodel still very experimental"; -// term_t binTerm = PL_new_term_ref(); -// PL_put_blob(binTerm, data.binary->data, data.binary->size, &blobType); -// return binTerm; - } - if (data.node) { - LOG(ERROR) << "DOM in event with prolog datamodel still very experimental"; - std::stringstream dataInitStr; - std::stringstream xmlDoc; - // xmlDoc << event.getFirstDOMElement(); - xmlDoc << data.node; - URL domUrl = URL::toLocalFile(xmlDoc.str(), ".pl"); - dataInitStr << "load_xml_file('" << domUrl.asLocalFile(".pl") << "', XML), copy_term(XML,DATA), assert(event(data(DATA)))"; - PlCall(dataInitStr.str().c_str()); - } - - return PlTerm(); -} - -bool SWIDataModel::validate(const std::string& location, const std::string& schema) { - SWIEngineLock engineLock; -// std::cout << "SWIDataModel::validate" << std::endl; - return true; -} - -bool SWIDataModel::isLocation(const std::string& expr) { - return true; -} - -uint32_t SWIDataModel::getLength(const std::string& expr) { - SWIEngineLock engineLock; - try { - PlCompound compound(expr.c_str()); - PlTermv termv(compound.arity()); - for (size_t i = 0; i < compound.arity(); i++) { - termv[i] = compound[i + 1]; - } - PlQuery query(compound.name(), termv); - uint32_t length = 0; - while(query.next_solution() > 0) - length++; - return length; - } - RETHROW_PLEX_AS_EVENT; -} - -void SWIDataModel::setForeach(const std::string& item, - const std::string& array, - const std::string& index, - uint32_t iteration) { - SWIEngineLock engineLock; - try { - PlCompound compound(array.c_str()); - PlCompound orig(array.c_str()); - PlTermv termv(compound.arity()); - for (size_t i = 0; i < compound.arity(); i++) { - termv[i] = compound[i + 1]; - } - { - int tmp = iteration + 1; - PlQuery query(compound.name(), termv); - while (tmp) { - query.next_solution(); - tmp--; - } - } - PlCall("retractall", PlCompound(index.c_str(), 1)); - PlCall("retractall", PlCompound(item.c_str(), 1)); - PlCall("assert", PlCompound(index.c_str(), PlTerm((long)iteration))); - - std::map<std::string, PlTerm> vars = resolveAtoms(compound, orig); - std::map<std::string, PlTerm>::iterator varIter = vars.begin(); - while(varIter != vars.end()) { - PlCall("assert", PlCompound(item.c_str(), varIter->second)); - varIter++; - } - } - RETHROW_PLEX_AS_EVENT; -} - -void SWIDataModel::eval(const Element<std::string>& scriptElem, const std::string& expr) { - SWIEngineLock engineLock; - try { - if (scriptElem && HAS_ATTR(scriptElem, "type") && iequals(ATTR(scriptElem, "type"), "query")) { - evalAsBool(expr); - } else { - URL localPLFile = URL::toLocalFile(expr, ".pl"); - PlCall("user", "load_files", PlTermv(localPLFile.asLocalFile(".pl").c_str())) || LOG(ERROR) << "Could not execute prolog from file"; - } - } - RETHROW_PLEX_AS_EVENT; -} - -bool SWIDataModel::evalAsBool(const std::string& expr) { - return evalAsBool(Arabica::DOM::Element<std::string>(), expr); -} - -bool SWIDataModel::evalAsBool(const Arabica::DOM::Element<std::string>& node, const std::string& expr) { - SWIEngineLock engineLock; - try { - PlCompound compound(expr.c_str()); - PlTermv termv(compound.arity()); - for (size_t i = 0; i < compound.arity(); i++) { - termv[i] = compound[i + 1]; - } - PlQuery query(compound.name(), termv); - return query.next_solution() > 0; - } - RETHROW_PLEX_AS_EVENT - catch(...) { - return false; - } -} - -std::string SWIDataModel::evalAsString(const std::string& expr) { - SWIEngineLock engineLock; - try { - - PlCompound compound(expr.c_str()); - - if (strlen(compound.name())) { - PlCompound orig(expr.c_str()); - - PlTermv termv(compound.arity()); - for (size_t i = 0; i < compound.arity(); i++) { - termv[i] = compound[i + 1]; - } - PlQuery query(compound.name(), termv); - - std::stringstream ss; - std::string solSeparator = ""; - while (query.next_solution()) { - ss << solSeparator; - std::map<std::string, PlTerm> vars = resolveAtoms(compound, orig); - std::map<std::string, PlTerm>::const_iterator varIter = vars.begin(); - - std::string varSeparator = ""; - while(varIter != vars.end()) { - ss << varSeparator << (char *)varIter->second; - varSeparator = ", "; - varIter++; - } - solSeparator = "\n"; - } - return ss.str(); - } - return std::string(compound); - - } catch(PlException plex) { - // we got an exception while trying to evaluate as compound - PlTerm term(expr.c_str()); - if (term.type() == PL_ATOM || term.type() == PL_CHARS || term.type() == PL_STRING) { - return std::string(term); - } else { - ERROR_EXECUTION_THROW((char*)plex); - } - } -} - - -// this is similar to http://etalis.googlecode.com/svn/eEtalis/src/term.c -std::map<std::string, PlTerm> SWIDataModel::resolveAtoms(PlTerm& term, PlTerm& orig) { - try { - std::map<std::string, PlTerm> atoms; - switch (orig.type()) { - case PL_VARIABLE: { - atoms[(char *)orig] = term; - break; - } - case PL_ATOM: - break; - case PL_STRING: - break; - case PL_INTEGER: - break; - case PL_TERM: - for (size_t i = 1; i <= orig.arity(); i++) { - PlTerm newTerm = term[i]; - PlTerm newOrig = orig[i]; - std::map<std::string, PlTerm> result = resolveAtoms(newTerm, newOrig); - atoms.insert(result.begin(), result.end()); - } - break; - default: - LOG(ERROR) << "Resolving variable of unknown type in query solution"; - } - return atoms; - } - RETHROW_PLEX_AS_EVENT -} - -void SWIDataModel::assign(const Element<std::string>& assignElem, - const Node<std::string>& node, - const std::string& content) { - SWIEngineLock engineLock; - try { - std::string expr = content; - std::string predicate; - if (HAS_ATTR(assignElem, "expr")) { - expr = ATTR(assignElem, "expr"); - } - if (HAS_ATTR(assignElem, "id")) - predicate = ATTR(assignElem, "id"); - if (HAS_ATTR(assignElem, "location")) - predicate = ATTR(assignElem, "location"); - - if (predicate.size() > 0) { - std::string callAssert = "assert"; - std::string type; - if (HAS_ATTR(assignElem, "type")) { - type = ATTR(assignElem, "type"); - if(iequals(type, "append")) { - callAssert = "assertz"; - } else if(iequals(type, "prepend")) { - callAssert = "asserta"; - } - } - - URL domUrl; - Data json; - if (!node) - json = Data::fromJSON(expr); - if (node) { - std::stringstream dataInitStr; - std::stringstream xmlDoc; - Node<std::string> child = node; - while(child) { - xmlDoc << child; - child = child.getNextSibling(); - } - domUrl = URL::toLocalFile(xmlDoc.str(), ".pl"); - if (iequals(type, "retract")) - PlCall("retractall", PlCompound(predicate.c_str(), 1)); - dataInitStr << "load_xml_file('" << domUrl.asLocalFile(".pl") << "', XML), copy_term(XML,DATA), " << callAssert << "(" << predicate << "(DATA))"; - PlCall(dataInitStr.str().c_str()); - } else if (!json.empty()) { - std::stringstream dataInitStr; - if (iequals(type, "retract")) - PlCall("retractall", PlCompound(predicate.c_str(), 1)); - dataInitStr << "json_to_prolog(" << expr << ", JSON), assert(" << predicate << "(JSON))"; - PlCall(dataInitStr.str().c_str()); - } else { - // treat content as . seperated facts - std::stringstream factStream(expr); - std::string item; - while(std::getline(factStream, item, '.')) { - std::string fact = boost::trim_copy(item); - if (fact.length() == 0) - continue; - PlCall((callAssert + "(" + predicate + "(" + fact + "))").c_str()); - } - } - } else if (expr.length() > 0) { - if (boost::equals(TAGNAME(assignElem), "data")) { - eval(assignElem, expr); - } else { - std::stringstream exprStream(expr); - std::string item; - while(std::getline(exprStream, item, '.')) { - std::string plExpr = boost::trim_copy(item); - if (plExpr.length() == 0) - continue; - PlCall(plExpr.c_str()); - } - } - } - } - RETHROW_PLEX_AS_EVENT -} - -void SWIDataModel::assign(const std::string& location, const Data& data) { - eval(Element<std::string>(), data.atom); -} - -void SWIDataModel::init(const Element<std::string>& dataElem, - const Node<std::string>& node, - const std::string& content) { - assign(dataElem, node, content); -} -void SWIDataModel::init(const std::string& location, const Data& data) { - assign(location, data); -} - -bool SWIDataModel::isDeclared(const std::string& expr) { - return true; -} - -void SWIDataModel::acquireBlob(atom_t symbol) { -} - - -int SWIDataModel::releaseBlob(atom_t symbol) { - return TRUE; -} - -int SWIDataModel::compareBlob(atom_t a, atom_t b) { - return 0; -} - -int SWIDataModel::writeBlob(void *s, atom_t symbol, int flags) { - return TRUE; -} - - -} diff --git a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h deleted file mode 100644 index e968b61..0000000 --- a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.h +++ /dev/null @@ -1,137 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef SWIDATAMODEL_H_KN8TWG0V -#define SWIDATAMODEL_H_KN8TWG0V - -#include "uscxml/InterpreterInfo.h" -#include "uscxml/plugins/DataModel.h" -#include "uscxml/SWIConfig.h" - -#include <list> -#include <SWI-cpp.h> - - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class SWIDataModel : public DataModelImpl { -public: - class SWIEngineLock { - public: - SWIEngineLock() { - isLocked = false; - int rc = PL_set_engine(PL_ENGINE_MAIN, NULL); - if (rc == PL_ENGINE_SET) { - isLocked = true; - } - } - ~SWIEngineLock() { - if (isLocked) - PL_set_engine(NULL, NULL); - } - bool isLocked; - }; - - SWIDataModel(); - virtual ~SWIDataModel(); - virtual boost::shared_ptr<DataModelImpl> create(InterpreterInfo* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("prolog"); - return names; - } - - virtual void initialize(); - virtual void setSessionId(const std::string& sessionId); - virtual void setName(const std::string& name); - virtual void setEvent(const Event& event); - - virtual void registerIOProcessor(const std::string& name, const IOProcessor& ioprocessor); - - virtual bool validate(const std::string& location, const std::string& schema); - virtual bool isLocation(const std::string& expr); - - virtual uint32_t getLength(const std::string& expr); - virtual void setForeach(const std::string& item, - const std::string& array, - const std::string& index, - uint32_t iteration); - - virtual void pushContext(); - virtual void popContext(); - - virtual void assign(const Arabica::DOM::Element<std::string>& assignElem, - const Arabica::DOM::Node<std::string>& node, - const std::string& content); - virtual void assign(const std::string& location, const Data& data); - - virtual void init(const Arabica::DOM::Element<std::string>& dataElem, - const Arabica::DOM::Node<std::string>& node, - const std::string& content); - virtual void init(const std::string& location, const Data& data); - - virtual void eval(const Arabica::DOM::Element<std::string>& scriptElem, - const std::string& expr); - - virtual bool isDeclared(const std::string& expr); - - virtual Data getStringAsData(const std::string& content); - - virtual std::string evalAsString(const std::string& expr); - virtual bool evalAsBool(const Arabica::DOM::Element<std::string>& node, const std::string& expr); - virtual bool evalAsBool(const std::string& expr); - - static foreign_t inPredicate(term_t a0, int arity, void* context); -protected: - void assertFromData(const Data& data, const std::string& expr, size_t nesting); - - static Data termAsData(PlTerm term); - static PlTerm dataAsTerm(Data data); - -// virtual std::list<PlCompound> getSolutions(PlCompound compound); - virtual std::map<std::string, PlTerm> resolveAtoms(PlTerm& term, PlTerm& orig); - - static int dictCallBack(term_t key, term_t value, int last, void *closure); - - static PL_blob_t blobType; - static void acquireBlob(atom_t symbol); - static int releaseBlob(atom_t symbol); - static int compareBlob(atom_t a, atom_t b); - static int writeBlob(void *s, atom_t symbol, int flags); - - Event _event; - - std::string _plModule; - std::string _name; - std::string _sessionId; - PL_engine_t _engine; -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(SWIDataModel, DataModelImpl); -#endif - -} - -#endif /* end of include guard: SWIDATAMODEL_H_KN8TWG0V */ diff --git a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.new b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.new deleted file mode 100644 index 8238577..0000000 --- a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.new +++ /dev/null @@ -1,962 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include <boost/algorithm/string.hpp> - -#include "uscxml/Common.h" -#include "uscxml/config.h" -#include "SWIDataModel.h" -#include "uscxml/DOMUtils.h" -#include "uscxml/Message.h" -#include <glog/logging.h> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -// these are defined but not exported by swi-prolog 7 -extern "C" { - PL_EXPORT(int) PL_is_dict(term_t t); - PL_EXPORT(int) PL_for_dict(term_t dict, int (*func)(term_t key, term_t value, int last, void *closure), void *closure, int flags); -} -#define RETHROW_PLEX_AS_EVENT \ -catch (PlException plex) { \ - ERROR_EXECUTION_THROW((char*)plex); \ -} \ - -#define PL_MODULE \ -_interpreter.getSessionId().c_str() \ - -#define SET_PL_ENGINE(dm) \ -assert(_swiEngines.find(dm) != _swiEngines.end()); \ -int rc = PL_set_engine(_swiEngines[dm], NULL); \ -assert(rc == PL_ENGINE_SET); \ -_dmPtr = dm; - -namespace uscxml { - -using namespace Arabica::XPath; -using namespace Arabica::DOM; - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new SWIDataModelProvider() ); - return true; -} -#endif - -// SWI prolog does not support passing user data -static SWIDataModel* _dmPtr; -static std::map<SWIDataModel*, PL_engine_t> _swiEngines; - -PL_blob_t SWIDataModel::blobType = { - PL_BLOB_MAGIC, - PL_BLOB_NOCOPY, - (char*)"blob", - releaseBlob, - compareBlob, - writeBlob, - acquireBlob -}; - -SWIDataModel::SWIDataModel() { -} - -SWIDataModel::~SWIDataModel() { - try { - if (_swiEngines.find(this) != _swiEngines.end()) { - PL_destroy_engine(_swiEngines[this]); - _swiEngines.erase(this); - } - } - RETHROW_PLEX_AS_EVENT; -} - -boost::shared_ptr<DataModelImpl> SWIDataModel::create(InterpreterImpl* interpreter) { - try { - boost::shared_ptr<SWIDataModel> dm = boost::shared_ptr<SWIDataModel>(new SWIDataModel()); - dm->_interpreter = interpreter; - - const char* swibin = getenv("SWI_BINARY"); - if (swibin == NULL) - swibin = SWI_BINARY; - const char* quiet = "--quiet"; - - int argc = 2; - static char * av[] = { - (char*)swibin, - (char*)quiet, - NULL - }; - - if (!PL_is_initialised(NULL, NULL)) { - if(!PL_initialise(argc,av)) { - LOG(ERROR) << "Error intializing prolog engine"; - PL_halt(1); - return boost::shared_ptr<DataModelImpl>(); - } - - PL_set_engine(PL_ENGINE_CURRENT, &_engine); - - // load SWI XML parser - try { - PlCall("use_module", PlCompound("library", PlTerm("sgml"))); - } catch (PlException plex) { - - LOG(ERROR) << "Cannot load prolog sgml module - make sure you have it installed in your prolog runtime: " << (char*)plex; - throw plex; - } - - // load json parser - try { - PlCall("use_module", PlCompound("library", PlTerm("http/json"))); - PlCall("use_module", PlCompound("library", PlTerm("http/json_convert"))); - } catch (PlException plex) { - LOG(ERROR) << "Cannot load prolog json module or json_convert - make sure you have it installed in your prolog runtime: " << (char*)plex; - throw plex; - } - - } else { - LOG(WARNING) << "Instantiating more than one SWI prolog datamodel will lead to weird effects as I cannot seperate the environments"; -// engine = PL_create_engine(NULL); - } - -// assert(engine); -// _swiEngines[dm.get()] = engine; - _dmPtr = dm.get(); - -// int rc = PL_set_engine(engine, NULL); -// assert(rc == PL_ENGINE_SET); -// (void)rc; - - _plModule = boost::replace_all_copy(interpreter->getSessionId(), "-", ""); - boost::replace_all(_plModule, "0", "g"); - boost::replace_all(_plModule, "1", "h"); - boost::replace_all(_plModule, "2", "i"); - boost::replace_all(_plModule, "3", "j"); - boost::replace_all(_plModule, "4", "k"); - boost::replace_all(_plModule, "5", "l"); - boost::replace_all(_plModule, "6", "m"); - boost::replace_all(_plModule, "7", "n"); - boost::replace_all(_plModule, "8", "o"); - boost::replace_all(_plModule, "9", "p"); - - // use atoms for double quoted - PlCall("set_prolog_flag(double_quotes,atom)."); - - // set system variables - PlCall("assert", PlCompound("sessionid", PlTerm(PlString(dm->_interpreter->getSessionId().c_str())))); - PlCall("assert", PlCompound("name", PlTerm(PlString(dm->_interpreter->getName().c_str())))); - - std::map<std::string, IOProcessor>::const_iterator ioProcIter = dm->_interpreter->getIOProcessors().begin(); - while(ioProcIter != dm->_interpreter->getIOProcessors().end()) { - Data ioProcData = ioProcIter->second.getDataModelVariables(); - - if (ioProcIter->first.find_first_of(":/'") == std::string::npos) { - std::stringstream ioProcShortCall; - ioProcShortCall << "assert(ioprocessors(" << ioProcIter->first << "(location('" << ioProcData.compound["location"].atom << "'))))"; - PlCall(ioProcShortCall.str().c_str()); - } - std::stringstream ioProcCall; - ioProcCall << "assert(ioprocessors(name('" << ioProcIter->first << "'), location('" << ioProcData.compound["location"].atom << "')))"; - PlCall(ioProcCall.str().c_str()); - - ioProcIter++; - } - - // the in predicate - PlRegister("user", "in", 1, SWIDataModel::inPredicate); - PL_set_engine(NULL, NULL); - return dm; - } - RETHROW_PLEX_AS_EVENT; -} - -foreign_t SWIDataModel::inPredicate(term_t a0, int arity, void* context) { - try { - char *s; - if ( PL_get_atom_chars(a0, &s) ) { - if (_dmPtr->_interpreter->isInState(s)) { - return true; - } - } - return FALSE; - } - RETHROW_PLEX_AS_EVENT; -} - -void SWIDataModel::registerIOProcessor(const std::string& name, const IOProcessor& ioprocessor) { -// std::cout << "SWIDataModel::registerIOProcessor" << std::endl; -} - -void SWIDataModel::setSessionId(const std::string& sessionId) { -// std::cout << "SWIDataModel::setSessionId" << std::endl; - _sessionId = sessionId; -} - -void SWIDataModel::setName(const std::string& name) { -// std::cout << "SWIDataModel::setName" << std::endl; - _name = name; -} - -void SWIDataModel::pushContext() { -// std::cout << "SWIDataModel::pushContext" << std::endl; -} - -void SWIDataModel::popContext() { -// std::cout << "SWIDataModel::popContext" << std::endl; -} - -void SWIDataModel::initialize() { -// std::cout << "SWIDataModel::initialize" << std::endl; -} - -void SWIDataModel::setEvent(const Event& event) { - SWIEngineLock engineLock; - - // remove old event - try { - PlCall("retractall(event(_))"); - - // simple values - PlCall("assert", PlCompound("event", PlCompound("name", PlTerm(event.name.c_str())))); - PlCall("assert", PlCompound("event", PlCompound("origin", PlString(event.origin.c_str())))); - PlCall("assert", PlCompound("event", PlCompound("origintype", PlString(event.invokeid.c_str())))); - PlCall("assert", PlCompound("event", PlCompound("invokeid", PlTerm(event.origintype.c_str())))); - PlCall("assert", PlCompound("event", PlCompound("raw", PlString(event.raw.c_str())))); - - // event.type - std::string type; - switch (event.eventType) { - case Event::PLATFORM: - type = "platform"; - break; - case Event::INTERNAL: - type = "internal"; - break; - case Event::EXTERNAL: - type = "external"; - break; - } - PlCall("assert", PlCompound("event", PlCompound("type", PlTerm(type.c_str())))); - - // event.sendid - if (!event.hideSendId) - PlCall("assert", PlCompound("event", PlCompound("sendid", PlTerm(event.sendid.c_str())))); - - // event.data - URL domUrl; - if (event.dom) { - std::stringstream dataInitStr; - std::stringstream xmlDoc; -// xmlDoc << event.getFirstDOMElement(); - xmlDoc << event.dom; - domUrl = URL::toLocalFile(xmlDoc.str(), ".pl"); - dataInitStr << "load_xml_file('" << domUrl.asLocalFile(".pl") << "', XML), copy_term(XML,DATA), assert(event(data(DATA)))"; - PlCall(dataInitStr.str().c_str()); - } else if (event.content.size() > 0) { - PlCall("assert", PlCompound("event", PlCompound("data", PlString(InterpreterImpl::spaceNormalize(event.content).c_str())))); - } else if (!event.data.empty()) { - assertFromData(event.data, "event(data(", 2); - } - - Event::params_t::const_iterator paramIter = event.params.begin(); - while(paramIter != event.params.end()) { - assertFromData(paramIter->second, "event(param(" + paramIter->first + "(", 3); - paramIter++; - } - - Event::namelist_t::const_iterator namelistIter = event.namelist.begin(); - while(namelistIter != event.namelist.end()) { - assertFromData(paramIter->second, "event(param(" + namelistIter->first + "(", 3); - namelistIter++; - } - -#if 0 - // event.params - size_t uniqueKeys = 0; - Event::params_t::const_iterator paramIter = event.params.begin(); - while(paramIter != event.params.end()) { - uniqueKeys++; - paramIter = event.params.upper_bound(paramIter->first); - } - if (uniqueKeys > 0) { - paramIter = event.params.begin(); - for(int i = 0; paramIter != event.params.end(); i++) { - std::stringstream paramArray; - Event::params_t::const_iterator lastValueIter = event.params.upper_bound(paramIter->first); - - paramArray << paramIter->first << "(["; - std::string termSep = ""; - - for (int j = 0; paramIter != lastValueIter; j++) { - paramArray << termSep << "'" << paramIter->second << "'"; - termSep = ", "; - paramIter++; - } - paramArray << "])"; - std::stringstream paramExpr; - paramExpr << "assert(event(param(" << paramArray.str() << ")))"; - //std::cout << paramExpr.str() << std::endl; - PlCall(paramExpr.str().c_str()); - - paramIter = lastValueIter; - } - } -#endif - } - RETHROW_PLEX_AS_EVENT; -} - -void SWIDataModel::assertFromData(const Data& data, const std::string& expr, size_t nesting) { - if (data.atom.size() > 0) { - // terminal branch, this is where we assert - - std::stringstream ss; - ss << expr; -// nesting++; - - if (data.type == Data::VERBATIM) { - ss << "\"" << data.atom << "\""; - } else { - ss << data.atom; - } - - for (size_t i = 0; i < nesting; i++) { - ss << ")"; - } - -// std::cout << ss.str() << std::endl; - PlCall("assert", PlCompound(ss.str().c_str())); - return; - } - - if (data.compound.size() > 0) { - std::map<std::string, Data>::const_iterator compIter = data.compound.begin(); - while(compIter != data.compound.end()) { -// std::cout << compIter->first << std::endl; - std::stringstream prefix; - size_t prefixNesting = 0; - size_t oldPos = 0; - size_t pos = 0; - while((pos = compIter->first.find_first_of(",.(-", oldPos)) != std::string::npos) { - prefix << compIter->first.substr(oldPos, pos - oldPos) << "("; - prefixNesting++; - oldPos = pos + 1; - } - if (oldPos != compIter->first.size()) { - prefix << compIter->first.substr(oldPos, compIter->first.size() - oldPos) << "("; - prefixNesting++; - } - assertFromData(compIter->second, expr + prefix.str(), nesting + prefixNesting); - compIter++; - } - } - - if (data.array.size() > 0) { - std::list<Data>::const_iterator arrIter = data.array.begin(); - while(arrIter != data.array.end()) { - assertFromData(*arrIter, expr, nesting); - arrIter++; - } - } - - if (data.node) { - std::stringstream dataInitStr; - std::stringstream xmlDoc; - - xmlDoc << data.node; - URL domUrl = URL::toLocalFile(xmlDoc.str(), ".pl"); - dataInitStr << "load_xml_file('" << domUrl.asLocalFile(".pl") << "', XML), "; - dataInitStr << "copy_term(XML,DATA), "; - dataInitStr << "assert("; - dataInitStr << expr << "(DATA)"; - - for (size_t i = 0; i < nesting; i++) { - dataInitStr << ")"; - } - - PlCall(dataInitStr.str().c_str()); - return; - } -} - -#if 0 -std::list<PlCompound> SWIDataModel::getSolutions(PlCompound compound) { - std::list<PlCompound> solutions; - - PlTermv termv(compound.arity()); - for (int i = 0; i < compound.arity(); i++) { - termv[i] = compound[i + 1]; - } - PlQuery query(compound.name(), termv); - while(query.next_solution()) { -// std::cout << (char*)compound << std::endl; - solutions.push_back(compound); - } - return solutions; -} -#endif - -Data SWIDataModel::getStringAsData(const std::string& content) { - SWIEngineLock engineLock; - try { - PlCompound compound(content.c_str()); - PlCompound orig(content.c_str()); - Data data; - - PlTermv termv(compound.arity()); - for (int i = 0; i < compound.arity(); i++) { - termv[i] = compound[i + 1]; - } - PlQuery query(compound.name(), termv); - - while(query.next_solution()) { - std::map<std::string, PlTerm> vars = resolveAtoms(compound, orig); - std::map<std::string, PlTerm>::const_iterator varIter = vars.begin(); - - while(varIter != vars.end()) { - data.merge(termAsData(varIter->second)); - varIter++; - } - - } -// std::cout << Data::toJSON(data) << std::endl; - return data; - } catch (PlException plex) { - try { - // could not parse as compound, try term and type in termAsData - PlTerm term(content.c_str()); - return(termAsData(term)); - } - RETHROW_PLEX_AS_EVENT - } - return Data(); -} - -Data SWIDataModel::termAsData(PlTerm term) { - - Data data; -// std::cout << term.name() << (char*)term << std::endl; - - switch (term.type()) { - case PL_TERM: - for (int i = 1; i <= term.arity(); i++) { // arguments start at 1 - data.compound[term.name()] = termAsData(term[i]); - } - break; - case PL_VARIABLE: - case PL_INTEGER: - case PL_FLOAT: - case PL_SHORT: - case PL_INT: - case PL_LONG: - case PL_DOUBLE: - data.atom = std::string(term); - data.type = Data::INTERPRETED; - break; - case PL_STRING: - case PL_ATOM: - data.atom = std::string(term); - data.type = Data::VERBATIM; - break; -#ifdef SWI_HAS_PL_NIL - case PL_NIL: - data.array.push_back(Data("", Data::VERBATIM)); - break; -#endif -#ifdef SWI_HAS_PL_LIST_PAIR - case PL_LIST_PAIR: { - PlTail tail(term); - PlTerm item; - while(tail.next(item)) { - data.array.push_back(termAsData(item)); - } - break; - } -#endif -#ifdef SWI_HAS_DICT - case PL_DICT: { - std::string key(term); - size_t curlyPos = key.find_first_of("{"); - if (curlyPos == std::string::npos || curlyPos == 0) { - // no key given - PL_for_dict(term, SWIDataModel::dictCallBack, &data, 0); - } else { - // with key given - Data& tmp = data.compound[boost::trim_copy(key.substr(0, curlyPos))]; - PL_for_dict(term, SWIDataModel::dictCallBack, &tmp, 0); - } - break; - } -#endif - default: - LOG(ERROR) << "Prolog type " << term.type() << " at '" << (char*)term << "' not supported"; - break; - } - return data; -} - -int SWIDataModel::dictCallBack(term_t key, term_t value, int last, void *closure) { - Data* data = (Data*)closure; - PlTerm keyTerm(key); - data->compound[(char*)keyTerm] = termAsData(value); - return 0; -} - -PlTerm SWIDataModel::dataAsTerm(Data data) { - if (data.atom.length() > 0) { - return PlTerm(data.atom.c_str()); - } - if (data.array.size() > 0) { - PlTerm head; - PlTail list(head); - - std::list<Data>::const_iterator arrIter = data.array.begin(); - while(arrIter != data.array.end()) { - list.append(dataAsTerm(*arrIter)); - arrIter++; - } - list.close(); - return PlTail(head); - } - if (data.compound.size() > 0) { - if (data.compound.size() == 1 && data.compound.begin()->second.array.size() > 0) { - // this used to be a prolog compound - const Data& arr = data.compound.begin()->second; - PlTermv termv(arr.array.size()); - int index = 0; - - std::list<Data>::const_iterator arrIter = arr.array.begin(); - while(arrIter != arr.array.end()) { - termv[index] = dataAsTerm(*arrIter); - index++; - arrIter++; - } - return PlCompound(data.compound.begin()->first.c_str(), termv); - } else if (data.compound.size() == 1 && data.compound.begin()->second.compound.size() > 0) { - // this used to be a named dict - until we have dict support in C/C++ use PL_chars_to_term - std::stringstream dictSS; - std::string seperator; - dictSS << data.compound.begin()->first << "{"; - - std::map<std::string, Data>::const_iterator keyIter = data.compound.begin()->second.compound.begin(); - while(keyIter != data.compound.begin()->second.compound.end()) { - dictSS << seperator << keyIter->first << ":" << (char*)dataAsTerm(keyIter->second); - seperator = ","; - keyIter++; - } - dictSS << "}"; - return PlCompound(dictSS.str().c_str()); - - } else { - // an array of dicts - PlTermv termv(data.compound.size()); - int index = 0; - - std::map<std::string, Data>::const_iterator compIter = data.compound.begin(); - while(compIter != data.compound.end()) { - termv[index] = PlCompound(compIter->first.c_str(), dataAsTerm(compIter->second)); - index++; - compIter++; - } - return PlCompound(data.compound.begin()->first.c_str(), termv); - - } - } - if (data.binary) { - LOG(ERROR) << "Binary data with prolog datamodel still very experimental"; -// term_t binTerm = PL_new_term_ref(); -// PL_put_blob(binTerm, data.binary->data, data.binary->size, &blobType); -// return binTerm; - } - if (data.node) { - LOG(ERROR) << "DOM in event with prolog datamodel still very experimental"; - std::stringstream dataInitStr; - std::stringstream xmlDoc; - // xmlDoc << event.getFirstDOMElement(); - xmlDoc << data.node; - URL domUrl = URL::toLocalFile(xmlDoc.str(), ".pl"); - dataInitStr << "load_xml_file('" << domUrl.asLocalFile(".pl") << "', XML), copy_term(XML,DATA), assert(event(data(DATA)))"; - PlCall(dataInitStr.str().c_str()); - } - - return PlTerm(); -} - -bool SWIDataModel::validate(const std::string& location, const std::string& schema) { - SWIEngineLock engineLock; -// std::cout << "SWIDataModel::validate" << std::endl; - return true; -} - -bool SWIDataModel::isLocation(const std::string& expr) { - return true; -} - -uint32_t SWIDataModel::getLength(const std::string& expr) { - SWIEngineLock engineLock; - try { - PlCompound compound(expr.c_str()); - PlTermv termv(compound.arity()); - for (int i = 0; i < compound.arity(); i++) { - termv[i] = compound[i + 1]; - } - PlQuery query(compound.name(), termv); - uint32_t length = 0; - while(query.next_solution() > 0) - length++; - return length; - } - RETHROW_PLEX_AS_EVENT; -} - -void SWIDataModel::setForeach(const std::string& item, - const std::string& array, - const std::string& index, - uint32_t iteration) { - SWIEngineLock engineLock; - try { - PlCompound compound(array.c_str()); - PlCompound orig(array.c_str()); - PlTermv termv(compound.arity()); - for (int i = 0; i < compound.arity(); i++) { - termv[i] = compound[i + 1]; - } - { - int tmp = iteration + 1; - PlQuery query(compound.name(), termv); - while (tmp) { - query.next_solution(); - tmp--; - } - } - PlCall("retractall", PlCompound(index.c_str(), 1)); - PlCall("retractall", PlCompound(item.c_str(), 1)); - PlCall("assert", PlCompound(index.c_str(), PlTerm((long)iteration))); - - std::map<std::string, PlTerm> vars = resolveAtoms(compound, orig); - std::map<std::string, PlTerm>::iterator varIter = vars.begin(); - while(varIter != vars.end()) { - PlCall("assert", PlCompound(item.c_str(), varIter->second)); - varIter++; - } - } - RETHROW_PLEX_AS_EVENT; -} - -void SWIDataModel::eval(const Element<std::string>& scriptElem, const std::string& expr) { - SWIEngineLock engineLock; - try { - if (scriptElem && HAS_ATTR(scriptElem, "type") && iequals(ATTR(scriptElem, "type"), "query")) { - evalAsBool(expr); - } else { - URL localPLFile = URL::toLocalFile(expr, ".pl"); - PlCall("user", "load_files", PlTermv(localPLFile.asLocalFile(".pl").c_str())) || LOG(ERROR) << "Could not execute prolog from file"; - } - } - RETHROW_PLEX_AS_EVENT; -} - -bool SWIDataModel::evalAsBool(const std::string& expr) { - return evalAsBool(Arabica::DOM::Element<std::string>(), expr); -} - -bool SWIDataModel::evalAsBool(const Arabica::DOM::Element<std::string>& node, const std::string& expr) { - SWIEngineLock engineLock; - try { - PlCompound compound(expr.c_str()); - PlTermv termv(compound.arity()); - for (int i = 0; i < compound.arity(); i++) { - termv[i] = compound[i + 1]; - } - PlQuery query(compound.name(), termv); - return query.next_solution() > 0; - } - RETHROW_PLEX_AS_EVENT - catch(...) { - return false; - } -} - -std::string SWIDataModel::evalAsString(const std::string& expr) { - SWIEngineLock engineLock; - try { - - PlCompound compound(expr.c_str()); - - if (strlen(compound.name())) { - PlCompound orig(expr.c_str()); - - PlTermv termv(compound.arity()); - for (int i = 0; i < compound.arity(); i++) { - termv[i] = compound[i + 1]; - } - PlQuery query(compound.name(), termv); - - std::stringstream ss; - std::string solSeparator = ""; - while (query.next_solution()) { - ss << solSeparator; - std::map<std::string, PlTerm> vars = resolveAtoms(compound, orig); - std::map<std::string, PlTerm>::const_iterator varIter = vars.begin(); - - std::string varSeparator = ""; - while(varIter != vars.end()) { - ss << varSeparator << (char *)varIter->second; - varSeparator = ", "; - varIter++; - } - solSeparator = "\n"; - } - return ss.str(); - } - return std::string(compound); - - } catch(PlException plex) { - // we got an exception while trying to evaluate as compound - PlTerm term(expr.c_str()); - if (term.type() == PL_ATOM || term.type() == PL_CHARS || term.type() == PL_STRING) { - return std::string(term); - } else { - ERROR_EXECUTION_THROW((char*)plex); - } - } -} - - -// this is similar to http://etalis.googlecode.com/svn/eEtalis/src/term.c -std::map<std::string, PlTerm> SWIDataModel::resolveAtoms(PlTerm& term, PlTerm& orig) { - try { - std::map<std::string, PlTerm> atoms; - switch (orig.type()) { - case PL_VARIABLE: { - atoms[(char *)orig] = term; - break; - } - case PL_ATOM: - break; - case PL_STRING: - break; - case PL_INTEGER: - break; - case PL_TERM: - for (int i = 1; i <= orig.arity(); i++) { - PlTerm newTerm = term[i]; - PlTerm newOrig = orig[i]; - std::map<std::string, PlTerm> result = resolveAtoms(newTerm, newOrig); - atoms.insert(result.begin(), result.end()); - } - break; - default: - LOG(ERROR) << "Resolving variable of unknown type in query solution"; - } - return atoms; - } - RETHROW_PLEX_AS_EVENT -} - -void SWIDataModel::assign(const Element<std::string>& assignElem, - const Node<std::string>& node, - const std::string& content) { - SWIEngineLock engineLock; - try { - std::string callAssert = "assert"; - std::string solution; - std::string expr = content; - std::string predicate; - if (HAS_ATTR(assignElem, "solution")) - solution = ATTR(assignElem, "solution"); - if (HAS_ATTR(assignElem, "expr")) - expr = ATTR(assignElem, "expr"); - if (HAS_ATTR(assignElem, "id")) - predicate = ATTR(assignElem, "id"); - if (HAS_ATTR(assignElem, "location")) - predicate = ATTR(assignElem, "location"); - - if (solution.size() > 0 && expr.size() > 0 && predicate.size() > 0) { - // <assign location="var1" solution="Y" expr="var1(X), Y is X + 1, retractall(var1(_))"/> - std::cout << expr + ", " + callAssert + "(" + predicate + "(" + solution + "))" << std::endl; - PlCall((expr + ", " + callAssert + "(" + predicate + "(" + solution + "))").c_str()); - return; - } - - if (expr.size() > 0 && predicate.size()) { - Data json = Data::fromJSON(expr); - if (!json.empty()) { - std::cout << callAssert + "(" + predicate + ")" << std::endl; - PlCall((callAssert + "(" + predicate + ")").c_str()); - // expression is a JSON structure! - std::stringstream dataInitStr; - // if (iequals(type, "retract")) - // PlCall("retractall", PlCompound(predicate.c_str(), 1)); - dataInitStr << "json_to_prolog(" << expr << ", JSON), assert(" << predicate << "(JSON))"; - PlCall(dataInitStr.str().c_str()); - return; - } - } - - if (expr.size() > 0 && predicate.size()) { - // treat content as . seperated facts - std::stringstream factStream(expr); - std::string item; - while(std::getline(factStream, item, '.')) { - std::string fact = boost::trim_copy(item); - if (fact.length() == 0) - continue; - std::cout << callAssert + "(" + predicate + "(" + fact + "))" << std::endl; - PlCall((callAssert + "(" + predicate + "(" + fact + "))").c_str()); - } - return; - } - - if (predicate.size() > 0) { - std::cout << callAssert + "(" + predicate + ")" << std::endl; - PlCall((callAssert + "(" + predicate + ")").c_str()); - return; - } - - abort(); - - if (expr.size() == 0) { - // no expression, just assert id or idlocation - std::cout << callAssert + "(" + predicate + ")" << std::endl; - PlCall((callAssert + "(" + predicate + ")").c_str()); - return; - } - - - std::cout << expr + ", " + callAssert + "(" + predicate + ")" << std::endl; - PlCall((expr + ", " + callAssert + "(" + predicate + ")").c_str()); - - - } -#if 0 - try { - std::string expr = content; - std::string predicate; - if (HAS_ATTR(assignElem, "expr")) { - expr = ATTR(assignElem, "expr"); - } - if (HAS_ATTR(assignElem, "id")) - predicate = ATTR(assignElem, "id"); - if (HAS_ATTR(assignElem, "location")) - predicate = ATTR(assignElem, "location"); - - if (predicate.size() > 0) { - std::string callAssert = "assert"; - std::string type; - if (HAS_ATTR(assignElem, "type")) { - type = ATTR(assignElem, "type"); - if(iequals(type, "append")) { - callAssert = "assertz"; - } else if(iequals(type, "prepend")) { - callAssert = "asserta"; - } - } - - URL domUrl; - Data json; - if (!node) - json = Data::fromJSON(expr); - if (node) { - std::stringstream dataInitStr; - std::stringstream xmlDoc; - Node<std::string> child = node; - while(child) { - xmlDoc << child; - child = child.getNextSibling(); - } - domUrl = URL::toLocalFile(xmlDoc.str(), ".pl"); - if (iequals(type, "retract")) - PlCall("retractall", PlCompound(predicate.c_str(), 1)); - dataInitStr << "load_xml_file('" << domUrl.asLocalFile(".pl") << "', XML), copy_term(XML,DATA), " << callAssert << "(" << predicate << "(DATA))"; - PlCall(dataInitStr.str().c_str()); - } else if (!json.empty()) { - std::stringstream dataInitStr; - if (iequals(type, "retract")) - PlCall("retractall", PlCompound(predicate.c_str(), 1)); - dataInitStr << "json_to_prolog(" << expr << ", JSON), assert(" << predicate << "(JSON))"; - PlCall(dataInitStr.str().c_str()); - } else { - // treat content as . seperated facts - std::stringstream factStream(content); - std::string item; - while(std::getline(factStream, item, '.')) { - std::string fact = boost::trim_copy(item); - if (fact.length() == 0) - continue; - PlCall((callAssert + "(" + predicate + "(" + fact + "))").c_str()); - } - } - } else if (expr.length() > 0) { - if (boost::equals(TAGNAME(assignElem), "data")) { - eval(assignElem, expr); - } else { - std::stringstream exprStream(expr); - std::string item; - while(std::getline(exprStream, item, '.')) { - std::string plExpr = boost::trim_copy(item); - if (plExpr.length() == 0) - continue; - PlCall(plExpr.c_str()); - } - } - } - } -#endif - RETHROW_PLEX_AS_EVENT -} - -void SWIDataModel::assign(const std::string& location, const Data& data) { - eval(Element<std::string>(), data.atom); -} - -void SWIDataModel::init(const Element<std::string>& dataElem, - const Node<std::string>& node, - const std::string& content) { - assign(dataElem, node, content); -} -void SWIDataModel::init(const std::string& location, const Data& data) { - assign(location, data); -} - -bool SWIDataModel::isDeclared(const std::string& expr) { - return true; -} - -void SWIDataModel::acquireBlob(atom_t symbol) { -} - - -int SWIDataModel::releaseBlob(atom_t symbol) { - return TRUE; -} - -int SWIDataModel::compareBlob(atom_t a, atom_t b) { - return 0; -} - -int SWIDataModel::writeBlob(void *s, atom_t symbol, int flags) { - return TRUE; -} - - -} diff --git a/src/uscxml/plugins/datamodel/promela/PromelaDataModel.cpp b/src/uscxml/plugins/datamodel/promela/PromelaDataModel.cpp deleted file mode 100644 index d65e9c7..0000000 --- a/src/uscxml/plugins/datamodel/promela/PromelaDataModel.cpp +++ /dev/null @@ -1,814 +0,0 @@ -/** - * @file - * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include <boost/algorithm/string.hpp> - -#include "uscxml/Common.h" -#include "uscxml/config.h" -#include "uscxml/util/String.h" -#include "PromelaDataModel.h" -#include "uscxml/dom/DOMUtils.h" -#include "uscxml/Message.h" -#include <glog/logging.h> -#include <cctype> - -#include "PromelaParser.h" -#include "parser/promela.tab.hpp" - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -#define INVALID_ASSIGNMENT(name) \ -name.compare("_sessionid") == 0 || \ -name.compare("_name") == 0 || \ -name.compare("_ioprocessors") == 0 || \ -name.compare("_event") == 0 - -namespace uscxml { - -using namespace Arabica::XPath; -using namespace Arabica::DOM; - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new PromelaDataModelProvider() ); - return true; -} -#endif - -PromelaDataModel::PromelaDataModel() { -} - -PromelaDataModel::~PromelaDataModel() { -} - -boost::shared_ptr<DataModelImpl> PromelaDataModel::create(InterpreterInfo* interpreter) { - boost::shared_ptr<PromelaDataModel> dm = boost::shared_ptr<PromelaDataModel>(new PromelaDataModel()); - dm->_interpreter = interpreter; - - // session id - Data sessionId; - sessionId.compound["type"] = Data("string", Data::VERBATIM); - sessionId.compound["value"] = Data(interpreter->getSessionId(), Data::VERBATIM); - dm->_variables["_sessionid"] = sessionId; - - // name - Data name; - name.compound["type"] = Data("string", Data::VERBATIM); - name.compound["value"] = Data(interpreter->getName(), Data::VERBATIM); - dm->_variables["_name"] = name; - - // ioprocessors - Data ioProcs; - ioProcs.compound["type"] = Data("compound", Data::VERBATIM); - - std::map<std::string, IOProcessor> ioProcessors = interpreter->getIOProcessors(); - for (std::map<std::string, IOProcessor>::iterator iter = ioProcessors.begin(); iter != ioProcessors.end(); iter++) { - ioProcs.compound["value"].compound[iter->first] = iter->second.getDataModelVariables(); - } - dm->_variables["_ioprocessors"] = ioProcs; - - dm->_lastMType = 0; - return dm; -} - -void PromelaDataModel::registerIOProcessor(const std::string& name, const IOProcessor& ioprocessor) { -} - -void PromelaDataModel::pushContext() { -// std::cout << "PromelaDataModel::pushContext" << std::endl; -} - -void PromelaDataModel::popContext() { -// std::cout << "PromelaDataModel::popContext" << std::endl; -} - -void PromelaDataModel::setEvent(const Event& event) { - Data variable; - variable.compound["type"] = Data("compound", Data::VERBATIM); - variable.compound["value"].compound["name"] = Data(event.name, Data::VERBATIM); - variable.compound["value"].compound["origin"] = Data(event.origin, Data::VERBATIM); - variable.compound["value"].compound["origintype"] = Data(event.origintype, Data::VERBATIM); - variable.compound["value"].compound["invokeid"] = Data(event.invokeid, Data::VERBATIM); - if (event.hideSendId) { - variable.compound["value"].compound["sendid"] = Data("", Data::VERBATIM); - } else { - variable.compound["value"].compound["sendid"] = Data(event.sendid, Data::VERBATIM); - } - switch (event.eventType) { - case Event::PLATFORM: - variable.compound["value"].compound["type"] = Data("platform", Data::VERBATIM); - break; - case Event::INTERNAL: - variable.compound["value"].compound["type"] = Data("internal", Data::VERBATIM); - break; - case Event::EXTERNAL: - variable.compound["value"].compound["type"] = Data("external", Data::VERBATIM); - break; - default: - variable.compound["value"].compound["type"] = Data("invalid", Data::VERBATIM); - break; - } - - if (event.dom) { - // no support - } else if (event.content.length() > 0) { - // _event.data is a string or JSON - Data json = Data::fromJSON(event.content); - if (!json.empty()) { - variable.compound["value"].compound["data"] = json; - } else { - if (isNumeric(event.content.c_str(), 10)) { - variable.compound["value"].compound["data"] = Data(event.content, Data::INTERPRETED); - } else { - variable.compound["value"].compound["data"] = Data(spaceNormalize(event.content), Data::VERBATIM); - } - } - } else { - // _event.data is KVP - if (!event.data.empty()) { - variable.compound["value"].compound["data"] = event.data; - } else { - // test 343 / test 488 - variable.compound["value"].compound["data"]; - } - - for (Event::params_t::const_iterator start = event.params.begin(), end = event.params.end(); - start != end; start = event.params.upper_bound(start->first)) { - // only set first param key - if (isNumeric(start->second.atom.c_str(), 10)) { - variable.compound["value"].compound["data"].compound[start->first] = strTo<int>(start->second.atom); - } else { - variable.compound["value"].compound["data"].compound[start->first] = start->second; - } - } - - for (Event::namelist_t::const_iterator iter = event.namelist.begin(); iter != event.namelist.end(); iter++) { - if (isNumeric(iter->second.atom.c_str(), 10)) { - variable.compound["value"].compound["data"].compound[iter->first] = strTo<int>(iter->second.atom); - } else { - variable.compound["value"].compound["data"].compound[iter->first] = iter->second; - } - } - } - - // iterate all data elements and adapt type for int if atom is integer - adaptType(variable.compound["value"].compound["data"]); - - _variables["_event"] = variable; -} - -void PromelaDataModel::adaptType(Data& data) { - if (data.atom.length() > 0 && isInteger(data.atom.c_str(), 10)) { - data.type = Data::INTERPRETED; - return; - } - - if (data.array.size() > 0) { - for (std::list<Data>::iterator iter = data.array.begin(); iter != data.array.end(); iter++) { - adaptType(*iter); - } - return; - } - - if (data.compound.size() > 0) { - for (std::map<std::string, Data>::iterator iter = data.compound.begin(); iter != data.compound.end(); iter++) { - adaptType(iter->second); - } - return; - } - -} - -Data PromelaDataModel::getStringAsData(const std::string& content) { - return evaluateExpr(content); -} - - -bool PromelaDataModel::validate(const std::string& location, const std::string& schema) { -// std::cout << "PromelaDataModel::validate" << std::endl; - return true; -} - -bool PromelaDataModel::isLocation(const std::string& expr) { - return true; -} - -bool PromelaDataModel::isValidSyntax(const std::string& expr) { - try { - PromelaParser parser(expr); - } catch (Event e) { - LOG(ERROR) << e << std::endl; - return false; - } - return true; -} - -uint32_t PromelaDataModel::getLength(const std::string& expr) { - if (!isDeclared(expr)) { - ERROR_EXECUTION_THROW("Variable '" + expr + "' was not declared"); - } - - if (!_variables[expr].hasKey("size")) { - ERROR_EXECUTION_THROW("Variable '" + expr + "' is no array"); - } - - return strTo<int>(_variables[expr]["size"].atom); -} - -void PromelaDataModel::setForeach(const std::string& item, - const std::string& array, - const std::string& index, - uint32_t iteration) { - // assign array element to item - std::stringstream ss; - ss << array << "[" << iteration << "]"; - - PromelaParser itemParser(item, 1, PromelaParser::PROMELA_EXPR); - if (itemParser.ast->type != PML_NAME) - ERROR_EXECUTION_THROW("Expression '" + item + "' is no valid item"); - - PromelaParser arrayParser(ss.str(), 1, PromelaParser::PROMELA_EXPR); - - setVariable(itemParser.ast, getVariable(arrayParser.ast)); - - if (index.length() > 0) { - PromelaParser indexParser(index, 1, PromelaParser::PROMELA_EXPR); - setVariable(indexParser.ast, iteration); - } - -} - -void PromelaDataModel::eval(const Element<std::string>& scriptElem, const std::string& expr) { - PromelaParser parser(expr, 1, PromelaParser::PROMELA_STMNT); - evaluateStmnt(parser.ast); -// parser.dump(); -} - -bool PromelaDataModel::evalAsBool(const std::string& expr) { - return evalAsBool(Arabica::DOM::Element<std::string>(), expr); -} - -bool PromelaDataModel::evalAsBool(const Arabica::DOM::Element<std::string>& node, const std::string& expr) { - PromelaParser parser(expr, 1, PromelaParser::PROMELA_EXPR); -// parser.dump(); - Data tmp = evaluateExpr(parser.ast); - - if (tmp.atom.compare("false") == 0) - return false; - if (tmp.atom.compare("0") == 0) - return false; - return true; -} - -std::string PromelaDataModel::evalAsString(const std::string& expr) { - PromelaParser parser(expr); - return evaluateExpr(parser.ast); -} - -void PromelaDataModel::assign(const Element<std::string>& assignElem, - const Node<std::string>& node, - const std::string& content) { - std::string key; - std::string value; - - if (node) { - ERROR_EXECUTION_THROW("Assigning DOM node to variable is not supported"); - } - - if (HAS_ATTR(assignElem, "id")) { - key = ATTR(assignElem, "id"); - } else if (HAS_ATTR(assignElem, "location")) { - key = ATTR(assignElem, "location"); - } - - if (HAS_ATTR(assignElem, "expr")) { - if (key.length() == 0) { - ERROR_EXECUTION_THROW("Assign element has neither id nor location"); - } - value = ATTR(assignElem, "expr"); - } else { - value = content; - } - - if (value.length() == 0) - return; - - Data json = Data::fromJSON(value); - if (!json.empty()) { - // simply assign from json to key - assign(key, json); - } else { - std::string expr = key + " = " + value; - PromelaParser parser(expr, 1, PromelaParser::PROMELA_STMNT); - evaluateStmnt(parser.ast); - } -} - -void PromelaDataModel::evaluateDecl(const std::string& expr) { - PromelaParser parser(expr, 1, PromelaParser::PROMELA_DECL); - evaluateDecl(parser.ast); -} - -Data PromelaDataModel::evaluateExpr(const std::string& expr) { - PromelaParser parser(expr, 1, PromelaParser::PROMELA_EXPR); - return evaluateExpr(parser.ast); -} - -void PromelaDataModel::evaluateStmnt(const std::string& expr) { - PromelaParser parser(expr, 1, PromelaParser::PROMELA_STMNT); - evaluateStmnt(parser.ast); -} - -void PromelaDataModel::evaluateDecl(void* ast) { - PromelaParserNode* node = (PromelaParserNode*)ast; -// node->dump(); - if (false) { - } else if (node->type == PML_DECL) { - std::list<PromelaParserNode*>::iterator opIter = node->operands.begin(); - PromelaParserNode* vis = *opIter++; - PromelaParserNode* type = *opIter++; - PromelaParserNode* varlist = *opIter++; - - for (std::list<PromelaParserNode*>::iterator nameIter = varlist->operands.begin(); - nameIter != varlist->operands.end(); - nameIter++) { - Data variable; - variable.compound["vis"] = Data(vis->value, Data::VERBATIM); - variable.compound["type"] = Data(type->value, Data::VERBATIM); - - if (false) { - } else if ((*nameIter)->type == PML_NAME) { - // plain variables without initial assignment - - if (type->value == "mtype") { - variable.compound["value"] = Data(_lastMType++, Data::INTERPRETED); - } else { - variable.compound["value"] = Data(0, Data::INTERPRETED); - } - _variables.compound[(*nameIter)->value] = variable; - - } else if ((*nameIter)->type == PML_ASGN) { - // initially assigned variables - - std::list<PromelaParserNode*>::iterator opIterAsgn = (*nameIter)->operands.begin(); - PromelaParserNode* name = *opIterAsgn++; - PromelaParserNode* expr = *opIterAsgn++; - - try { - variable.compound["value"] = evaluateExpr(expr); - } catch(uscxml::Event e) { - // test277, declare and throw - _variables.compound[name->value] = variable; - throw e; - } - - assert(opIterAsgn == (*nameIter)->operands.end()); - _variables.compound[name->value] = variable; - } else if ((*nameIter)->type == PML_VAR_ARRAY) { - // variable arrays - - std::list<PromelaParserNode*>::iterator opIterAsgn = (*nameIter)->operands.begin(); - PromelaParserNode* name = *opIterAsgn++; - int size = dataToInt(evaluateExpr(*opIterAsgn++)); - - variable.compound["size"] = size; - for (size_t i = 0; i < size; i++) { - variable.compound["value"].array.push_back(Data(0, Data::INTERPRETED)); - } - - assert(opIterAsgn == (*nameIter)->operands.end()); - _variables.compound[name->value] = variable; - - } else { - ERROR_EXECUTION_THROW("Declaring variables via " + PromelaParserNode::typeToDesc((*nameIter)->type) + " not implemented"); - } - } - assert(opIter == node->operands.end()); - } else if (node->type == PML_DECLLIST) { - for (std::list<PromelaParserNode*>::iterator declIter = node->operands.begin(); - declIter != node->operands.end(); - declIter++) { - evaluateDecl(*declIter); - } - } else { - node->dump(); - ERROR_EXECUTION_THROW("Declaring variables via " + PromelaParserNode::typeToDesc(node->type) + " not implemented"); - } -} - -int PromelaDataModel::dataToInt(const Data& data) { - if (data.type != Data::INTERPRETED) - ERROR_EXECUTION_THROW("Operand is not integer"); - int value = strTo<int>(data.atom); - if (data.atom.compare(toStr(value)) != 0) - ERROR_EXECUTION_THROW("Operand is not integer"); - return value; -} - -bool PromelaDataModel::dataToBool(const Data& data) { - if (data.atom.size() == 0) // empty string or undefined - return false; - - if (data.type == Data::VERBATIM) { - // non-empty string is true - return true; - } else { - if (data.atom.compare("true") == 0) { - // boolean true is true - return true; - } else if (data.atom.compare("false") == 0) { - return false; - } else if (dataToInt(data) != 0) { - return true; // non zero values are true - } - } - return false; -} - -Data PromelaDataModel::evaluateExpr(void* ast) { - PromelaParserNode* node = (PromelaParserNode*)ast; - std::list<PromelaParserNode*>::iterator opIter = node->operands.begin(); - switch (node->type) { - case PML_CONST: - if (iequals(node->value, "false")) - return Data(false); - if (iequals(node->value, "true")) - return Data(true); - return strTo<int>(node->value); - case PML_NAME: - case PML_VAR_ARRAY: - case PML_CMPND: - return getVariable(node); - case PML_STRING: { - std::string stripped = node->value.substr(1, node->value.size() - 2); - return Data(stripped, Data::VERBATIM); -// return Data(node->value, Data::INTERPRETED); - } - case PML_PLUS: - return dataToInt(evaluateExpr(*opIter++)) + dataToInt(evaluateExpr(*opIter++)); - case PML_MINUS: - return dataToInt(evaluateExpr(*opIter++)) - dataToInt(evaluateExpr(*opIter++)); - case PML_DIVIDE: - return dataToInt(evaluateExpr(*opIter++)) / dataToInt(evaluateExpr(*opIter++)); - case PML_MODULO: - return dataToInt(evaluateExpr(*opIter++)) % dataToInt(evaluateExpr(*opIter++)); - case PML_EQ: { - PromelaParserNode* lhs = *opIter++; - PromelaParserNode* rhs = *opIter++; - - Data left = evaluateExpr(lhs); - Data right = evaluateExpr(rhs); - - if (left == right) // overloaded operator== - return Data(true); - - // literal strings or strings in variables - if ((lhs->type == PML_STRING || rhs->type == PML_STRING) - || (left.type == Data::VERBATIM && right.type == Data::VERBATIM)) { - return (left.atom.compare(right.atom) == 0 ? Data(true) : Data(false)); - } - return dataToInt(left) == dataToInt(right); - } - case PML_NEG: - return !dataToBool(evaluateExpr(*opIter++)); - case PML_LT: - return dataToInt(evaluateExpr(*opIter++)) < dataToInt(evaluateExpr(*opIter++)); - case PML_LE: - return dataToInt(evaluateExpr(*opIter++)) <= dataToInt(evaluateExpr(*opIter++)); - case PML_GT: - return dataToInt(evaluateExpr(*opIter++)) > dataToInt(evaluateExpr(*opIter++)); - case PML_GE: - return dataToInt(evaluateExpr(*opIter++)) >= dataToInt(evaluateExpr(*opIter++)); - case PML_TIMES: - return dataToInt(evaluateExpr(*opIter++)) * dataToInt(evaluateExpr(*opIter++)); - case PML_LSHIFT: - return dataToInt(evaluateExpr(*opIter++)) << dataToInt(evaluateExpr(*opIter++)); - case PML_RSHIFT: - return dataToInt(evaluateExpr(*opIter++)) >> dataToInt(evaluateExpr(*opIter++)); - case PML_AND: - case PML_OR: { - PromelaParserNode* lhs = *opIter++; - PromelaParserNode* rhs = *opIter++; - -// std::cout << "-----" << std::endl; -// lhs->dump(); -// rhs->dump(); - - Data left = evaluateExpr(lhs); - Data right = evaluateExpr(rhs); - - bool truthLeft = dataToBool(left); - bool truthRight = dataToBool(right); - - if (node->type == PML_AND) { - return truthLeft && truthRight; - } else { - return truthLeft || truthRight; - } - } - default: - ERROR_EXECUTION_THROW("Support for " + PromelaParserNode::typeToDesc(node->type) + " expressions not implemented"); - } - return 0; -} - -void PromelaDataModel::evaluateStmnt(void* ast) { - PromelaParserNode* node = (PromelaParserNode*)ast; - std::list<PromelaParserNode*>::iterator opIter = node->operands.begin(); - switch (node->type) { - case PML_ASGN: { - PromelaParserNode* name = *opIter++; - PromelaParserNode* expr = *opIter++; - setVariable(name, evaluateExpr(expr)); - break; - } - case PML_STMNT: { - while(opIter != node->operands.end()) { - evaluateStmnt(*opIter++); - } - break; - } - case PML_INCR: { - PromelaParserNode* name = *opIter++; - setVariable(name, strTo<long>(getVariable(name)) + 1); - break; - } - case PML_DECR: { - PromelaParserNode* name = *opIter++; - setVariable(name, strTo<long>(getVariable(name)) - 1); - break; - } - default: - node->dump(); - ERROR_EXECUTION_THROW("No support for " + PromelaParserNode::typeToDesc(node->type) + " statement implemented"); - } -} - - -void PromelaDataModel::setVariable(void* ast, const Data& value) { - PromelaParserNode* node = (PromelaParserNode*)ast; - - if (INVALID_ASSIGNMENT(node->value)) { - ERROR_EXECUTION_THROW("Cannot assign to " + node->value); - } - -// if (_variables.compound.find(name->value) == _variables.compound.end()) { -// // declare implicitly / convenience -// evaluateDecl(ast); -// } - - switch (node->type) { - case PML_VAR_ARRAY: { - std::list<PromelaParserNode*>::iterator opIter = node->operands.begin(); - - PromelaParserNode* name = *opIter++; - PromelaParserNode* expr = *opIter++; - - // is the location an array? - if (!_variables[name->value].hasKey("size")) { - ERROR_EXECUTION_THROW("Variable " + name->value + " is no array"); - } - - // is the array large enough? - int index = dataToInt(evaluateExpr(expr)); - if (strTo<int>(_variables[name->value]["size"].atom) <= index) { - ERROR_EXECUTION_THROW("Index " + toStr(index) + " in array " + name->value + "[" + _variables[name->value]["size"].atom + "] is out of bounds"); - } - - _variables.compound[name->value].compound["value"][index] = value; - - break; - } - case PML_NAME: { - // location is an array, but no array was passed - if (_variables[node->value].hasKey("size")) { - if (value.compound.size() > 0 || value.atom.size() > 0) - ERROR_EXECUTION_THROW("Variable " + node->value + " is an array"); - - if (strTo<size_t>(_variables[node->value].compound["size"].atom) < value.array.size()) - ERROR_EXECUTION_THROW("Array assigned to " + node->value + " is too large"); - } - - _variables.compound[node->value].compound["value"] = value; - break; - } - case PML_CMPND: { - std::list<PromelaParserNode*>::iterator opIter = node->operands.begin(); - PromelaParserNode* name = *opIter++; - - // location is no array - if (_variables[name->value].hasKey("size")) { - ERROR_EXECUTION_THROW("Variable " + name->value + " is an array"); - } - -// std::cout << Data::toJSON(_variables) << std::endl;; - - Data* var = &_variables[name->value].compound["value"]; - var->compound["type"] = Data("compound", Data::VERBATIM); - var->compound["vis"] = Data("", Data::VERBATIM); - - while(opIter != node->operands.end()) { - name = *opIter; - opIter++; - var = &(var->compound[name->value]); - } - *var = value; - - break; - } - default: - node->dump(); - ERROR_EXECUTION_THROW("No support for " + PromelaParserNode::typeToDesc(node->type) + " variables implemented"); - break; - } - -// std::cout << Data::toJSON(_variables) << std::endl; -} - -Data PromelaDataModel::getVariable(void* ast) { - PromelaParserNode* node = (PromelaParserNode*)ast; -// node->dump(); - - std::list<PromelaParserNode*>::iterator opIter = node->operands.begin(); - switch(node->type) { - case PML_NAME: - if (_variables.compound.find(node->value) == _variables.compound.end()) { - ERROR_EXECUTION_THROW("No variable " + node->value + " was declared"); - } -// if (_variables[node->value].compound.find("size") != _variables[node->value].compound.end()) { -// ERROR_EXECUTION_THROW("Type error: Variable " + node->value + " is an array"); -// } - return _variables[node->value]["value"]; - case PML_VAR_ARRAY: { - PromelaParserNode* name = *opIter++; - PromelaParserNode* expr = *opIter++; - int index = dataToInt(evaluateExpr(expr)); - - if (_variables.compound.find(name->value) == _variables.compound.end()) { - ERROR_EXECUTION_THROW("No variable " + name->value + " was declared"); - } - - if (!_variables[name->value].hasKey("size")) { - ERROR_EXECUTION_THROW("Variable " + name->value + " is no array"); - } - - if (strTo<int>(_variables[name->value]["size"].atom) <= index) { - ERROR_EXECUTION_THROW("Index " + toStr(index) + " in array " + name->value + "[" + _variables[name->value]["size"].atom + "] is out of bounds"); - } - return _variables.compound[name->value].compound["value"][index]; - } - case PML_CMPND: { -// node->dump(); -// std::cout << Data::toJSON(_variables["_event"]); - std::stringstream idPath; - PromelaParserNode* name = *opIter++; - - // special case for _x variables - if (name->value.compare("_x") == 0) { - PromelaParserNode* what = *opIter++; - - if (what->type == PML_VAR_ARRAY) { - if (what->operands.size() == 2) { - std::string arrName = what->operands.front()->value; - std::string index = what->operands.back()->value; - - if (what->operands.back()->type == PML_STRING) { - index = index.substr(1, index.size() - 2); // remove quotes - } - - if (arrName.compare("states") == 0) { - return Data(_interpreter->isInState(index)); - } - } - } - ERROR_EXECUTION_THROW("No variable " + name->value + " was declared"); - } - - if (_variables.compound.find(name->value) == _variables.compound.end()) { - ERROR_EXECUTION_THROW("No variable " + name->value + " was declared"); - } - - Data currData = _variables.compound[name->value]["value"]; - idPath << name->value; - while(opIter != node->operands.end()) { - std::string key = (*opIter)->value; - idPath << "." << key; - if (currData.compound.find(key) == currData.compound.end()) { - ERROR_EXECUTION_THROW("No variable " + idPath.str() + " was declared"); - } - Data tmp = currData.compound[key]; - currData = tmp; - - opIter++; - } - return currData; - } - default: - ERROR_EXECUTION_THROW("Retrieving value of " + PromelaParserNode::typeToDesc(node->type) + " variable not implemented"); - } - return 0; -} - -std::string PromelaDataModel::andExpressions(std::list<std::string> expressions) { - - if (expressions.size() == 0) - return ""; - - if (expressions.size() == 1) - return *(expressions.begin()); - - std::ostringstream exprSS; - exprSS << "("; - std::string conjunction = ""; - for (std::list<std::string>::const_iterator exprIter = expressions.begin(); - exprIter != expressions.end(); - exprIter++) { - exprSS << conjunction << "(" << *exprIter << ")"; - conjunction = " && "; - } - exprSS << ")"; - return exprSS.str(); -} - -void PromelaDataModel::assign(const std::string& location, const Data& data) { - // used for e.g. to assign command line parameters and idlocation - PromelaParser parser(location); - setVariable(parser.ast, data); -} - -void PromelaDataModel::init(const Element<std::string>& dataElem, - const Node<std::string>& node, - const std::string& content) { - // from <datamodel> - if (HAS_ATTR(dataElem, "id")) { - std::string identifier = ATTR(dataElem, "id"); - std::string type = (HAS_ATTR(dataElem, "type") ? ATTR(dataElem, "type") : "auto"); - std::string arrSize; - - size_t bracketPos = type.find("["); - if (bracketPos != std::string::npos) { - arrSize = type.substr(bracketPos, type.length() - bracketPos); - type = type.substr(0, bracketPos); - } - - std::string expr = type + " " + identifier + arrSize; - PromelaParser parser(expr, 1, PromelaParser::PROMELA_DECL); - evaluateDecl(parser.ast); - - } - assign(dataElem, node, content); -} -void PromelaDataModel::init(const std::string& location, const Data& data) { - assign(location, data); -} - -bool PromelaDataModel::isDeclared(const std::string& expr) { - PromelaParser parser(expr); -// parser.dump(); - if (parser.ast->type == PML_VAR_ARRAY) - return _variables.compound.find(parser.ast->operands.front()->value) != _variables.compound.end(); - - if (parser.ast->type == PML_CMPND) { - // JSON declaration - std::list<PromelaParserNode*>::iterator opIter = parser.ast->operands.begin(); - Data* var = &_variables; - - while(opIter != parser.ast->operands.end()) { - std::string name = (*opIter)->value; - opIter++; - if (var->compound.find(name) != var->compound.end()) { - var = &(var->compound.at(name)); - } else if (var->compound.find("value") != var->compound.end() && var->compound.at("value").compound.find(name) != var->compound.at("value").compound.end()) { - var = &(var->compound.at("value").compound.at(name)); - } else { - return false; - } - } - return true; - - } - - return _variables.compound.find(expr) != _variables.compound.end(); -} - - -} diff --git a/src/uscxml/plugins/datamodel/promela/PromelaDataModel.h b/src/uscxml/plugins/datamodel/promela/PromelaDataModel.h deleted file mode 100644 index 0778ecf..0000000 --- a/src/uscxml/plugins/datamodel/promela/PromelaDataModel.h +++ /dev/null @@ -1,119 +0,0 @@ -/** - * @file - * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef PROMELADATAMODEL_H_4VG0TDMU -#define PROMELADATAMODEL_H_4VG0TDMU - -#include "uscxml/InterpreterInfo.h" -#include "uscxml/plugins/DataModel.h" -#include <list> - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class PromelaDataModel : public DataModelImpl { -public: - PromelaDataModel(); - virtual ~PromelaDataModel(); - virtual boost::shared_ptr<DataModelImpl> create(InterpreterInfo* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("promela"); - return names; - } - - virtual void setEvent(const Event& event); - - virtual void registerIOProcessor(const std::string& name, const IOProcessor& ioprocessor); - - virtual bool validate(const std::string& location, const std::string& schema); - virtual bool isLocation(const std::string& expr); - virtual bool isValidSyntax(const std::string& expr); - - virtual uint32_t getLength(const std::string& expr); - virtual void setForeach(const std::string& item, - const std::string& array, - const std::string& index, - uint32_t iteration); - - virtual void pushContext(); - virtual void popContext(); - - virtual void assign(const Arabica::DOM::Element<std::string>& assignElem, - const Arabica::DOM::Node<std::string>& node, - const std::string& content); - virtual void assign(const std::string& location, const Data& data); - - virtual void init(const Arabica::DOM::Element<std::string>& dataElem, - const Arabica::DOM::Node<std::string>& node, - const std::string& content); - virtual void init(const std::string& location, const Data& data); - - virtual void eval(const Arabica::DOM::Element<std::string>& scriptElem, - const std::string& expr); - - virtual bool isDeclared(const std::string& expr); - - virtual Data getStringAsData(const std::string& content); - - virtual std::string evalAsString(const std::string& expr); - virtual bool evalAsBool(const Arabica::DOM::Element<std::string>& node, const std::string& expr); - virtual bool evalAsBool(const std::string& expr); - - virtual std::string andExpressions(std::list<std::string> expressions); - -protected: - - int dataToInt(const Data& data); - bool dataToBool(const Data& data); - - void evaluateDecl(void* ast); - Data evaluateExpr(void* ast); - void evaluateStmnt(void* ast); - - void evaluateDecl(const std::string& expr); - Data evaluateExpr(const std::string& expr); - void evaluateStmnt(const std::string& expr); - - void setVariable(void* ast, const Data& value); - Data getVariable(void* ast); - - void adaptType(Data& data); - - int _lastMType; - - Event _event; - std::string _name; - std::string _sessionId; - - Data _variables; - -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(PromelaDataModel, DataModelImpl); -#endif - -} - -#endif /* end of include guard: PROMELADATAMODEL_H_4VG0TDMU */ diff --git a/src/uscxml/plugins/datamodel/promela/PromelaParser.cpp b/src/uscxml/plugins/datamodel/promela/PromelaParser.cpp deleted file mode 100644 index 3467598..0000000 --- a/src/uscxml/plugins/datamodel/promela/PromelaParser.cpp +++ /dev/null @@ -1,298 +0,0 @@ -/** - * @file - * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "PromelaParser.h" -#include "parser/promela.tab.hpp" -#include "uscxml/messages/Event.h" - -#include <iostream> - -struct yy_buffer_state; -typedef yy_buffer_state *YY_BUFFER_STATE; -extern YY_BUFFER_STATE promela__scan_buffer(char *, size_t, void*); -void promela__delete_buffer(YY_BUFFER_STATE, void*); -YY_BUFFER_STATE promela__scan_string (const char * yystr , void*); - - -extern int promela_lex (PROMELA_STYPE* yylval_param, PROMELA_LTYPE* yylloc_param, void* yyscanner); -int promela_lex_init (void**); -int promela_lex_destroy (void*); - -void promela_error (void* yylloc_param, uscxml::PromelaParser* ctx, void* yyscanner, const char* err) { - PROMELA_LTYPE* yylloc = (PROMELA_LTYPE*)yylloc_param; - // mark as pending exception as we cannot throw from constructor and have the destructor called - ERROR_EXECUTION(excEvent, err); - excEvent.data.compound["line"] = uscxml::Data(yylloc->first_line, uscxml::Data::VERBATIM); - excEvent.data.compound["col"] = uscxml::Data(yylloc->first_column, uscxml::Data::VERBATIM); - - std::stringstream ssUnderline; - for (size_t i = 0; i < yylloc->first_column; i++) - ssUnderline << " "; - ssUnderline << "^"; - excEvent.data.compound["sourcemark"] = uscxml::Data(ssUnderline.str(), uscxml::Data::VERBATIM); - - ctx->pendingException = excEvent; -} - -namespace uscxml { - -PromelaParser::PromelaParser(const std::string& expr) { - init(expr); -} - -PromelaParser::PromelaParser(const std::string& expr, int nrArgs, ...) { - init(expr); - - if (nrArgs == 0) - return; - - std::stringstream errSS; - std::string seperator; - errSS << "Promela syntax type mismatch: Expected {"; - - va_list ap; - va_start(ap, nrArgs); - for(int i = 1; i <= nrArgs; i++) { - int expectedType = va_arg(ap, int); - if (type == expectedType) - return; - errSS << seperator << typeToDesc(expectedType); - seperator = ", "; - } - errSS << "} but got " << typeToDesc(type); - ERROR_EXECUTION_THROW(errSS.str()); -} - -void PromelaParser::init(const std::string& expr) { - ast = NULL; - parseInCompound = 0; - input_length = expr.length() + 2; // plus some zero terminators - input = (char*) calloc(1, input_length); - memcpy(input, expr.c_str(), expr.length()); - - promela_lex_init(&scanner); - // promela_assign_set_extra(ast, &scanner); - buffer = promela__scan_string(input, scanner); - // buffer = promela__scan_buffer(input, input_length, scanner); - promela_parse(this, scanner); - if (pendingException.name.size() > 0) { - // parsing failed in promela_error - destroy(); - pendingException.data.compound["sourceline"] = Data(expr, Data::VERBATIM); - throw pendingException; - } -} - -void PromelaParser::destroy() { - if (ast) - delete(ast); - free(input); - promela__delete_buffer((YY_BUFFER_STATE)buffer, scanner); - promela_lex_destroy(scanner); -} - -PromelaParser::~PromelaParser() { - destroy(); -} - -std::string PromelaParser::typeToDesc(int type) { - switch (type) { - case PROMELA_EXPR: - return "expression"; - case PROMELA_DECL: - return "declarations"; - case PROMELA_STMNT: - return "statements"; - default: - break; - } - return ""; -} - -PromelaParserNode::~PromelaParserNode() { - while(operands.size() > 0) { - delete operands.front(); - operands.pop_front(); - } - if (loc) - free(loc); -} - -PromelaParserNode* PromelaParser::node(int type, int nrArgs, ...) { - PromelaParserNode* newNode = new PromelaParserNode(); - - newNode->type = type; - va_list ap; - va_start(ap, nrArgs); - for(int i = 1; i <= nrArgs; i++) { - newNode->operands.push_back(va_arg(ap, PromelaParserNode*)); - newNode->operands.back()->parent = newNode; - } - return newNode; -} - -PromelaParserNode* PromelaParser::value(int type, void* location, const char* value) { - PromelaParserNode* newNode = new PromelaParserNode(); - - if (location) { - PROMELA_LTYPE* location_param = (PROMELA_LTYPE*)location; - newNode->loc = (PromelaParserNode::Location*)malloc(sizeof(PromelaParserNode::Location)); - newNode->loc->firstCol = location_param->first_column; - newNode->loc->firstLine = location_param->first_line; - newNode->loc->lastCol = location_param->last_column; - newNode->loc->lastLine = location_param->last_line; - } - - newNode->value = value; - newNode->type = type; - return newNode; -} - - -void PromelaParser::dump() { - switch (type) { - case PROMELA_EXPR: - std::cout << "Promela Expression" << std::endl; - break; - case PROMELA_DECL: - std::cout << "Promela Declarations" << std::endl; - break; - case PROMELA_STMNT: - std::cout << "Promela Statement" << std::endl; - break; - } - ast->dump(); -} - - -void PromelaParserNode::merge(PromelaParserNode* node) { - for (std::list<PromelaParserNode*>::iterator iter = node->operands.begin(); - iter != node->operands.end(); iter++) { - operands.push_back(*iter); - (*iter)->parent = this; - } - node->operands.clear(); -} - -void PromelaParserNode::push(PromelaParserNode* node) { - node->parent = this; - operands.push_back(node); -} - -void PromelaParserNode::dump(int indent) { - std::string padding; - for (size_t i = 0; i < indent; i++) { - padding += " "; - } - std::cout << padding << typeToDesc(type) << ": " << value; - if (loc != NULL) { - std::cout << " (" << loc->firstLine << ":" << loc->firstCol << ")-(" << loc->lastLine << ":" << loc->lastCol << ")"; - } - std::cout << std::endl; - for (std::list<PromelaParserNode*>::iterator iter = operands.begin(); - iter != operands.end(); iter++) { - (*iter)->dump(indent + 1); - } -} - -std::string PromelaParserNode::typeToDesc(int type) { - switch(type) { - case PML_PLUS: - return "PLUS"; - case PML_MINUS: - return "MINUS"; - case PML_TIMES: - return "TIMES"; - case PML_DIVIDE: - return "DIVIDE"; - case PML_MODULO: - return "MODULO"; - case PML_BITAND: - return "BITAND"; - case PML_BITXOR: - return "BITXOR"; - case PML_BITOR: - return "BITOR"; - case PML_GT: - return "GT"; - case PML_LT: - return "LT"; - case PML_GE: - return "GE"; - case PML_LE: - return "LE"; - case PML_EQ: - return "EQ"; - case PML_NE: - return "NE"; - case PML_AND: - return "AND"; - case PML_OR: - return "OR"; - case PML_LSHIFT: - return "LSHIFT"; - case PML_RSHIFT: - return "RSHIFT"; - case PML_NEG: - return "NEG"; - case PML_ASGN: - return "ASGN"; - case PML_INCR: - return "INCR"; - case PML_DECR: - return "DECR"; - case PML_VAR_ARRAY: - return "VAR_ARRAY"; - case PML_DECL: - return "DECL"; - case PML_STMNT: - return "STMNT"; - case PML_TYPE: - return "TYPE"; - case PML_NAME: - return "NAME"; - case PML_CONST: - return "CONST"; - case PML_PRINT: - return "PRINT"; - case PML_SHOW: - return "SHOW"; - case PML_EXPR: - return "EXPR"; - case PML_VARLIST: - return "VARLIST"; - case PML_DECLLIST: - return "DECLLIST"; - case PML_NAMELIST: - return "NAMELIST"; - case PML_STRING: - return "STRING"; - case PML_TYPEDEF: - return "TYPEDEF"; - case PML_CMPND: - return "CMPND"; - case PML_ASSERT: - return "ASSERT"; - - default: - return std::string("UNK(") + toStr(type) + ")"; - } -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/datamodel/promela/PromelaParser.h b/src/uscxml/plugins/datamodel/promela/PromelaParser.h deleted file mode 100644 index d79a2d0..0000000 --- a/src/uscxml/plugins/datamodel/promela/PromelaParser.h +++ /dev/null @@ -1,104 +0,0 @@ -/** - * @file - * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -// bison -v promela.ypp && flex promela.l - -#ifndef PROMELA_H_9AB78YB1 -#define PROMELA_H_9AB78YB1 - -#include <stdlib.h> -//#include <stdarg.h> -#include <cstdarg> - -#include "uscxml/Message.h" - -namespace uscxml { - -class PromelaParser; - -class PromelaParserNode { -public: - struct Location { - int firstLine; - int firstCol; - int lastLine; - int lastCol; - }; - - PromelaParserNode() : type(0), parent(NULL), loc(NULL) {} - virtual ~PromelaParserNode(); - - void merge(PromelaParserNode* node); - void push(PromelaParserNode* node); - void dump(int indent = 0); - - static std::string typeToDesc(int type); - - int type; - std::string value; - std::list<PromelaParserNode*> operands; - PromelaParserNode* parent; - Location* loc; -}; - -class PromelaParser { -public: - enum Type { - PROMELA_EXPR, - PROMELA_DECL, - PROMELA_STMNT - }; - - static std::string typeToDesc(int type); - - PromelaParser() : ast(NULL) {} - PromelaParser(const std::string& expr); - PromelaParser(const std::string& expr, int nrArgs, ...); - virtual ~PromelaParser(); - - virtual PromelaParserNode* node(int type, int nrArgs, ...); - virtual PromelaParserNode* value(int type, void* location, const char* value); - void dump(); - - int parseInCompound; - - PromelaParserNode* ast; - Type type; - - Event pendingException; - operator bool() const { - return ast != NULL; - } - -protected: - - void init(const std::string& expr); - void destroy(); - - void* buffer; - void* scanner; - char* input; - size_t input_length; -}; - -} - -void promela_error (void* yylloc_param, uscxml::PromelaParser* ctx, void* yyscanner, const char* err); - -#endif /* end of include guard: PROMELA_H_9AB78YB1 */ diff --git a/src/uscxml/plugins/datamodel/promela/parser/promela.l b/src/uscxml/plugins/datamodel/promela/parser/promela.l deleted file mode 100644 index 1edc625..0000000 --- a/src/uscxml/plugins/datamodel/promela/parser/promela.l +++ /dev/null @@ -1,117 +0,0 @@ -/* see: http://www.phpcompiler.org/articles/reentrantparser.html */ -/* see: http://spinroot.com/spin/Man/operators.html */ - - -%option yylineno -%option reentrant -%option bison-bridge -%option prefix="promela_" -%option outfile="promela.lex.yy.cpp" -%option noyywrap -%option debug -%option never-interactive nounistd -%option bison-locations - -%{ - -#include "../PromelaParser.h" -#include "promela.tab.hpp" -#define YYSTYPE PROMELA_STYPE -#define YYLTYPE PROMELA_LTYPE -#define YY_USER_INIT \ - yycolumn = yylloc->first_line = yylloc->first_column = 0; \ - yylineno = yylloc->last_line = yylloc->last_column = 0; \ - -//int yycolumn = 1; - -#define YY_USER_ACTION \ -{ \ - yylloc->first_line = yylineno; \ - yylloc->first_column = yycolumn; \ - yylloc->last_column = yycolumn + yyleng; \ - yylloc->last_line = yylineno; \ - yycolumn = yycolumn + yyleng; \ -} - -%} - -DIGIT [0-9] -ID [_a-zA-Z][_a-zA-Z0-9]* -L [a-zA-Z_] - -%% - -\/\*([^*]|\*[^/])*\*+\/ /* multiline comments */ - -bit|bool|byte|int|mtype|short|unsigned|string|auto { - yylval->value = strdup(yytext); - return PML_TYPE; -} - -len { return PML_LEN; } -false|skip|true { yylval->value = strdup(yytext); return PML_CONST; } -printf { return PML_PRINT; } -typedef { return PML_TYPEDEF; } -assert { return PML_ASSERT; } - -"!" { return PML_NEG; } -"~" { return PML_COMPL; } -"++" { return PML_INCR; } -"--" { return PML_DECR; } - -"*" { return PML_TIMES; } -"/" { return PML_DIVIDE; } -"%" { return PML_MODULO; } - -"+" { return PML_PLUS; } -"-" { return PML_MINUS; } - -"<<" { return PML_LSHIFT; } -">>" { return PML_RSHIFT; } - -"<=" { return PML_LE; } -">=" { return PML_GE; } -"<" { return PML_LT; } -">" { return PML_GT; } - -"!=" { return PML_NE; } -"==" { return PML_EQ; } - -"&" { return PML_BITAND; } -"^" { return PML_BITXOR; } -"|" { return PML_BITOR; } - - -"&&" { return PML_AND; } -"||" { return PML_OR; } - -"." { return PML_DOT; } -"," { return PML_COMMA; } -";" { return PML_SEMI; } - -"(" { return '('; } -")" { return ')'; } - -"[" { return '['; } -"]" { return ']'; } - -"{" { return '{'; } -"}" { return '}'; } - -"=" { return PML_ASGN; } - -L?\"(\\.|[^\\"])*\" { yylval->value = strdup(yytext); return(PML_STRING); } - - -L?'(\\.|[^\'])*\' { - /* Non PROMELA extension for single quoted string literals */ - yylval->value = strdup(yytext); return(PML_STRING); -} - -{DIGIT}+ { yylval->value = strdup(yytext); return PML_CONST; } -{ID} { yylval->value = strdup(yytext); return PML_NAME; } - -[ \t\n]+ /* eat up whitespace */ - - -. { /*printf( "Unrecognized character: %s\n", yytext ); */ } diff --git a/src/uscxml/plugins/datamodel/promela/parser/promela.lex.yy.cpp b/src/uscxml/plugins/datamodel/promela/parser/promela.lex.yy.cpp deleted file mode 100644 index 3a99921..0000000 --- a/src/uscxml/plugins/datamodel/promela/parser/promela.lex.yy.cpp +++ /dev/null @@ -1,2598 +0,0 @@ -#line 2 "promela.lex.yy.cpp" - -#line 4 "promela.lex.yy.cpp" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -/* %not-for-header */ - -/* %if-c-only */ -/* %if-not-reentrant */ -/* %endif */ -/* %endif */ -/* %ok-for-header */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* %if-c++-only */ -/* %endif */ - -/* %if-c-only */ - -/* %endif */ - -/* %if-c-only */ - -/* %endif */ - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -/* %if-c-only */ -#include <stdio.h> -#include <string.h> -#include <errno.h> -#include <stdlib.h> -/* %endif */ - -/* %if-tables-serialization */ -/* %endif */ -/* end standard C headers. */ - -/* %if-c-or-c++ */ -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include <inttypes.h> -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -typedef uint64_t flex_uint64_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! FLEXINT_H */ - -/* %endif */ - -/* %if-c++-only */ -/* %endif */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -/* %not-for-header */ - -/* Returned upon end-of-file. */ -#define YY_NULL 0 -/* %ok-for-header */ - -/* %not-for-header */ - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) -/* %ok-for-header */ - -/* %if-reentrant */ - -/* An opaque pointer. */ -#ifndef YY_TYPEDEF_YY_SCANNER_T -#define YY_TYPEDEF_YY_SCANNER_T -typedef void* yyscan_t; -#endif - -/* For convenience, these vars (plus the bison vars far below) - are macros in the reentrant scanner. */ -#define yyin yyg->yyin_r -#define yyout yyg->yyout_r -#define yyextra yyg->yyextra_r -#define yyleng yyg->yyleng_r -#define yytext yyg->yytext_r -#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) -#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) -#define yy_flex_debug yyg->yy_flex_debug_r - -/* %endif */ - -/* %if-not-reentrant */ -/* %endif */ - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yyg->yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yyg->yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE promela_restart(yyin ,yyscanner ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#define YY_BUF_SIZE 16384 -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -/* %if-not-reentrant */ -/* %endif */ - -/* %if-c-only */ -/* %if-not-reentrant */ -/* %endif */ -/* %endif */ - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* Note: We specifically omit the test for yy_rule_can_match_eol because it requires - * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE promela_lex. - * One obvious solution it to make yy_act a global. I tried that, and saw - * a 5% performance hit in a non-yylineno scanner, because yy_act is - * normally declared as a register variable-- so it is not worth it. - */ -#define YY_LESS_LINENO(n) \ - do { \ - yy_size_t yyl;\ - for ( yyl = n; yyl < yyleng; ++yyl )\ - if ( yytext[yyl] == '\n' )\ - --yylineno;\ - }while(0) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = yyg->yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state { - /* %if-c-only */ - FILE *yy_input_file; - /* %endif */ - - /* %if-c++-only */ - /* %endif */ - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - yy_size_t yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via promela_restart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - -}; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* %if-c-only Standard (non-C++) definition */ -/* %not-for-header */ - -/* %if-not-reentrant */ -/* %endif */ -/* %ok-for-header */ - -/* %endif */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ - ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ - : NULL) - -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] - -/* %if-c-only Standard (non-C++) definition */ - -/* %if-not-reentrant */ -/* %not-for-header */ - -/* %ok-for-header */ - -/* %endif */ - -void promela_restart (FILE *input_file ,yyscan_t yyscanner ); -void promela__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE promela__create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void promela__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void promela__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void promela_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void promela_pop_buffer_state (yyscan_t yyscanner ); - -static void promela_ensure_buffer_stack (yyscan_t yyscanner ); -static void promela__load_buffer_state (yyscan_t yyscanner ); -static void promela__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); - -#define YY_FLUSH_BUFFER promela__flush_buffer(YY_CURRENT_BUFFER ,yyscanner) - -YY_BUFFER_STATE promela__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE promela__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE promela__scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); - -/* %endif */ - -void *promela_alloc (yy_size_t ,yyscan_t yyscanner ); -void *promela_realloc (void *,yy_size_t ,yyscan_t yyscanner ); -void promela_free (void * ,yyscan_t yyscanner ); - -#define yy_new_buffer promela__create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - promela_ensure_buffer_stack (yyscanner); \ - YY_CURRENT_BUFFER_LVALUE = \ - promela__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - promela_ensure_buffer_stack (yyscanner); \ - YY_CURRENT_BUFFER_LVALUE = \ - promela__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */ - -#define promela_wrap(n) 1 -#define YY_SKIP_YYWRAP - -#define FLEX_DEBUG - -typedef unsigned char YY_CHAR; - -typedef int yy_state_type; - -#define yytext_ptr yytext_r - -/* %if-c-only Standard (non-C++) definition */ - -static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); -static int yy_get_next_buffer (yyscan_t yyscanner ); -static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); - -/* %endif */ - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yyg->yytext_ptr = yy_bp; \ -/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\ - yyleng = (yy_size_t) (yy_cp - yy_bp); \ - yyg->yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ -/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\ - yyg->yy_c_buf_p = yy_cp; - -/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */ -#define YY_NUM_RULES 46 -#define YY_END_OF_BUFFER 47 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; -}; -static yyconst flex_int16_t yy_accept[126] = { - 0, - 0, 0, 47, 45, 44, 44, 8, 45, 14, 25, - 45, 33, 34, 12, 15, 31, 16, 30, 13, 42, - 32, 21, 39, 22, 43, 43, 35, 36, 26, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 37, - 27, 38, 9, 44, 23, 0, 40, 0, 28, 0, - 41, 0, 10, 11, 0, 42, 17, 19, 24, 20, - 18, 43, 0, 0, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 29, 0, 41, 0, 0, 0, 43, 43, 2, 43, - 43, 43, 3, 43, 43, 43, 43, 43, 43, 43, - - 43, 0, 1, 43, 43, 43, 43, 43, 4, 43, - 43, 43, 1, 43, 43, 43, 43, 43, 7, 5, - 43, 43, 6, 43, 0 -} ; - -static yyconst flex_int32_t yy_ec[256] = { - 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 5, 1, 1, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 1, 18, 19, - 20, 21, 1, 1, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 23, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 24, 25, 26, 27, 22, 1, 28, 29, 22, 30, - - 31, 32, 33, 34, 35, 22, 36, 37, 38, 39, - 40, 41, 22, 42, 43, 44, 45, 22, 22, 22, - 46, 22, 47, 48, 49, 50, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 -} ; - -static yyconst flex_int32_t yy_meta[51] = { - 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, - 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 1, 1, 1 -} ; - -static yyconst flex_int16_t yy_base[131] = { - 0, - 0, 0, 172, 173, 49, 51, 151, 50, 173, 163, - 48, 173, 173, 173, 157, 173, 154, 173, 156, 149, - 173, 38, 145, 39, 0, 56, 173, 173, 173, 20, - 31, 136, 124, 131, 117, 118, 34, 30, 120, 173, - 110, 173, 173, 77, 173, 57, 173, 154, 173, 59, - 173, 66, 173, 173, 145, 138, 173, 173, 173, 173, - 173, 0, 76, 75, 111, 109, 108, 111, 106, 112, - 104, 108, 100, 110, 104, 108, 100, 96, 99, 96, - 173, 77, 78, 84, 127, 77, 106, 96, 0, 98, - 103, 90, 0, 91, 92, 88, 88, 93, 96, 95, - - 90, 78, 173, 82, 92, 91, 77, 76, 0, 80, - 88, 75, 96, 62, 73, 71, 68, 59, 0, 0, - 65, 65, 0, 65, 173, 109, 111, 88, 113, 115 -} ; - -static yyconst flex_int16_t yy_def[131] = { - 0, - 125, 1, 125, 125, 125, 125, 125, 126, 125, 125, - 127, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 125, 125, 125, 128, 128, 125, 125, 125, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 125, - 125, 125, 125, 125, 125, 126, 125, 126, 125, 127, - 125, 129, 125, 125, 130, 125, 125, 125, 125, 125, - 125, 128, 126, 127, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 125, 127, 127, 129, 130, 130, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - - 128, 130, 125, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 130, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 0, 125, 125, 125, 125, 125 -} ; - -static yyconst flex_int16_t yy_nxt[224] = { - 0, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 4, 28, 29, 30, 31, 25, - 25, 32, 25, 25, 33, 25, 34, 35, 25, 25, - 36, 25, 37, 38, 39, 25, 40, 41, 42, 43, - 44, 44, 44, 44, 47, 51, 57, 58, 60, 61, - 63, 47, 65, 64, 66, 67, 51, 75, 50, 76, - 68, 78, 52, 83, 48, 79, 69, 77, 44, 44, - 47, 48, 51, 52, 51, 51, 50, 102, 86, 62, - 84, 83, 103, 113, 89, 124, 123, 122, 121, 52, - - 48, 52, 52, 89, 120, 119, 86, 118, 84, 46, - 46, 50, 50, 82, 82, 85, 85, 117, 116, 89, - 115, 89, 109, 114, 112, 111, 109, 110, 109, 108, - 107, 106, 105, 89, 89, 89, 104, 86, 101, 100, - 99, 98, 97, 96, 95, 94, 93, 89, 92, 91, - 90, 89, 88, 87, 56, 86, 125, 81, 80, 74, - 73, 72, 71, 70, 59, 56, 55, 54, 53, 49, - 45, 125, 3, 125, 125, 125, 125, 125, 125, 125, - 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, - - 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 125, 125 -} ; - -static yyconst flex_int16_t yy_chk[224] = { - 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 5, 5, 6, 6, 8, 11, 22, 22, 24, 24, - 26, 46, 30, 26, 30, 31, 50, 37, 52, 37, - 31, 38, 11, 52, 8, 38, 31, 37, 44, 44, - 63, 46, 64, 50, 82, 83, 84, 86, 102, 128, - 52, 84, 86, 102, 124, 122, 121, 118, 117, 64, - - 63, 82, 83, 116, 115, 114, 113, 112, 84, 126, - 126, 127, 127, 129, 129, 130, 130, 111, 110, 108, - 107, 106, 105, 104, 101, 100, 99, 98, 97, 96, - 95, 94, 92, 91, 90, 88, 87, 85, 80, 79, - 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, - 68, 67, 66, 65, 56, 55, 48, 41, 39, 36, - 35, 34, 33, 32, 23, 20, 19, 17, 15, 10, - 7, 3, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, - - 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 125, 125 -} ; - -/* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[47] = { - 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 1, 0, 0, -}; - -static yyconst flex_int16_t yy_rule_linenum[46] = { - 0, - 44, 46, 51, 52, 53, 54, 55, 57, 58, 59, - 60, 62, 63, 64, 66, 67, 69, 70, 72, 73, - 74, 75, 77, 78, 80, 81, 82, 85, 86, 88, - 89, 90, 92, 93, 95, 96, 98, 99, 101, 103, - 106, 111, 112, 114, 117 -} ; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -#line 1 "promela.l" -/* see: http://www.phpcompiler.org/articles/reentrantparser.html */ -/* see: http://spinroot.com/spin/Man/operators.html */ -#define YY_NO_UNISTD_H 1 -#line 16 "promela.l" - -#include "../PromelaParser.h" -#include "promela.tab.hpp" -#define YYSTYPE PROMELA_STYPE -#define YYLTYPE PROMELA_LTYPE -#define YY_USER_INIT \ - yycolumn = yylloc->first_line = yylloc->first_column = 0; \ - yylineno = yylloc->last_line = yylloc->last_column = 0; \ - -//int yycolumn = 1; - -#define YY_USER_ACTION \ -{ \ - yylloc->first_line = yylineno; \ - yylloc->first_column = yycolumn; \ - yylloc->last_column = yycolumn + yyleng; \ - yylloc->last_line = yylineno; \ - yycolumn = yycolumn + yyleng; \ -} - -#line 661 "promela.lex.yy.cpp" - -#define INITIAL 0 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -/* %if-c-only */ -#include <unistd.h> -/* %endif */ -/* %if-c++-only */ -/* %endif */ -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -/* %if-c-only Reentrant structure and macros (non-C++). */ -/* %if-reentrant */ - -/* Holds the entire state of the reentrant scanner. */ -struct yyguts_t { - - /* User-defined. Not touched by flex. */ - YY_EXTRA_TYPE yyextra_r; - - /* The rest are the same as the globals declared in the non-reentrant scanner. */ - FILE *yyin_r, *yyout_r; - size_t yy_buffer_stack_top; /**< index of top of stack. */ - size_t yy_buffer_stack_max; /**< capacity of stack. */ - YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ - char yy_hold_char; - yy_size_t yy_n_chars; - yy_size_t yyleng_r; - char *yy_c_buf_p; - int yy_init; - int yy_start; - int yy_did_buffer_switch_on_eof; - int yy_start_stack_ptr; - int yy_start_stack_depth; - int *yy_start_stack; - yy_state_type yy_last_accepting_state; - char* yy_last_accepting_cpos; - - int yylineno_r; - int yy_flex_debug_r; - - char *yytext_r; - int yy_more_flag; - int yy_more_len; - - YYSTYPE * yylval_r; - - YYLTYPE * yylloc_r; - -}; /* end struct yyguts_t */ - -/* %if-c-only */ - -static int yy_init_globals (yyscan_t yyscanner ); - -/* %endif */ - -/* %if-reentrant */ - -/* This must go here because YYSTYPE and YYLTYPE are included - * from bison output in section 1.*/ -# define yylval yyg->yylval_r - -# define yylloc yyg->yylloc_r - -int promela_lex_init (yyscan_t* scanner); - -int promela_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); - -/* %endif */ - -/* %endif End reentrant structures and macros. */ - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int promela_lex_destroy (yyscan_t yyscanner ); - -int promela_get_debug (yyscan_t yyscanner ); - -void promela_set_debug (int debug_flag ,yyscan_t yyscanner ); - -YY_EXTRA_TYPE promela_get_extra (yyscan_t yyscanner ); - -void promela_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); - -FILE *promela_get_in (yyscan_t yyscanner ); - -void promela_set_in (FILE * in_str ,yyscan_t yyscanner ); - -FILE *promela_get_out (yyscan_t yyscanner ); - -void promela_set_out (FILE * out_str ,yyscan_t yyscanner ); - -yy_size_t promela_get_leng (yyscan_t yyscanner ); - -char *promela_get_text (yyscan_t yyscanner ); - -int promela_get_lineno (yyscan_t yyscanner ); - -void promela_set_lineno (int line_number ,yyscan_t yyscanner ); - -/* %if-bison-bridge */ - -YYSTYPE * promela_get_lval (yyscan_t yyscanner ); - -void promela_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); - -YYLTYPE *promela_get_lloc (yyscan_t yyscanner ); - -void promela_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); - -/* %endif */ - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int promela_wrap (yyscan_t yyscanner ); -#else -extern int promela_wrap (yyscan_t yyscanner ); -#endif -#endif - -/* %not-for-header */ - -static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner); - -/* %ok-for-header */ - -/* %endif */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); -#endif - -#ifndef YY_NO_INPUT -/* %if-c-only Standard (non-C++) definition */ -/* %not-for-header */ - -#ifdef __cplusplus -static int yyinput (yyscan_t yyscanner ); -#else -static int input (yyscan_t yyscanner ); -#endif -/* %ok-for-header */ - -/* %endif */ -#endif - -/* %if-c-only */ - -/* %endif */ - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* %if-c-only Standard (non-C++) definition */ -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO fwrite( yytext, yyleng, 1, yyout ) -/* %endif */ -/* %if-c++-only C++ definition */ -/* %endif */ -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ -/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - yy_size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ -/* %if-c++-only C++ definition \ */\ -/* %endif */ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -/* %if-c-only */ -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) -/* %endif */ -/* %if-c++-only */ -/* %endif */ -#endif - -/* %if-tables-serialization structures and prototypes */ -/* %not-for-header */ - -/* %ok-for-header */ - -/* %not-for-header */ - -/* %tables-yydmap generated elements */ -/* %endif */ -/* end tables serialization structures and prototypes */ - -/* %ok-for-header */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 -/* %if-c-only Standard (non-C++) definition */ - -extern int promela_lex \ -(YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner); - -#define YY_DECL int promela_lex \ - (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) -/* %endif */ -/* %if-c++-only C++ definition */ -/* %endif */ -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -/* %% [6.0] YY_RULE_SETUP definition goes here */ -#define YY_RULE_SETUP \ - YY_USER_ACTION - -/* %not-for-header */ - -/** The main scanner function which does all the work. - */ -YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* %% [7.0] user's declarations go here */ -#line 42 "promela.l" - - -#line 970 "promela.lex.yy.cpp" - - yylval = yylval_param; - - yylloc = yylloc_param; - - if ( !yyg->yy_init ) { - yyg->yy_init = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yyg->yy_start ) - yyg->yy_start = 1; /* first start state */ - - if ( ! yyin ) - /* %if-c-only */ - yyin = stdin; - /* %endif */ - /* %if-c++-only */ - /* %endif */ - - if ( ! yyout ) - /* %if-c-only */ - yyout = stdout; - /* %endif */ - /* %if-c++-only */ - /* %endif */ - - if ( ! YY_CURRENT_BUFFER ) { - promela_ensure_buffer_stack (yyscanner); - YY_CURRENT_BUFFER_LVALUE = - promela__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); - } - - promela__load_buffer_state(yyscanner ); - } - - while ( 1 ) { /* loops until end-of-file is reached */ - /* %% [8.0] yymore()-related code goes here */ - yy_cp = yyg->yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yyg->yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - /* %% [9.0] code to set up and find next match goes here */ - yy_current_state = yyg->yy_start; -yy_match: - do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 126 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } while ( yy_current_state != 125 ); - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - -yy_find_action: - /* %% [10.0] code to find the action number goes here */ - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - - /* %% [11.0] code for yylineno update goes here */ - - if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { - yy_size_t yyl; - for ( yyl = 0; yyl < yyleng; ++yyl ) - if ( yytext[yyl] == '\n' ) - - do { - yylineno++; - yycolumn=0; - } while(0) - ; - } - -do_action: /* This label is used only to access EOF actions. */ - - /* %% [12.0] debug code goes here */ - if ( yy_flex_debug ) { - if ( yy_act == 0 ) - fprintf( stderr, "--scanner backing up\n" ); - else if ( yy_act < 46 ) - fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n", - (long)yy_rule_linenum[yy_act], yytext ); - else if ( yy_act == 46 ) - fprintf( stderr, "--accepting default rule (\"%s\")\n", - yytext ); - else if ( yy_act == 47 ) - fprintf( stderr, "--(end of buffer or a NUL)\n" ); - else - fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); - } - - switch ( yy_act ) { - /* beginning of action switch */ - /* %% [13.0] actions go here */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yyg->yy_hold_char; - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - goto yy_find_action; - - case 1: - /* rule 1 can match eol */ - YY_RULE_SETUP -#line 44 "promela.l" - /* multiline comments */ - YY_BREAK - case 2: - YY_RULE_SETUP -#line 46 "promela.l" - { - yylval->value = strdup(yytext); - return PML_TYPE; - } - YY_BREAK - case 3: - YY_RULE_SETUP -#line 51 "promela.l" - { return PML_LEN; } - YY_BREAK - case 4: - YY_RULE_SETUP -#line 52 "promela.l" - { yylval->value = strdup(yytext); return PML_CONST; } - YY_BREAK - case 5: - YY_RULE_SETUP -#line 53 "promela.l" - { return PML_PRINT; } - YY_BREAK - case 6: - YY_RULE_SETUP -#line 54 "promela.l" - { return PML_TYPEDEF; } - YY_BREAK - case 7: - YY_RULE_SETUP -#line 55 "promela.l" - { return PML_ASSERT; } - YY_BREAK - case 8: - YY_RULE_SETUP -#line 57 "promela.l" - { return PML_NEG; } - YY_BREAK - case 9: - YY_RULE_SETUP -#line 58 "promela.l" - { return PML_COMPL; } - YY_BREAK - case 10: - YY_RULE_SETUP -#line 59 "promela.l" - { return PML_INCR; } - YY_BREAK - case 11: - YY_RULE_SETUP -#line 60 "promela.l" - { return PML_DECR; } - YY_BREAK - case 12: - YY_RULE_SETUP -#line 62 "promela.l" - { return PML_TIMES; } - YY_BREAK - case 13: - YY_RULE_SETUP -#line 63 "promela.l" - { return PML_DIVIDE; } - YY_BREAK - case 14: - YY_RULE_SETUP -#line 64 "promela.l" - { return PML_MODULO; } - YY_BREAK - case 15: - YY_RULE_SETUP -#line 66 "promela.l" - { return PML_PLUS; } - YY_BREAK - case 16: - YY_RULE_SETUP -#line 67 "promela.l" - { return PML_MINUS; } - YY_BREAK - case 17: - YY_RULE_SETUP -#line 69 "promela.l" - { return PML_LSHIFT; } - YY_BREAK - case 18: - YY_RULE_SETUP -#line 70 "promela.l" - { return PML_RSHIFT; } - YY_BREAK - case 19: - YY_RULE_SETUP -#line 72 "promela.l" - { return PML_LE; } - YY_BREAK - case 20: - YY_RULE_SETUP -#line 73 "promela.l" - { return PML_GE; } - YY_BREAK - case 21: - YY_RULE_SETUP -#line 74 "promela.l" - { return PML_LT; } - YY_BREAK - case 22: - YY_RULE_SETUP -#line 75 "promela.l" - { return PML_GT; } - YY_BREAK - case 23: - YY_RULE_SETUP -#line 77 "promela.l" - { return PML_NE; } - YY_BREAK - case 24: - YY_RULE_SETUP -#line 78 "promela.l" - { return PML_EQ; } - YY_BREAK - case 25: - YY_RULE_SETUP -#line 80 "promela.l" - { return PML_BITAND; } - YY_BREAK - case 26: - YY_RULE_SETUP -#line 81 "promela.l" - { return PML_BITXOR; } - YY_BREAK - case 27: - YY_RULE_SETUP -#line 82 "promela.l" - { return PML_BITOR; } - YY_BREAK - case 28: - YY_RULE_SETUP -#line 85 "promela.l" - { return PML_AND; } - YY_BREAK - case 29: - YY_RULE_SETUP -#line 86 "promela.l" - { return PML_OR; } - YY_BREAK - case 30: - YY_RULE_SETUP -#line 88 "promela.l" - { return PML_DOT; } - YY_BREAK - case 31: - YY_RULE_SETUP -#line 89 "promela.l" - { return PML_COMMA; } - YY_BREAK - case 32: - YY_RULE_SETUP -#line 90 "promela.l" - { return PML_SEMI; } - YY_BREAK - case 33: - YY_RULE_SETUP -#line 92 "promela.l" - { return '('; } - YY_BREAK - case 34: - YY_RULE_SETUP -#line 93 "promela.l" - { return ')'; } - YY_BREAK - case 35: - YY_RULE_SETUP -#line 95 "promela.l" - { return '['; } - YY_BREAK - case 36: - YY_RULE_SETUP -#line 96 "promela.l" - { return ']'; } - YY_BREAK - case 37: - YY_RULE_SETUP -#line 98 "promela.l" - { return '{'; } - YY_BREAK - case 38: - YY_RULE_SETUP -#line 99 "promela.l" - { return '}'; } - YY_BREAK - case 39: - YY_RULE_SETUP -#line 101 "promela.l" - { return PML_ASGN; } - YY_BREAK - case 40: - /* rule 40 can match eol */ - YY_RULE_SETUP -#line 103 "promela.l" - { yylval->value = strdup(yytext); return(PML_STRING); } - YY_BREAK - case 41: - /* rule 41 can match eol */ - YY_RULE_SETUP -#line 106 "promela.l" - { - /* Non PROMELA extension for single quoted string literals */ - yylval->value = strdup(yytext); - return(PML_STRING); - } - YY_BREAK - case 42: - YY_RULE_SETUP -#line 111 "promela.l" - { yylval->value = strdup(yytext); return PML_CONST; } - YY_BREAK - case 43: - YY_RULE_SETUP -#line 112 "promela.l" - { yylval->value = strdup(yytext); return PML_NAME; } - YY_BREAK - case 44: - /* rule 44 can match eol */ - YY_RULE_SETUP -#line 114 "promela.l" - /* eat up whitespace */ - YY_BREAK - case 45: - YY_RULE_SETUP -#line 117 "promela.l" - { /*printf( "Unrecognized character: %s\n", yytext ); */ } - YY_BREAK - case 46: - YY_RULE_SETUP -#line 118 "promela.l" - ECHO; - YY_BREAK -#line 1336 "promela.lex.yy.cpp" - case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yyg->yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * promela_lex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) { - /* This was really a NUL. */ - yy_state_type yy_next_state; - - yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( yyscanner ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); - - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) { - /* Consume the NUL. */ - yy_cp = ++yyg->yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else { - /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */ - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( yyscanner ) ) { - case EOB_ACT_END_OF_FILE: { - yyg->yy_did_buffer_switch_on_eof = 0; - - if ( promela_wrap(yyscanner ) ) { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else { - if ( ! yyg->yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yyg->yy_c_buf_p = - yyg->yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( yyscanner ); - - yy_cp = yyg->yy_c_buf_p; - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yyg->yy_c_buf_p = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; - - yy_current_state = yy_get_previous_state( yyscanner ); - - yy_cp = yyg->yy_c_buf_p; - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ -} /* end of promela_lex */ -/* %ok-for-header */ - -/* %if-c++-only */ -/* %not-for-header */ - -/* %ok-for-header */ - -/* %endif */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -/* %if-c-only */ -static int yy_get_next_buffer (yyscan_t yyscanner) -/* %endif */ -/* %if-c++-only */ -/* %endif */ -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = yyg->yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { - /* Don't try to fill the buffer, so this is an EOF. */ - if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; - - else { - yy_size_t num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) { - /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; - - int yy_c_buf_p_offset = - (int) (yyg->yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) { - yy_size_t new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - promela_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); - } else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - if ( yyg->yy_n_chars == 0 ) { - if ( number_to_move == YY_MORE_ADJ ) { - ret_val = EOB_ACT_END_OF_FILE; - promela_restart(yyin ,yyscanner); - } - - else { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) promela_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - yyg->yy_n_chars += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -/* %if-c-only */ -/* %not-for-header */ - -static yy_state_type yy_get_previous_state (yyscan_t yyscanner) -/* %endif */ -/* %if-c++-only */ -/* %endif */ -{ - register yy_state_type yy_current_state; - register char *yy_cp; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* %% [15.0] code to get the start state into yy_current_state goes here */ - yy_current_state = yyg->yy_start; - - for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) { - /* %% [16.0] code to find the next state goes here */ - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 126 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ -/* %if-c-only */ -static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) -/* %endif */ -/* %if-c++-only */ -/* %endif */ -{ - register int yy_is_jam; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ - /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ - register char *yy_cp = yyg->yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 126 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 125); - - return yy_is_jam ? 0 : yy_current_state; -} - -/* %if-c-only */ - -static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner) -/* %endif */ -/* %if-c++-only */ -/* %endif */ -{ - register char *yy_cp; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - yy_cp = yyg->yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yyg->yy_hold_char; - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { - /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register yy_size_t number_to_move = yyg->yy_n_chars + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - - while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - - if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - /* %% [18.0] update yylineno here */ - - if ( c == '\n' ) { - --yylineno; - } - - yyg->yytext_ptr = yy_bp; - yyg->yy_hold_char = *yy_cp; - yyg->yy_c_buf_p = yy_cp; -} -/* %if-c-only */ - -/* %endif */ - -/* %if-c-only */ -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput (yyscan_t yyscanner) -#else -static int input (yyscan_t yyscanner) -#endif - -/* %endif */ -/* %if-c++-only */ -/* %endif */ -{ - int c; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - *yyg->yy_c_buf_p = yyg->yy_hold_char; - - if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) - /* This was really a NUL. */ - *yyg->yy_c_buf_p = '\0'; - - else { - /* need more input */ - yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; - ++yyg->yy_c_buf_p; - - switch ( yy_get_next_buffer( yyscanner ) ) { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - promela_restart(yyin ,yyscanner); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: { - if ( promela_wrap(yyscanner ) ) - return 0; - - if ( ! yyg->yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(yyscanner); -#else - return input(yyscanner); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yyg->yy_c_buf_p = yyg->yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ - *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ - yyg->yy_hold_char = *++yyg->yy_c_buf_p; - - /* %% [19.0] update BOL and yylineno */ - if ( c == '\n' ) - - do { - yylineno++; - yycolumn=0; - } while(0) - ; - - return c; -} -/* %if-c-only */ -#endif /* ifndef YY_NO_INPUT */ -/* %endif */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * @param yyscanner The scanner object. - * @note This function does not reset the start condition to @c INITIAL . - */ -/* %if-c-only */ -void promela_restart (FILE * input_file , yyscan_t yyscanner) -/* %endif */ -/* %if-c++-only */ -/* %endif */ -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if ( ! YY_CURRENT_BUFFER ) { - promela_ensure_buffer_stack (yyscanner); - YY_CURRENT_BUFFER_LVALUE = - promela__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); - } - - promela__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); - promela__load_buffer_state(yyscanner ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * @param yyscanner The scanner object. - */ -/* %if-c-only */ -void promela__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) -/* %endif */ -/* %if-c++-only */ -/* %endif */ -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* TODO. We should be able to replace this entire function body - * with - * promela_pop_buffer_state(); - * promela_push_buffer_state(new_buffer); - */ - promela_ensure_buffer_stack (yyscanner); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) { - /* Flush out information for old buffer. */ - *yyg->yy_c_buf_p = yyg->yy_hold_char; - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - promela__load_buffer_state(yyscanner ); - - /* We don't actually know whether we did this switch during - * EOF (promela_wrap()) processing, but the only time this flag - * is looked at is after promela_wrap() is called, so it's safe - * to go ahead and always set it. - */ - yyg->yy_did_buffer_switch_on_eof = 1; -} - -/* %if-c-only */ -static void promela__load_buffer_state (yyscan_t yyscanner) -/* %endif */ -/* %if-c++-only */ -/* %endif */ -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - yyg->yy_hold_char = *yyg->yy_c_buf_p; -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * @param yyscanner The scanner object. - * @return the allocated buffer state. - */ -/* %if-c-only */ -YY_BUFFER_STATE promela__create_buffer (FILE * file, int size , yyscan_t yyscanner) -/* %endif */ -/* %if-c++-only */ -/* %endif */ -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) promela_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in promela__create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) promela_alloc(b->yy_buf_size + 2 ,yyscanner ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in promela__create_buffer()" ); - - b->yy_is_our_buffer = 1; - - promela__init_buffer(b,file ,yyscanner); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with promela__create_buffer() - * @param yyscanner The scanner object. - */ -/* %if-c-only */ -void promela__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) -/* %endif */ -/* %if-c++-only */ -/* %endif */ -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - promela_free((void *) b->yy_ch_buf ,yyscanner ); - - promela_free((void *) b ,yyscanner ); -} - -/* %if-c-only */ - -/* %endif */ - -/* %if-c++-only */ -/* %endif */ - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a promela_restart() or at EOF. - */ -/* %if-c-only */ -static void promela__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) -/* %endif */ -/* %if-c++-only */ -/* %endif */ - -{ - int oerrno = errno; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - promela__flush_buffer(b ,yyscanner); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then promela__init_buffer was _probably_ - * called from promela_restart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER) { - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - /* %if-c-only */ - - b->yy_is_interactive = 0; - - /* %endif */ - /* %if-c++-only */ - /* %endif */ - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * @param yyscanner The scanner object. - */ -/* %if-c-only */ -void promela__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) -/* %endif */ -/* %if-c++-only */ -/* %endif */ -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - promela__load_buffer_state(yyscanner ); -} - -/* %if-c-or-c++ */ -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * @param yyscanner The scanner object. - */ -/* %if-c-only */ -void promela_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) -/* %endif */ -/* %if-c++-only */ -/* %endif */ -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (new_buffer == NULL) - return; - - promela_ensure_buffer_stack(yyscanner); - - /* This block is copied from promela__switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) { - /* Flush out information for old buffer. */ - *yyg->yy_c_buf_p = yyg->yy_hold_char; - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - yyg->yy_buffer_stack_top++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from promela__switch_to_buffer. */ - promela__load_buffer_state(yyscanner ); - yyg->yy_did_buffer_switch_on_eof = 1; -} -/* %endif */ - -/* %if-c-or-c++ */ -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * @param yyscanner The scanner object. - */ -/* %if-c-only */ -void promela_pop_buffer_state (yyscan_t yyscanner) -/* %endif */ -/* %if-c++-only */ -/* %endif */ -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (!YY_CURRENT_BUFFER) - return; - - promela__delete_buffer(YY_CURRENT_BUFFER ,yyscanner); - YY_CURRENT_BUFFER_LVALUE = NULL; - if (yyg->yy_buffer_stack_top > 0) - --yyg->yy_buffer_stack_top; - - if (YY_CURRENT_BUFFER) { - promela__load_buffer_state(yyscanner ); - yyg->yy_did_buffer_switch_on_eof = 1; - } -} -/* %endif */ - -/* %if-c-or-c++ */ -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -/* %if-c-only */ -static void promela_ensure_buffer_stack (yyscan_t yyscanner) -/* %endif */ -/* %if-c++-only */ -/* %endif */ -{ - yy_size_t num_to_alloc; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if (!yyg->yy_buffer_stack) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - yyg->yy_buffer_stack = (struct yy_buffer_state**)promela_alloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - , yyscanner); - if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in promela_ensure_buffer_stack()" ); - - memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - yyg->yy_buffer_stack_max = num_to_alloc; - yyg->yy_buffer_stack_top = 0; - return; - } - - if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1) { - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = yyg->yy_buffer_stack_max + grow_size; - yyg->yy_buffer_stack = (struct yy_buffer_state**)promela_realloc - (yyg->yy_buffer_stack, - num_to_alloc * sizeof(struct yy_buffer_state*) - , yyscanner); - if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in promela_ensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); - yyg->yy_buffer_stack_max = num_to_alloc; - } -} -/* %endif */ - -/* %if-c-only */ -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE promela__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) promela_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in promela__scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - promela__switch_to_buffer(b ,yyscanner ); - - return b; -} -/* %endif */ - -/* %if-c-only */ -/** Setup the input buffer state to scan a string. The next call to promela_lex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * promela__scan_bytes() instead. - */ -YY_BUFFER_STATE promela__scan_string (yyconst char * yystr , yyscan_t yyscanner) { - - return promela__scan_bytes(yystr,strlen(yystr) ,yyscanner); -} -/* %endif */ - -/* %if-c-only */ -/** Setup the input buffer state to scan the given bytes. The next call to promela_lex() will - * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. - * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE promela__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n, i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) promela_alloc(n ,yyscanner ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in promela__scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = promela__scan_buffer(buf,n ,yyscanner); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in promela__scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} -/* %endif */ - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -/* %if-c-only */ -static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} -/* %endif */ -/* %if-c++-only */ -/* %endif */ - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = yyg->yy_hold_char; \ - yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ - yyg->yy_hold_char = *yyg->yy_c_buf_p; \ - *yyg->yy_c_buf_p = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/* %if-c-only */ -/* %if-reentrant */ - -/** Get the user-defined data for this scanner. - * @param yyscanner The scanner object. - */ -YY_EXTRA_TYPE promela_get_extra (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyextra; -} - -/* %endif */ - -/** Get the current line number. - * @param yyscanner The scanner object. - */ -int promela_get_lineno (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if (! YY_CURRENT_BUFFER) - return 0; - - return yylineno; -} - -/** Get the current column number. - * @param yyscanner The scanner object. - */ -int promela_get_column (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if (! YY_CURRENT_BUFFER) - return 0; - - return yycolumn; -} - -/** Get the input stream. - * @param yyscanner The scanner object. - */ -FILE *promela_get_in (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyin; -} - -/** Get the output stream. - * @param yyscanner The scanner object. - */ -FILE *promela_get_out (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyout; -} - -/** Get the length of the current token. - * @param yyscanner The scanner object. - */ -yy_size_t promela_get_leng (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyleng; -} - -/** Get the current token. - * @param yyscanner The scanner object. - */ - -char *promela_get_text (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yytext; -} - -/* %if-reentrant */ - -/** Set the user-defined data. This data is never touched by the scanner. - * @param user_defined The data to be associated with this scanner. - * @param yyscanner The scanner object. - */ -void promela_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyextra = user_defined ; -} - -/* %endif */ - -/** Set the current line number. - * @param line_number - * @param yyscanner The scanner object. - */ -void promela_set_lineno (int line_number , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* lineno is only valid if an input buffer exists. */ - if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "promela_set_lineno called with no buffer" , yyscanner); - - yylineno = line_number; -} - -/** Set the current column. - * @param line_number - * @param yyscanner The scanner object. - */ -void promela_set_column (int column_no , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* column is only valid if an input buffer exists. */ - if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "promela_set_column called with no buffer" , yyscanner); - - yycolumn = column_no; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param in_str A readable stream. - * @param yyscanner The scanner object. - * @see promela__switch_to_buffer - */ -void promela_set_in (FILE * in_str , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyin = in_str ; -} - -void promela_set_out (FILE * out_str , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyout = out_str ; -} - -int promela_get_debug (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yy_flex_debug; -} - -void promela_set_debug (int bdebug , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flex_debug = bdebug ; -} - -/* %endif */ - -/* %if-reentrant */ -/* Accessor methods for yylval and yylloc */ - -/* %if-bison-bridge */ - -YYSTYPE * promela_get_lval (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yylval; -} - -void promela_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yylval = yylval_param; -} - -YYLTYPE *promela_get_lloc (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yylloc; -} - -void promela_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yylloc = yylloc_param; -} - -/* %endif */ - -/* User-visible API */ - -/* promela_lex_init is special because it creates the scanner itself, so it is - * the ONLY reentrant function that doesn't take the scanner as the last argument. - * That's why we explicitly handle the declaration, instead of using our macros. - */ - -int promela_lex_init(yyscan_t* ptr_yy_globals) - -{ - if (ptr_yy_globals == NULL) { - errno = EINVAL; - return 1; - } - - *ptr_yy_globals = (yyscan_t) promela_alloc ( sizeof( struct yyguts_t ), NULL ); - - if (*ptr_yy_globals == NULL) { - errno = ENOMEM; - return 1; - } - - /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - - return yy_init_globals ( *ptr_yy_globals ); -} - -/* promela_lex_init_extra has the same functionality as promela_lex_init, but follows the - * convention of taking the scanner as the last argument. Note however, that - * this is a *pointer* to a scanner, as it will be allocated by this call (and - * is the reason, too, why this function also must handle its own declaration). - * The user defined value in the first argument will be available to promela_alloc in - * the yyextra field. - */ - -int promela_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) - -{ - struct yyguts_t dummy_yyguts; - - promela_set_extra (yy_user_defined, &dummy_yyguts); - - if (ptr_yy_globals == NULL) { - errno = EINVAL; - return 1; - } - - *ptr_yy_globals = (yyscan_t) promela_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - - if (*ptr_yy_globals == NULL) { - errno = ENOMEM; - return 1; - } - - /* By setting to 0xAA, we expose bugs in - yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - - promela_set_extra (yy_user_defined, *ptr_yy_globals); - - return yy_init_globals ( *ptr_yy_globals ); -} - -/* %endif if-c-only */ - -/* %if-c-only */ -static int yy_init_globals (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from promela_lex_destroy(), so don't allocate here. - */ - - yyg->yy_buffer_stack = 0; - yyg->yy_buffer_stack_top = 0; - yyg->yy_buffer_stack_max = 0; - yyg->yy_c_buf_p = (char *) 0; - yyg->yy_init = 0; - yyg->yy_start = 0; - - yyg->yy_start_stack_ptr = 0; - yyg->yy_start_stack_depth = 0; - yyg->yy_start_stack = NULL; - - /* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = (FILE *) 0; - yyout = (FILE *) 0; -#endif - - /* For future reference: Set errno on error, since we are called by - * promela_lex_init() - */ - return 0; -} -/* %endif */ - -/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */ -/* promela_lex_destroy is for both reentrant and non-reentrant scanners. */ -int promela_lex_destroy (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER) { - promela__delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); - YY_CURRENT_BUFFER_LVALUE = NULL; - promela_pop_buffer_state(yyscanner); - } - - /* Destroy the stack itself. */ - promela_free(yyg->yy_buffer_stack ,yyscanner); - yyg->yy_buffer_stack = NULL; - - /* Destroy the start condition stack. */ - promela_free(yyg->yy_start_stack ,yyscanner ); - yyg->yy_start_stack = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * promela_lex() is called, initialization will occur. */ - yy_init_globals( yyscanner); - - /* %if-reentrant */ - /* Destroy the main struct (reentrant only). */ - promela_free ( yyscanner , yyscanner ); - yyscanner = NULL; - /* %endif */ - return 0; -} -/* %endif */ - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *promela_alloc (yy_size_t size , yyscan_t yyscanner) { - return (void *) malloc( size ); -} - -void *promela_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner) { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); -} - -void promela_free (void * ptr , yyscan_t yyscanner) { - free( (char *) ptr ); /* see promela_realloc() for (char *) cast */ -} - -/* %if-tables-serialization definitions */ -/* %define-yytables The name for this specific scanner's tables. */ -#define YYTABLES_NAME "yytables" -/* %endif */ - -/* %ok-for-header */ - -#line 118 "promela.l" diff --git a/src/uscxml/plugins/datamodel/promela/parser/promela.tab.cpp b/src/uscxml/plugins/datamodel/promela/parser/promela.tab.cpp deleted file mode 100644 index 098c890..0000000 --- a/src/uscxml/plugins/datamodel/promela/parser/promela.tab.cpp +++ /dev/null @@ -1,2634 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.7.12-4996. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.7.12-4996" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - -/* Substitute the type names. */ -#define YYSTYPE PROMELA_STYPE -#define YYLTYPE PROMELA_LTYPE -/* Substitute the variable and function names. */ -#define yyparse promela_parse -#define yylex promela_lex -#define yyerror promela_error -#define yylval promela_lval -#define yychar promela_char -#define yydebug promela_debug -#define yynerrs promela_nerrs -#define yylloc promela_lloc - -/* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 14 "promela.ypp" - -#include "../PromelaParser.h" -#include "promela.tab.hpp" -#include <sys/types.h> -#include <stdarg.h> - -#define YYMAXDEPTH 20000 // default is 10000 -#define YYDEBUG 1 -#define YYERROR_VERBOSE 1 - -extern int promela_lex (PROMELA_STYPE* yylval_param, PROMELA_LTYPE* yylloc_param, void* yyscanner); - -using namespace uscxml; - -/* Line 371 of yacc.c */ -#line 93 "promela.tab.cpp" - -# ifndef YY_NULL -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr -# else -# define YY_NULL 0 -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 1 -#endif - -/* In a future release of Bison, this section will be replaced - by #include "promela.tab.hpp". */ -#ifndef YY_PROMELA_PROMELA_TAB_HPP_INCLUDED -# define YY_PROMELA_PROMELA_TAB_HPP_INCLUDED -/* Enabling traces. */ -#ifndef PROMELA_DEBUG -# if defined YYDEBUG -# if YYDEBUG -# define PROMELA_DEBUG 1 -# else -# define PROMELA_DEBUG 0 -# endif -# else /* ! defined YYDEBUG */ -# define PROMELA_DEBUG 1 -# endif /* ! defined YYDEBUG */ -#endif /* ! defined PROMELA_DEBUG */ -#if PROMELA_DEBUG -extern int promela_debug; -#endif - -/* Tokens. */ -#ifndef PROMELA_TOKENTYPE -# define PROMELA_TOKENTYPE -/* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ -enum promela_tokentype { - PML_VAR_ARRAY = 258, - PML_VARLIST = 259, - PML_DECL = 260, - PML_DECLLIST = 261, - PML_STMNT = 262, - PML_COLON = 263, - PML_EXPR = 264, - PML_NAMELIST = 265, - PML_ASSERT = 266, - PML_PRINT = 267, - PML_PRINTM = 268, - PML_LEN = 269, - PML_STRING = 270, - PML_TYPEDEF = 271, - PML_MTYPE = 272, - PML_INLINE = 273, - PML_RETURN = 274, - PML_LABEL = 275, - PML_OF = 276, - PML_GOTO = 277, - PML_BREAK = 278, - PML_ELSE = 279, - PML_SEMI = 280, - PML_ARROW = 281, - PML_IF = 282, - PML_FI = 283, - PML_DO = 284, - PML_OD = 285, - PML_FOR = 286, - PML_SELECT = 287, - PML_IN = 288, - PML_SEP = 289, - PML_DOTDOT = 290, - PML_HIDDEN = 291, - PML_SHOW = 292, - PML_ISLOCAL = 293, - PML_CONST = 294, - PML_TYPE = 295, - PML_XU = 296, - PML_NAME = 297, - PML_UNAME = 298, - PML_PNAME = 299, - PML_INAME = 300, - PML_CLAIM = 301, - PML_TRACE = 302, - PML_INIT = 303, - PML_LTL = 304, - PML_COMMA = 305, - PML_ASGN = 306, - PML_AND = 307, - PML_OR = 308, - PML_BITAND = 309, - PML_BITXOR = 310, - PML_BITOR = 311, - PML_NE = 312, - PML_EQ = 313, - PML_LE = 314, - PML_GE = 315, - PML_LT = 316, - PML_GT = 317, - PML_RSHIFT = 318, - PML_LSHIFT = 319, - PML_MINUS = 320, - PML_PLUS = 321, - PML_MODULO = 322, - PML_DIVIDE = 323, - PML_TIMES = 324, - PML_DECR = 325, - PML_INCR = 326, - PML_COMPL = 327, - PML_NEG = 328, - PML_CMPND = 329, - PML_DOT = 330 -}; -#endif - - -#if ! defined PROMELA_STYPE && ! defined PROMELA_STYPE_IS_DECLARED -typedef union PROMELA_STYPE { - /* Line 387 of yacc.c */ -#line 39 "promela.ypp" - - uscxml::PromelaParserNode* node; - char* value; - - - /* Line 387 of yacc.c */ -#line 225 "promela.tab.cpp" -} PROMELA_STYPE; -# define PROMELA_STYPE_IS_TRIVIAL 1 -# define promela_stype PROMELA_STYPE /* obsolescent; will be withdrawn */ -# define PROMELA_STYPE_IS_DECLARED 1 -#endif - -#if ! defined PROMELA_LTYPE && ! defined PROMELA_LTYPE_IS_DECLARED -typedef struct PROMELA_LTYPE { - int first_line; - int first_column; - int last_line; - int last_column; -} PROMELA_LTYPE; -# define promela_ltype PROMELA_LTYPE /* obsolescent; will be withdrawn */ -# define PROMELA_LTYPE_IS_DECLARED 1 -# define PROMELA_LTYPE_IS_TRIVIAL 1 -#endif - - -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int promela_parse (void *YYPARSE_PARAM); -#else -int promela_parse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int promela_parse (uscxml::PromelaParser* ctx, void * scanner); -#else -int promela_parse (); -#endif -#endif /* ! YYPARSE_PARAM */ - -#endif /* !YY_PROMELA_PROMELA_TAB_HPP_INCLUDED */ - -/* Copy the second part of user declarations. */ - -/* Line 390 of yacc.c */ -#line 265 "promela.tab.cpp" - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if (! defined __GNUC__ || __GNUC__ < 2 \ - || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)) -# define __attribute__(Spec) /* empty */ -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) -int yyi; -#endif -{ - return yyi; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -/* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC -/* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM -/* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined PROMELA_LTYPE_IS_TRIVIAL && PROMELA_LTYPE_IS_TRIVIAL \ - && defined PROMELA_STYPE_IS_TRIVIAL && PROMELA_STYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc { - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; - YYLTYPE yyls_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ - + 2 * YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 32 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 285 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 82 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 21 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 81 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 143 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 330 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = { - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 11, 12, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 13, 2, 14, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 15, 2, 16, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81 -}; - -#if PROMELA_DEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = { - 0, 0, 3, 5, 7, 9, 11, 13, 18, 21, - 22, 25, 29, 33, 37, 41, 45, 49, 53, 57, - 61, 65, 69, 73, 77, 81, 85, 89, 93, 97, - 101, 104, 107, 112, 114, 116, 118, 119, 121, 123, - 125, 129, 133, 140, 143, 149, 151, 154, 158, 160, - 164, 166, 170, 172, 176, 181, 183, 186, 190, 194, - 198, 202, 206, 210, 212, 215, 218, 220, 223, 227, - 229, 233, 236, 239, 245, 250, 255, 258, 260, 261, - 264, 266 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = { - 83, 0, -1, 92, -1, 88, -1, 98, -1, 86, - -1, 48, -1, 48, 13, 88, 14, -1, 85, 87, - -1, -1, 81, 86, -1, 11, 88, 12, -1, 88, - 72, 88, -1, 88, 71, 88, -1, 88, 75, 88, - -1, 88, 74, 88, -1, 88, 73, 88, -1, 88, - 60, 88, -1, 88, 61, 88, -1, 88, 62, 88, - -1, 88, 68, 88, -1, 88, 67, 88, -1, 88, - 66, 88, -1, 88, 65, 88, -1, 88, 64, 88, - -1, 88, 63, 88, -1, 88, 58, 88, -1, 88, - 59, 88, -1, 88, 70, 88, -1, 88, 69, 88, - -1, 79, 88, -1, 71, 88, -1, 20, 11, 84, - 12, -1, 84, -1, 45, -1, 21, -1, -1, 42, - -1, 43, -1, 44, -1, 89, 46, 93, -1, 89, - 49, 93, -1, 89, 46, 57, 15, 97, 16, -1, - 89, 91, -1, 22, 48, 15, 92, 16, -1, 90, - -1, 90, 31, -1, 90, 31, 92, -1, 94, -1, - 94, 56, 93, -1, 95, -1, 95, 57, 88, -1, - 48, -1, 48, 8, 45, -1, 48, 13, 96, 14, - -1, 45, -1, 71, 96, -1, 11, 96, 12, -1, - 96, 72, 96, -1, 96, 71, 96, -1, 96, 75, - 96, -1, 96, 74, 96, -1, 96, 73, 96, -1, - 48, -1, 97, 48, -1, 97, 56, -1, 99, -1, - 99, 31, -1, 99, 31, 98, -1, 100, -1, 84, - 57, 88, -1, 84, 77, -1, 84, 76, -1, 18, - 11, 21, 101, 12, -1, 18, 11, 84, 12, -1, - 18, 11, 45, 12, -1, 17, 88, -1, 88, -1, - -1, 56, 102, -1, 88, -1, 88, 56, 102, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint8 yyrline[] = { - 0, 85, 85, 89, 93, 99, 102, 103, 106, 121, - 122, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 154, 155, 156, 157, 163, 164, 165, 166, - 169, 170, 171, 172, 175, 178, 179, 180, 190, 191, - 194, 195, 198, 199, 200, 203, 204, 205, 206, 207, - 208, 209, 210, 213, 214, 223, 226, 227, 228, 231, - 234, 235, 236, 237, 238, 239, 240, 241, 244, 245, - 248, 249 -}; -#endif - -#if PROMELA_DEBUG || YYERROR_VERBOSE || 1 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = { - "$end", "error", "$undefined", "PML_VAR_ARRAY", "PML_VARLIST", - "PML_DECL", "PML_DECLLIST", "PML_STMNT", "PML_COLON", "PML_EXPR", - "PML_NAMELIST", "'('", "')'", "'['", "']'", "'{'", "'}'", "PML_ASSERT", - "PML_PRINT", "PML_PRINTM", "PML_LEN", "PML_STRING", "PML_TYPEDEF", - "PML_MTYPE", "PML_INLINE", "PML_RETURN", "PML_LABEL", "PML_OF", - "PML_GOTO", "PML_BREAK", "PML_ELSE", "PML_SEMI", "PML_ARROW", "PML_IF", - "PML_FI", "PML_DO", "PML_OD", "PML_FOR", "PML_SELECT", "PML_IN", - "PML_SEP", "PML_DOTDOT", "PML_HIDDEN", "PML_SHOW", "PML_ISLOCAL", - "PML_CONST", "PML_TYPE", "PML_XU", "PML_NAME", "PML_UNAME", "PML_PNAME", - "PML_INAME", "PML_CLAIM", "PML_TRACE", "PML_INIT", "PML_LTL", - "PML_COMMA", "PML_ASGN", "PML_AND", "PML_OR", "PML_BITAND", "PML_BITXOR", - "PML_BITOR", "PML_NE", "PML_EQ", "PML_LE", "PML_GE", "PML_LT", "PML_GT", - "PML_RSHIFT", "PML_LSHIFT", "PML_MINUS", "PML_PLUS", "PML_MODULO", - "PML_DIVIDE", "PML_TIMES", "PML_DECR", "PML_INCR", "PML_COMPL", - "PML_NEG", "PML_CMPND", "PML_DOT", "$accept", "program", "varref", - "pfld", "cmpnd", "sfld", "expr", "vis", "one_decl", "utype", "decl_lst", - "var_list", "ivar", "vardcl", "const_expr", "nlst", "stmnt_lst", "stmnt", - "Stmnt", "prargs", "arg", YY_NULL -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = { - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 40, 41, 91, 93, 123, 125, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = { - 0, 82, 83, 83, 83, 84, 85, 85, 86, 87, - 87, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 89, 89, 89, 89, - 90, 90, 90, 90, 91, 92, 92, 92, 93, 93, - 94, 94, 95, 95, 95, 96, 96, 96, 96, 96, - 96, 96, 96, 97, 97, 97, 98, 98, 98, 99, - 100, 100, 100, 100, 100, 100, 100, 100, 101, 101, - 102, 102 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = { - 0, 2, 1, 1, 1, 1, 1, 4, 2, 0, - 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 2, 2, 4, 1, 1, 1, 0, 1, 1, 1, - 3, 3, 6, 2, 5, 1, 2, 3, 1, 3, - 1, 3, 1, 3, 4, 1, 2, 3, 3, 3, - 3, 3, 3, 1, 2, 2, 1, 2, 3, 1, - 3, 2, 2, 5, 4, 4, 2, 1, 0, 2, - 1, 3 -}; - -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = { - 36, 0, 0, 0, 0, 35, 37, 38, 39, 34, - 6, 0, 0, 0, 33, 9, 5, 3, 0, 45, - 2, 4, 66, 69, 33, 0, 76, 0, 0, 0, - 31, 30, 1, 0, 72, 71, 0, 8, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, - 36, 67, 11, 78, 0, 0, 0, 0, 70, 10, - 26, 27, 17, 18, 19, 25, 24, 23, 22, 21, - 20, 29, 28, 13, 12, 16, 15, 14, 0, 52, - 0, 40, 48, 50, 41, 47, 77, 68, 0, 0, - 75, 74, 32, 7, 36, 0, 0, 0, 0, 0, - 80, 79, 73, 0, 53, 0, 55, 0, 0, 63, - 0, 49, 51, 0, 44, 0, 56, 54, 0, 0, - 0, 0, 0, 42, 64, 65, 81, 57, 59, 58, - 62, 61, 60 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = { - -1, 13, 24, 15, 16, 37, 110, 18, 19, 59, - 20, 91, 92, 93, 118, 120, 21, 22, 23, 99, - 111 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -112 -static const yytype_int16 yypact[] = { - 14, 53, 53, 3, 13, -112, -112, -112, -112, -112, - 15, 53, 53, 26, 34, -51, -112, 138, 81, 5, - -112, -112, 58, -112, -112, 75, 160, 169, 42, 53, - -66, -112, -112, 53, -112, -112, 42, -112, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 44, -35, 51, -112, - 72, 49, -112, 46, 88, 96, 100, 93, 160, -112, - 176, 176, 189, 189, 189, 200, 200, 207, 207, 207, - 207, 120, 120, -66, -66, -112, -112, -112, 98, -3, - 102, -112, 63, 74, -112, -112, 160, -112, 53, 113, - -112, -112, -112, -112, 62, 126, -8, 167, 51, 53, - 114, -112, -112, 267, -112, -8, -112, -8, 9, -112, - 70, -112, 160, 53, -112, 4, 48, -112, -8, -8, - -8, -8, -8, -112, -112, -112, -112, -112, 48, 48, - -112, -112, -112 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = { - -112, -112, 68, -112, 180, -112, 0, -112, -112, -112, - -33, -43, -112, -112, -111, -112, 223, -112, -112, -112, - 162 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -78 -static const yytype_int16 yytable[] = { - 17, 25, 26, 115, 125, 105, 126, 53, 54, 55, - 106, 30, 31, 89, 27, 94, 137, 138, 139, 140, - 141, 142, 90, 127, 28, 1, 32, 95, 29, 67, - 36, 2, 3, 68, 4, 5, 60, 116, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 6, 7, 8, 9, - 1, 96, 10, 117, 1, 121, 2, 3, 14, 4, - 5, 113, -46, 4, 5, 128, 129, 130, 131, 132, - 128, 129, 130, 131, 132, 11, 133, 62, -46, 61, - 10, 33, 88, 12, 9, 65, 66, 10, 9, 89, - 100, 10, 98, 56, 6, 7, 8, 103, 101, 122, - 34, 35, 102, 104, 6, 7, 8, 107, 134, 108, - 11, 130, 131, 132, 11, 112, 135, 57, 12, 14, - 58, 109, 12, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, -77, - 123, 114, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 63, 51, 52, 53, 54, 55, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 64, 119, 69, 10, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 49, 50, 51, 52, - 53, 54, 55, 124, 97, 136 -}; - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-112))) - -#define yytable_value_is_error(Yytable_value) \ - YYID (0) - -static const yytype_uint8 yycheck[] = { - 0, 1, 2, 11, 115, 8, 117, 73, 74, 75, - 13, 11, 12, 48, 11, 58, 12, 128, 129, 130, - 131, 132, 57, 14, 11, 11, 0, 60, 13, 29, - 81, 17, 18, 33, 20, 21, 31, 45, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 42, 43, 44, 45, - 11, 61, 48, 71, 11, 108, 17, 18, 0, 20, - 21, 104, 0, 20, 21, 71, 72, 73, 74, 75, - 71, 72, 73, 74, 75, 71, 16, 12, 16, 31, - 48, 57, 48, 79, 45, 27, 28, 48, 45, 48, - 12, 48, 56, 22, 42, 43, 44, 14, 12, 109, - 76, 77, 12, 15, 42, 43, 44, 15, 48, 56, - 71, 73, 74, 75, 71, 12, 56, 46, 79, 61, - 49, 57, 79, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 31, - 56, 45, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 21, 71, 72, 73, 74, 75, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 45, 48, 36, 48, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 69, 70, 71, 72, - 73, 74, 75, 16, 61, 123 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = { - 0, 11, 17, 18, 20, 21, 42, 43, 44, 45, - 48, 71, 79, 83, 84, 85, 86, 88, 89, 90, - 92, 98, 99, 100, 84, 88, 88, 11, 11, 13, - 88, 88, 0, 57, 76, 77, 81, 87, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 22, 46, 49, 91, - 31, 31, 12, 21, 45, 84, 84, 88, 88, 86, - 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 88, 88, 48, 48, - 57, 93, 94, 95, 93, 92, 88, 98, 56, 101, - 12, 12, 12, 14, 15, 8, 13, 15, 56, 57, - 88, 102, 12, 92, 45, 11, 45, 71, 96, 48, - 97, 93, 88, 56, 16, 96, 96, 14, 71, 72, - 73, 74, 75, 16, 48, 56, 102, 12, 96, 96, - 96, 96, 96 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL -/* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (&yylloc, ctx, scanner, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if defined PROMELA_LTYPE_IS_TRIVIAL && PROMELA_LTYPE_IS_TRIVIAL - -/* Print *YYLOCP on YYO. Private, do not rely on its existence. */ - -__attribute__((__unused__)) -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static unsigned -yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) -#else -static unsigned -yy_location_print_ (yyo, yylocp) -FILE *yyo; -YYLTYPE const * const yylocp; -#endif -{ - unsigned res = 0; - int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; - if (0 <= yylocp->first_line) { - res += fprintf (yyo, "%d", yylocp->first_line); - if (0 <= yylocp->first_column) - res += fprintf (yyo, ".%d", yylocp->first_column); - } - if (0 <= yylocp->last_line) { - if (yylocp->first_line < yylocp->last_line) { - res += fprintf (yyo, "-%d", yylocp->last_line); - if (0 <= end_col) - res += fprintf (yyo, ".%d", end_col); - } else if (0 <= end_col && yylocp->first_column < end_col) - res += fprintf (yyo, "-%d", end_col); - } - return res; -} - -# define YY_LOCATION_PRINT(File, Loc) \ - yy_location_print_ (File, &(Loc)) - -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval, &yylloc, scanner) -#endif - -/* Enable debugging if requested. */ -#if PROMELA_DEBUG - -# ifndef YYFPRINTF -# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, Location, ctx, scanner); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, uscxml::PromelaParser* ctx, void * scanner) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, ctx, scanner) -FILE *yyoutput; -int yytype; -YYSTYPE const * const yyvaluep; -YYLTYPE const * const yylocationp; -uscxml::PromelaParser* ctx; -void * scanner; -#endif -{ - FILE *yyo = yyoutput; - YYUSE (yyo); - if (!yyvaluep) - return; - YYUSE (yylocationp); - YYUSE (ctx); - YYUSE (scanner); -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - YYUSE (yytype); -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, uscxml::PromelaParser* ctx, void * scanner) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, ctx, scanner) -FILE *yyoutput; -int yytype; -YYSTYPE const * const yyvaluep; -YYLTYPE const * const yylocationp; -uscxml::PromelaParser* ctx; -void * scanner; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - YY_LOCATION_PRINT (yyoutput, *yylocationp); - YYFPRINTF (yyoutput, ": "); - yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, ctx, scanner); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) -yytype_int16 *yybottom; -yytype_int16 *yytop; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, uscxml::PromelaParser* ctx, void * scanner) -#else -static void -yy_reduce_print (yyvsp, yylsp, yyrule, ctx, scanner) -YYSTYPE *yyvsp; -YYLTYPE *yylsp; -int yyrule; -uscxml::PromelaParser* ctx; -void * scanner; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , &(yylsp[(yyi + 1) - (yynrhs)]) , ctx, scanner); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, yylsp, Rule, ctx, scanner); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !PROMELA_DEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !PROMELA_DEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) -const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) -char *yydest; -const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) { - if (*yystr == '"') { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } -do_not_strip_quotes: - ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULL; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> - for details. YYERROR is fine as it does not invoke this - function. - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } - } - - switch (yycount) { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - - if (*yymsg_alloc < yysize) { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } else { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, uscxml::PromelaParser* ctx, void * scanner) -#else -static void -yydestruct (yymsg, yytype, yyvaluep, yylocationp, ctx, scanner) -const char *yymsg; -int yytype; -YYSTYPE *yyvaluep; -YYLTYPE *yylocationp; -uscxml::PromelaParser* ctx; -void * scanner; -#endif -{ - YYUSE (yyvaluep); - YYUSE (yylocationp); - YYUSE (ctx); - YYUSE (scanner); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YYUSE (yytype); -} - - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) -void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (uscxml::PromelaParser* ctx, void * scanner) -#else -int -yyparse (ctx, scanner) -uscxml::PromelaParser* ctx; -void * scanner; -#endif -#endif -{ - /* The lookahead symbol. */ - int yychar; - - -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ - /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else - /* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ - static YYSTYPE yyval_default; -# define YY_INITIAL_VALUE(Value) = Value -#endif - static YYLTYPE yyloc_default -# if defined PROMELA_LTYPE_IS_TRIVIAL && PROMELA_LTYPE_IS_TRIVIAL - = { 1, 1, 1, 1 } -# endif - ; -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - - /* The semantic value of the lookahead symbol. */ - YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); - - /* Location data for the lookahead symbol. */ - YYLTYPE yylloc = yyloc_default; - - - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - `yyls': related to locations. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - /* The location stack. */ - YYLTYPE yylsa[YYINITDEPTH]; - YYLTYPE *yyls; - YYLTYPE *yylsp; - - /* The locations where the error started and ended. */ - YYLTYPE yyerror_range[3]; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - YYLTYPE yyloc; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yylsp = yyls = yylsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - yylsp[0] = yylloc; - goto yysetstate; - - /*------------------------------------------------------------. - | yynewstate -- Push a new state, which is found in yystate. | - `------------------------------------------------------------*/ -yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - -yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - YYLTYPE *yyls1 = yyls; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yyls1, yysize * sizeof (*yylsp), - &yystacksize); - - yyls = yyls1; - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); - YYSTACK_RELOCATE (yyls_alloc, yyls); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - yylsp = yyls + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - - /*-----------. - | yybackup. | - `-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } else { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - *++yylsp = yylloc; - goto yynewstate; - - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - - /*-----------------------------. - | yyreduce -- Do a reduction. | - `-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - /* Default location. */ - YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); - YY_REDUCE_PRINT (yyn); - switch (yyn) { - case 2: - /* Line 1787 of yacc.c */ -#line 85 "promela.ypp" - { - ctx->ast = (yyvsp[(1) - (1)].node); - ctx->type = PromelaParser::PROMELA_DECL; - } - break; - - case 3: - /* Line 1787 of yacc.c */ -#line 89 "promela.ypp" - { - ctx->ast = (yyvsp[(1) - (1)].node); - ctx->type = PromelaParser::PROMELA_EXPR; - } - break; - - case 4: - /* Line 1787 of yacc.c */ -#line 93 "promela.ypp" - { - ctx->ast = (yyvsp[(1) - (1)].node); - ctx->type = PromelaParser::PROMELA_STMNT; - } - break; - - case 5: - /* Line 1787 of yacc.c */ -#line 99 "promela.ypp" - { - (yyval.node) = (yyvsp[(1) - (1)].node); - } - break; - - case 6: - /* Line 1787 of yacc.c */ -#line 102 "promela.ypp" - { - (yyval.node) = ctx->value(PML_NAME, (void*)&((yylsp[(1) - (1)])), (yyvsp[(1) - (1)].value)); - free((yyvsp[(1) - (1)].value)); - } - break; - - case 7: - /* Line 1787 of yacc.c */ -#line 103 "promela.ypp" - { - (yyval.node) = ctx->node(PML_VAR_ARRAY, 2, ctx->value(PML_NAME, (void*)&((yylsp[(1) - (4)])), (yyvsp[(1) - (4)].value)), (yyvsp[(3) - (4)].node)); - free((yyvsp[(1) - (4)].value)); - } - break; - - case 8: - /* Line 1787 of yacc.c */ -#line 107 "promela.ypp" - { - if ((yyvsp[(2) - (2)].node) != NULL) { - if ((yyvsp[(2) - (2)].node)->type == PML_CMPND) { - (yyval.node) = ctx->node(PML_CMPND, 1, (yyvsp[(1) - (2)].node)); - (yyval.node)->merge((yyvsp[(2) - (2)].node)); - delete (yyvsp[(2) - (2)].node); - } else { - (yyval.node) = ctx->node(PML_CMPND, 2, (yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node)); - } - } else { - (yyval.node) = (yyvsp[(1) - (2)].node); - } - } - break; - - case 9: - /* Line 1787 of yacc.c */ -#line 121 "promela.ypp" - { - (yyval.node) = NULL; - } - break; - - case 10: - /* Line 1787 of yacc.c */ -#line 122 "promela.ypp" - { - (yyval.node) = (yyvsp[(2) - (2)].node); - } - break; - - case 11: - /* Line 1787 of yacc.c */ -#line 132 "promela.ypp" - { - (yyval.node) = (yyvsp[(2) - (3)].node); - } - break; - - case 12: - /* Line 1787 of yacc.c */ -#line 133 "promela.ypp" - { - (yyval.node) = ctx->node(PML_PLUS, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 13: - /* Line 1787 of yacc.c */ -#line 134 "promela.ypp" - { - (yyval.node) = ctx->node(PML_MINUS, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 14: - /* Line 1787 of yacc.c */ -#line 135 "promela.ypp" - { - (yyval.node) = ctx->node(PML_TIMES, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 15: - /* Line 1787 of yacc.c */ -#line 136 "promela.ypp" - { - (yyval.node) = ctx->node(PML_DIVIDE, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 16: - /* Line 1787 of yacc.c */ -#line 137 "promela.ypp" - { - (yyval.node) = ctx->node(PML_MODULO, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 17: - /* Line 1787 of yacc.c */ -#line 138 "promela.ypp" - { - (yyval.node) = ctx->node(PML_BITAND, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 18: - /* Line 1787 of yacc.c */ -#line 139 "promela.ypp" - { - (yyval.node) = ctx->node(PML_BITXOR, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 19: - /* Line 1787 of yacc.c */ -#line 140 "promela.ypp" - { - (yyval.node) = ctx->node(PML_BITOR, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 20: - /* Line 1787 of yacc.c */ -#line 141 "promela.ypp" - { - (yyval.node) = ctx->node(PML_GT, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 21: - /* Line 1787 of yacc.c */ -#line 142 "promela.ypp" - { - (yyval.node) = ctx->node(PML_LT, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 22: - /* Line 1787 of yacc.c */ -#line 143 "promela.ypp" - { - (yyval.node) = ctx->node(PML_GE, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 23: - /* Line 1787 of yacc.c */ -#line 144 "promela.ypp" - { - (yyval.node) = ctx->node(PML_LE, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 24: - /* Line 1787 of yacc.c */ -#line 145 "promela.ypp" - { - (yyval.node) = ctx->node(PML_EQ, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 25: - /* Line 1787 of yacc.c */ -#line 146 "promela.ypp" - { - (yyval.node) = ctx->node(PML_NE, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 26: - /* Line 1787 of yacc.c */ -#line 147 "promela.ypp" - { - (yyval.node) = ctx->node(PML_AND, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 27: - /* Line 1787 of yacc.c */ -#line 148 "promela.ypp" - { - (yyval.node) = ctx->node(PML_OR, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 28: - /* Line 1787 of yacc.c */ -#line 149 "promela.ypp" - { - (yyval.node) = ctx->node(PML_LSHIFT, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 29: - /* Line 1787 of yacc.c */ -#line 150 "promela.ypp" - { - (yyval.node) = ctx->node(PML_RSHIFT, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 30: - /* Line 1787 of yacc.c */ -#line 151 "promela.ypp" - { - (yyval.node) = ctx->node(PML_NEG, 1, (yyvsp[(2) - (2)].node)); - } - break; - - case 31: - /* Line 1787 of yacc.c */ -#line 152 "promela.ypp" - { - (yyval.node) = ctx->node(PML_MINUS, 1, (yyvsp[(2) - (2)].node)); - } - break; - - case 32: - /* Line 1787 of yacc.c */ -#line 154 "promela.ypp" - { - (yyval.node) = ctx->node(PML_LEN, 1, (yyvsp[(3) - (4)].node)); - } - break; - - case 33: - /* Line 1787 of yacc.c */ -#line 155 "promela.ypp" - { - (yyval.node) = (yyvsp[(1) - (1)].node); - } - break; - - case 34: - /* Line 1787 of yacc.c */ -#line 156 "promela.ypp" - { - (yyval.node) = ctx->value(PML_CONST, (void*)&((yylsp[(1) - (1)])), (yyvsp[(1) - (1)].value)); - free((yyvsp[(1) - (1)].value)); - } - break; - - case 35: - /* Line 1787 of yacc.c */ -#line 157 "promela.ypp" - { - /* Non standard promela for string literals */ - (yyval.node) = ctx->value(PML_STRING, (void*)&((yylsp[(1) - (1)])), (yyvsp[(1) - (1)].value)); - free((yyvsp[(1) - (1)].value)); - } - break; - - case 36: - /* Line 1787 of yacc.c */ -#line 163 "promela.ypp" - { - (yyval.node) = ctx->node(PML_SHOW, 0); - } - break; - - case 37: - /* Line 1787 of yacc.c */ -#line 164 "promela.ypp" - { - (yyval.node) = ctx->node(PML_HIDDEN, 0); - } - break; - - case 38: - /* Line 1787 of yacc.c */ -#line 165 "promela.ypp" - { - (yyval.node) = ctx->node(PML_SHOW, 0); - } - break; - - case 39: - /* Line 1787 of yacc.c */ -#line 166 "promela.ypp" - { - (yyval.node) = ctx->node(PML_ISLOCAL, 0); - } - break; - - case 40: - /* Line 1787 of yacc.c */ -#line 169 "promela.ypp" - { - (yyval.node) = ctx->node(PML_DECL, 3, (yyvsp[(1) - (3)].node), ctx->value(PML_TYPE, (void*)&((yylsp[(2) - (3)])), (yyvsp[(2) - (3)].value)), (yyvsp[(3) - (3)].node)); - free((yyvsp[(2) - (3)].value)); - } - break; - - case 41: - /* Line 1787 of yacc.c */ -#line 170 "promela.ypp" - { - (yyval.node) = ctx->node(PML_UNAME, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 42: - /* Line 1787 of yacc.c */ -#line 171 "promela.ypp" - { - (yyval.node) = ctx->node(PML_DECL, 3, (yyvsp[(1) - (6)].node), ctx->value(PML_TYPE, (void*)&((yylsp[(2) - (6)])), (yyvsp[(2) - (6)].value)), (yyvsp[(5) - (6)].node)); - free((yyvsp[(2) - (6)].value)); - } - break; - - case 43: - /* Line 1787 of yacc.c */ -#line 172 "promela.ypp" - { - (yyval.node) = (yyvsp[(2) - (2)].node); - } - break; - - case 44: - /* Line 1787 of yacc.c */ -#line 175 "promela.ypp" - { - (yyval.node) = ctx->node(PML_TYPEDEF, 2, ctx->value(PML_NAME, (void*)&((yylsp[(2) - (5)])), (yyvsp[(2) - (5)].value)), (yyvsp[(4) - (5)].node)); - } - break; - - case 45: - /* Line 1787 of yacc.c */ -#line 178 "promela.ypp" - { - (yyval.node) = (yyvsp[(1) - (1)].node); - } - break; - - case 46: - /* Line 1787 of yacc.c */ -#line 179 "promela.ypp" - { - (yyval.node) = (yyvsp[(1) - (2)].node); - } - break; - - case 47: - /* Line 1787 of yacc.c */ -#line 180 "promela.ypp" - { - (yyval.node) = ctx->node(PML_DECLLIST, 1, (yyvsp[(1) - (3)].node)); - if((yyvsp[(3) - (3)].node)->type == PML_DECLLIST) { - (yyval.node)->merge((yyvsp[(3) - (3)].node)); - delete (yyvsp[(3) - (3)].node); - } else { - (yyval.node)->push((yyvsp[(3) - (3)].node)); - } - } - break; - - case 48: - /* Line 1787 of yacc.c */ -#line 190 "promela.ypp" - { - (yyval.node) = ctx->node(PML_VARLIST, 1, (yyvsp[(1) - (1)].node)); - } - break; - - case 49: - /* Line 1787 of yacc.c */ -#line 191 "promela.ypp" - { - (yyval.node) = ctx->node(PML_VARLIST, 1, (yyvsp[(1) - (3)].node)); - (yyval.node)->merge((yyvsp[(3) - (3)].node)); - delete (yyvsp[(3) - (3)].node); - } - break; - - case 50: - /* Line 1787 of yacc.c */ -#line 194 "promela.ypp" - { - (yyval.node) = (yyvsp[(1) - (1)].node); - } - break; - - case 51: - /* Line 1787 of yacc.c */ -#line 195 "promela.ypp" - { - (yyval.node) = ctx->node(PML_ASGN, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 52: - /* Line 1787 of yacc.c */ -#line 198 "promela.ypp" - { - (yyval.node) = ctx->value(PML_NAME, (void*)&((yylsp[(1) - (1)])), (yyvsp[(1) - (1)].value)); - free((yyvsp[(1) - (1)].value)); - } - break; - - case 53: - /* Line 1787 of yacc.c */ -#line 199 "promela.ypp" - { - (yyval.node) = ctx->node(PML_COLON, 2, ctx->value(PML_NAME, (void*)&((yylsp[(1) - (3)])), (yyvsp[(1) - (3)].value)), ctx->value(PML_CONST, (void*)&((yylsp[(3) - (3)])), (yyvsp[(3) - (3)].value))); - free((yyvsp[(1) - (3)].value)); - free((yyvsp[(3) - (3)].value)); - } - break; - - case 54: - /* Line 1787 of yacc.c */ -#line 200 "promela.ypp" - { - (yyval.node) = ctx->node(PML_VAR_ARRAY, 2, ctx->value(PML_NAME, (void*)&((yylsp[(1) - (4)])), (yyvsp[(1) - (4)].value)), (yyvsp[(3) - (4)].node)); - free((yyvsp[(1) - (4)].value)); - } - break; - - case 55: - /* Line 1787 of yacc.c */ -#line 203 "promela.ypp" - { - (yyval.node) = ctx->value(PML_CONST, (void*)&((yylsp[(1) - (1)])), (yyvsp[(1) - (1)].value)); - free((yyvsp[(1) - (1)].value)); - } - break; - - case 56: - /* Line 1787 of yacc.c */ -#line 204 "promela.ypp" - { - (yyval.node) = ctx->node(PML_MINUS, 1, (yyvsp[(2) - (2)].node)); - } - break; - - case 57: - /* Line 1787 of yacc.c */ -#line 205 "promela.ypp" - { - (yyval.node) = (yyvsp[(2) - (3)].node); - } - break; - - case 58: - /* Line 1787 of yacc.c */ -#line 206 "promela.ypp" - { - (yyval.node) = ctx->node(PML_PLUS, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 59: - /* Line 1787 of yacc.c */ -#line 207 "promela.ypp" - { - (yyval.node) = ctx->node(PML_MINUS, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 60: - /* Line 1787 of yacc.c */ -#line 208 "promela.ypp" - { - (yyval.node) = ctx->node(PML_TIMES, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 61: - /* Line 1787 of yacc.c */ -#line 209 "promela.ypp" - { - (yyval.node) = ctx->node(PML_DIVIDE, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 62: - /* Line 1787 of yacc.c */ -#line 210 "promela.ypp" - { - (yyval.node) = ctx->node(PML_MODULO, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 63: - /* Line 1787 of yacc.c */ -#line 213 "promela.ypp" - { - (yyval.node) = ctx->value(PML_NAME, (void*)&((yylsp[(1) - (1)])), (yyvsp[(1) - (1)].value)); - free((yyvsp[(1) - (1)].value)); - } - break; - - case 64: - /* Line 1787 of yacc.c */ -#line 214 "promela.ypp" - { - if ((yyvsp[(1) - (2)].node)->type == PML_NAME) { - (yyval.node) = ctx->node(PML_NAMELIST, 1, (yyvsp[(1) - (2)].node)); - (yyval.node)->push(ctx->value(PML_NAME, (void*)&((yylsp[(2) - (2)])), (yyvsp[(2) - (2)].value))); - } else { - (yyvsp[(1) - (2)].node)->push(ctx->value(PML_NAME, (void*)&((yylsp[(2) - (2)])), (yyvsp[(2) - (2)].value))); - } - free((yyvsp[(2) - (2)].value)); - } - break; - - case 65: - /* Line 1787 of yacc.c */ -#line 223 "promela.ypp" - { - (yyval.node) = (yyvsp[(1) - (2)].node); - } - break; - - case 66: - /* Line 1787 of yacc.c */ -#line 226 "promela.ypp" - { - (yyval.node) = (yyvsp[(1) - (1)].node); - } - break; - - case 67: - /* Line 1787 of yacc.c */ -#line 227 "promela.ypp" - { - (yyval.node) = (yyvsp[(1) - (2)].node); - } - break; - - case 68: - /* Line 1787 of yacc.c */ -#line 228 "promela.ypp" - { - (yyval.node) = ctx->node(PML_STMNT, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 69: - /* Line 1787 of yacc.c */ -#line 231 "promela.ypp" - { - (yyval.node) = (yyvsp[(1) - (1)].node); - } - break; - - case 70: - /* Line 1787 of yacc.c */ -#line 234 "promela.ypp" - { - (yyval.node) = ctx->node(PML_ASGN, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - case 71: - /* Line 1787 of yacc.c */ -#line 235 "promela.ypp" - { - (yyval.node) = ctx->node(PML_INCR, 1, (yyvsp[(1) - (2)].node)); - } - break; - - case 72: - /* Line 1787 of yacc.c */ -#line 236 "promela.ypp" - { - (yyval.node) = ctx->node(PML_DECR, 1, (yyvsp[(1) - (2)].node)); - } - break; - - case 73: - /* Line 1787 of yacc.c */ -#line 237 "promela.ypp" - { - (yyval.node) = ctx->node(PML_PRINT, 2, ctx->value(PML_STRING, (void*)&((yylsp[(3) - (5)])), (yyvsp[(3) - (5)].value)), (yyvsp[(4) - (5)].node)); - free((yyvsp[(3) - (5)].value)); - } - break; - - case 74: - /* Line 1787 of yacc.c */ -#line 238 "promela.ypp" - { - (yyval.node) = ctx->node(PML_PRINT, 1, (yyvsp[(3) - (4)].node)); - } - break; - - case 75: - /* Line 1787 of yacc.c */ -#line 239 "promela.ypp" - { - (yyval.node) = ctx->node(PML_PRINT, 1, ctx->value(PML_CONST, (void*)&((yylsp[(3) - (4)])), (yyvsp[(3) - (4)].value))); - free((yyvsp[(3) - (4)].value)); - } - break; - - case 76: - /* Line 1787 of yacc.c */ -#line 240 "promela.ypp" - { - (yyval.node) = ctx->node(PML_ASSERT, 1, (yyvsp[(2) - (2)].node)); - } - break; - - case 77: - /* Line 1787 of yacc.c */ -#line 241 "promela.ypp" - { - (yyval.node) = (yyvsp[(1) - (1)].node); - } - break; - - case 78: - /* Line 1787 of yacc.c */ -#line 244 "promela.ypp" - { - (yyval.node) = ctx->value(0, NULL, ""); - } - break; - - case 79: - /* Line 1787 of yacc.c */ -#line 245 "promela.ypp" - { - (yyval.node) = (yyvsp[(2) - (2)].node); - } - break; - - case 80: - /* Line 1787 of yacc.c */ -#line 248 "promela.ypp" - { - (yyval.node) = (yyvsp[(1) - (1)].node); - } - break; - - case 81: - /* Line 1787 of yacc.c */ -#line 249 "promela.ypp" - { - (yyval.node) = ctx->node(0, 2, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); - } - break; - - - /* Line 1787 of yacc.c */ -#line 2285 "promela.tab.cpp" - default: - break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - *++yylsp = yyloc; - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - - /*------------------------------------. - | yyerrlab -- here on detecting error | - `------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (&yylloc, ctx, scanner, YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } else { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (&yylloc, ctx, scanner, yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - yyerror_range[1] = yylloc; - - if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } else { - yydestruct ("Error: discarding", - yytoken, &yylval, &yylloc, ctx, scanner); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - yyerror_range[1] = yylsp[1-yylen]; - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - yyerror_range[1] = *yylsp; - yydestruct ("Error: popping", - yystos[yystate], yyvsp, yylsp, ctx, scanner); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - yyerror_range[2] = yylloc; - /* Using YYLLOC is tempting, but would change the location of - the lookahead. YYLOC is available though. */ - YYLLOC_DEFAULT (yyloc, yyerror_range, 2); - *++yylsp = yyloc; - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined yyoverflow || YYERROR_VERBOSE - /*-------------------------------------------------. - | yyexhaustedlab -- memory exhaustion comes here. | - `-------------------------------------------------*/ -yyexhaustedlab: - yyerror (&yylloc, ctx, scanner, YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEMPTY) { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, &yylloc, ctx, scanner); - } - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, yylsp, ctx, scanner); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} - - -/* Line 2050 of yacc.c */ -#line 253 "promela.ypp" - - diff --git a/src/uscxml/plugins/datamodel/promela/parser/promela.tab.hpp b/src/uscxml/plugins/datamodel/promela/parser/promela.tab.hpp deleted file mode 100644 index a48031a..0000000 --- a/src/uscxml/plugins/datamodel/promela/parser/promela.tab.hpp +++ /dev/null @@ -1,180 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.7.12-4996. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -#ifndef YY_PROMELA_PROMELA_TAB_HPP_INCLUDED -# define YY_PROMELA_PROMELA_TAB_HPP_INCLUDED -/* Enabling traces. */ -#ifndef PROMELA_DEBUG -# if defined YYDEBUG -# if YYDEBUG -# define PROMELA_DEBUG 1 -# else -# define PROMELA_DEBUG 0 -# endif -# else /* ! defined YYDEBUG */ -# define PROMELA_DEBUG 1 -# endif /* ! defined YYDEBUG */ -#endif /* ! defined PROMELA_DEBUG */ -#if PROMELA_DEBUG -extern int promela_debug; -#endif - -/* Tokens. */ -#ifndef PROMELA_TOKENTYPE -# define PROMELA_TOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum promela_tokentype { - PML_VAR_ARRAY = 258, - PML_VARLIST = 259, - PML_DECL = 260, - PML_DECLLIST = 261, - PML_STMNT = 262, - PML_COLON = 263, - PML_EXPR = 264, - PML_NAMELIST = 265, - PML_ASSERT = 266, - PML_PRINT = 267, - PML_PRINTM = 268, - PML_LEN = 269, - PML_STRING = 270, - PML_TYPEDEF = 271, - PML_MTYPE = 272, - PML_INLINE = 273, - PML_RETURN = 274, - PML_LABEL = 275, - PML_OF = 276, - PML_GOTO = 277, - PML_BREAK = 278, - PML_ELSE = 279, - PML_SEMI = 280, - PML_ARROW = 281, - PML_IF = 282, - PML_FI = 283, - PML_DO = 284, - PML_OD = 285, - PML_FOR = 286, - PML_SELECT = 287, - PML_IN = 288, - PML_SEP = 289, - PML_DOTDOT = 290, - PML_HIDDEN = 291, - PML_SHOW = 292, - PML_ISLOCAL = 293, - PML_CONST = 294, - PML_TYPE = 295, - PML_XU = 296, - PML_NAME = 297, - PML_UNAME = 298, - PML_PNAME = 299, - PML_INAME = 300, - PML_CLAIM = 301, - PML_TRACE = 302, - PML_INIT = 303, - PML_LTL = 304, - PML_COMMA = 305, - PML_ASGN = 306, - PML_AND = 307, - PML_OR = 308, - PML_BITAND = 309, - PML_BITXOR = 310, - PML_BITOR = 311, - PML_NE = 312, - PML_EQ = 313, - PML_LE = 314, - PML_GE = 315, - PML_LT = 316, - PML_GT = 317, - PML_RSHIFT = 318, - PML_LSHIFT = 319, - PML_MINUS = 320, - PML_PLUS = 321, - PML_MODULO = 322, - PML_DIVIDE = 323, - PML_TIMES = 324, - PML_DECR = 325, - PML_INCR = 326, - PML_COMPL = 327, - PML_NEG = 328, - PML_CMPND = 329, - PML_DOT = 330 - }; -#endif - - -#if ! defined PROMELA_STYPE && ! defined PROMELA_STYPE_IS_DECLARED -typedef union PROMELA_STYPE -{ -/* Line 2053 of yacc.c */ -#line 39 "promela.ypp" - - uscxml::PromelaParserNode* node; - char* value; - - -/* Line 2053 of yacc.c */ -#line 146 "promela.tab.hpp" -} PROMELA_STYPE; -# define PROMELA_STYPE_IS_TRIVIAL 1 -# define promela_stype PROMELA_STYPE /* obsolescent; will be withdrawn */ -# define PROMELA_STYPE_IS_DECLARED 1 -#endif - -#if ! defined PROMELA_LTYPE && ! defined PROMELA_LTYPE_IS_DECLARED -typedef struct PROMELA_LTYPE -{ - int first_line; - int first_column; - int last_line; - int last_column; -} PROMELA_LTYPE; -# define promela_ltype PROMELA_LTYPE /* obsolescent; will be withdrawn */ -# define PROMELA_LTYPE_IS_DECLARED 1 -# define PROMELA_LTYPE_IS_TRIVIAL 1 -#endif - - -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int promela_parse (void *YYPARSE_PARAM); -#else -int promela_parse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int promela_parse (uscxml::PromelaParser* ctx, void * scanner); -#else -int promela_parse (); -#endif -#endif /* ! YYPARSE_PARAM */ - -#endif /* !YY_PROMELA_PROMELA_TAB_HPP_INCLUDED */ diff --git a/src/uscxml/plugins/datamodel/promela/parser/promela.ypp b/src/uscxml/plugins/datamodel/promela/parser/promela.ypp deleted file mode 100644 index d76b24a..0000000 --- a/src/uscxml/plugins/datamodel/promela/parser/promela.ypp +++ /dev/null @@ -1,254 +0,0 @@ -/** Subset extracted from spin.y by Stefan Radomski 2014 */ - -/***** spin: spin.y *****/ - -/* Copyright (c) 1989-2003 by Lucent Technologies, Bell Laboratories. */ -/* All Rights Reserved. This software is for educational purposes only. */ -/* No guarantee whatsoever is expressed or implied by the distribution of */ -/* this code. Permission is given to distribute this code provided that */ -/* this introductory message is not removed and no monies are exchanged. */ -/* Software written by Gerard J. Holzmann. For tool documentation see: */ -/* http://spinroot.com/ */ -/* Send all bug-reports and/or questions to: bugs@spinroot.com */ - -%{ -#include "../PromelaParser.h" -#include "promela.tab.hpp" -#include <sys/types.h> -#include <stdarg.h> - -#define YYMAXDEPTH 20000 // default is 10000 -#define YYDEBUG 1 -#define YYERROR_VERBOSE 1 - -extern int promela_lex (PROMELA_STYPE* yylval_param, PROMELA_LTYPE* yylloc_param, void* yyscanner); - -using namespace uscxml; -%} - -%pure-parser -%debug -%locations -%file-prefix "promela" -%parse-param { uscxml::PromelaParser* ctx } -%lex-param {void * scanner} -%parse-param {void * scanner} -%define api.prefix promela_ -%defines - -%union { - uscxml::PromelaParserNode* node; - char* value; -} - -%error-verbose - -/* %type <node> expr_lst */ -%type <node> expr pfld sfld varref decl_lst stmnt_lst vardcl ivar var_list one_decl prargs utype cmpnd -%type <node> stmnt Stmnt const_expr nlst vis arg - -%token PML_VAR_ARRAY PML_VARLIST PML_DECL PML_DECLLIST PML_STMNT PML_COLON PML_EXPR PML_NAMELIST - -%token '(' ')' -%token '[' ']' -%token '{' '}' -%token PML_ASSERT PML_PRINT PML_PRINTM -%token <value> PML_LEN PML_STRING -%token PML_TYPEDEF PML_MTYPE PML_INLINE PML_RETURN PML_LABEL PML_OF -%token PML_GOTO PML_BREAK PML_ELSE PML_SEMI PML_ARROW -%token PML_IF PML_FI PML_DO PML_OD PML_FOR PML_SELECT PML_IN PML_SEP PML_DOTDOT -%token PML_HIDDEN PML_SHOW PML_ISLOCAL -%token <value> PML_CONST PML_TYPE PML_XU /* val */ -%token <value> PML_NAME PML_UNAME PML_PNAME PML_INAME /* sym */ -%token PML_CLAIM PML_TRACE PML_INIT PML_LTL /* sym */ -%token PML_COMMA - -%right PML_ASGN -%left PML_OR PML_AND -%left PML_BITOR PML_BITXOR PML_BITAND -%left PML_EQ PML_NE -%left PML_GT PML_LT PML_GE PML_LE -%left PML_LSHIFT PML_RSHIFT -%left PML_PLUS PML_MINUS -%left PML_TIMES PML_DIVIDE PML_MODULO -%left PML_INCR PML_DECR -%left PML_COMPL -%right PML_NEG -%left PML_DOT PML_CMPND - -%% - - -/** PROMELA Grammar Rules **/ - -program : - decl_lst { - ctx->ast = $1; - ctx->type = PromelaParser::PROMELA_DECL; - } - | expr { - ctx->ast = $1; - ctx->type = PromelaParser::PROMELA_EXPR; - } - | stmnt_lst { - ctx->ast = $1; - ctx->type = PromelaParser::PROMELA_STMNT; - } - ; - -varref : cmpnd { $$ = $1; } - ; - -pfld : PML_NAME { $$ = ctx->value(PML_NAME, (void*)&(@1), $1); free($1); } - | PML_NAME '[' expr ']' { $$ = ctx->node(PML_VAR_ARRAY, 2, ctx->value(PML_NAME, (void*)&(@1), $1), $3); free($1); } - ; - -cmpnd : pfld - sfld { - if ($2 != NULL) { - if ($2->type == PML_CMPND) { - $$ = ctx->node(PML_CMPND, 1, $1); - $$->merge($2); delete $2; - } else { - $$ = ctx->node(PML_CMPND, 2, $1, $2); - } - } else { - $$ = $1; - } - } - ; - -sfld : /* empty */ { $$ = NULL; } - | PML_DOT cmpnd %prec PML_DOT { $$ = $2; } - ; - -/* -expr_lst: expr { $$ = ctx->node(PML_EXPR, 1, $1); } - | expr PML_SEMI { $$ = ctx->node(PML_EXPR, 1, $1); } - | expr PML_SEMI expr_lst { $$ = ctx->node(PML_EXPR, 2, $1, $3); } - ; -*/ - -expr : '(' expr ')' { $$ = $2; } - | expr PML_PLUS expr { $$ = ctx->node(PML_PLUS, 2, $1, $3); } - | expr PML_MINUS expr { $$ = ctx->node(PML_MINUS, 2, $1, $3); } - | expr PML_TIMES expr { $$ = ctx->node(PML_TIMES, 2, $1, $3); } - | expr PML_DIVIDE expr { $$ = ctx->node(PML_DIVIDE, 2, $1, $3); } - | expr PML_MODULO expr { $$ = ctx->node(PML_MODULO, 2, $1, $3); } - | expr PML_BITAND expr { $$ = ctx->node(PML_BITAND, 2, $1, $3); } - | expr PML_BITXOR expr { $$ = ctx->node(PML_BITXOR, 2, $1, $3); } - | expr PML_BITOR expr { $$ = ctx->node(PML_BITOR, 2, $1, $3); } - | expr PML_GT expr { $$ = ctx->node(PML_GT, 2, $1, $3); } - | expr PML_LT expr { $$ = ctx->node(PML_LT, 2, $1, $3); } - | expr PML_GE expr { $$ = ctx->node(PML_GE, 2, $1, $3); } - | expr PML_LE expr { $$ = ctx->node(PML_LE, 2, $1, $3); } - | expr PML_EQ expr { $$ = ctx->node(PML_EQ, 2, $1, $3); } - | expr PML_NE expr { $$ = ctx->node(PML_NE, 2, $1, $3); } - | expr PML_AND expr { $$ = ctx->node(PML_AND, 2, $1, $3); } - | expr PML_OR expr { $$ = ctx->node(PML_OR, 2, $1, $3); } - | expr PML_LSHIFT expr { $$ = ctx->node(PML_LSHIFT, 2, $1, $3); } - | expr PML_RSHIFT expr { $$ = ctx->node(PML_RSHIFT, 2, $1, $3); } - | PML_NEG expr { $$ = ctx->node(PML_NEG, 1, $2); } - | PML_MINUS expr %prec PML_MINUS { $$ = ctx->node(PML_MINUS, 1, $2); } - - | PML_LEN '(' varref ')' { $$ = ctx->node(PML_LEN, 1, $3); } - | varref { $$ = $1; } - | PML_CONST { $$ = ctx->value(PML_CONST, (void*)&(@1), $1); free($1); } - | PML_STRING { - /* Non standard promela for string literals */ - $$ = ctx->value(PML_STRING, (void*)&(@1), $1); free($1); } - ; - - -vis : /* empty */ { $$ = ctx->node(PML_SHOW, 0); } - | PML_HIDDEN { $$ = ctx->node(PML_HIDDEN, 0); } - | PML_SHOW { $$ = ctx->node(PML_SHOW, 0); } - | PML_ISLOCAL { $$ = ctx->node(PML_ISLOCAL, 0); } - ; - -one_decl: vis PML_TYPE var_list { $$ = ctx->node(PML_DECL, 3, $1, ctx->value(PML_TYPE, (void*)&(@2), $2), $3); free($2); } - | vis PML_UNAME var_list { $$ = ctx->node(PML_UNAME, 2, $1, $3); } - | vis PML_TYPE PML_ASGN '{' nlst '}' { $$ = ctx->node(PML_DECL, 3, $1, ctx->value(PML_TYPE, (void*)&(@2), $2), $5); free($2); } - | vis utype { $$ = $2; } - ; - -utype : PML_TYPEDEF PML_NAME '{' decl_lst '}' { $$ = ctx->node(PML_TYPEDEF, 2, ctx->value(PML_NAME, (void*)&(@2), $2), $4); } - ; - -decl_lst: one_decl { $$ = $1; } - | one_decl PML_SEMI { $$ = $1; } - | one_decl PML_SEMI decl_lst { - $$ = ctx->node(PML_DECLLIST, 1, $1); - if($3->type == PML_DECLLIST) { - $$->merge($3); delete $3; - } else { - $$->push($3); - } - } - ; - -var_list: ivar { $$ = ctx->node(PML_VARLIST, 1, $1); } - | ivar PML_COMMA var_list { $$ = ctx->node(PML_VARLIST, 1, $1); $$->merge($3); delete $3; } - ; - -ivar : vardcl { $$ = $1; } - | vardcl PML_ASGN expr { $$ = ctx->node(PML_ASGN, 2, $1, $3); } - ; - -vardcl : PML_NAME { $$ = ctx->value(PML_NAME, (void*)&(@1), $1); free($1); } - | PML_NAME PML_COLON PML_CONST { $$ = ctx->node(PML_COLON, 2, ctx->value(PML_NAME, (void*)&(@1), $1), ctx->value(PML_CONST, (void*)&(@3), $3)); free($1); free($3); } - | PML_NAME '[' const_expr ']' { $$ = ctx->node(PML_VAR_ARRAY, 2, ctx->value(PML_NAME, (void*)&(@1), $1), $3); free($1); } - ; - -const_expr: PML_CONST { $$ = ctx->value(PML_CONST, (void*)&(@1), $1); free($1); } - | PML_MINUS const_expr %prec PML_MINUS { $$ = ctx->node(PML_MINUS, 1, $2); } - | '(' const_expr ')' { $$ = $2; } - | const_expr PML_PLUS const_expr { $$ = ctx->node(PML_PLUS, 2, $1, $3); } - | const_expr PML_MINUS const_expr { $$ = ctx->node(PML_MINUS, 2, $1, $3); } - | const_expr PML_TIMES const_expr { $$ = ctx->node(PML_TIMES, 2, $1, $3); } - | const_expr PML_DIVIDE const_expr { $$ = ctx->node(PML_DIVIDE, 2, $1, $3); } - | const_expr PML_MODULO const_expr { $$ = ctx->node(PML_MODULO, 2, $1, $3); } - ; - -nlst : PML_NAME { $$ = ctx->value(PML_NAME, (void*)&(@1), $1); free($1); } - | nlst PML_NAME { - if ($1->type == PML_NAME) { - $$ = ctx->node(PML_NAMELIST, 1, $1); - $$->push(ctx->value(PML_NAME, (void*)&(@2), $2)); - } else { - $1->push(ctx->value(PML_NAME, (void*)&(@2), $2)); - } - free($2); - } - | nlst PML_COMMA { $$ = $1; } - ; - -stmnt_lst: stmnt { $$ = $1; } - | stmnt PML_SEMI { $$ = $1; } - | stmnt PML_SEMI stmnt_lst { $$ = ctx->node(PML_STMNT, 2, $1, $3); } - ; - -stmnt : Stmnt { $$ = $1; } - ; - -Stmnt : varref PML_ASGN expr { $$ = ctx->node(PML_ASGN, 2, $1, $3); } - | varref PML_INCR { $$ = ctx->node(PML_INCR, 1, $1); } - | varref PML_DECR { $$ = ctx->node(PML_DECR, 1, $1); } - | PML_PRINT '(' PML_STRING prargs ')' { $$ = ctx->node(PML_PRINT, 2, ctx->value(PML_STRING, (void*)&(@3), $3), $4); free($3); } - | PML_PRINT '(' varref ')' { $$ = ctx->node(PML_PRINT, 1, $3); } - | PML_PRINT '(' PML_CONST ')' { $$ = ctx->node(PML_PRINT, 1, ctx->value(PML_CONST, (void*)&(@3), $3)); free($3); } - | PML_ASSERT expr { $$ = ctx->node(PML_ASSERT, 1, $2); } - | expr { $$ = $1; } - ; - -prargs : /* empty */ { $$ = ctx->value(0, NULL, ""); } - | PML_COMMA arg { $$ = $2; } - ; - -arg : expr { $$ = $1; } - | expr PML_COMMA arg { $$ = ctx->node(0, 2, $1, $3); } - ; - - -%% - diff --git a/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp b/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp deleted file mode 100644 index 282e8c6..0000000 --- a/src/uscxml/plugins/datamodel/xpath/XPathDataModel.cpp +++ /dev/null @@ -1,876 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @author 2013 Enrico Papi (enrico.papi@ajile.it) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "uscxml/Common.h" -#include "XPathDataModel.h" - -#include "uscxml/Message.h" -#include "uscxml/util/String.h" -#include "uscxml/dom/DOMUtils.h" -#include <glog/logging.h> -#include <boost/algorithm/string.hpp> - -#include <DOM/SAX2DOM/SAX2DOM.hpp> -//#include <SAX/helpers/CatchErrorHandler.hpp> -//#include <DOM/Events/EventTarget.hpp> -//#include <DOM/Events/EventListener.hpp> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -namespace uscxml { - -using namespace Arabica::XPath; -using namespace Arabica::DOM; - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new XPathDataModelProvider() ); - return true; -} -#endif - -XPathDataModel::XPathDataModel() { -} - -boost::shared_ptr<DataModelImpl> XPathDataModel::create(InterpreterInfo* interpreter) { - boost::shared_ptr<XPathDataModel> dm = boost::shared_ptr<XPathDataModel>(new XPathDataModel()); - dm->_interpreter = interpreter; - -// dm->_xpath->setVariableCompileTimeResolver(_varCTResolver); -// dm->_xpath->setNamespaceContext(interpreter->getNSContext()); - - dm->_funcResolver.setInterpreter(interpreter); - dm->_xpath.setNamespaceContext(*interpreter->getNameSpaceInfo().getNSContext()); - dm->_xpath.setFunctionResolver(dm->_funcResolver); - dm->_xpath.setVariableResolver(dm->_varResolver); - - dm->_domFactory = Arabica::SimpleDOM::DOMImplementation<std::string>::getDOMImplementation(); - dm->_doc = dm->_domFactory.createDocument("http://www.w3.org/2005/07/scxml", "", 0); - dm->_datamodel = dm->_doc.createElement("datamodel"); - dm->_doc.appendChild(dm->_datamodel); - - Element<std::string> ioProcElem = dm->_doc.createElement("data"); - ioProcElem.setAttribute("id", "_ioprocessors"); - std::map<std::string, IOProcessor>::const_iterator ioProcIter = interpreter->getIOProcessors().begin(); - while(ioProcIter != interpreter->getIOProcessors().end()) { - Element<std::string> ioProc = dm->_doc.createElement("processor"); - ioProc.setAttribute("name", ioProcIter->first); - - Data ioProcData = ioProcIter->second.getDataModelVariables(); - Element<std::string> ioProcLoc = dm->_doc.createElement("location"); - Text<std::string> ioProcLocText = dm->_doc.createTextNode(ioProcData.compound["location"].atom); - ioProcLoc.appendChild(ioProcLocText); - ioProc.appendChild(ioProcLoc); - ioProcElem.appendChild(ioProc); - - ioProcIter++; - } - dm->_datamodel.appendChild(ioProcElem); - - NodeSet<std::string> ioProcNodeSet; - ioProcNodeSet.push_back(ioProcElem); - dm->_varResolver.setVariable("_ioprocessors", ioProcNodeSet); - - Element<std::string> sessIdElem = dm->_doc.createElement("data"); - sessIdElem.setAttribute("id", "_sessionid"); - Text<std::string> sessIdText = dm->_doc.createTextNode(interpreter->getSessionId()); - sessIdElem.appendChild(sessIdText); - dm->_datamodel.appendChild(sessIdElem); - - NodeSet<std::string> sessIdNodeSet; - sessIdNodeSet.push_back(sessIdText); - dm->_varResolver.setVariable("_sessionid", sessIdNodeSet); - - - Element<std::string> nameElem = dm->_doc.createElement("data"); - nameElem.setAttribute("id", "_name"); - Text<std::string> nameText = dm->_doc.createTextNode(interpreter->getName()); - nameElem.appendChild(nameText); - dm->_datamodel.appendChild(nameElem); - - NodeSet<std::string> nameNodeSet; - nameNodeSet.push_back(nameText); - dm->_varResolver.setVariable("_name", nameNodeSet); - - return dm; -} - -XPathDataModel::~XPathDataModel() { -} - -void XPathDataModel::pushContext() { -} - -void XPathDataModel::popContext() { -} - -void XPathDataModel::initialize() { -} - -void XPathDataModel::setEvent(const Event& event) { - Element<std::string> eventElem = _doc.createElement("data"); - eventElem.setAttribute("id", "_event"); - - Element<std::string> eventDataElem = _doc.createElement("data"); - NodeSet<std::string> eventNodeSet; - - { - // -- name - Element<std::string> eventNameElem = _doc.createElement("name"); - Text<std::string> eventName = _doc.createTextNode(event.name.c_str()); - eventNameElem.appendChild(eventName); - eventElem.appendChild(eventNameElem); - } - { - // -- origin - Element<std::string> eventOriginElem = _doc.createElement("origin"); - Text<std::string> eventOrigin = _doc.createTextNode(event.origin.c_str()); - eventOriginElem.appendChild(eventOrigin); - eventElem.appendChild(eventOriginElem); - } - { - // -- type - Element<std::string> eventTypeElem = _doc.createElement("type"); - Text<std::string> eventType; - switch (event.eventType) { - case Event::INTERNAL: - eventType = _doc.createTextNode("internal"); - break; - case Event::EXTERNAL: - eventType = _doc.createTextNode("external"); - break; - case Event::PLATFORM: - eventType = _doc.createTextNode("platform"); - break; - } - eventTypeElem.appendChild(eventType); - eventElem.appendChild(eventTypeElem); - } - - if (event.params.size() > 0) { - std::multimap<std::string, Data>::const_iterator paramIter = event.params.begin(); - while(paramIter != event.params.end()) { - Element<std::string> eventParamElem = _doc.createElement("data"); - // this is simplified - Data might be more elaborate than a simple string atom - Text<std::string> eventParamText = _doc.createTextNode(paramIter->second.atom); - - eventParamElem.setAttribute("id", paramIter->first); - eventParamElem.appendChild(eventParamText); - eventDataElem.appendChild(eventParamElem); - paramIter++; - } - } - if (event.namelist.size() > 0) { - std::map<std::string, Data>::const_iterator namelistIter = event.namelist.begin(); - while(namelistIter != event.namelist.end()) { - Element<std::string> eventNamelistElem = _doc.createElement("data"); - // this is simplified - Data might be more elaborate than a simple string atom - Text<std::string> eventNamelistText = _doc.createTextNode(namelistIter->second.atom); - - eventNamelistElem.setAttribute("id", namelistIter->first); - eventNamelistElem.appendChild(eventNamelistText); - eventDataElem.appendChild(eventNamelistElem); - namelistIter++; - } - } - if (event.raw.size() > 0) { - Element<std::string> eventRawElem = _doc.createElement("raw"); - Text<std::string> textNode = _doc.createTextNode(event.raw.c_str()); - eventRawElem.appendChild(textNode); - eventElem.appendChild(eventRawElem); - } - - if (event.content.size() > 0) { - Text<std::string> textNode = _doc.createTextNode(spaceNormalize(event.content).c_str()); - eventDataElem.appendChild(textNode); - } - if (event.dom) { - Node<std::string> importedNode = _doc.importNode(event.dom, true); - eventDataElem.appendChild(importedNode); - } - if (event.data.array.size() == 1) { - Text<std::string> textNode = _doc.createTextNode(event.data.array.front().atom.c_str()); - eventDataElem.appendChild(textNode); - } else if (event.data.array.size() > 1) { - std::list<uscxml::Data>::const_iterator ptr; - unsigned int i; - - for( i = 0 , ptr = event.data.array.begin() ; - ((i < event.data.array.size()) && (ptr != event.data.array.end())); - i++ , ptr++ ) { - Element<std::string> eventMESElem = _doc.createElement("data"); - Text<std::string> textNode = _doc.createTextNode(ptr->atom.c_str()); - std::stringstream ss; - ss << i; - eventMESElem.setAttribute("id", ss.str()); - eventMESElem.appendChild(textNode); - eventDataElem.appendChild(eventMESElem); - } - } - - eventElem.appendChild(eventDataElem); - eventNodeSet.push_back(eventElem); - - // do we need to replace an existing event? - Node<std::string> oldEventElem = _datamodel.getFirstChild(); - while(oldEventElem) { - if (oldEventElem.getNodeType() == Node_base::ELEMENT_NODE) { - if (HAS_ATTR_CAST(oldEventElem, "id") && iequals(ATTR_CAST(oldEventElem, "id"), "_event")) - break; - } - oldEventElem = oldEventElem.getNextSibling(); - } - - if (oldEventElem) { - _datamodel.replaceChild(eventElem, oldEventElem); - } else { - _datamodel.appendChild(eventElem); - } - _varResolver.setVariable("_event", eventNodeSet); -} - -Data XPathDataModel::getStringAsData(const std::string& content) { - Data data; - XPathValue<std::string> result = _xpath.evaluate_expr(content, _doc); - - std::stringstream ss; - - switch (result.type()) { - case ANY: - break; - case Arabica::XPath::BOOL: - ss << result.asBool(); - break; - case NUMBER: - ss << result.asNumber(); - break; - case STRING: - ss << result.asString(); - break; - case NODE_SET: - NodeSet<std::string> ns = result.asNodeSet(); - for (size_t i = 0; i < ns.size(); i++) { - ss.str(""); - ss << i; - std::string idx = ss.str(); - ss.str(""); - ss << ns[i]; - data.compound[idx] = Data(ss.str(), Data::INTERPRETED); - } - data.type = Data::INTERPRETED; - return data; - break; - } - - data.atom = ss.str(); - data.type = Data::VERBATIM; - return data; -} - -bool XPathDataModel::validate(const std::string& location, const std::string& schema) { - return true; -} - -bool XPathDataModel::isLocation(const std::string& expr) { - return true; -} - -uint32_t XPathDataModel::getLength(const std::string& expr) { -// std::cout << _datamodel << std::endl; - XPathValue<std::string> result = _xpath.evaluate_expr(expr, _doc); - switch(result.type()) { - case NUMBER: - return result.asNumber(); - break; - case NODE_SET: - return result.asNodeSet().size(); - break; - default: - ERROR_EXECUTION_THROW("'" + expr + "' does not evaluate to an array."); - } - return 0; -} - -void XPathDataModel::setForeach(const std::string& item, - const std::string& array, - const std::string& index, - uint32_t iteration) { - - XPathValue<std::string> arrayResult = _xpath.evaluate_expr(array, _doc); - assert(arrayResult.type() == NODE_SET); - -#if 0 - std::cout << "Array Size: " << arrayResult.asNodeSet().size() << std::endl; - for (size_t i = 0; i < arrayResult.asNodeSet().size(); i++) { - std::cout << arrayResult.asNodeSet()[i] << std::endl; - } -#endif - - assert(arrayResult.asNodeSet().size() >= iteration); - - - NodeSet<std::string> arrayNodeSet; - arrayNodeSet.push_back(arrayResult.asNodeSet()[iteration]); - - if (!isDeclared(item)) { - if (!isValidIdentifier(item)) - ERROR_EXECUTION_THROW("Expression '" + item + "' not a valid identifier."); - Element<std::string> container = _doc.createElement("data"); - container.setAttribute("id", item); - container.appendChild(arrayResult.asNodeSet()[iteration].cloneNode(true)); - _datamodel.appendChild(container); - _varResolver.setVariable(item, arrayNodeSet); - } - XPathValue<std::string> itemResult = _varResolver.resolveVariable("", item); - assign(itemResult, arrayNodeSet, Element<std::string>()); - - if (index.length() > 0) { - NodeSet<std::string> indexNodeSet; - Text<std::string> indexElem = _doc.createTextNode(toStr(iteration)); - indexNodeSet.push_back(indexElem); - - if (!isDeclared(index)) { - Element<std::string> container = _doc.createElement("data"); - container.setAttribute("id", index); - container.appendChild(indexElem); - _datamodel.appendChild(container); - - NodeSet<std::string> indexVarNodeSet; - indexVarNodeSet.push_back(container); - _varResolver.setVariable(index, indexVarNodeSet); - } - XPathValue<std::string> indexResult = _varResolver.resolveVariable("", index); - assign(indexResult, indexNodeSet, Element<std::string>()); - } - - -#if 0 - std::cout << _datamodel << std::endl << std::endl; - std::cout << "Index: " << indexResult.asNodeSet().size() << std::endl; - for (size_t i = 0; i < indexResult.asNodeSet().size(); i++) { - std::cout << indexResult.asNodeSet()[i] << std::endl; - } - std::cout << std::endl; -#endif - - -} - -bool XPathDataModel::isValidIdentifier(const std::string& identifier) { - if(boost::starts_with(identifier, ".")) - return false; - - return true; -} - - -void XPathDataModel::eval(const Arabica::DOM::Element<std::string>& scriptElem, - const std::string& expr) { - XPathValue<std::string> result = _xpath.evaluate_expr(expr, _doc); -} - -bool XPathDataModel::isDeclared(const std::string& expr) { - return true; - try { - return _varResolver.isDeclared(expr) || evalAsBool(expr); - } catch(...) { - return false; - } -} - -bool XPathDataModel::evalAsBool(const std::string& expr) { - return evalAsBool(Arabica::DOM::Element<std::string>(), expr); -} - -bool XPathDataModel::evalAsBool(const Arabica::DOM::Element<std::string>& node, const std::string& expr) { -// std::cout << std::endl << evalAsString(expr); - XPathValue<std::string> result; - try { - result = _xpath.evaluate_expr(expr, _doc); - } catch(SyntaxException e) { - ERROR_EXECUTION_THROW(e.what()); - } catch(std::runtime_error e) { - ERROR_EXECUTION_THROW(e.what()); - } - return result.asBool(); -} - -std::string XPathDataModel::evalAsString(const std::string& expr) { - - XPathValue<std::string> result; - try { - result = _xpath.evaluate_expr(expr, _doc); - } catch(SyntaxException e) { - ERROR_EXECUTION_THROW(e.what()); - } catch(std::runtime_error e) { - ERROR_EXECUTION_THROW(e.what()); - } - switch (result.type()) { - case STRING: - return result.asString(); - break; - case Arabica::XPath::BOOL: // MSVC croaks with ambiguous symbol without qualified name - return (result.asBool() ? "true" : "false"); - break; - case NUMBER: - return toStr(result.asNumber()); - break; - case NODE_SET: { - NodeSet<std::string> nodeSet = result.asNodeSet(); - std::stringstream ss; - for (size_t i = 0; i < nodeSet.size(); i++) { - ss << nodeSet[i]; - if (nodeSet[i].getNodeType() != Node_base::TEXT_NODE) { - ss << std::endl; - } - } - return ss.str(); - break; - } - case ANY: - ERROR_EXECUTION_THROW("Type ANY not supported to evaluate as string"); - break; - } - return "undefined"; -} - -double XPathDataModel::evalAsNumber(const std::string& expr) { - XPathValue<std::string> result = _xpath.evaluate_expr(expr, _doc); - return result.asNumber(); -} - -void XPathDataModel::assign(const Element<std::string>& assignElem, - const Node<std::string>& node, - const std::string& content) { - std::string location; - if (HAS_ATTR(assignElem, "id")) { - location = ATTR(assignElem, "id"); - } else if (HAS_ATTR(assignElem, "location")) { - location = ATTR(assignElem, "location"); - } - - // test 326ff - XPathValue<std::string> key = _xpath.evaluate_expr(location, _doc); -#ifdef VERBOSE - LOG(INFO) << "Key XPath : " << key.asString(); -#endif -#if 0 - if (key.type() == NODE_SET) { - try { - for (size_t i = 0; i < key.asNodeSet().size(); i++) { - Node<std::string> node = key.asNodeSet()[i]; - if (node == _varResolver.resolveVariable("", "_ioprocessors").asNodeSet()[0]) - ERROR_EXECUTION_THROW("Cannot assign _ioProcessors"); - if (node == _varResolver.resolveVariable("", "_sessionid").asNodeSet()[0]) - ERROR_EXECUTION_THROW("Cannot assign _sessionid"); - if (node == _varResolver.resolveVariable("", "_name").asNodeSet()[0]) - ERROR_EXECUTION_THROW("Cannot assign _name"); - if (node == _varResolver.resolveVariable("", "_event").asNodeSet()[0]) - ERROR_EXECUTION_THROW("Cannot assign _event"); - } - } catch (Event e) {} - } -#endif - NodeSet<std::string> nodeSet; - if (node) { - Node<std::string> data = node; - while (data) { - // do not add empty text as a node - if (data.getNodeType() == Node_base::TEXT_NODE) { - std::string trimmed = data.getNodeValue(); - boost::trim(trimmed); - if (trimmed.length() == 0) { - data = data.getNextSibling(); - continue; - } - } - nodeSet.push_back(data); - data = data.getNextSibling(); - } - assign(key, nodeSet, assignElem); - } else if (content.length() > 0) { - Text<std::string> textNode = _doc.createTextNode(spaceNormalize(content)); - nodeSet.push_back(textNode); - assign(key, nodeSet, assignElem); - } else if (HAS_ATTR(assignElem, "expr")) { - XPathValue<std::string> value = _xpath.evaluate_expr(ATTR(assignElem, "expr"), _doc); -#ifdef VERBOSE - LOG(INFO) << "Value XPath : " << value.asString(); -#endif - assign(key, value, assignElem); - } else { - LOG(ERROR) << "assign element has no content"; - } - -// std::cout << _datamodel << std::endl; -} - -void XPathDataModel::assign(const std::string& location, const Data& data) { - XPathValue<std::string> locationResult = _xpath.evaluate_expr(location, _doc); - NodeSet<std::string> dataNodeSet = dataToNodeSet(data); - assign(locationResult, dataNodeSet, Element<std::string>()); -// std::cout << _datamodel << std::endl; -} - -NodeSet<std::string> XPathDataModel::dataToNodeSet(const Data& data) { - NodeSet<std::string> dataNodeSet; - if (data.atom.length() > 0) { - dataNodeSet.push_back(_doc.createTextNode(data.atom)); - } - return dataNodeSet; -} - -void XPathDataModel::init(const Element<std::string>& dataElem, - const Node<std::string>& node, - const std::string& content) { - std::string location; - if (HAS_ATTR(dataElem, "id")) { - location = ATTR(dataElem, "id"); - } else if (HAS_ATTR(dataElem, "location")) { - location = ATTR(dataElem, "location"); - } - - NodeSet<std::string> nodeSet; - if (node || (content.length() > 0)) { - _datamodel.appendChild(_doc.importNode(dataElem, true)); - nodeSet.push_back(dataElem); - } else if (HAS_ATTR(dataElem, "expr")) { - try { - Element<std::string> container = _doc.createElement("data"); - container.setAttribute("id", location); - XPathValue<std::string> expr = _xpath.evaluate_expr(ATTR(dataElem, "expr"), _doc); - switch (expr.type()) { - case NODE_SET: { - for (size_t i = 0; i < expr.asNodeSet().size(); i++) { - container.appendChild(expr.asNodeSet()[i].cloneNode(true)); - nodeSet.push_back(expr.asNodeSet()[i].cloneNode(true)); - } - break; - } - case STRING: - container.appendChild(_doc.createTextNode(expr.asString())); - nodeSet.push_back(_doc.createTextNode(expr.asString())); - break; - case NUMBER: { - container.appendChild(_doc.createTextNode(toStr(expr.asNumber()))); - nodeSet.push_back(_doc.createTextNode(toStr(expr.asNumber()))); - break; - } - case Arabica::XPath::BOOL: - case ANY: - ERROR_EXECUTION_THROW("expr evaluates to type ANY"); - } - _datamodel.appendChild(container); - } catch (SyntaxException e) { - ERROR_EXECUTION_THROW(e.what()); - } - } else { - LOG(ERROR) << "data element has no content"; - } - - _varResolver.setVariable(location, nodeSet); -} - -void XPathDataModel::init(const std::string& location, const Data& data) { - NodeSet<std::string> nodeSet; - _varResolver.setVariable(location, nodeSet); -} - - -void XPathDataModel::assign(const XPathValue<std::string>& key, - const XPathValue<std::string>& value, - const Element<std::string>& assignElem) { - switch (key.type()) { - case NODE_SET: - if (key.asNodeSet().size() == 0) { - ERROR_EXECUTION_THROW("key for assign is empty nodeset"); - } - switch (value.type()) { - case STRING: - assign(key.asNodeSet(), value.asString(), assignElem); - break; - case Arabica::XPath::BOOL: - assign(key.asNodeSet(), value.asBool(), assignElem); - break; - case NUMBER: - assign(key.asNodeSet(), value.asNumber(), assignElem); - break; - case NODE_SET: - assign(key.asNodeSet(), value.asNodeSet(), assignElem); - break; - case ANY: - ERROR_EXECUTION_THROW("Type ANY as key for assign not supported"); - } - break; - case STRING: - case Arabica::XPath::BOOL: - case NUMBER: - case ANY: - ERROR_EXECUTION_THROW("Type ANY as key for assign not supported") - break; - } -} - -void XPathDataModel::assign(const XPathValue<std::string>& key, - const NodeSet<std::string>& value, - const Element<std::string>& assignElem) { - if (value.size() == 0 || !value[0]) - return; - switch (key.type()) { - case NODE_SET: { - assign(key.asNodeSet(), value, assignElem); - break; - } - case STRING: - case Arabica::XPath::BOOL: - case NUMBER: - case ANY: - ERROR_EXECUTION_THROW("Type ANY as key for assign not supported") - } -} - -void XPathDataModel::assign(const NodeSet<std::string>& key, - const std::string& value, - const Element<std::string>& assignElem) { - if (key.size() == 0) - return; - for (size_t i = 0; i < key.size(); i++) { - Node<std::string> node = key[i]; - switch (node.getNodeType()) { - case Node_base::ATTRIBUTE_NODE: { - Attr<std::string> attr(node); - attr.setValue(value); - break; - } - case Node_base::TEXT_NODE: { - Text<std::string> text(node); - text.setNodeValue(value); - break; - } - case Node_base::ELEMENT_NODE: { - Element<std::string> element(node); - if (HAS_ATTR(assignElem, "type") && iequals(ATTR(assignElem, "type"), "addattribute")) { - // addattribute: Add an attribute with the name specified by 'attr' - // and value specified by 'expr' to the node specified by 'location'. - if (!HAS_ATTR(assignElem, "attr")) - ERROR_EXECUTION_THROW("Assign element is missing 'attr'"); - element.setAttribute(ATTR(assignElem, "attr"), value); - } else { - /// test 547 - while(element.hasChildNodes()) - element.removeChild(element.getChildNodes().item(0)); - Text<std::string> text = _doc.createTextNode(value); - element.appendChild(text); - } - break; - } - default: - ERROR_EXECUTION_THROW("Unsupported node type with assign"); - break; - } - } -} - -void XPathDataModel::assign(const NodeSet<std::string>& key, - const double value, - const Element<std::string>& assignElem) { - assign(key, toStr(value), assignElem); -} - -void XPathDataModel::assign(const NodeSet<std::string>& key, - const bool value, - const Element<std::string>& assignElem) { -} - -void XPathDataModel::assign(const NodeSet<std::string>& key, - const NodeSet<std::string>& value, - const Element<std::string>& assignElem) { - if (key.size() == 0) - return; - if (value.size() == 0 || !value[0]) - return; - - for (size_t i = 0; i < key.size(); i++) { - switch (key[i].getNodeType()) - case Node_base::ELEMENT_NODE: { - assign(Element<std::string>(key[i]), value, assignElem); - break; - default: -// std::cout << key[i].getNodeType() << std::endl; - ERROR_EXECUTION_THROW("Unsupported node type for assign"); - break; - } - } -} - -void XPathDataModel::assign(const Element<std::string>& key, - const NodeSet<std::string>& value, - const Element<std::string>& assignElem) { - Element<std::string> element(key); - if (value.size() == 0 || !value[0]) - return; - - if (false) { - } else if (assignElem && HAS_ATTR(assignElem, "type") && iequals(ATTR(assignElem, "type"), "firstchild")) { - // firstchild: Insert the value specified by 'expr' before all of the children at 'location'. - for (size_t i = value.size(); i; i--) { - Node<std::string> importedNode = (value[i-1].getOwnerDocument() == _doc ? value[i-1].cloneNode(true) : _doc.importNode(value[i-1], true)); - element.insertBefore(importedNode, element.getFirstChild()); - } - } else if (assignElem && HAS_ATTR(assignElem, "type") && iequals(ATTR(assignElem, "type"), "lastchild")) { - // lastchild: Insert the value specified by 'expr' after all of the children at 'location'. - for (size_t i = 0; i < value.size(); i++) { - Node<std::string> importedNode = (value[i].getOwnerDocument() == _doc ? value[i].cloneNode(true) : _doc.importNode(value[i], true)); - element.appendChild(importedNode); - } - } else if (assignElem && HAS_ATTR(assignElem, "type") && iequals(ATTR(assignElem, "type"), "previoussibling")) { - // previoussibling: Insert the value specified by 'expr' before the - // node specified by 'location', keeping the same parent. - Node<std::string> parent = element.getParentNode(); - if (!parent) - ERROR_EXECUTION_THROW("Node has no parent"); - for (size_t i = 0; i < value.size(); i++) { - Node<std::string> importedNode = (value[i].getOwnerDocument() == _doc ? value[i].cloneNode(true) : _doc.importNode(value[i], true)); - parent.insertBefore(importedNode, element); - } - } else if (assignElem && HAS_ATTR(assignElem, "type") && iequals(ATTR(assignElem, "type"), "nextsibling")) { - // nextsibling: Insert the value specified by 'expr' after the node - // specified by 'location', keeping the same parent. - Node<std::string> parent = element.getParentNode(); - if (!parent) - ERROR_EXECUTION_THROW("Node has no parent"); - for (size_t i = value.size(); i; i--) { - Node<std::string> importedNode = (value[i-1].getOwnerDocument() == _doc ? value[i-1].cloneNode(true) : _doc.importNode(value[i-1], true)); - Node<std::string> nextSibling = element.getNextSibling(); - if (nextSibling) { - parent.insertBefore(importedNode, element.getNextSibling()); - } else { - parent.appendChild(importedNode); - } - } - } else if (assignElem && HAS_ATTR(assignElem, "type") && iequals(ATTR(assignElem, "type"), "replace")) { - // replace: Replace the node specified by 'location' by the value specified by 'expr'. - Node<std::string> parent = element.getParentNode(); - if (!parent) - ERROR_EXECUTION_THROW("Node has no parent"); - if (value.size() != 1) - ERROR_EXECUTION_THROW("Value not singular"); - Node<std::string> importedNode = (value[0].getOwnerDocument() == _doc ? value[0].cloneNode(true) : _doc.importNode(value[0], true)); - parent.replaceChild(importedNode, element); - } else if (assignElem && HAS_ATTR(assignElem, "type") && iequals(ATTR(assignElem, "type"), "delete")) { - // delete: Delete the node specified by 'location'. ('expr' is ignored.). - Node<std::string> parent = element.getParentNode(); - if (!parent) - ERROR_EXECUTION_THROW("Node has no parent"); - parent.removeChild(element); - } else { - // replacechildren: Replace all the children at 'location' with the value specified by 'expr'. - while(element.hasChildNodes()) - element.removeChild(element.getChildNodes().item(0)); - for (size_t i = 0; i < value.size(); i++) { - Node<std::string> importedNode = element.getOwnerDocument().importNode(value[i], true); - element.appendChild(importedNode); - } - } -} - -XPathValue<std::string> -NodeSetVariableResolver::resolveVariable(const std::string& namepaceUri, - const std::string& name) const { - std::map<std::string, NodeSet<std::string> >::const_iterator n = _variables.find(name); - if(n == _variables.end()) { - ERROR_EXECUTION_THROW("No variable named '" + name + "'"); - } -#if VERBOSE - std::cout << std::endl << "Getting " << name << ":" << std::endl; - for (size_t i = 0; i < n->second.size(); i++) { - std::cout << n->second[i].getNodeType() << " | " << n->second[i] << std::endl; - } - std::cout << std::endl; -#endif - return XPathValue<std::string>(new NodeSetValue<std::string>(n->second)); -} - -void NodeSetVariableResolver::setVariable(const std::string& name, const NodeSet<std::string>& value) { -#if VERBOSE - std::cout << std::endl << "Setting " << name << ":" << std::endl; - for (size_t i = 0; i < value.size(); i++) { - std::cout << value[i].getNodeType() << " | " << value[i] << std::endl; - } - std::cout << std::endl; -#endif - _variables[name] = value; -#if 0 - std::map<std::string, Arabica::XPath::NodeSet<std::string> >::iterator varIter = _variables.begin(); - while (varIter != _variables.end()) { - std::cout << varIter->first << ":" << std::endl; - for (size_t i = 0; i < varIter->second.size(); i++) { - std::cout << varIter->second[i].getNodeType() << " | " << varIter->second[i] << std::endl; - } - varIter++; - } -#endif -} - -bool NodeSetVariableResolver::isDeclared(const std::string& name) { -#if 0 - std::map<std::string, Arabica::XPath::NodeSet<std::string> >::iterator varIter = _variables.begin(); - while (varIter != _variables.end()) { - std::cout << varIter->first << std::endl; - varIter++; - } -#endif - return _variables.find(name) != _variables.end(); -} - -XPathFunction<std::string>* -XPathFunctionResolver::resolveFunction(const std::string& namespace_uri, - const std::string& name, - const std::vector<XPathExpression<std::string> >& argExprs) const { - if (iequals(name, "in")) { - return new XPathFunctionIn(1, -1, argExprs, _interpreter); - } - return _xpathFuncRes.resolveFunction(namespace_uri, name, argExprs); -} - -std::vector<std::pair<std::string, std::string> > XPathFunctionResolver::validNames() const { - std::vector<std::pair<std::string, std::string> > names = _xpathFuncRes.validNames(); - names.push_back(std::make_pair("", "In")); - return names; -} - -bool XPathFunctionIn::doEvaluate(const Node<std::string>& context, - const ExecutionContext<std::string>& executionContext) const { - for (size_t i = 0; i < argCount(); i++) { - XPathValue<std::string> stateName = arg(i, context, executionContext); - if (stateName.type() == STRING) { - if (_interpreter->isInState(stateName.asString())) { - continue; - } - } - return false; - } - return true; -} - -} diff --git a/src/uscxml/plugins/datamodel/xpath/XPathDataModel.h b/src/uscxml/plugins/datamodel/xpath/XPathDataModel.h deleted file mode 100644 index 7a085d2..0000000 --- a/src/uscxml/plugins/datamodel/xpath/XPathDataModel.h +++ /dev/null @@ -1,185 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef XPATHDATAMODEL_H_KN8TWG0V -#define XPATHDATAMODEL_H_KN8TWG0V - -#include "uscxml/InterpreterInfo.h" -#include "uscxml/plugins/DataModel.h" - -#include <list> - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { -class Event; -class Data; -} - -namespace uscxml { - -class XPathFunctionIn : public Arabica::XPath::BooleanXPathFunction<std::string> { -public: - XPathFunctionIn(int minArgs, - int maxArgs, - const std::vector<Arabica::XPath::XPathExpression<std::string> >& args, - InterpreterInfo* interpreter) : - Arabica::XPath::BooleanXPathFunction<std::string>(minArgs, maxArgs, args), - _interpreter(interpreter) {} - -protected: - bool doEvaluate(const Arabica::DOM::Node<std::string>& context, - const Arabica::XPath::ExecutionContext<std::string>& executionContext) const; - InterpreterInfo* _interpreter; -}; - -class XPathFunctionResolver : public Arabica::XPath::FunctionResolver<std::string> { -public: - virtual ~XPathFunctionResolver() { } - - virtual Arabica::XPath::XPathFunction<std::string>* - resolveFunction(const std::string& namespace_uri, - const std::string& name, - const std::vector<Arabica::XPath::XPathExpression<std::string> >& argExprs) const; - - virtual std::vector<std::pair<std::string, std::string> > validNames() const; - void setInterpreter(InterpreterInfo* interpreter) { - _interpreter = interpreter; - } -protected: - Arabica::XPath::StandardXPathFunctionResolver<std::string> _xpathFuncRes; - InterpreterInfo* _interpreter; -}; - -class NodeSetVariableResolver : public Arabica::XPath::VariableResolver<std::string> { -public: - Arabica::XPath::XPathValue<std::string> resolveVariable(const std::string& namepaceUri, - const std::string& name) const; - void setVariable(const std::string& name, const Arabica::XPath::NodeSet<std::string>& value); - bool isDeclared(const std::string& name); - -private: - std::map<std::string, Arabica::XPath::NodeSet<std::string> > _variables; - friend class XPathDataModel; -}; - -class XPathDataModel : public DataModelImpl { -public: - XPathDataModel(); - virtual ~XPathDataModel(); - virtual boost::shared_ptr<DataModelImpl> create(InterpreterInfo* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("xpath"); - return names; - } - - virtual void initialize(); - virtual void setEvent(const Event& event); - - virtual bool validate(const std::string& location, const std::string& schema); - virtual bool isLocation(const std::string& expr); - - virtual uint32_t getLength(const std::string& expr); - virtual void setForeach(const std::string& item, - const std::string& array, - const std::string& index, - uint32_t iteration); - - virtual void pushContext(); - virtual void popContext(); - - virtual void eval(const Arabica::DOM::Element<std::string>& scriptElem, - const std::string& expr); - virtual void assign(const Arabica::DOM::Element<std::string>& assignElem, - const Arabica::DOM::Node<std::string>& node, - const std::string& content); - virtual void assign(const std::string& location, const Data& data); - - virtual void init(const Arabica::DOM::Element<std::string>& dataElem, - const Arabica::DOM::Node<std::string>& node, - const std::string& content); - virtual void init(const std::string& location, const Data& data); - - virtual Data getStringAsData(const std::string& content); - virtual bool isDeclared(const std::string& expr); - - virtual std::string evalAsString(const std::string& expr); - virtual bool evalAsBool(const std::string& expr); - virtual bool evalAsBool(const Arabica::DOM::Element<std::string>& node, const std::string& expr); - virtual double evalAsNumber(const std::string& expr); - -protected: - Arabica::XPath::XPath<std::string> _xpath; - Arabica::DOM::DOMImplementation<std::string> _domFactory; - Arabica::DOM::Element<std::string> _datamodel; - Arabica::DOM::Document<std::string> _doc; - - bool isValidIdentifier(const std::string& identifier); - Arabica::XPath::NodeSet<std::string> dataToNodeSet(const Data& data); - - // resolve value to its type - void assign(const Arabica::XPath::XPathValue<std::string>& key, - const Arabica::XPath::XPathValue<std::string>& value, - const Arabica::DOM::Element<std::string>& assignElem); - void assign(const Arabica::XPath::XPathValue<std::string>& key, - const Arabica::XPath::NodeSet<std::string>& value, - const Arabica::DOM::Element<std::string>& assignElem); - - // assign value to a nodeset key - void assign(const Arabica::XPath::NodeSet<std::string>& key, - const std::string& value, - const Arabica::DOM::Element<std::string>& assignElem); - void assign(const Arabica::XPath::NodeSet<std::string>& key, - const double value, - const Arabica::DOM::Element<std::string>& assignElem); - void assign(const Arabica::XPath::NodeSet<std::string>& key, - const bool value, - const Arabica::DOM::Element<std::string>& assignElem); - void assign(const Arabica::XPath::NodeSet<std::string>& key, - const Arabica::XPath::NodeSet<std::string>& value, - const Arabica::DOM::Element<std::string>& assignElem); - - // assign value to an element key (from nodeset) - void assign(const Arabica::DOM::Element<std::string>& key, - const Arabica::XPath::NodeSet<std::string>& value, - const Arabica::DOM::Element<std::string>& assignElem); - - - // assign value to a text node key (from nodeset) - void assign(const Arabica::DOM::Text<std::string>& key, - const Arabica::XPath::NodeSet<std::string>& value, - const Arabica::DOM::Element<std::string>& assignElem); - - - NodeSetVariableResolver _varResolver; - XPathFunctionResolver _funcResolver; - -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(XPathDataModel, DataModelImpl); -#endif - -} - -#endif /* end of include guard: XPATHDATAMODEL_H_KN8TWG0V */ diff --git a/src/uscxml/plugins/element/CMakeLists.txt b/src/uscxml/plugins/element/CMakeLists.txt deleted file mode 100644 index e2142ca..0000000 --- a/src/uscxml/plugins/element/CMakeLists.txt +++ /dev/null @@ -1,114 +0,0 @@ -if (NOT BUILD_MINIMAL) - - # Fetch element - - set(USCXML_ELEMENTS "fetch ${USCXML_ELEMENTS}") - file(GLOB_RECURSE FETCH_ELEMENT - fetch/*.cpp - fetch/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${FETCH_ELEMENT}) - add_library( - element_fetch SHARED - ${FETCH_ELEMENT} - "../Plugins.cpp") - target_link_libraries(element_fetch uscxml) - set_target_properties(element_fetch PROPERTIES FOLDER "Plugin Element") - set_target_properties(element_fetch PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(element_fetch PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${FETCH_ELEMENT}) - endif() - - # MMI elements - - # file(GLOB_RECURSE MMI_ELEMENT - # mmi/*.cpp - # mmi/*.h - # ) - # if (BUILD_AS_PLUGINS) - # source_group("" FILES ${MMI_ELEMENT}) - # add_library( - # element_mmi SHARED - # ${MMI_ELEMENT} - # "../Plugins.cpp") - # target_link_libraries(element_mmi uscxml) - # set_target_properties(element_mmi PROPERTIES FOLDER "Plugin Element") - # set_target_properties(element_mmi PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - # set_target_properties(element_mmi PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - # else() - # list (APPEND USCXML_FILES ${MMI_ELEMENT}) - # endif() - - - # Postpone element - - set(USCXML_ELEMENTS "postpone ${USCXML_ELEMENTS}") - file(GLOB_RECURSE POSTPONE_ELEMENT - postpone/*.cpp - postpone/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${POSTPONE_ELEMENT}) - add_library( - element_postpone SHARED - ${POSTPONE_ELEMENT} - "../Plugins.cpp") - target_link_libraries(element_postpone uscxml) - set_target_properties(element_postpone PROPERTIES FOLDER "Plugin Element") - set_target_properties(element_postpone PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(element_postpone PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${POSTPONE_ELEMENT}) - endif() - - - # File element - - set(USCXML_ELEMENTS "file ${USCXML_ELEMENTS}") - file(GLOB_RECURSE FILE_ELEMENT - file/*.cpp - file/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${FILE_ELEMENT}) - add_library( - element_file SHARED - ${FILE_ELEMENT} - "../Plugins.cpp") - target_link_libraries(element_file uscxml) - set_target_properties(element_file PROPERTIES FOLDER "Plugin Element") - set_target_properties(element_file PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(element_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${FILE_ELEMENT}) - endif() - - - # Respond element - - set(USCXML_ELEMENTS "respond ${USCXML_ELEMENTS}") - file(GLOB_RECURSE RESPOND_ELEMENT - respond/*.cpp - respond/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${RESPOND_ELEMENT}) - add_library( - element_respond SHARED - ${RESPOND_ELEMENT} - "../Plugins.cpp") - target_link_libraries(element_respond uscxml) - set_target_properties(element_respond PROPERTIES FOLDER "Plugin Element") - set_target_properties(element_respond PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(element_respond PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${RESPOND_ELEMENT}) - endif() - -endif() # BUILD_MINIMAL - -set(USCXML_INCLUDE_DIRS ${USCXML_INCLUDE_DIRS} PARENT_SCOPE) -set(USCXML_FILES ${USCXML_FILES} PARENT_SCOPE) -set(USCXML_ELEMENTS ${USCXML_ELEMENTS} PARENT_SCOPE) diff --git a/src/uscxml/plugins/element/fetch/FetchElement.cpp b/src/uscxml/plugins/element/fetch/FetchElement.cpp deleted file mode 100644 index bf3129b..0000000 --- a/src/uscxml/plugins/element/fetch/FetchElement.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include <boost/algorithm/string.hpp> - -#include "FetchElement.h" -#include "uscxml/dom/DOMUtils.h" -#include <glog/logging.h> - -#include <event2/http.h> -#include <event2/http_struct.h> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new FetchElementProvider() ); - return true; -} -#endif - -boost::shared_ptr<ExecutableContentImpl> FetchElement::create(InterpreterImpl* interpreter) { - boost::shared_ptr<FetchElement> element = boost::shared_ptr<FetchElement>(new FetchElement()); - element->_interpreter = interpreter; - return element; -} - -FetchElement::~FetchElement() { - URLFetcher::breakURL(_targetUrl); -} - -void FetchElement::downloadCompleted(const URL& url) { - Event event; - event.name = _callback; - - std::string content = url.getInContent(); - std::map<std::string, std::string> headerFields = url.getInHeaderFields(); - - if (false) { - } else if (iequals(_type, "text")) { - event.data.atom = content; - event.data.type = Data::VERBATIM; - } else if (iequals(_type, "url")) { - } else if (iequals(_type, "json")) { - event.data = Data::fromJSON(content); - } else if (iequals(_type, "xml")) { - event = Event::fromXML(content); - } - - _interpreter->receive(event); - -} - -void FetchElement::downloadFailed(const URL& url, int errorCode) { - Event event; - event.name = _callback + ".failed"; - - _interpreter->receive(event); - -} - -void FetchElement::enterElement(const Arabica::DOM::Element<std::string>& node) { - if (!HAS_ATTR(node, "src") && !HAS_ATTR(node, "srcexpr")) { - LOG(ERROR) << "Fetch element requires src or srcexpr"; - return; - } - if (HAS_ATTR(node, "srcexpr") && !_interpreter->getDataModel()) { - LOG(ERROR) << "Fetch element with srcexpr requires datamodel"; - return; - } - _source = (HAS_ATTR(node, "src") ? ATTR(node, "src") : _interpreter->getDataModel().evalAsString(ATTR(node, "srcexpr"))); - - if (!HAS_ATTR(node, "callback") && !HAS_ATTR(node, "callbackexpr")) { - LOG(ERROR) << "Fetch element requires callback or callbackexpr"; - return; - } - if (HAS_ATTR(node, "callbackexpr") && !_interpreter->getDataModel()) { - LOG(ERROR) << "Fetch element with callbackexpr requires datamodel"; - return; - } - _callback = (HAS_ATTR(node, "callback") ? ATTR(node, "callback") : _interpreter->getDataModel().evalAsString(ATTR(node, "callbackexpr"))); - - _type = (HAS_ATTR(node, "type") ? ATTR(node, "type") : "text"); - if (!iequals(_type, "text") && - !iequals(_type, "url") && - !iequals(_type, "json") && - !iequals(_type, "xml")) { - LOG(ERROR) << "Fetch element type attribute not one of text, url, json, xml."; - return; - } - - _targetUrl = URL(_source); - if (!_targetUrl.isAbsolute()) { - if (!_targetUrl.toAbsolute(_interpreter->getBaseURL(node))) { - LOG(ERROR) << "Cannot transform " << _source << " into absolute URL"; - return; - } - } - - _targetUrl.addMonitor(this); - URLFetcher::fetchURL(_targetUrl); - -} - -void FetchElement::exitElement(const Arabica::DOM::Element<std::string>& node) { - -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/element/fetch/FetchElement.h b/src/uscxml/plugins/element/fetch/FetchElement.h deleted file mode 100644 index 3b7628a..0000000 --- a/src/uscxml/plugins/element/fetch/FetchElement.h +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef FETCHELEMENT_H_R6GH94FV -#define FETCHELEMENT_H_R6GH94FV - -#include <uscxml/Interpreter.h> - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class FetchElement : public ExecutableContentImpl, public URLMonitor { -public: - FetchElement() {} - virtual ~FetchElement(); - boost::shared_ptr<ExecutableContentImpl> create(InterpreterImpl* interpreter); - - std::string getLocalName() { - return "fetch"; - } - - std::string getNamespace() { - return "http://www.w3.org/2005/07/scxml"; - } - - bool processChildren() { - return false; - } - - void enterElement(const Arabica::DOM::Element<std::string>& node); - void exitElement(const Arabica::DOM::Element<std::string>& node); - void downloadCompleted(const URL& url); - void downloadFailed(const URL& url, int errorCode); - -protected: - URL _targetUrl; - std::string _source; - std::string _callback; - std::string _type; -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(FetchElement, ExecutableContentImpl); -#endif - -} - -#endif /* end of include guard: FETCHELEMENT_H_R6GH94FV */ diff --git a/src/uscxml/plugins/element/file/FileElement.cpp b/src/uscxml/plugins/element/file/FileElement.cpp deleted file mode 100644 index c2e4f55..0000000 --- a/src/uscxml/plugins/element/file/FileElement.cpp +++ /dev/null @@ -1,259 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "FileElement.h" -#include <glog/logging.h> -#include <stdio.h> -#include <vector> -#include <boost/algorithm/string.hpp> -#include "uscxml/messages/Blob.h" - -#include "uscxml/dom/DOMUtils.h" -#include "uscxml/dom/NameSpacingParser.h" - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new FileElementProvider() ); - return true; -} -#endif - -boost::shared_ptr<ExecutableContentImpl> FileElement::create(InterpreterImpl* interpreter) { - boost::shared_ptr<FileElement> element = boost::shared_ptr<FileElement>(new FileElement()); - return element; -} - -FileElement::~FileElement() { -} - -void FileElement::enterElement(const Arabica::DOM::Element<std::string>& node) { - if (!HAS_ATTR(node, "url") && !HAS_ATTR(node, "urlexpr")) { - LOG(ERROR) << "File element requires url or urlexpr"; - return; - } - _givenUrl = (HAS_ATTR(node, "url") ? ATTR(node, "url") : _interpreter->getDataModel().evalAsString(ATTR(node, "urlexpr"))); - - std::string sandBoxStr = (HAS_ATTR(node, "sandbox") ? ATTR(node, "sandbox") : "on"); - if (iequals(sandBoxStr, "off") || iequals(sandBoxStr, "false") || iequals(sandBoxStr, "no")) { - _sandBoxed = false; - } - - if (HAS_ATTR(node, "operation")) { - std::string operation = ATTR(node, "operation"); - if (iequals(operation, "read") || iequals(operation, "load")) { - _operation = READ; - } else if(iequals(operation, "write")) { - _operation = WRITE; - } else if(iequals(operation, "append")) { - _operation = APPEND; - } else { - LOG(ERROR) << "File element operation attribute not one of read, write or append."; - return; - } - } else { - _operation = READ; - } - - // callback is only needed for reading - std::string callback; - if (_operation == READ) { - if (!HAS_ATTR(node, "callback") && !HAS_ATTR(node, "callbackexpr")) { - LOG(ERROR) << "File element requires callback or callbackexpr"; - return; - } - callback = (HAS_ATTR(node, "callback") ? ATTR(node, "callback") : _interpreter->getDataModel().evalAsString(ATTR(node, "callbackexpr"))); - } - - std::string contentStr; - char* content = NULL; - size_t contentSize = 0; - if (_operation == WRITE || _operation == APPEND) { - if (!HAS_ATTR(node, "content") && !HAS_ATTR(node, "contentexpr")) { - LOG(ERROR) << "File element requires content or contentexpr"; - return; - } - if (HAS_ATTR(node, "content")) { - contentStr = ATTR(node, "content"); - } else { - Data data = _interpreter->getDataModel().getStringAsData(ATTR(node, "contentexpr")); - if (data.binary) { - content = data.binary.getData(); - contentSize = data.binary.getSize(); - } else if (data.atom.length() > 0) { - contentStr = data.atom; - } - } - } - - std::string type = "text"; - if (HAS_ATTR(node, "type")) { - type = ATTR(node, "type"); - } else if(HAS_ATTR(node, "typeexpr")) { - type = _interpreter->getDataModel().evalAsString(ATTR(node, "typeexpr")); - } - if (iequals(type, "text")) { - _type = TEXT; - } else if (iequals(type, "json")) { - _type = JSON; - } else if (iequals(type, "binary")) { - _type = BINARY; - } else if(iequals(type, "xml")) { - _type = XML; - } else { - LOG(ERROR) << "File element type attribute not one of text, json, xml or binary."; - return; - } - - _actualUrl = URL(_givenUrl); - if (_sandBoxed && _actualUrl.isAbsolute()) { - LOG(ERROR) << "Given URL is absolute with sandboxing enabled."; - return; - } - - if (_sandBoxed) - _actualUrl.toAbsolute(URL::getResourceDir()); - - _filepath = _actualUrl.path(); - - - std::string writeMode; - switch (_operation) { - case APPEND: - writeMode = "a+"; - case WRITE: { - if (writeMode.length() == 0) - writeMode = "w+"; - - FILE *fp; - fp = fopen(_filepath.c_str(), writeMode.c_str()); - if (fp == NULL) { - LOG(ERROR) << "Error opening '" << _filepath << "' for writing: " << strerror(errno); - } - - if (content && contentSize > 0) { - size_t written = fwrite(content, 1, contentSize, fp); - if (written != contentSize) { - LOG(ERROR) << "Error writing to '" << _filepath << "': " << strerror(errno); - return; - } - } else if (contentStr.length() > 0) { - size_t written = fwrite(contentStr.c_str(), contentStr.length(), 1, fp); - if (written < 1) { - LOG(ERROR) << "Error writing to '" << _filepath << "': " << strerror(errno); - } - } else { - LOG(WARNING) << "Nothing to write to '" << _filepath; - } - fclose(fp); - break; - } - case READ: { - struct stat fileStat; - int err = stat(_filepath.c_str(), &fileStat); - if (err < 0) { - LOG(ERROR) << "Cannot stat file '" << _filepath << "': " << strerror(errno); - return; - } - - Event event; - event.name = callback; - - std::string filename = _actualUrl.pathComponents()[_actualUrl.pathComponents().size() - 1]; - - event.data.compound["file"].compound["name"] = Data(filename, Data::VERBATIM); - event.data.compound["file"].compound["path"] = Data(_filepath, Data::VERBATIM); - event.data.compound["file"].compound["mtime"] = Data(toStr(fileStat.st_mtime), Data::INTERPRETED); - event.data.compound["file"].compound["ctime"] = Data(toStr(fileStat.st_ctime), Data::INTERPRETED); - event.data.compound["file"].compound["atime"] = Data(toStr(fileStat.st_atime), Data::INTERPRETED); - event.data.compound["file"].compound["size"] = Data(toStr(fileStat.st_size), Data::INTERPRETED); - - - FILE *fp; - fp = fopen(_filepath.c_str(), "r"); - - fseek (fp, 0, SEEK_END); - size_t filesize = ftell(fp); - rewind (fp); - - char* fileContents = (char*)malloc(filesize); - size_t read = fread(fileContents, 1, filesize, fp); - fclose(fp); - if (read != filesize) { - LOG(ERROR) << "Error reading from '" << _filepath << "': " << strerror(errno); - return; - } - - switch (_type) { - case BINARY: { - std::string mimetype = "application/octet-stream"; - if (HAS_ATTR(node, "mimetype")) { - mimetype = ATTR(node, "mimetype"); - } else if(HAS_ATTR(node, "mimetypeexpr")) { - mimetype = _interpreter->getDataModel().evalAsString(ATTR(node, "mimetypeexpr")); - } - - event.data.compound["content"] = Data(fileContents, fileStat.st_size, mimetype, true); - break; - } - case TEXT: - event.data.compound["content"] = Data(fileContents, Data::VERBATIM); - free(fileContents); - break; - case JSON: { - Data json = Data::fromJSON(fileContents); - free(fileContents); - if (json.empty()) { - LOG(ERROR) << "Cannot parse contents of " << _filepath << " as JSON"; - return; - } - event.data.compound["content"] = json; - break; - } - case XML: { - NameSpacingParser parser = NameSpacingParser::fromXML(fileContents); - if (parser.errorsReported()) { - LOG(ERROR) << "Cannot parse contents of " << _filepath << " as XML"; - return; - } - event.dom = parser.getDocument().getDocumentElement(); - break; - } - } - _interpreter->receive(event); - break; - } - } - - - - -} - -void FileElement::exitElement(const Arabica::DOM::Element<std::string>& node) { - -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/element/file/FileElement.h b/src/uscxml/plugins/element/file/FileElement.h deleted file mode 100644 index b1b3426..0000000 --- a/src/uscxml/plugins/element/file/FileElement.h +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef FILEELEMENT_H_VJ3JIMEJ -#define FILEELEMENT_H_VJ3JIMEJ - -#include <uscxml/Interpreter.h> -#include <sys/stat.h> - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class FileElement : public ExecutableContentImpl { -public: - enum Operation { - READ, - WRITE, - APPEND - }; - - enum Type { - XML, - JSON, - TEXT, - BINARY - }; - - FileElement() { - _sandBoxed = true; - } - virtual ~FileElement(); - boost::shared_ptr<ExecutableContentImpl> create(InterpreterImpl* interpreter); - - std::string getLocalName() { - return "file"; - } - - std::string getNamespace() { - return "http://www.w3.org/2005/07/scxml"; - } - - bool processChildren() { - return false; - } - - void enterElement(const Arabica::DOM::Element<std::string>& node); - void exitElement(const Arabica::DOM::Element<std::string>& node); - -protected: - - bool _sandBoxed; - std::string _givenUrl; - URL _actualUrl; - std::string _filepath; - Operation _operation; - Type _type; -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(FileElement, ExecutableContentImpl); -#endif - -} - -#endif /* end of include guard: FILEELEMENT_H_VJ3JIMEJ */ diff --git a/src/uscxml/plugins/element/mmi/MMIEvents.cpp b/src/uscxml/plugins/element/mmi/MMIEvents.cpp deleted file mode 100644 index e6d6954..0000000 --- a/src/uscxml/plugins/element/mmi/MMIEvents.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "MMIEvents.h" - -namespace uscxml { - -void PrepareRequestElement::enterElement(const Arabica::DOM::Node<std::string>& node) { -} -void StartRequestElement::enterElement(const Arabica::DOM::Node<std::string>& node) { -} -void PauseRequestElement::enterElement(const Arabica::DOM::Node<std::string>& node) { -} -void ResumeRequestElement::enterElement(const Arabica::DOM::Node<std::string>& node) { -} -void CancelRequestElement::enterElement(const Arabica::DOM::Node<std::string>& node) { -} -void ClearContextRequestElement::enterElement(const Arabica::DOM::Node<std::string>& node) { -} -void StatusRequestElement::enterElement(const Arabica::DOM::Node<std::string>& node) { -} -void NewContextResponseElement::enterElement(const Arabica::DOM::Node<std::string>& node) { -} -void PrepareResponseElement::enterElement(const Arabica::DOM::Node<std::string>& node) { -} -void StartResponseElement::enterElement(const Arabica::DOM::Node<std::string>& node) { -} -void PauseResponseElement::enterElement(const Arabica::DOM::Node<std::string>& node) { -} -void ResumeResponseElement::enterElement(const Arabica::DOM::Node<std::string>& node) { -} -void CancelResponseElement::enterElement(const Arabica::DOM::Node<std::string>& node) { -} -void ClearContextResponseElement::enterElement(const Arabica::DOM::Node<std::string>& node) { -} -void StatusResponseElement::enterElement(const Arabica::DOM::Node<std::string>& node) { -} -void DoneNotificationElement::enterElement(const Arabica::DOM::Node<std::string>& node) { -} -void NewContextRequestElement::enterElement(const Arabica::DOM::Node<std::string>& node) { -} -void ExtensionNotificationElement::enterElement(const Arabica::DOM::Node<std::string>& node) { -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/element/mmi/MMIEvents.h b/src/uscxml/plugins/element/mmi/MMIEvents.h deleted file mode 100644 index 74c66c0..0000000 --- a/src/uscxml/plugins/element/mmi/MMIEvents.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef MMIEVENTS_H_QHO6VT3M -#define MMIEVENTS_H_QHO6VT3M - -#include <uscxml/Interpreter.h> - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -#define ELEMENT_CREATOR(elementName) \ -boost::shared_ptr<ExecutableContentImpl> create(InterpreterImpl* interpreter) { \ - boost::shared_ptr<elementName> element = boost::shared_ptr<elementName>(new elementName()); \ - element->_interpreter = interpreter; \ - return element; \ -} - -#define ELEMENT_MMI_CLASS(elementName) \ -class elementName##Element : public ExecutableContentImpl { \ -public:\ - elementName##Element () {}\ - virtual ~elementName##Element () {}\ - ELEMENT_CREATOR(elementName##Element);\ - std::string getLocalName() { return "elementName"; }\ - std::string getNamespace() { return "http://www.w3.org/2008/04/mmi-arch"; }\ - bool processChildren() { return false; }\ - void enterElement(const Arabica::DOM::Element<std::string>& node) {}\ - void exitElement(const Arabica::DOM::Element<std::string>& node) {}\ -}; - -namespace uscxml { - -ELEMENT_MMI_CLASS(PrepareRequest); -ELEMENT_MMI_CLASS(StartRequest); -ELEMENT_MMI_CLASS(PauseRequest); -ELEMENT_MMI_CLASS(ResumeRequest); -ELEMENT_MMI_CLASS(CancelRequest); -ELEMENT_MMI_CLASS(ClearContextRequest); -ELEMENT_MMI_CLASS(StatusRequest); -ELEMENT_MMI_CLASS(NewContextResponse); -ELEMENT_MMI_CLASS(PrepareResponse); -ELEMENT_MMI_CLASS(StartResponse); -ELEMENT_MMI_CLASS(PauseResponse); -ELEMENT_MMI_CLASS(ResumeResponse); -ELEMENT_MMI_CLASS(CancelResponse); -ELEMENT_MMI_CLASS(ClearContextResponse); -ELEMENT_MMI_CLASS(StatusResponse); -ELEMENT_MMI_CLASS(DoneNotification); -ELEMENT_MMI_CLASS(NewContextRequest); -ELEMENT_MMI_CLASS(ExtensionNotification); - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(FetchElement, ExecutableContentImpl); -#endif - -} - - -#endif /* end of include guard: MMIEVENTS_H_QHO6VT3M */ diff --git a/src/uscxml/plugins/element/postpone/PostponeElement.cpp b/src/uscxml/plugins/element/postpone/PostponeElement.cpp deleted file mode 100644 index 460cc88..0000000 --- a/src/uscxml/plugins/element/postpone/PostponeElement.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include <boost/algorithm/string.hpp> - -#include "PostponeElement.h" -#include "uscxml/plugins/invoker/http/HTTPServletInvoker.h" -#include "uscxml/dom/DOMUtils.h" -#include <glog/logging.h> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new PostponeElementProvider() ); - return true; -} -#endif - -boost::shared_ptr<ExecutableContentImpl> PostponeElement::create(InterpreterImpl* interpreter) { - boost::shared_ptr<PostponeElement> invoker = boost::shared_ptr<PostponeElement>(new PostponeElement()); - invoker->_interpreter = interpreter; - return invoker; -} - -void PostponeElement::enterElement(const Arabica::DOM::Element<std::string>& node) { - if (!_interpreter->getDataModel()) { - LOG(ERROR) << "Postpone element requires a datamodel"; - return; - } - - // under which condition will we postpone the current event? - if (HAS_ATTR(node, "cond")) { - std::string cond = ATTR(node, "cond"); - try { - if (!_interpreter->getDataModel().evalAsBool(cond)) - return; - } catch (Event e) { - LOG(ERROR) << "Syntax error in cond attribute of postpone element:" << std::endl << e << std::endl; - return; - } - } - - // chaining causes the event to fire if the condition was true since postponing - bool chained = false; - if (HAS_ATTR(node, "chaining")) { - chained = iequals(ATTR(node, "chaining"), "true"); - } - - // when will we refire the event? - std::string until; - try { - if (HAS_ATTR(node, "untilexpr")) { - until = _interpreter->getDataModel().evalAsString(ATTR(node, "untilexpr")); - } else if (HAS_ATTR(node, "until")) { - until = ATTR(node, "until"); - } - } catch (Event e) { - LOG(ERROR) << "Syntax error in postpone element untilexpr:" << std::endl << e << std::endl; - return; - } - - if (until.length() == 0) { - LOG(ERROR) << "Postpone element requires until or untilexpr attribute "; - return; - } - -// LOG(INFO) << until; - -#if 0 - std::string timeoutStr = "0s"; - try { - if (HAS_ATTR(node, "timeoutexpr")) { - timeoutStr = _interpreter->getDataModel().evalAsString(ATTR(node, "timeoutexpr")); - } else if (HAS_ATTR(node, "timeout")) { - timeoutStr = ATTR(node, "timeout"); - } - } catch (Event e) { - LOG(ERROR) << "Syntax error in postpone element timeoutexpr:" << std::endl << e << std::endl; - return; - } - - uint64_t timeout = 0; - NumAttr timeoutAttr(timeoutStr); - if (iequals(timeoutAttr.unit, "s")) { - timeout = strTo<int>(timeoutAttr.value) * 1000; - } else if (iequals(timeoutAttr.unit, "ms")) { - timeout = strTo<int>(timeoutAttr.value); - } - if (timeout > 0) { - timeout += tthread::chrono::system_clock::now(); - } -#endif - Event currEvent = _interpreter->getCurrentEvent(); - Resubmitter::postpone(currEvent, until, 0, chained, _interpreter); -} - -void PostponeElement::exitElement(const Arabica::DOM::Element<std::string>& node) { -} - -void PostponeElement::Resubmitter::postpone(const Event& event, std::string until, uint64_t timeout, bool chained, InterpreterImpl* interpreter) { - Resubmitter* resubmitter = getInstance(interpreter); - resubmitter->_postponedEvents.push_back(Postponed(event, until, timeout, chained)); -} - -void PostponeElement::Resubmitter::onStableConfiguration(Interpreter interpreter) { - std::list<Postponed>::iterator eventIter = _postponedEvents.begin(); - bool dispatched = false; - while(eventIter != _postponedEvents.end()) { - try { -// LOG(INFO) << "Reevaluating: >> " << eventIter->first << " <<"; - if ((!dispatched || eventIter->chaining) && interpreter.getDataModel().evalAsBool(eventIter->until)) { -// LOG(INFO) << " -> is TRUE"; - eventIter->event.name += ".postponed"; - interpreter.receive(eventIter->event, true); - _postponedEvents.erase(eventIter++); - dispatched = true; - } -// LOG(INFO) << " -> is FALSE"; - } catch (Event e) { - LOG(ERROR) << "Syntax error while evaluating until attribute of postpone element:" << std::endl << e << std::endl; - _postponedEvents.erase(eventIter++); - continue; - } - eventIter++; - } -// LOG(ERROR) << _postponedEvents.size() << " Postponess remaining"; - -} - -void PostponeElement::Resubmitter::afterCompletion(Interpreter interpreter) { - tthread::lock_guard<tthread::recursive_mutex> lock(PostponeElement::Resubmitter::_accessLock); - _instances.erase(interpreter); - delete this; // committing suicide is ok if we are careful -} - -std::map<Interpreter, PostponeElement::Resubmitter*> PostponeElement::Resubmitter::_instances; -tthread::recursive_mutex PostponeElement::Resubmitter::_accessLock; - -PostponeElement::Resubmitter* PostponeElement::Resubmitter::getInstance(InterpreterImpl* interpreter) { - tthread::lock_guard<tthread::recursive_mutex> lock(PostponeElement::Resubmitter::_accessLock); - if (_instances.find(interpreter->shared_from_this()) == _instances.end()) { - _instances[interpreter->shared_from_this()] = new Resubmitter(interpreter); - } - return _instances[interpreter->shared_from_this()]; -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/element/postpone/PostponeElement.h b/src/uscxml/plugins/element/postpone/PostponeElement.h deleted file mode 100644 index 9840c75..0000000 --- a/src/uscxml/plugins/element/postpone/PostponeElement.h +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef POSTPONEELEMENT_H_WN8EIYYI -#define POSTPONEELEMENT_H_WN8EIYYI - -#include <uscxml/Interpreter.h> -#include <list> - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class PostponeElement : public ExecutableContentImpl { -public: - struct Postponed { - Postponed(const Event& event, const std::string& until, long timeout, bool chaining = false) : - event(event), until(until), timeout(timeout), chaining(chaining) {} - Event event; - std::string until; - uint64_t timeout; - bool chaining; - }; - - PostponeElement() {} - virtual ~PostponeElement() {} - boost::shared_ptr<ExecutableContentImpl> create(InterpreterImpl* interpreter); - - std::string getLocalName() { - return "postpone"; - } - - std::string getNamespace() { - return "http://www.w3.org/2005/07/scxml"; - } - - bool processChildren() { - return false; - } - - void enterElement(const Arabica::DOM::Element<std::string>& node); - void exitElement(const Arabica::DOM::Element<std::string>& node); - -protected: - // once per interpreter - class Resubmitter : public InterpreterMonitor { - public: - Resubmitter(InterpreterImpl* interpreter) { - interpreter->addMonitor(this); - } - - static Resubmitter* getInstance(InterpreterImpl* interpreter); - static void postpone(const Event& event, std::string until, uint64_t timeout, bool chained, InterpreterImpl* interpreter); - - // InterpreterMonitor - void onStableConfiguration(Interpreter interpreter); - void afterCompletion(Interpreter interpreter); - - std::list<Postponed> _postponedEvents; - static std::map<Interpreter, Resubmitter*> _instances; - static tthread::recursive_mutex _accessLock; - - }; -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(PostponeElement, ExecutableContentImpl); -#endif - -} - -#endif /* end of include guard: POSTPONEELEMENT_H_WN8EIYYI */ diff --git a/src/uscxml/plugins/element/respond/RespondElement.cpp b/src/uscxml/plugins/element/respond/RespondElement.cpp deleted file mode 100644 index 032f74e..0000000 --- a/src/uscxml/plugins/element/respond/RespondElement.cpp +++ /dev/null @@ -1,202 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "RespondElement.h" -#include "uscxml/plugins/invoker/http/HTTPServletInvoker.h" -#include "uscxml/server/InterpreterServlet.h" -#include "uscxml/dom/DOMUtils.h" -#include <glog/logging.h> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new RespondElementProvider() ); - return true; -} -#endif - -boost::shared_ptr<ExecutableContentImpl> RespondElement::create(InterpreterImpl* interpreter) { - boost::shared_ptr<RespondElement> invoker = boost::shared_ptr<RespondElement>(new RespondElement()); - invoker->_interpreter = interpreter; - return invoker; -} - -void RespondElement::enterElement(const Arabica::DOM::Element<std::string>& node) { - // try to get the request id - if (!HAS_ATTR(node, "to")) { - LOG(ERROR) << "Respond element requires to attribute"; - return; - } - if (HAS_ATTR(node, "to") && !_interpreter->getDataModel()) { - LOG(ERROR) << "Respond element with to requires datamodel"; - return; - } - std::string requestId = _interpreter->getDataModel().evalAsString(ATTR(node, "to")); - - // try to get the request object - InterpreterHTTPServlet* servlet = _interpreter->getHTTPServlet(); - tthread::lock_guard<tthread::recursive_mutex> lock(servlet->getMutex()); - - if (servlet->getRequests().find(requestId) == servlet->getRequests().end()) { - LOG(ERROR) << "No matching HTTP request for respond element"; - return; - } - - assert(servlet->getRequests().find(requestId) != servlet->getRequests().end()); - HTTPServer::Request httpReq = servlet->getRequests()[requestId]; - assert(httpReq.evhttpReq != NULL); - HTTPServer::Reply httpReply(httpReq); - servlet->getRequests().erase(requestId); - - // get the status or default to 200 - std::string statusStr = (HAS_ATTR(node, "status") ? ATTR(node, "status") : "200"); - if (!isNumeric(statusStr.c_str(), 10)) { - LOG(ERROR) << "Respond element with non-numeric status " << statusStr; - return; - } - httpReply.status = strTo<int>(statusStr);; - - // extract the content - Arabica::XPath::NodeSet<std::string> contents = DOMUtils::filterChildElements(_interpreter->getNameSpaceInfo().getXMLPrefixForNS(getNamespace()) + "content", node); - if (contents.size() > 0) { - Arabica::DOM::Element<std::string> contentElem = Arabica::DOM::Element<std::string>(contents[0]); - if (HAS_ATTR(contentElem, "expr")) { // -- content is evaluated string from datamodel ------ - if (_interpreter->getDataModel()) { - try { - Data contentData = _interpreter->getDataModel().getStringAsData(ATTR(contentElem, "expr")); - if (contentData.atom.length() > 0) { - httpReply.content = contentData.atom; - httpReply.headers["Content-Type"] = "text/plain"; - } else if (contentData.binary) { - httpReply.content = std::string(contentData.binary.getData(), contentData.binary.getSize()); - httpReply.headers["Content-Type"] = contentData.binary.getMimeType(); - } else if (contentData.node) { - std::stringstream ss; - ss << contentData.node; - httpReply.content = ss.str();; - httpReply.headers["Content-Type"] = "application/xml"; - } else { - httpReply.content = Data::toJSON(contentData); - httpReply.headers["Content-Type"] = "application/json"; - } - } catch (Event e) { - LOG(ERROR) << "Syntax error with expr in content child of Respond element:" << std::endl << e << std::endl; - return; - } - } else { - LOG(ERROR) << "content element has expr attribute but no datamodel is specified."; - return; - } - } else if (HAS_ATTR(contentElem, "file") || HAS_ATTR(contentElem, "fileexpr")) { // -- content is from file ------ - URL file; - if (HAS_ATTR(contentElem, "fileexpr")) { - if (_interpreter->getDataModel()) { - try { - file = "file://" + _interpreter->getDataModel().evalAsString(ATTR(contentElem, "fileexpr")); - } catch (Event e) { - LOG(ERROR) << "Syntax error with fileexpr in content child of Respond element:" << std::endl << e << std::endl; - return; - } - } - } else { - file = "file://" + ATTR(contentElem, "fileexpr"); - } - if (file) { - httpReply.content = file.getInContent(); - size_t lastDot; - if ((lastDot = file.path().find_last_of(".")) != std::string::npos) { - std::string extension = file.path().substr(lastDot + 1); - std::string mimeType = URL::getMimeType(extension); - if (mimeType.length() > 0) { - httpReply.headers["Content-Type"] = mimeType; - } - } - } - } else if (contents[0].hasChildNodes()) { // -- content embedded as child nodes ------ - httpReply.content = contents[0].getFirstChild().getNodeValue(); - } else { - LOG(ERROR) << "content element does not specify any content."; - return; - } - } - - // process headers - Arabica::XPath::NodeSet<std::string> headers = DOMUtils::filterChildElements(_interpreter->getNameSpaceInfo().getXMLPrefixForNS(getNamespace()) + "header", node); - for (size_t i = 0; i < headers.size(); i++) { - Arabica::DOM::Element<std::string> headerElem = Arabica::DOM::Element<std::string>(headers[i]); - - std::string name; - if (HAS_ATTR(headerElem, "name")) { - name = ATTR(headerElem, "name"); - } else if(HAS_ATTR(headerElem, "nameexpr")) { - if (_interpreter->getDataModel()) { - try { - name = _interpreter->getDataModel().evalAsString(ATTR(headerElem, "nameexpr")); - } catch (Event e) { - LOG(ERROR) << "Syntax error with nameexpr in header child of Respond element:" << std::endl << e << std::endl; - return; - } - } else { - LOG(ERROR) << "header element has nameexpr attribute but no datamodel is specified."; - return; - } - } else { - LOG(ERROR) << "header element has no name or nameexpr attribute."; - return; - } - - std::string value; - if (HAS_ATTR(headerElem, "value")) { - value = ATTR(headerElem, "value"); - } else if(HAS_ATTR(headerElem, "valueexpr")) { - if (_interpreter->getDataModel()) { - try { - value = _interpreter->getDataModel().evalAsString(ATTR(headerElem, "valueexpr")); - } catch (Event e) { - LOG(ERROR) << "Syntax error with valueexpr in header child of Respond element:" << std::endl << e << std::endl; - return; - } - } else { - LOG(ERROR) << "header element has valueexpr attribute but no datamodel is specified."; - return; - } - } else { - LOG(ERROR) << "header element has no value or valueexpr attribute."; - return; - } - - httpReply.headers[name] = value; - } - - // send the reply - HTTPServer::reply(httpReply); - servlet->getRequests().erase(requestId); -} - -void RespondElement::exitElement(const Arabica::DOM::Element<std::string>& node) { - -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/element/respond/RespondElement.h b/src/uscxml/plugins/element/respond/RespondElement.h deleted file mode 100644 index 2e8cec7..0000000 --- a/src/uscxml/plugins/element/respond/RespondElement.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef RESPONDELEMENT_H_I11KQ39Q -#define RESPONDELEMENT_H_I11KQ39Q - -#include <uscxml/Interpreter.h> - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class RespondElement : public ExecutableContentImpl { -public: - RespondElement() {} - virtual ~RespondElement() {} - boost::shared_ptr<ExecutableContentImpl> create(InterpreterImpl* interpreter); - - std::string getLocalName() { - return "respond"; - } - - std::string getNamespace() { - return "http://www.w3.org/2005/07/scxml"; - } - - bool processChildren() { - return false; - } - - void enterElement(const Arabica::DOM::Element<std::string>& node); - void exitElement(const Arabica::DOM::Element<std::string>& node); - -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(RespondElement, ExecutableContentImpl); -#endif - -} - - -#endif /* end of include guard: RESPONDELEMENT_H_I11KQ39Q */ diff --git a/src/uscxml/plugins/invoker/CMakeLists.txt b/src/uscxml/plugins/invoker/CMakeLists.txt index 03f22a6..ec64899 100644 --- a/src/uscxml/plugins/invoker/CMakeLists.txt +++ b/src/uscxml/plugins/invoker/CMakeLists.txt @@ -4,572 +4,7 @@ set(USCXML_INVOKERS "scxml ${USCXML_INVOKERS}") file(GLOB_RECURSE USCXML_INVOKER scxml/*.cpp scxml/*.h) -if (BUILD_AS_PLUGINS) - source_group("" FILES ${USCXML_INVOKER}) - add_library( - invoker_uscxml SHARED - ${USCXML_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_uscxml uscxml) - set_target_properties(invoker_uscxml PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_uscxml PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_uscxml PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") -else() list (APPEND USCXML_FILES ${USCXML_INVOKER}) -endif() - -if (NOT BUILD_MINIMAL) - # sample invoker - include to make sure it compiles - set(USCXML_INVOKERS "sample ${USCXML_INVOKERS}") - file(GLOB_RECURSE SAMPLE_INVOKER - sample/*.cpp - sample/*.h - ) - - if (BUILD_AS_PLUGINS) - source_group("" FILES ${SAMPLE_INVOKER}) - add_library( - invoker_sample SHARED - ${SAMPLE_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_sample uscxml) - set_target_properties(invoker_sample PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_sample PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_sample PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${SAMPLE_INVOKER}) - endif() - - # DirMon invoker to watch for filesystem changes - - set(USCXML_INVOKERS "dirmon ${USCXML_INVOKERS}") - file(GLOB_RECURSE DIRMON_INVOKER - filesystem/dirmon/*.cpp - filesystem/dirmon/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${DIRMON_INVOKER}) - add_library( - invoker_dirmon SHARED - ${DIRMON_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_dirmon uscxml) - set_target_properties(invoker_dirmon PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_dirmon PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_dirmon PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${DIRMON_INVOKER}) - endif() - - - # Location invoker to watch for proximity to GPS coordinates - - # file(GLOB_RECURSE LOCATION_INVOKER - # location/*.cpp - # location/*.h - # ) - # if (BUILD_AS_PLUGINS) - # source_group("" FILES ${LOCATION_INVOKER}) - # add_library( - # invoker_location SHARED - # ${LOCATION_INVOKER} - # "../Plugins.cpp") - # target_link_libraries(invoker_location uscxml) - # set_target_properties(invoker_location PROPERTIES FOLDER "Plugin Invoker") - # else() - # list (APPEND USCXML_FILES ${LOCATION_INVOKER}) - # endif() - - - # XHTML invoker - - set(USCXML_INVOKERS "xhtml ${USCXML_INVOKERS}") - file(GLOB_RECURSE XHTML_INVOKER - xhtml/*.cpp - xhtml/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${XHTML_INVOKER}) - add_library( - invoker_xhtml SHARED - ${XHTML_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_xhtml uscxml) - set_target_properties(invoker_xhtml PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_xhtml PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_xhtml PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${XHTML_INVOKER}) - endif() - - - # System invoker to open a native command - - file(GLOB_RECURSE SYSTEM_INVOKER - system/*.cpp - system/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${SYSTEM_INVOKER}) - add_library( - invoker_system SHARED - ${SYSTEM_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_system uscxml) - set_target_properties(invoker_system PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_system PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_system PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${SYSTEM_INVOKER}) - endif() - - - # expect invoker - - if (EXPECT_FOUND AND TCL_FOUND) - set(USCXML_INVOKERS "expect ${USCXML_INVOKERS}") - file(GLOB_RECURSE EXPECT_INVOKER - expect/*.cpp - expect/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES EXPECT_INVOKER) - add_library( - invoker_expect SHARED - ${EXPECT_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_expect uscxml ${EXPECT_LIBRARY} ${TCL_LIBRARY}) - set_target_properties(invoker_expect PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_expect PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_expect PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${EXPECT_INVOKER}) - endif() - endif() - - - # SMTP invoker via curl - - if (CURL_HAS_SMTP) - set(USCXML_INVOKERS "smtp ${USCXML_INVOKERS}") - file(GLOB_RECURSE SMTP_INVOKER - smtp/*.cpp - smtp/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES SMTP_INVOKER) - add_library( - invoker_smtp SHARED - ${SMTP_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_smtp uscxml) - set_target_properties(invoker_smtp PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_smtp PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_smtp PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${SMTP_INVOKER}) - endif() - endif() - - - # IMAP invoker via curl - - set(USCXML_INVOKERS "imap ${USCXML_INVOKERS}") - file(GLOB_RECURSE IMAP_INVOKER - imap/*.cpp - imap/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES IMAP_INVOKER) - add_library( - invoker_imap SHARED - ${IMAP_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_imap uscxml) - set_target_properties(invoker_imap PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_imap PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_imap PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${IMAP_INVOKER}) - endif() - - - # SQLite3 SQL Invoker - - if (SQLITE3_FOUND) - file(GLOB_RECURSE SQLITE3_INVOKER - sqlite3/*.cpp - sqlite3/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${SQLITE3_INVOKER}) - add_library( - invoker_sqlite3 SHARED - ${SQLITE3_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_sqlite3 uscxml) - set_target_properties(invoker_sqlite3 PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_sqlite3 PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_sqlite3 PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${SQLITE3_INVOKER}) - endif() - endif() - - - # ffmpeg invoker - - if (FFMPEG_FOUND) - set(USCXML_INVOKERS "ffmpeg ${USCXML_INVOKERS}") - file(GLOB_RECURSE FFMPEG_INVOKER - ffmpeg/*.cpp - ffmpeg/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${FFMPEG_INVOKER}) - add_library( - invoker_ffmpeg SHARED - ${FFMPEG_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_ffmpeg uscxml ${FFMPEG_LIBRARIES}) - set_target_properties(invoker_ffmpeg PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_ffmpeg PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_ffmpeg PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${FFMPEG_INVOKER}) - endif() - endif() - - - # instant messaging invoker - - if (LIBPURPLE_FOUND) - set(USCXML_INVOKERS "im ${USCXML_INVOKERS}") - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/im/IMConfig.h.in ${CMAKE_BINARY_DIR}/uscxml/IMConfig.h) - - file(GLOB_RECURSE LIBPURPLE_INVOKER - im/*.cpp - im/*.h - ) - - if (BUILD_AS_PLUGINS) - source_group("" FILES ${LIBPURPLE_INVOKER}) - add_library( - invoker_im SHARED - ${LIBPURPLE_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_im uscxml ${LIBPURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${ICONV_LIBRARIES}) - set_target_properties(invoker_im PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_im PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_im PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${LIBPURPLE_INVOKER}) - endif() - endif() - - - # calendar invoker - - if (LIBICAL_FOUND) - set(USCXML_INVOKERS "calendar ${USCXML_INVOKERS}") - file(GLOB_RECURSE CALENDAR_INVOKER - calendar/*.cpp - calendar/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${CALENDAR_INVOKER}) - add_library( - invoker_calendar SHARED - ${CALENDAR_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_calendar uscxml ${LIBICAL_LIBRARIES}) - set_target_properties(invoker_calendar PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_calendar PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_calendar PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${CALENDAR_INVOKER}) - endif() - endif() - - - # webrtc invoker - - if (LIBJINGLE_FOUND) - set(USCXML_INVOKERS "webrtc ${USCXML_INVOKERS}") - file(GLOB_RECURSE WEBRTC_INVOKER - webrtc/*.cpp - webrtc/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${WEBRTC_INVOKER}) - add_library( - invoker_webrtc SHARED - ${WEBRTC_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_webrtc uscxml ${LIBJINGLE_LIBRARIES}) - set_target_properties(invoker_webrtc PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_webrtc PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_webrtc PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${WEBRTC_INVOKER}) - endif() - endif() - - - # location invoker - - if (CORELOCATION_LIBRARY AND OFF) - set(USCXML_INVOKERS "location ${USCXML_INVOKERS}") - file(GLOB_RECURSE LOCATION_INVOKER - location/CoreLocation/*.cpp - location/CoreLocation/*.mm - location/CoreLocation/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${LOCATION_INVOKER}) - add_library( - invoker_location SHARED - ${LOCATION_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_location uscxml) - set_target_properties(invoker_location PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_location PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_location PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${LOCATION_INVOKER}) - endif() - endif() - - - # UMUNDO invoker - - if (UMUNDO_FOUND AND PROTOBUF_FOUND) - set(USCXML_INVOKERS "umundo ${USCXML_INVOKERS}") - set(UMUNDO_INVOKER - ${CMAKE_CURRENT_SOURCE_DIR}/umundo/UmundoInvoker.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/umundo/UmundoInvoker.h - ) - if (PROTOBUF_FOUND) - list(APPEND UMUNDO_INVOKER - ${CMAKE_CURRENT_SOURCE_DIR}/umundo/JSON.pb.cc - ${CMAKE_CURRENT_SOURCE_DIR}/umundo/JSON.pb.h - ) - endif() - if (BUILD_AS_PLUGINS) - source_group("" FILES ${UMUNDO_INVOKER}) - # message(FATAL_ERROR "UMUNDO_LIBRARIES: ${UMUNDO_LIBRARIES}") - add_library( - invoker_umundo SHARED - ${UMUNDO_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_umundo uscxml - ${UMUNDO_LIBRARIES}) - if (PROTOBUF_FOUND) - target_link_libraries(invoker_umundo - optimized ${PROTOBUF_LIBRARY} - debug ${PROTOBUF_LIBRARY_DEBUG}) - endif() - set_target_properties(invoker_umundo PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_umundo PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_umundo PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${UMUNDO_INVOKER}) - endif() - endif() - - - # HTTP server invoker - - set(USCXML_INVOKERS "httpservlet ${USCXML_INVOKERS}") - file(GLOB_RECURSE HTTPSERVLET_INVOKER - http/*.cpp - http/*.h) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${HTTPSERVLET_INVOKER}) - add_library( - invoker_httpserver SHARED - ${HTTPSERVLET_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_httpserver - uscxml) - set_target_properties(invoker_httpserver PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_httpserver PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_httpserver PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${HTTPSERVLET_INVOKER}) - endif() - - - # Heartbeat invoker - - set(USCXML_INVOKERS "heartbeat ${USCXML_INVOKERS}") - file(GLOB_RECURSE HEARTBEAT_INVOKER - heartbeat/*.cpp - heartbeat/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${HEARTBEAT_INVOKER}) - add_library( - invoker_heartbeat SHARED - ${HEARTBEAT_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_heartbeat uscxml) - set_target_properties(invoker_heartbeat PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_heartbeat PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_heartbeat PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${HEARTBEAT_INVOKER}) - endif() - - - # OpenSceneGraph invoker - if (OPENSCENEGRAPH_FOUND AND OPENGL_FOUND) - set(USCXML_INVOKERS "scenegraph ${USCXML_INVOKERS}") - file(GLOB OPENSCENEGRAPH_INVOKER - graphics/openscenegraph/*.cpp - graphics/openscenegraph/*.h) - - if (BUILD_AS_PLUGINS) - source_group("" FILES ${OPENSCENEGRAPH_INVOKER}) - add_library( - invoker_openscenegraph SHARED - ${OPENSCENEGRAPH_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_openscenegraph - ${OPENSCENEGRAPH_LIBRARIES} - ${OPENGL_LIBRARIES} - uscxml) - set_target_properties(invoker_openscenegraph PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_openscenegraph PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_openscenegraph PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${OPENSCENEGRAPH_INVOKER}) - endif() - - set(USCXML_INVOKERS "osgvonvert ${USCXML_INVOKERS}") - file(GLOB OPENSCENEGRAPH_CONVERTER_INVOKER - graphics/openscenegraph/converter/*.cpp - graphics/openscenegraph/converter/*.h) - - if (BUILD_AS_PLUGINS) - source_group("" FILES ${OPENSCENEGRAPH_CONVERTER_INVOKER}) - add_library( - invoker_openscenegraph_convert SHARED - ${OPENSCENEGRAPH_CONVERTER_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_openscenegraph_convert - ${OPENSCENEGRAPH_LIBRARIES} - ${OPENGL_LIBRARIES} - uscxml) - set_target_properties(invoker_openscenegraph_convert PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_openscenegraph_convert PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_openscenegraph_convert PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${OPENSCENEGRAPH_CONVERTER_INVOKER}) - endif() - endif() - - - # OpenAL modality components - - if (OPENAL_FOUND AND (LIBSNDFILE_FOUND OR AUDIOTOOLBOX_FOUND)) - set(USCXML_INVOKERS "openal ${USCXML_INVOKERS}") - file(GLOB_RECURSE OPENAL_INVOKER - audio/OpenAL*.cpp - audio/OpenAL*.h) - if (LIBSNDFILE_FOUND) - file(GLOB_RECURSE LIBSNDFILE_WRAPPER - audio/LibSoundFile*.cpp - audio/LibSoundFile*.h) - LIST(APPEND OPENAL_INVOKER ${LIBSNDFILE_WRAPPER}) - elseif(AUDIOTOOLBOX_FOUND) - file(GLOB_RECURSE AUDIOTOOLBOX_WRAPPER - audio/AudioToolbox*.mm - audio/AudioToolbox*.h) - LIST(APPEND OPENAL_INVOKER ${AUDIOTOOLBOX_WRAPPER}) - endif() - # message("MILES_INVOKER ${MILES_INVOKER}") - - if (BUILD_AS_PLUGINS) - source_group("" FILES ${OPENAL_INVOKER}) - add_library( - invoker_openal SHARED - ${OPENAL_INVOKER} - "../Plugins.cpp") - if (LIBSNDFILE_FOUND) - target_link_libraries(invoker_openal - ${OPENAL_LIBRARY} - ${LIBSNDFILE_LIBRARY} - uscxml) - elseif(AUDIOTOOLBOX_FOUND) - target_link_libraries(invoker_openal - ${OPENAL_LIBRARY} - ${AUDIOTOOLBOX}/AudioToolbox - uscxml) - endif() - set_target_properties(invoker_openal PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_openal PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_openal PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${OPENAL_INVOKER}) - endif() - endif() - - - # MILES modality components - - if (MILES_FOUND) - set(USCXML_INVOKERS "miles ${USCXML_INVOKERS}") - file(GLOB_RECURSE MILES_INVOKER - miles/*.cpp - miles/*.h) - # message("MILES_INVOKER ${MILES_INVOKER}") - - if (BUILD_AS_PLUGINS) - source_group("" FILES ${MILES_INVOKER}) - add_library( - invoker_miles SHARED - ${MILES_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_miles - ${MILES_LIBRARIES} - ${JPEG_LIBRARIES} - uscxml) - if (ICONV_FOUND) - target_link_libraries(invoker_miles ${ICONV_LIBRARIES}) - endif() - if (OPENAL_FOUND) - target_link_libraries(invoker_miles ${OPENAL_LIBRARY}) - endif() - set_target_properties(invoker_miles PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_miles PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_miles PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${MILES_INVOKER}) - endif() - endif() - - - set(USCXML_INVOKERS "vxml ${USCXML_INVOKERS}") - file(GLOB_RECURSE VXML_INVOKER - vxml/*.cpp - vxml/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${VXML_INVOKER}) - add_library( - invoker_voicexml SHARED - ${VXML_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_voicexml uscxml) - set_target_properties(invoker_voicexml PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_voicexml PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_voicexml PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${VXML_INVOKER}) - endif() - -endif() # BUILD_MINIMAL set(USCXML_INCLUDE_DIRS ${USCXML_INCLUDE_DIRS} PARENT_SCOPE) set(USCXML_FILES ${USCXML_FILES} PARENT_SCOPE) diff --git a/src/uscxml/plugins/invoker/audio/AudioToolbox.h b/src/uscxml/plugins/invoker/audio/AudioToolbox.h deleted file mode 100644 index 5834f34..0000000 --- a/src/uscxml/plugins/invoker/audio/AudioToolbox.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef AUDIOTOOLBOX_H_GX4SW17C -#define AUDIOTOOLBOX_H_GX4SW17C - -#include "PCMConverter.h" -#include <AudioToolbox/AudioToolbox.h> - -namespace uscxml { - -class AudioToolbox : public PCMConverter { -public: - AudioToolbox(const std::string filename); - virtual ~AudioToolbox(); - virtual void seek(unsigned int pos); - virtual int read(char* buffer, unsigned int size); - - virtual void setOutFormat(const PCMFormat& format); - virtual PCMFormat getInFormat(); - -protected: - ExtAudioFileRef _afId; - AudioStreamBasicDescription _outputFormat; - AudioStreamBasicDescription _inputFormat; - - ALenum formatToALEnum(AudioStreamBasicDescription); - bool alEnumToFormat(AudioStreamBasicDescription&, ALenum); -}; - -} - -#endif /* end of include guard: AUDIOTOOLBOX_H_GX4SW17C */ - - diff --git a/src/uscxml/plugins/invoker/audio/AudioToolbox.mm b/src/uscxml/plugins/invoker/audio/AudioToolbox.mm deleted file mode 100644 index ef99063..0000000 --- a/src/uscxml/plugins/invoker/audio/AudioToolbox.mm +++ /dev/null @@ -1,185 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "AudioToolbox.h" -#include <glog/logging.h> - -#import <Foundation/Foundation.h> -#import <Foundation/NSURL.h> - -#ifdef __has_feature -# if __has_feature(objc_arc) -# define(HAS_AUTORELEASE_POOL) -# endif -#endif - -namespace uscxml { - -AudioToolbox::AudioToolbox(const std::string filename) { -#if HAS_AUTORELEASE_POOL - @autoreleasepool { -#else - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; -#endif - _afId = 0; - NSString* filePath = [NSString stringWithCString:filename.c_str() encoding:NSASCIIStringEncoding]; - NSURL* afUrl = [NSURL fileURLWithPath:filePath]; - - OSStatus result = noErr; - - result = ExtAudioFileOpenURL((CFURLRef)afUrl, &_afId); - - if (result != noErr) { - LOG(WARNING) << "Cannot open audio file " << filename; - return; - } - UInt32 thePropertySize = sizeof(_inputFormat); - result = ExtAudioFileGetProperty(_afId, kExtAudioFileProperty_FileDataFormat, &thePropertySize, &_inputFormat); - if (result != noErr) { - LOG(WARNING) << "Cannot determine input format of " << filename; - return; - } - - // output format is input format - memcpy(&_outputFormat, &_inputFormat, sizeof(_inputFormat)); - - // except for things that make no sense for open al - _outputFormat.mFormatID = kAudioFormatLinearPCM; - _outputFormat.mFormatFlags = kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsPacked | kAudioFormatFlagIsSignedInteger; - - ALenum bestFormat = formatToALEnum(_outputFormat); - alEnumToFormat(_outputFormat, bestFormat); - - result = ExtAudioFileSetProperty(_afId, kExtAudioFileProperty_ClientDataFormat, sizeof(_outputFormat), &_outputFormat); - - if (result != noErr) { - LOG(WARNING) << "Cannot set audio format file " << filename; - return; - } - -#if HAS_AUTORELEASE_POOL - } -#else - [pool drain]; -#endif -} - -AudioToolbox::~AudioToolbox() { - if (_afId) - ExtAudioFileDispose(_afId); //close the file -} - -void AudioToolbox::seek(unsigned int pos) { - ExtAudioFileSeek(_afId, pos); -} - -int AudioToolbox::read(char* buffer, unsigned int size) { - UInt32 read = size / _outputFormat.mBytesPerFrame; - OSStatus result = noErr; - - SInt64 theFileLengthInFrames = 0; - UInt32 thePropertySize = sizeof(theFileLengthInFrames); - result = ExtAudioFileGetProperty(_afId, kExtAudioFileProperty_FileLengthFrames, &thePropertySize, &theFileLengthInFrames); - - read = (theFileLengthInFrames < read ? theFileLengthInFrames : read); - - AudioBufferList dataBuffer; - dataBuffer.mNumberBuffers = 1; - dataBuffer.mBuffers[0].mDataByteSize = size; - dataBuffer.mBuffers[0].mNumberChannels = _outputFormat.mChannelsPerFrame; - dataBuffer.mBuffers[0].mData = buffer; - - result = ExtAudioFileRead(_afId, &read, &dataBuffer); - if (result != noErr) { - LOG(WARNING) << "Cannot read data"; - return 0; - } - - return read * _outputFormat.mBytesPerFrame; -} - -ALenum AudioToolbox::formatToALEnum(AudioStreamBasicDescription asbd) { - if (asbd.mBitsPerChannel < 16) { - if (asbd.mChannelsPerFrame == 1) { - return AL_FORMAT_MONO8; - } else { - return AL_FORMAT_STEREO8; - } - } else { - if (asbd.mChannelsPerFrame == 1) { - return AL_FORMAT_MONO16; - } else { - return AL_FORMAT_STEREO16; - } - } -} - -bool AudioToolbox::alEnumToFormat(AudioStreamBasicDescription& asbd, ALenum format) { - switch (format) { - case AL_FORMAT_MONO8: - asbd.mBitsPerChannel = 8; - asbd.mBytesPerFrame = 1; - asbd.mBytesPerPacket = 1; - asbd.mChannelsPerFrame = 1; - break; - case AL_FORMAT_MONO16: - asbd.mBitsPerChannel = 16; - asbd.mBytesPerFrame = 2; - asbd.mBytesPerPacket = 2; - asbd.mChannelsPerFrame = 1; - break; - case AL_FORMAT_STEREO8: - asbd.mBitsPerChannel = 8; - asbd.mBytesPerFrame = 2; - asbd.mBytesPerPacket = 2; - asbd.mChannelsPerFrame = 2; - break; - case AL_FORMAT_STEREO16: - asbd.mBitsPerChannel = 16; - asbd.mBytesPerFrame = 4; - asbd.mBytesPerPacket = 4; - asbd.mChannelsPerFrame = 2; - break; - default: - break; - } - return true; -} - -void AudioToolbox::setOutFormat(const PCMFormat& format) { - - alEnumToFormat(_outputFormat, format.alFormat); - _outputFormat.mSampleRate = format.sampleRate; - - OSStatus result = ExtAudioFileSetProperty(_afId, kExtAudioFileProperty_ClientDataFormat, sizeof(_outputFormat), &_outputFormat); - if (result != noErr) { - LOG(WARNING) << "Cannot set audio format"; - return; - } - -} - -PCMFormat AudioToolbox::getInFormat() { - PCMFormat format; - format.sampleRate = _inputFormat.mSampleRate; - format.alFormat = formatToALEnum(_inputFormat); - return format; -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/audio/LibSoundFile.cpp b/src/uscxml/plugins/invoker/audio/LibSoundFile.cpp deleted file mode 100644 index b881e41..0000000 --- a/src/uscxml/plugins/invoker/audio/LibSoundFile.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "LibSoundFile.h" - -namespace uscxml { - -LibSoundFile::LibSoundFile(const std::string filename) : PCMConverter() { - _filename = filename; - _handle = SndfileHandle(_filename, SFM_READ, SF_FORMAT_PCM_16, 1, 44100); - _format.sampleRate = _handle.samplerate(); - _format.alFormat = AL_FORMAT_MONO16; - -} - -LibSoundFile::~LibSoundFile() { - -} - -void LibSoundFile::seek(unsigned int pos) { - _handle.seek(pos, 0); -} - -int LibSoundFile::read(char* buffer, unsigned int size) { - return _handle.readRaw(buffer, size); -} - -void LibSoundFile::setOutFormat(const PCMFormat& format) { - _format = format; - switch (_format.alFormat) { - case AL_FORMAT_MONO8: - _handle = SndfileHandle(_filename, SFM_READ, SF_FORMAT_PCM_S8, 1, _format.sampleRate); - break; - case AL_FORMAT_MONO16: - _handle = SndfileHandle(_filename, SFM_READ, SF_FORMAT_PCM_16, 1, _format.sampleRate); - break; - case AL_FORMAT_STEREO8: - _handle = SndfileHandle(_filename, SFM_READ, SF_FORMAT_PCM_S8, 2, _format.sampleRate); - break; - case AL_FORMAT_STEREO16: - _handle = SndfileHandle(_filename, SFM_READ, SF_FORMAT_PCM_16, 2, _format.sampleRate); - break; - - default: - break; - } -} - -PCMFormat LibSoundFile::getInFormat() { - return _format; -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/audio/LibSoundFile.h b/src/uscxml/plugins/invoker/audio/LibSoundFile.h deleted file mode 100644 index 0e0b304..0000000 --- a/src/uscxml/plugins/invoker/audio/LibSoundFile.h +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef LIBSOUNDFILE_H_Q97OEKGG -#define LIBSOUNDFILE_H_Q97OEKGG - -#include "PCMConverter.h" -#include <sndfile.hh> - -namespace uscxml { - -class LibSoundFile : public PCMConverter { -public: - LibSoundFile(const std::string filename); - virtual ~LibSoundFile(); - void seek(unsigned int pos); - int read(char* buffer, unsigned int size); - - virtual void setOutFormat(const PCMFormat& format); - virtual PCMFormat getInFormat(); - -protected: - std::string _filename; - SndfileHandle _handle; - PCMFormat _format; -}; - -} - -#endif /* end of include guard: LIBSOUNDFILE_H_Q97OEKGG */ diff --git a/src/uscxml/plugins/invoker/audio/OpenALInvoker.cpp b/src/uscxml/plugins/invoker/audio/OpenALInvoker.cpp deleted file mode 100644 index e813f2f..0000000 --- a/src/uscxml/plugins/invoker/audio/OpenALInvoker.cpp +++ /dev/null @@ -1,421 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -// see http://stackoverflow.com/questions/6563810/m-pi-works-with-math-h-but-not-with-cmath-in-visual-studio -#define _USE_MATH_DEFINES -#include <cmath> - -#include <boost/algorithm/string.hpp> - -#include "OpenALInvoker.h" -#include <uscxml/config.h> -#include <glog/logging.h> -#include <limits.h> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new OpenALInvokerProvider() ); - return true; -} -#endif - -// see http://stackoverflow.com/questions/1904635/warning-c4003-and-errors-c2589-and-c2059-on-x-stdnumeric-limitsintmax -#undef max - -OpenALInvoker::OpenALInvoker() { - _isStarted = false; - _alContext = NULL; - _alDevice = NULL; - _thread = NULL; - _listenerPos[0] = _listenerPos[1] = _listenerPos[2] = 0; - _listenerVel[0] = _listenerVel[1] = _listenerVel[2] = 0; - _maxPos[0] = _maxPos[1] = _maxPos[2] = 1; - - _listenerOrient[0] = _listenerOrient[1] = _listenerOrient[3] = _listenerOrient[5] = 0; - _listenerOrient[2] = _listenerOrient[4] = 1.0; -} - -OpenALInvoker::~OpenALInvoker() { - if (_thread) { - _isStarted = false; - _sourcesAvailable.notify_all(); - _thread->join(); - delete(_thread); - } - if (_alContext) { -// alcCloseDevice(alcGetContextsDevice(_alContext)); -// alcDestroyContext(_alContext); - } -}; - -boost::shared_ptr<InvokerImpl> OpenALInvoker::create(InterpreterImpl* interpreter) { - boost::shared_ptr<OpenALInvoker> invoker = boost::shared_ptr<OpenALInvoker>(new OpenALInvoker()); - invoker->_interpreter = interpreter; - return invoker; -} - -Data OpenALInvoker::getDataModelVariables() { - Data data; - return data; -} - -void OpenALInvoker::send(const SendRequest& req) { - tthread::lock_guard<tthread::recursive_mutex> lock(_mutex); - - if (!_isStarted) - start(); - - if (iequals(req.name, "play")) { - if (req.params.find("src") == req.params.end()) { - LOG(ERROR) << "Sent event play with no src URL"; - } - - URL srcURL = req.params.find("src")->second.atom; - if (!srcURL.toAbsolute(_interpreter->getBaseURL(req.elem))) { - LOG(ERROR) << "src URL " << req.params.find("src")->second << " is relative with no base URI set for interpreter"; - return; - } - - _sources[req.sendid] = new OpenALSource(); - _sources[req.sendid]->loop = req.params.find("loop") != req.params.end() && iequals(req.params.find("loop")->second.atom, "true"); - _sources[req.sendid]->file = srcURL; -#ifdef LIBSNDFILE_FOUND - _sources[req.sendid]->transform = new LibSoundFile(srcURL.asLocalFile(".audio")); -#else -# ifdef AUDIOTOOLBOX_FOUND - _sources[req.sendid]->transform = new AudioToolbox(srcURL.asLocalFile(".audio")); -# endif -#endif - if (_sources[req.sendid]->transform == NULL) { - LOG(ERROR) << "No transcoder for input file known - install libsndfile or AudioToolbox"; - _sources.erase(req.sendid); - return; - } - - // force mono format to ensure actual spatial audio - PCMFormat format = _sources[req.sendid]->transform->getInFormat(); - format.alFormat = AL_FORMAT_MONO16; - _sources[req.sendid]->transform->setOutFormat(format); - - try { - _sources[req.sendid]->player = new OpenALPlayer(_alContext, NULL, format.alFormat, format.sampleRate); - } catch (std::exception ex) { - returnErrorExecution(ex.what()); - return; - } - - getPosFromParams(req.params, _sources[req.sendid]->pos); - - _sources[req.sendid]->pos[0] -= _listenerPos[0]; - _sources[req.sendid]->pos[1] -= _listenerPos[1]; - _sources[req.sendid]->pos[2] -= _listenerPos[2]; - try { - _sources[req.sendid]->player->setPosition(_sources[req.sendid]->pos); - - } catch (std::exception ex) { - returnErrorExecution(ex.what()); - } - - _sourcesAvailable.notify_all(); - } - - if (iequals(req.name, "move.source")) { - std::string sourceId; - if (req.params.find("source") == req.params.end()) { - LOG(WARNING) << "Cannot move source with no source given in parameters"; - return; - } - sourceId = req.params.find("source")->second.atom; - - if (_sources.find(sourceId) == _sources.end()) { - LOG(WARNING) << "Given source '" << sourceId << "' not active or not existing"; - return; - } - - getPosFromParams(req.params, _sources[sourceId]->pos); - try { - _sources[sourceId]->player->setPosition(_sources[sourceId]->pos); - } catch (std::exception ex) { - returnErrorExecution(ex.what()); - } - } - - if (iequals(req.name, "move.listener")) { - getPosFromParams(req.params, _listenerPos); - - try { - alcMakeContextCurrent(_alContext); - alListenerfv(AL_POSITION, _listenerPos); - OpenALPlayer::checkOpenALError(__LINE__); - } catch (std::exception ex) { - returnErrorExecution(ex.what()); - } - } - -} - -void OpenALInvoker::start() { - _isStarted = true; - _thread = new tthread::thread(&OpenALInvoker::fillBuffers, this); -} - -void OpenALInvoker::fillBuffers(void* userdata) { - OpenALInvoker* INST = (OpenALInvoker*)userdata; - while(INST->_isStarted) { - // do nothing until we have at least one source - int waitMs = std::numeric_limits<int>::max(); - INST->_mutex.lock(); - while (INST->_sources.size() == 0 && INST->_isStarted) { - INST->_sourcesAvailable.wait(INST->_mutex); - } - - if (!INST->_isStarted) - return; - - // here we are with at least one source and a locked mutex - assert(INST->_sources.size() > 0); - - std::map<std::string, OpenALSource*>::iterator srcIter = INST->_sources.begin(); - while(srcIter != INST->_sources.end()) { - OpenALSource* src = srcIter->second; - int wait = std::numeric_limits<int>::max(); - - if (src->finished) { - // source has already finished playing, feed no more samples to it - try { - wait = src->player->isPlaying(); - if (wait == 0) { - // source stopped playing, delete it - INST->notifyOfEnd(src); - delete src; - INST->_sources.erase(srcIter++); - continue; - } else { - // source returned time when to repoll - assert(wait > 0); - } - } catch (std::exception ex) { - INST->returnErrorExecution(ex.what()); - delete src; - INST->_sources.erase(srcIter++); - continue; - } - } else { - // source still needs more samples or play existing buffer - if (src->written == src->read) { - // all read samples have been written, read some more - src->written = 0; - src->read = src->transform->read(src->buffer, ALPLAY_AUDIO_BUFFER_SIZE); - if (src->read < ALPLAY_AUDIO_BUFFER_SIZE) { - if (src->loop) { - INST->notifyOfLoop(src); - while (src->read < ALPLAY_AUDIO_BUFFER_SIZE) { - src->transform->seek(0); - src->read += src->transform->read(src->buffer + src->read, ALPLAY_AUDIO_BUFFER_SIZE - src->read); - } - } else { - src->finished = true; - memset(src->buffer + src->read, 0, ALPLAY_AUDIO_BUFFER_SIZE - src->read); - } - } - } - - // there are unwritten samples in the buffer - if (src->read != src->written) { - try { - int written = src->player->write(src->buffer, ALPLAY_AUDIO_BUFFER_SIZE, &wait); - if (written >=0 ) { - src->written += written; - } - } catch (std::exception ex) { - INST->returnErrorExecution(ex.what()); - src->finished = true; - } - } else { - assert(src->finished); - } - } - - waitMs = (wait < waitMs ? wait : waitMs); - srcIter++; - } - -// std::cout << "W" << waitMs << "."; - - INST->_mutex.unlock(); - if (waitMs < std::numeric_limits<int>::max()) - tthread::this_thread::sleep_for(tthread::chrono::milliseconds(waitMs)); - } -} - -void OpenALInvoker::cancel(const std::string sendId) { - tthread::lock_guard<tthread::recursive_mutex> lock(_mutex); - -} - -void OpenALInvoker::invoke(const InvokeRequest& req) { - _alDevice = alcOpenDevice(NULL); - if (_alDevice == NULL) { - throw std::string("__FILE__ __LINE__ openal error opening device"); - } - - std::multimap<std::string, Data>::const_iterator paramIter = req.params.begin(); - while(paramIter != req.params.end()) { - if (iequals(paramIter->first, "maxX")) - _maxPos[0] = strTo<float>(paramIter->second.atom); - if (iequals(paramIter->first, "maxY")) - _maxPos[1] = strTo<float>(paramIter->second.atom); - if (iequals(paramIter->first, "maxZ")) - _maxPos[2] = strTo<float>(paramIter->second.atom); - paramIter++; - } - - // create new context with device - _alContext = alcCreateContext (_alDevice, NULL); - if (_alContext == NULL) { - alcCloseDevice (_alDevice); - throw std::string("openal error create context"); - } - -// std::cout << boost::lexical_cast<std::string>(_alContext); -// std::cout << boost::lexical_cast<std::string>(_alDevice); - - alcMakeContextCurrent(_alContext); -// float listener[3] = {0,0,0}; -// alListenerfv(AL_POSITION, listener); - - alcMakeContextCurrent(_alContext); - alListenerfv(AL_POSITION, _listenerPos); - alListenerfv(AL_VELOCITY, _listenerVel); - alListenerfv(AL_ORIENTATION, _listenerOrient); - - alListenerf(AL_GAIN, 0.5); - - start(); -} - -void OpenALInvoker::notifyOfEnd(OpenALSource* src) { - Event ev; - ev.name = "audio.end"; - ev.data.compound["file"] = src->file; - returnEvent(ev); -} - -void OpenALInvoker::notifyOfLoop(OpenALSource* src) { - Event ev; - ev.name = "audio.loop"; - ev.data.compound["file"] = src->file; - returnEvent(ev); -} - -void OpenALInvoker::getPosFromParams(const std::multimap<std::string, Data>& params, float* position) { - // vector explicitly given - try { - if (params.find("x") != params.end()) - position[0] = boost::lexical_cast<float>(params.find("x")->second); - if (params.find("y") != params.end()) - position[1] = boost::lexical_cast<float>(params.find("y")->second); - if (params.find("z") != params.end()) - position[2] = boost::lexical_cast<float>(params.find("z")->second); - } catch (boost::bad_lexical_cast& e) { - LOG(ERROR) << "Cannot interpret x, y or z as float value in params: " << e.what(); - } - - try { - // right is an alias for x - if (params.find("right") != params.end()) - position[0] = boost::lexical_cast<float>(params.find("right")->second); - // height is an alias for y - if (params.find("height") != params.end()) - position[1] = boost::lexical_cast<float>(params.find("height")->second); - // front is an alias for z - if (params.find("front") != params.end()) - position[2] = boost::lexical_cast<float>(params.find("front")->second); - } catch (boost::bad_lexical_cast& e) { - LOG(ERROR) << "Cannot interpret right, height or front as float value in params: " << e.what(); - } - - // do we have a position on a circle? - try { - if (params.find("circle") != params.end()) { - float rad = posToRadian(params.find("circle")->second); - position[0] = cosf(rad); - position[2] = -1 * sinf(rad); // z axis increases to front -// position[0] *= 150; -// position[2] *= 150; - - } - } catch (boost::bad_lexical_cast& e) { - LOG(ERROR) << "Cannot interpret circle as float value in params: " << e.what(); - } - - position[0] = position[0] / _maxPos[0]; - position[1] = position[1] / _maxPos[1]; - position[2] = position[2] / _maxPos[2]; -// std::cout << position[0] << ":" << position[1] << ":" << position[2] << std::endl; - -} - -float OpenALInvoker::posToRadian(const std::string& pos) { - - std::string trimmedPos = boost::trim_copy(pos); - float rad = 0; - - if (trimmedPos.size() > 3 && iequals("deg", trimmedPos.substr(trimmedPos.length() - 3, 3))) { - rad = boost::lexical_cast<float>(trimmedPos.substr(0, trimmedPos.size() - 3)); - rad = fmodf(rad, 360); // into range [0-360] - rad /= 180; // into range [0-2] - rad *= M_PI; // into range [0-2PI] - rad -= M_PI_2; // 0 to top; - rad *= -1; // make clockwise - rad += 2 * M_PI; // make positive - } else if (trimmedPos.size() > 3 && iequals("rad", trimmedPos.substr(trimmedPos.length() - 3, 3))) { - rad = boost::lexical_cast<float>(trimmedPos.substr(0, trimmedPos.size() - 3)); - rad = fmodf(rad, M_PI * 2); // into range [0-2*PI] - } else { - LOG(ERROR) << "Cannot make sense of position value " << trimmedPos << ": does not end in 'deg', 'rad'"; - } - return rad; -} - -OpenALSource::OpenALSource() { - pos[0] = pos[1] = pos[2] = 0; - player = NULL; - loop = false; - finished = false; - transform = NULL; - read = written = 0; - memset(buffer, 0, ALPLAY_AUDIO_BUFFER_SIZE); -} - -OpenALSource::~OpenALSource() { - if (player) - delete player; - if (transform) - delete transform; -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/audio/OpenALInvoker.h b/src/uscxml/plugins/invoker/audio/OpenALInvoker.h deleted file mode 100644 index 98524ed..0000000 --- a/src/uscxml/plugins/invoker/audio/OpenALInvoker.h +++ /dev/null @@ -1,111 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef OPENALINVOKER_H_W09J90F0 -#define OPENALINVOKER_H_W09J90F0 - -#include "uscxml/config.h" -#include <uscxml/Interpreter.h> -#include "OpenALPlayer.h" - -#include "PCMConverter.h" -#ifdef LIBSNDFILE_FOUND -# include "LibSoundFile.h" -#else -# ifdef AUDIOTOOLBOX_FOUND -# include "AudioToolbox.h" -# endif -#endif - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class OpenALSource { -public: - OpenALSource(); - ~OpenALSource(); - - OpenALPlayer* player; - char buffer[ALPLAY_AUDIO_BUFFER_SIZE]; - bool loop; - bool finished; - int read; - int written; - ALfloat pos[3]; - URL file; - PCMConverter* transform; -}; - -class OpenALInvoker : public InvokerImpl { -public: - OpenALInvoker(); - virtual ~OpenALInvoker(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("openal"); - names.push_back("spatial-audio"); - names.push_back("http://uscxml.tk.informatik.tu-darmstadt.de/#openal"); - return names; - } - - virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void cancel(const std::string sendId); - virtual void invoke(const InvokeRequest& req); - -protected: - std::map<std::string, OpenALSource*> _sources; - ALCcontext* _alContext; - ALCdevice* _alDevice; - - tthread::recursive_mutex _mutex; - tthread::thread* _thread; - tthread::condition_variable _sourcesAvailable; - - bool _isStarted; - bool _isRunning; - ALfloat _listenerPos[3]; - ALfloat _listenerVel[3]; - ALfloat _listenerOrient[6]; - float _maxPos[3]; - - static void fillBuffers(void* userdata); - void start(); - - void notifyOfEnd(OpenALSource*); - void notifyOfLoop(OpenALSource*); - - float posToRadian(const std::string& pos); - void getPosFromParams(const std::multimap<std::string, Data>& params, float* position); - -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(OpenALInvoker, InvokerImpl); -#endif - -} - - -#endif /* end of include guard: OPENALINVOKER_H_W09J90F0 */ diff --git a/src/uscxml/plugins/invoker/audio/OpenALPlayer.cpp b/src/uscxml/plugins/invoker/audio/OpenALPlayer.cpp deleted file mode 100644 index 3aaeddf..0000000 --- a/src/uscxml/plugins/invoker/audio/OpenALPlayer.cpp +++ /dev/null @@ -1,541 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "OpenALPlayer.h" -#include <assert.h> -#include <stdexcept> - -tthread::recursive_mutex OpenALPlayer::_alMutex; - -/** -* Create a new OpenAL stream source -*/ -OpenALPlayer::OpenALPlayer(ALCcontext* context, OpenALPlayerCallback* audioCallback, ALenum format, ALsizei freq) { - - _isInitialized = false; - _audioCallback = audioCallback; - _freq = freq; - _format = format; - _bufferSize = 0; - _nrBuffers = 0; - _thread = NULL; - _alId = 0; - - _position[0] = _position[1] = _position[2] = 0; - _velocity[0] = _velocity[1] = _velocity[2] = 0; - _direction[0] = _direction[1] = _direction[2] = 0; - - tthread::lock_guard<tthread::recursive_mutex> lock(_alMutex); - if (context == NULL) { - // this is in essence alutInit() from freealut. - - // use the current context if there is one - _context = alcGetCurrentContext(); - - if (_context == NULL) { -// std::cout << "\tnew context" << std::endl; - // create a new context if none was given and no is current - - // get default device - ALCdevice* device = alcOpenDevice(NULL); - if (device == NULL) { - throw std::runtime_error("__FILE__ __LINE__ openal error opening device"); - } - - // create new context with device - _context = alcCreateContext (device, NULL); - if (_context == NULL) { - alcCloseDevice (device); - throw std::runtime_error("openal error create context"); - } - - // make context current - if (!alcMakeContextCurrent (_context)) { - alcDestroyContext (_context); - alcCloseDevice (device); - throw std::runtime_error("openal error make context current"); - } - } else { -// std::cout << "\texisting context" << std::endl; - } - } else { -// std::cout << "\tgiven context" << std::endl; - _context = context; - } -} - -OpenALPlayer::~OpenALPlayer() { - tthread::lock_guard<tthread::recursive_mutex> lock(_alMutex); - if (isPlaying()) { - alSourceStop(_alId); - } - if (_thread) { - stop(); - _thread->join(); - delete(_thread); - } - - if (_isInitialized) { - alDeleteSources(1, &_alId); - if (alIsSource(_alId)) { - throw std::runtime_error("openal source id still valid"); - } - for (size_t i = 0; i < _nrBuffers; i++) { - assert(alIsBuffer(_bufferIds[i])); - free(_buffers[i]); - } - alDeleteBuffers(_nrBuffers, _bufferIds); - for (size_t i = 0; i < _nrBuffers; i++) { -// assert(!alIsBuffer(_bufferIds[i])); - } - free(_buffers); - free(_bufferIds); - } - // clear errors and begone - alGetError(); - -} - -/** -* Allocate; data and set defaults -*/ -void OpenALPlayer::init() { - _userData = NULL; - _pitch = 0; - _gain = 0; - _referenceDistance = 1.0; - _isLooping = false; - - // no one set a buffer size yet - if (_bufferSize <= 0) - _bufferSize = ALPLAY_AUDIO_BUFFER_SIZE; - - // no one set the number of buffers yet - if (_nrBuffers <= 0) - _nrBuffers = ALPLAY_NR_AUDIO_BUFFERS; - - _isInitialized = true; - - _buffers = (char**)malloc(_nrBuffers * sizeof(char*)); - _bufferIds = (ALuint*)malloc(_nrBuffers * sizeof(ALuint)); - for (size_t i = 0; i < _nrBuffers; i++) { - _buffers[i] = 0; //(char*)malloc(_bufferSize); - } - - // there are other formats as well and this will have to be extended - int bytesPerSample = 2; - switch(_format) { - case AL_FORMAT_MONO8: - case AL_FORMAT_STEREO8: - bytesPerSample = 1; - break; - - case AL_FORMAT_MONO16: - case AL_FORMAT_STEREO16: - bytesPerSample = 2; - break; - } - - // how many ms audio is in one buffer? - _msForBuffer = (int)(((float)_bufferSize / (float)bytesPerSample) / ((float)_freq / 1000.0f)); - _initialSleep = (_msForBuffer - (int)(0.6 * _msForBuffer)) * _nrBuffers; - _bufferSleep = _msForBuffer - (int)(0.4 * _msForBuffer); - _repollSleep = _msForBuffer - (int)(0.7 * _msForBuffer); - -// std::cout << _msForBuffer << "ms in one buffer" << std::endl; - - // get available buffer ids - tthread::lock_guard<tthread::recursive_mutex> lock(_alMutex); - - if (!alcMakeContextCurrent (_context)) { - throw std::runtime_error("openal error make context current"); - } - - alGenBuffers(_nrBuffers, _bufferIds); - checkOpenALError(__LINE__); - - // get new source id from openAL - alGenSources(1, &_alId); - - checkOpenALError(__LINE__); - if (!alIsSource(_alId)) { - throw std::runtime_error("openal source id not valid"); - } - - // set our position and various flags to meaningful defaults - alSourcei (_alId, AL_SOURCE_RELATIVE, AL_TRUE); - checkOpenALError(__LINE__); - alSourcei(_alId, AL_LOOPING, AL_FALSE); - checkOpenALError(__LINE__); - alSourcefv(_alId, AL_POSITION, _position); - checkOpenALError(__LINE__); -// alSourcef(_alId,AL_REFERENCE_DISTANCE, 5.0f); -// checkOpenALError(__LINE__); - alDistanceModel(AL_LINEAR_DISTANCE); - checkOpenALError(__LINE__); - alSourcefv(_alId, AL_VELOCITY, _velocity); - checkOpenALError(__LINE__); - alSourcefv(_alId, AL_DIRECTION, _direction); - checkOpenALError(__LINE__); -// alSourcef (_alId, AL_ROLLOFF_FACTOR, 1.0); -// checkOpenALError(__LINE__); -// alSourcef(_alId,AL_REFERENCE_DISTANCE, 5.0f); -// checkOpenALError(__LINE__); -// float listener[] = { 0.0, 0.0, 0.0 }; -// alListenerfv(AL_POSITION, listener); -// checkOpenALError(__LINE__); -} - -/** -* Start the sound source. -* -* This will trigger continuous calls top the audio callback. -*/ -void OpenALPlayer::start() { - if (!_isInitialized) - init(); - - if (_audioCallback == NULL) - throw std::runtime_error("cannot start without an audio callback"); - - _isStarted = true; - - // prime the buffers with some initial data and register for buffer ids - tthread::lock_guard<tthread::recursive_mutex> lock(_alMutex); - for (ALuint i = 0; i < (unsigned int)_nrBuffers; i++) { - _buffers[i] = (char*)malloc(_bufferSize); - _audioCallback->getSamples(_buffers[i], _bufferSize, this); - alBufferData(_bufferIds[i], _format, _buffers[i], _bufferSize, _freq); - checkOpenALError(__LINE__); - } - // enqueue all buffers - alSourceQueueBuffers(_alId, _nrBuffers, _bufferIds); - checkOpenALError(__LINE__); - - // start thread - if (_audioCallback != NULL) { - _thread = new tthread::thread(&OpenALPlayer::updateBuffersWrapper, this); - } - - // tell openAL to start rendering the buffers - alSourcePlay(_alId); - checkOpenALError(__LINE__); -} - -// find bufferId in _bufferIds to get bufferIndex into _buffers - messy -int OpenALPlayer::bufferIndex(int bufferId) { - int bufferIndex = 0; - for (; bufferIndex < _nrBuffers; bufferIndex++) { - if (_bufferIds[bufferIndex] == (unsigned int)bufferId) - break; - } - if (bufferIndex >= _nrBuffers) - throw std::runtime_error("could not find dequeued bufferId in ids"); - return bufferIndex; -} - -/** -* Write a buffer (blocking). -* -* This allows for a pushing model, whereas the callback allows for a polling model. -*/ -int OpenALPlayer::write(char* buffer, int size, int* repollAt, bool blocking) { - tthread::lock_guard<tthread::recursive_mutex> lock(_alMutex); - - if (!_isInitialized) - init(); - - if (_audioCallback != NULL) { - throw std::runtime_error("you cannot use the write interface with an audio callback"); - } - - if (size != _bufferSize) { - throw std::runtime_error("buffersize does not match"); - } - - if (!alcMakeContextCurrent (_context)) { - throw std::runtime_error("openal error make context current"); - } - - // try to enqueue the given buffer data - for (;;) { - // do we have an empty buffer in the OpenAL queue? - int processed; - alGetSourcei(_alId, AL_BUFFERS_PROCESSED, &processed); - checkOpenALError(__LINE__); - -// if (!isPlaying()) -// std::cout << "-"; - - if (processed > 0) { -// std::cout << "P" << processed; - ALuint bufferId = 0; - alSourceUnqueueBuffers(_alId, 1, &bufferId); - checkOpenALError(__LINE__); - - int bufferIdx = bufferIndex(bufferId); - - // fill the buffer with the given data - memcpy(_buffers[bufferIdx], buffer, _bufferSize); - alBufferData(bufferId, _format, _buffers[bufferIdx], _bufferSize, _freq); - checkOpenALError(__LINE__); - - // enqueue - alSourceQueueBuffers(_alId, 1, &bufferId); - checkOpenALError(__LINE__); - - // some buffers were processed - if (repollAt) - *repollAt = _repollSleep; - break; - - } else { - // no buffer processed - is there an uninitialized buffer left? - int nextBuffer = 0; - for(; nextBuffer < _nrBuffers; nextBuffer++) { - if (_buffers[nextBuffer] == 0) { - break; - } - } - if (nextBuffer < _nrBuffers) { -// std::cout << "N"; - _buffers[nextBuffer] = (char*)malloc(_bufferSize); - memcpy(_buffers[nextBuffer], buffer, _bufferSize); - - alBufferData(_bufferIds[nextBuffer], _format, _buffers[nextBuffer], _bufferSize, _freq); - checkOpenALError(__LINE__); - - alSourceQueueBuffers(_alId, 1, &_bufferIds[nextBuffer]); - checkOpenALError(__LINE__); - // there was a free buffer, repoll immediately to try to write more - if (repollAt) - *repollAt = 0; - - break; - } else { -// std::cout << "X"; - // no processed, no new buffer, wait until we processed one - if (blocking) { - tthread::this_thread::sleep_for(tthread::chrono::milliseconds(_repollSleep)); - } else { - if (repollAt) - *repollAt = _repollSleep; - return -1; - } - } - } - } - - // we have at least one buffer queued, start playing - if (!_isStarted || !isPlaying()) { - alSourcePlay(_alId); - checkOpenALError(__LINE__); - _isStarted = true; - } - - return size; -} - - -/** -* Dequeue, refill and re-enqueue buffers. -*/ -void OpenALPlayer::updateBuffers() { - int processed; -// int queued; - -// std::cout << "Initial sleep: " << initialSleep << "ms" << std::endl; -// std::cout << "Buffer sleep: " << bufferSleep << "ms" << std::endl; -// std::cout << "Repoll sleep: " << repollSleep << "ms" << std::endl; - tthread::this_thread::sleep_for(tthread::chrono::milliseconds(_bufferSleep * _initialSleep)); - - - while(_isStarted) { - - // how many buffers have been rendered already? - tthread::lock_guard<tthread::recursive_mutex> lock(_alMutex); - alGetSourcei(_alId, AL_BUFFERS_PROCESSED, &processed); - checkOpenALError(__LINE__); - //std::cout << processed << std::flush; - - if (processed == 0) { - // avoid busy wait by sleeping - tthread::this_thread::sleep_for(tthread::chrono::milliseconds(_bufferSleep * _initialSleep)); - } else { - // dequeue buffers and get ids - // see http://stackoverflow.com/questions/1900665/c-compiler-differences-vs2008-and-g - ALuint bufferIds[ALPLAY_NR_AUDIO_BUFFERS]; - alSourceUnqueueBuffers(_alId, processed, bufferIds); - checkOpenALError(__LINE__); - - for (size_t id = 0; id < processed; id++) { - int bufferIdx = bufferIndex(bufferIds[id]); - - // refill the buffer with data from the callback - _audioCallback->getSamples(_buffers[bufferIdx], _bufferSize, this); - alBufferData(bufferIds[id], _format, _buffers[bufferIdx], _bufferSize, _freq); - checkOpenALError(__LINE__); - - } - // re-enqueue - alSourceQueueBuffers(_alId, processed, bufferIds); - checkOpenALError(__LINE__); - - // restart if we are not running anymore - if (!isPlaying()) { - alSourcePlay(_alId); - checkOpenALError(__LINE__); - } - - // sleep a bit less than the duration of one buffer - tthread::this_thread::sleep_for(tthread::chrono::milliseconds(_bufferSleep * processed)); - } - } -} - -/** -* TODO -*/ -void OpenALPlayer::stop() { - _isStarted = false; - _thread->join(); -} - -void OpenALPlayer::checkOpenALError(int line) { - int error = alGetError(); - if(error != AL_NO_ERROR) { - std::stringstream out; - out << "OpenALError:" << line << ":"; - - switch (error) { - case AL_INVALID_NAME: - out << "OpenAL invalid name."; - break; - case AL_INVALID_ENUM: - out << "OpenAL invalid enum."; - break; - case AL_INVALID_VALUE: - out << "OpenAL invalid value."; - break; - case AL_INVALID_OPERATION: - out << "OpenAL invalid operation."; - break; - case AL_OUT_OF_MEMORY: - out << "OpenAL out of memory."; - break; - - default: - out << "OpenAL unknown error."; - break; - } - throw std::runtime_error(out.str()); - } -} - -unsigned int OpenALPlayer::isPlaying() { - ALint val; - alGetSourcei(_alId, AL_SOURCE_STATE, &val); - if(val != AL_PLAYING) - return 0; - return _repollSleep; -} - -void OpenALPlayer::updateBuffersWrapper(void *obj) { - try { - reinterpret_cast<OpenALPlayer *>(obj)->updateBuffers(); - } catch(std::runtime_error& error) { -// std::cout << "Terminating Thread: " << error << std::endl; - } catch(...) { -// std::cout << "Terminating Thread! " << std::endl; - } -} - -void OpenALPlayer::setNrBuffers(int nrBuffers) { - if (_nrBuffers > 0) - throw std::runtime_error("cannot modify number of buffers"); - _nrBuffers = nrBuffers; -} - -int OpenALPlayer::getNrBuffers() { - return _nrBuffers; -} - -/** -* Set position of sound source in coordinate system -*/ -void OpenALPlayer::setPosition(ALfloat position[]) { - memcpy(&_position, position, 3 * sizeof(ALfloat)); -// std::cout << _position[0] << ", " << _position[1] << ", " << _position[2] << std::endl; - if (_isInitialized) - alSourcefv(_alId, AL_POSITION, _position); -} - -ALfloat* OpenALPlayer::getPosition() { - return _position; -} - -/** -* Set velocity of sound source in coordinate system -*/ -void OpenALPlayer::setVelocity(ALfloat velocity[]) { - memcpy(&_velocity, velocity, 3 * sizeof(ALfloat)); - if (_isInitialized) - alSourcefv(_alId, AL_VELOCITY, _velocity); -} - -ALfloat* OpenALPlayer::getVelocity() { - return _velocity; -} - -/** -* Set direction of sound source in coordinate system -*/ -void OpenALPlayer::setDirection(ALfloat direction[]) { - memcpy(&_direction, direction, 3 * sizeof(ALfloat)); - if (_isInitialized) - alSourcefv(_alId, AL_DIRECTION, _direction); -} - -ALfloat* OpenALPlayer::getDirection() { - return _direction; -} - -void OpenALPlayer::setBufferSize(int bufferSize) { - if (_bufferSize > 0) - throw std::runtime_error("cannot modify buffersize"); - _bufferSize = bufferSize; -} - -int OpenALPlayer::getBufferSize() { - return _bufferSize; -} - -OpenALPlayerCallback* OpenALPlayer::getCallback() { - return _audioCallback; -} -void OpenALPlayer::setCallback(OpenALPlayerCallback* callback) { - _audioCallback = callback; -} - -void* OpenALPlayer::getUserData() { - return _userData; -} -void OpenALPlayer::setUserData(void* userData) { - _userData = userData; -} diff --git a/src/uscxml/plugins/invoker/audio/OpenALPlayer.h b/src/uscxml/plugins/invoker/audio/OpenALPlayer.h deleted file mode 100644 index db883a0..0000000 --- a/src/uscxml/plugins/invoker/audio/OpenALPlayer.h +++ /dev/null @@ -1,125 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef OPENALPLAYER_H_3PORVJDU -#define OPENALPLAYER_H_3PORVJDU - -#include <iostream> -#include <string.h> -#include <stdlib.h> -#include <sstream> -#include <uscxml/concurrency/tinythread.h> - -#include <al.h> -#include <alc.h> - -// sometimes the stream drops if this is less than 5000 bytes -#define ALPLAY_NR_AUDIO_BUFFERS 3 -#define ALPLAY_AUDIO_BUFFER_SIZE 2048 -//#define ALPLAYER_FORMAT_MONO16 0x1101 - -class OpenALPlayer; - -class OpenALPlayerCallback { -public: - virtual ~OpenALPlayerCallback() {} - /* - * Returning an OpenALPlayerCallback is a hack to be able to provide a typemap for SWIG. - * We cannot use SWIG directors with byte arrays otherwise. Posted to swig-ML already. - */ - virtual OpenALPlayerCallback* getSamples(char* buffer, int size, OpenALPlayer* player) = 0; -}; - -class OpenALPlayer { -private: - ALCcontext* _context; - - ALuint _alId; - ALfloat _position[3]; - ALfloat _velocity[3]; - ALfloat _direction[3]; - ALfloat _pitch; - ALfloat _gain; - ALfloat _referenceDistance; - ALboolean _isLooping; - - // OpenAL is not really thread safe - static tthread::recursive_mutex _alMutex; - - ALenum _format; - ALsizei _freq; - int _msForBuffer; - int _initialSleep; - int _bufferSleep; - int _repollSleep; - - int _bufferSize; - int _nrBuffers; - ALuint* _bufferIds; - char** _buffers; - OpenALPlayerCallback* _audioCallback; - void* _userData; - - tthread::thread* _thread; - bool _isStarted; - bool _isInitialized; - - void updateBuffers(); - void init(); - - // static wrapper as an entry point for pthreads - static void updateBuffersWrapper(void *obj); - - // get the index in _buffers for a buffer ID - int inline bufferIndex(int bufferId); - -public: - OpenALPlayer(ALCcontext*, OpenALPlayerCallback*, ALenum, ALsizei); - virtual ~OpenALPlayer(); - - unsigned int isPlaying(); - static void checkOpenALError(int line); - - ALfloat* getPosition(); - void setPosition(ALfloat[3]); - ALfloat* getVelocity(); - void setVelocity(ALfloat[3]); - ALfloat* getDirection(); - void setDirection(ALfloat[3]); - - void setBufferSize(int bufferSize); - int getBufferSize(); - void setNrBuffers(int nrBuffers); - int getNrBuffers(); - - // callback interface for pull - OpenALPlayerCallback* getCallback(); - void setCallback(OpenALPlayerCallback* callback); - - // stream interface for push - int write(char* buffer, int size, int* repollAt, bool blocking = false); - - void* getUserData(); - void setUserData(void* userData); - - void start(); - void stop(); -}; - -#endif /* end of include guard: OPENALPLAYER_H_3PORVJDU */ diff --git a/src/uscxml/plugins/invoker/audio/PCMConverter.h b/src/uscxml/plugins/invoker/audio/PCMConverter.h deleted file mode 100644 index 1984600..0000000 --- a/src/uscxml/plugins/invoker/audio/PCMConverter.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef PCMCONVERTER_H_97Z8U7PA -#define PCMCONVERTER_H_97Z8U7PA - -#include <string> -#include <al.h> -#include <alc.h> - -namespace uscxml { - -struct PCMFormat { - ALenum alFormat; - unsigned int sampleRate; -}; - -class PCMConverter { -public: - PCMConverter(const std::string filename) {} - virtual ~PCMConverter() {} - virtual void seek(unsigned int pos) = 0; - virtual int read(char* buffer, unsigned int size) = 0; - - virtual void setOutFormat(const PCMFormat& format) = 0; - virtual PCMFormat getInFormat() = 0; -protected: - PCMConverter() {} -}; - -} - -#endif /* end of include guard: PCMCONVERTER_H_97Z8U7PA */ diff --git a/src/uscxml/plugins/invoker/calendar/CalendarInvoker.cpp b/src/uscxml/plugins/invoker/calendar/CalendarInvoker.cpp deleted file mode 100644 index 8a4ea3d..0000000 --- a/src/uscxml/plugins/invoker/calendar/CalendarInvoker.cpp +++ /dev/null @@ -1,651 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include <boost/algorithm/string.hpp> - -#include "CalendarInvoker.h" -#include "uscxml/concurrency/DelayedEventQueue.h" - -#include <glog/logging.h> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new CalendarInvokerProvider() ); - return true; -} -#endif - -CalendarInvoker::CalendarInvoker() { - _icalSet = NULL; - _icalComp = NULL; -} - -CalendarInvoker::~CalendarInvoker() { - tthread::lock_guard<tthread::recursive_mutex> lock(_mutex); - std::set<std::string>::iterator _eventIdIter = _eventIds.begin(); - while(_eventIdIter != _eventIds.end()) { - _interpreter->getDelayQueue()->cancelEvent(*_eventIdIter); - _eventIds.erase(_eventIdIter++); - - } - - std::map<std::string, CalendarEvent*>::iterator eventIter = _events.begin(); - while(eventIter != _events.end()) { - delete eventIter->second; - eventIter++; - } - - if (_icalComp) - icalcomponent_free(_icalComp); -}; - -boost::shared_ptr<InvokerImpl> CalendarInvoker::create(InterpreterImpl* interpreter) { - boost::shared_ptr<CalendarInvoker> invoker = boost::shared_ptr<CalendarInvoker>(new CalendarInvoker()); - invoker->_interpreter = interpreter; - - icalerror_set_error_state(ICAL_PARSE_ERROR, ICAL_ERROR_NONFATAL); - -// invoker->_calFile = URL::tmpFile(); -// invoker->_icalSet = icalfileset_new(invoker->_calFile.c_str()); - -// if (!invoker->_icalSet) { -// LOG(WARNING) << "Could not create new ical fileset: " << icalerror_perror(); -// } - - return invoker; -} - -Data CalendarInvoker::getDataModelVariables() { - Data data; - return data; -} - -void CalendarInvoker::send(const SendRequest& req) { - tthread::lock_guard<tthread::recursive_mutex> lock(_mutex); -} - -void CalendarInvoker::cancel(const std::string sendId) { - tthread::lock_guard<tthread::recursive_mutex> lock(_mutex); - std::set<std::string>::iterator _eventIdIter = _eventIds.begin(); - while(_eventIdIter != _eventIds.end()) { - _interpreter->getDelayQueue()->cancelEvent(*_eventIdIter); - _eventIds.erase(_eventIdIter++); - } -} - -void CalendarInvoker::invoke(const InvokeRequest& req) { - tthread::lock_guard<tthread::recursive_mutex> lock(_mutex); - - _icalComp = addIcal(req.content); -// dumpComponent(_icalComp); - setupEvents(_icalComp); - -} - -icalcomponent* CalendarInvoker::addIcal(const std::string& icalString) { - - icalcomponent* root = icalparser_parse_string(icalString.c_str()); - if (!root) { - LOG(WARNING) << "Could not parse ical data: " << icalerror_perror(); - return NULL; - } -// icalerrorenum err; -// err = icalset_add_component(_icalSet, root); -// icalfileset_commit(_icalSet); - - return root; -} - -void CalendarInvoker::setupEvents(icalcomponent* comp) { -// dumpComponent(comp); - - switch (icalcomponent_isa(comp)) { - case ICAL_VCALENDAR_COMPONENT: - case ICAL_XROOT_COMPONENT: - break; - case ICAL_VALARM_COMPONENT: { - break; - } - case ICAL_VEVENT_COMPONENT: { - // event to map - CalendarEvent* event = new CalendarEvent(comp); - _events[toStr((uintptr_t)event)] = event; - queueEvent(event); - break; - } - default: -// dumpComponent(comp); - break; - } - - icalcomponent* child = icalcomponent_get_first_component(comp, ICAL_ANY_COMPONENT); - while(child) { - setupEvents(child); - child = icalcomponent_get_next_component(comp, ICAL_ANY_COMPONENT); - } - -} - -void CalendarInvoker::queueEvent(CalendarEvent* event) { - if (_events.find(toStr((uintptr_t)event)) == _events.end()) { - _events[toStr((uintptr_t)event)] = event; - } - time_t now = time(NULL); - struct icaltime_span span; - - if (event->_nextSpan.start > 0) { - span = event->getNextDuration(event->_nextSpan.start + 1); - } else { - span = event->getNextDuration(now); - } - -#if 0 - if (span.end > 0) { - std::cout << "\t\t" << ctime(&span.start); - std::cout << "\t\t" << ctime(&span.end); - span = event->getNextDuration(span.end); - } -#endif - - if (span.start <= 0 || span.end <= 0) { - event->_nextSpan.start = 0; - event->_nextSpan.end = 0; - return; - } - - int beginSecs = span.start - now; - int endSecs = span.end - now; - - if (beginSecs > endSecs) { - LOG(WARNING) << "Event ends before it starts"; - return; - } - - event->_nextSpan = span; - - std::string beginEventId = event->getId() + "." + toStr(span.start) + ".started"; - std::string endEventId = event->getId() + "." + toStr(span.end) + ".ended"; - -#if 0 - beginSecs = 1; - endSecs = 2; -#endif - if (beginSecs > 0) { - _interpreter->getDelayQueue()->addEvent(beginEventId, CalendarInvoker::raiseEvent, beginSecs * 1000, this); - _eventIds.insert(beginEventId); - } else { - raiseEvent(this, beginEventId); - } - _interpreter->getDelayQueue()->addEvent(endEventId, CalendarInvoker::raiseEvent, endSecs * 1000, this); - _eventIds.insert(endEventId); - -} - -void CalendarInvoker::raiseEvent(void* userdata, const std::string eventId) { - CalendarInvoker* INSTANCE = (CalendarInvoker*)userdata; - tthread::lock_guard<tthread::recursive_mutex> lock(INSTANCE->_mutex); - - std::string address = eventId.substr(0, eventId.find_first_of(".")); - - if (INSTANCE->_events.find(address) == INSTANCE->_events.end()) { - LOG(WARNING) << "No such event: " << eventId; - return; - } - - if(INSTANCE->_eventIds.find(eventId) != INSTANCE->_eventIds.end()) { - INSTANCE->_eventIds.erase(eventId); - } - - CalendarEvent* calEvent = INSTANCE->_events[address]; - Event event; - - event.data = *calEvent; - if (boost::ends_with(eventId, ".started")) { - event.name = "event.started." + calEvent->getId(); - assert(!calEvent->_active); - calEvent->_active = true; - } else { - event.name = "event.ended." + calEvent->getId(); - assert(calEvent->_active); - calEvent->_active = false; - } - INSTANCE->returnEvent(event); - - // event ended, reschedule next event - if (boost::ends_with(eventId, ".ended")) - INSTANCE->queueEvent(calEvent); -} - -/** - * Get the next duration for this event starting no earlier - * than the given time. - */ -icaltime_span CalendarEvent::getNextDuration(time_t time) { - if (!_icalComp) - return icaltime_span_new(icaltime_null_time(), icaltime_null_time(), 0); - - // see icalcomponent_foreach_recurrence - icalproperty *rrule; - - icaltimetype calTime = icaltime_from_timet_with_zone(time, 0, 0); - - // actual occurence, without reocurrence - if (!icalproperty_recurrence_is_excluded(_icalComp, &_dtstart, &_dtend)) { - if (icaltime_compare(_dtstart, calTime) >= 0) { - // start is still in the future - return icaltime_span_new(_dtstart, _dtend, 0); - } - } - - icaltime_span recDur = icaltime_span_new(icaltime_null_time(), icaltime_null_time(), 0); - - // iterate all rrules - for (rrule = icalcomponent_get_first_property(_icalComp, ICAL_RRULE_PROPERTY); - rrule != NULL; - rrule = icalcomponent_get_next_property(_icalComp, ICAL_RRULE_PROPERTY)) { - - struct icalrecurrencetype recurType = icalproperty_get_rrule(rrule); - icalrecur_iterator *ritr; - struct icaltimetype rtime; - - // do we have an old iterator that has not yet passed time? - if (_recIters.find(rrule) != _recIters.end()) { - if (_recIters[rrule].second > time) { - icalrecur_iterator_free(_recIters[rrule].first); - _recIters[rrule].first = icalrecur_iterator_new(recurType, _dtstart); - - // skip initial non-reoccurence - if(_recIters[rrule].first) - rtime = icalrecur_iterator_next(_recIters[rrule].first); - - } - ritr = _recIters[rrule].first; - } else { - // create a new iterator for this rrule - _recIters[rrule] = std::make_pair(icalrecur_iterator_new(recurType, _dtstart), 0); - ritr = _recIters[rrule].first; - } - -// std::cout << icalrecurrencetype_as_string(&recurType) << std::endl; - - while (ritr) { - rtime = icalrecur_iterator_next(ritr); - -#if 0 - time_t tt = icaltime_as_timet(rtime); - std::cout << "\t\t" << ctime(&tt); -#endif - - if (icaltime_is_null_time(rtime)) { - // remove iterator - icalrecur_iterator_free(_recIters[rrule].first); - _recIters.erase(rrule); - break; // for next rule - } - _recIters[rrule].second = icaltime_as_timet(rtime); - - if (icaltime_compare(rtime, calTime) < 0) - continue; // until we are after given time - - if (icalproperty_recurrence_is_excluded(_icalComp, &_dtstart, &rtime)) - continue; - - icaltime_span thisDur = icaltime_span_new(rtime, rtime, 1); - thisDur.end += _dtduration; - - if (recDur.start == 0 || thisDur.start < recDur.start) { - // update soonest reoccurence with the one from this rule - recDur = thisDur; - } - break; // we are after the event - } - } - return recDur; -} - -CalendarEvent::~CalendarEvent() { - std::map<icalproperty*, std::pair<icalrecur_iterator*, time_t> >::iterator recItersIter = _recIters.begin(); - while(recItersIter != _recIters.end()) { - icalrecur_iterator_free(recItersIter->second.first); - recItersIter++; - } -} - -CalendarEvent::CalendarEvent(icalcomponent* icalComp) { - _nextSpan.start = 0; - _nextSpan.end = 0; - _icalComp = NULL; - _active = false; - - - _dtstart = icalcomponent_get_dtstart(icalComp); - _dtend = icalcomponent_get_dtend(icalComp); - - if (!icaltime_is_valid_time(_dtstart)) { - LOG(WARNING) << "Start of event not a valid time"; - return; - } - - if (!icaltime_is_valid_time(_dtend)) { - LOG(WARNING) << "End of event not a valid time"; - return; - } - - _dtduration = icaldurationtype_as_int(icaltime_subtract(_dtend, _dtstart)); - - if (_dtduration <= 0) { - LOG(WARNING) << "Event has negative or zero duration"; - return; - } - - _icalComp = icalComp; - - // initialize all iterators - not really needed anymore - for (icalproperty* rrule = icalcomponent_get_first_property(_icalComp, ICAL_RRULE_PROPERTY); - rrule != NULL; - rrule = icalcomponent_get_next_property(_icalComp, ICAL_RRULE_PROPERTY)) { - - struct icalrecurrencetype recurType = icalproperty_get_rrule(rrule); - icalrecur_iterator *ritr = icalrecur_iterator_new(recurType, _dtstart); - - _recIters[rrule] = std::make_pair(ritr, 0); - } - - -} - -CalendarEvent::operator Data() { - Data data; - data = CalendarInvoker::toData(_icalComp); - return data; -} - -Data CalendarInvoker::toData(icalcomponent* comp) { - Data data; - data.compound["kind"] = Data(icalcomponent_kind_to_string(icalcomponent_isa(comp)), Data::VERBATIM); - - // iterate all properties - icalproperty* prop = icalcomponent_get_first_property(comp, ICAL_ANY_PROPERTY); - while(prop) { - std::string propName = icalproperty_kind_to_string(icalproperty_isa(prop)); - boost::to_lower(propName); - -#if 0 - // iterate all parameters - icalparameter* para = icalproperty_get_first_parameter(prop, ICAL_ANY_PARAMETER); - while(para) { - std::string paraName = icalparameter_kind_to_string(icalparameter_isa(para)); - - switch(icalparameter_get_value(para)) { - case ICAL_VALUE_X: - data.compound[propName].compound[paraName] = Data(icalparameter_get_x(para), Data::VERBATIM); - break; - case ICAL_VALUE_BOOLEAN: - case ICAL_VALUE_BINARY: - case ICAL_VALUE_DATE: - case ICAL_VALUE_DURATION: - case ICAL_VALUE_FLOAT: - case ICAL_VALUE_INTEGER: - case ICAL_VALUE_PERIOD: - case ICAL_VALUE_RECUR: - case ICAL_VALUE_TEXT: - case ICAL_VALUE_URI: - case ICAL_VALUE_ERROR: - case ICAL_VALUE_DATETIME: - case ICAL_VALUE_UTCOFFSET: - case ICAL_VALUE_CALADDRESS: - case ICAL_VALUE_NONE: - data.compound[propName].compound[paraName] = Data("", Data::VERBATIM); - break; - } - - para = icalproperty_get_next_parameter(prop, ICAL_ANY_PARAMETER); - } - data.compound[propName].compound["value"] = Data(icalproperty_get_value_as_string(prop), Data::VERBATIM); -#endif -#if 0 - data.compound[propName] = Data(icalproperty_as_ical_string(prop), Data::VERBATIM); -#endif - data.compound[propName] = Data(icalproperty_get_value_as_string(prop), Data::VERBATIM); - - prop = icalcomponent_get_next_property(comp, ICAL_ANY_PROPERTY); - } - - - icalcomponent* child = icalcomponent_get_first_component(comp, ICAL_ANY_COMPONENT); - while(child) { - data.compound["childs"].array.push_back(toData(child)); - child = icalcomponent_get_next_component(comp, ICAL_ANY_COMPONENT); - } - - return data; -} - -#if 0 -void CalendarInvoker::dumpComponent(icalcomponent* comp) { - std::cout << icalcomponent_kind_to_string(icalcomponent_isa(comp)) << std::endl; - - struct icaltimetype start, end; - time_t tt; - - icalproperty *startProp = icalcomponent_get_first_property(comp, ICAL_DTSTART_PROPERTY); - if (startProp) { - start = icalproperty_get_dtstart(startProp); - } - - icalproperty *endProp = icalcomponent_get_first_property(comp, ICAL_DTEND_PROPERTY); - if (endProp) { - end = icalproperty_get_dtend(endProp); - } - - icalproperty *prop = icalcomponent_get_first_property(comp, ICAL_ANY_PROPERTY); - - while(prop) { - std::cout << "\t" << icalproperty_kind_to_string(icalproperty_isa(prop)) << std::endl; - switch (icalproperty_isa(prop)) { - case ICAL_ANY_PROPERTY: - case ICAL_ACKNOWLEDGED_PROPERTY: - case ICAL_ACTION_PROPERTY: - case ICAL_ALLOWCONFLICT_PROPERTY: - case ICAL_ATTACH_PROPERTY: - case ICAL_ATTENDEE_PROPERTY: - case ICAL_CALID_PROPERTY: - case ICAL_CALMASTER_PROPERTY: - case ICAL_CALSCALE_PROPERTY: - case ICAL_CAPVERSION_PROPERTY: - case ICAL_CARLEVEL_PROPERTY: - case ICAL_CARID_PROPERTY: - case ICAL_CATEGORIES_PROPERTY: - case ICAL_CLASS_PROPERTY: - case ICAL_CMD_PROPERTY: - case ICAL_COMMENT_PROPERTY: - case ICAL_COMPLETED_PROPERTY: - case ICAL_COMPONENTS_PROPERTY: - case ICAL_CONTACT_PROPERTY: - case ICAL_CREATED_PROPERTY: - case ICAL_CSID_PROPERTY: - case ICAL_DATEMAX_PROPERTY: - case ICAL_DATEMIN_PROPERTY: - case ICAL_DECREED_PROPERTY: - case ICAL_DEFAULTCHARSET_PROPERTY: - case ICAL_DEFAULTLOCALE_PROPERTY: - case ICAL_DEFAULTTZID_PROPERTY: - case ICAL_DEFAULTVCARS_PROPERTY: - case ICAL_DENY_PROPERTY: - break; - case ICAL_DESCRIPTION_PROPERTY: - std::cout << "\t\t" << icalproperty_get_description(prop) << std::endl; - break; - case ICAL_DTEND_PROPERTY: { - end = icalproperty_get_dtend(prop); - tt = icaltime_as_timet(start); - std::cout << "\t\t" << ctime(&tt) << std::endl; - break; - } - case ICAL_DTSTAMP_PROPERTY: - break; - case ICAL_DTSTART_PROPERTY: { - start = icalproperty_get_dtstart(prop); - tt = icaltime_as_timet(start); - std::cout << "\t\t" << ctime(&tt) << std::endl; - break; - } - case ICAL_DUE_PROPERTY: - case ICAL_DURATION_PROPERTY: - case ICAL_EXDATE_PROPERTY: - case ICAL_EXPAND_PROPERTY: - case ICAL_EXRULE_PROPERTY: - case ICAL_FREEBUSY_PROPERTY: - case ICAL_GEO_PROPERTY: - case ICAL_GRANT_PROPERTY: - case ICAL_ITIPVERSION_PROPERTY: - case ICAL_LASTMODIFIED_PROPERTY: - case ICAL_LOCATION_PROPERTY: - case ICAL_MAXCOMPONENTSIZE_PROPERTY: - case ICAL_MAXDATE_PROPERTY: - case ICAL_MAXRESULTS_PROPERTY: - case ICAL_MAXRESULTSSIZE_PROPERTY: - case ICAL_METHOD_PROPERTY: - case ICAL_MINDATE_PROPERTY: - case ICAL_MULTIPART_PROPERTY: - case ICAL_NAME_PROPERTY: - case ICAL_ORGANIZER_PROPERTY: - case ICAL_OWNER_PROPERTY: - case ICAL_PERCENTCOMPLETE_PROPERTY: - case ICAL_PERMISSION_PROPERTY: - case ICAL_PRIORITY_PROPERTY: - case ICAL_PRODID_PROPERTY: - case ICAL_QUERY_PROPERTY: - case ICAL_QUERYLEVEL_PROPERTY: - case ICAL_QUERYID_PROPERTY: - case ICAL_QUERYNAME_PROPERTY: - case ICAL_RDATE_PROPERTY: - case ICAL_RECURACCEPTED_PROPERTY: - case ICAL_RECUREXPAND_PROPERTY: - case ICAL_RECURLIMIT_PROPERTY: - case ICAL_RECURRENCEID_PROPERTY: - case ICAL_RELATEDTO_PROPERTY: - case ICAL_RELCALID_PROPERTY: - case ICAL_REPEAT_PROPERTY: - case ICAL_REQUESTSTATUS_PROPERTY: - case ICAL_RESOURCES_PROPERTY: - case ICAL_RESTRICTION_PROPERTY: - break; - case ICAL_RRULE_PROPERTY: { - // struct icaltimetype start = icaltime_from_timet(1,0); - // struct icaltimetype start = icalproperty_get_dtstart(icalcomponent_get_first_property(comp,ICAL_DTSTART_PROPERTY)); - - // struct icaltimetype end = icaltime_today(); - struct icalrecurrencetype recur = icalproperty_get_rrule(prop); - struct icaltimetype next; - - icalrecur_iterator* ritr; - for(ritr = icalrecur_iterator_new(recur,start), - next = icalrecur_iterator_next(ritr); - !icaltime_is_null_time(next); - next = icalrecur_iterator_next(ritr)) { - - tt = icaltime_as_timet(next); - printf(" %s",ctime(&tt )); - - } - icalrecur_iterator_free(ritr); - - break; - } - case ICAL_SCOPE_PROPERTY: - case ICAL_SEQUENCE_PROPERTY: - case ICAL_STATUS_PROPERTY: - case ICAL_STORESEXPANDED_PROPERTY: - case ICAL_SUMMARY_PROPERTY: - case ICAL_TARGET_PROPERTY: - case ICAL_TRANSP_PROPERTY: - case ICAL_TRIGGER_PROPERTY: - case ICAL_TZID_PROPERTY: - case ICAL_TZNAME_PROPERTY: - case ICAL_TZOFFSETFROM_PROPERTY: - case ICAL_TZOFFSETTO_PROPERTY: - case ICAL_TZURL_PROPERTY: - case ICAL_UID_PROPERTY: - case ICAL_URL_PROPERTY: - case ICAL_VERSION_PROPERTY: - case ICAL_X_PROPERTY: - case ICAL_XLICCLASS_PROPERTY: - case ICAL_XLICCLUSTERCOUNT_PROPERTY: - case ICAL_XLICERROR_PROPERTY: - case ICAL_XLICMIMECHARSET_PROPERTY: - case ICAL_XLICMIMECID_PROPERTY: - case ICAL_XLICMIMECONTENTTYPE_PROPERTY: - case ICAL_XLICMIMEENCODING_PROPERTY: - case ICAL_XLICMIMEFILENAME_PROPERTY: - case ICAL_XLICMIMEOPTINFO_PROPERTY: - case ICAL_NO_PROPERTY: - break; - } - prop = icalcomponent_get_next_property(comp, ICAL_ANY_PROPERTY); - } - - switch (icalcomponent_isa(comp)) { - case ICAL_NO_COMPONENT: - case ICAL_ANY_COMPONENT: - break; - case ICAL_XROOT_COMPONENT: { - icalcomponent* child = icalcomponent_get_first_component(comp, ICAL_ANY_COMPONENT); - while(child) { - dumpComponent(child); - child = icalcomponent_get_next_component(comp, ICAL_ANY_COMPONENT); - } - break; - } - case ICAL_XATTACH_COMPONENT: - case ICAL_VEVENT_COMPONENT: - case ICAL_VTODO_COMPONENT: - case ICAL_VJOURNAL_COMPONENT: - case ICAL_VCALENDAR_COMPONENT: - case ICAL_VAGENDA_COMPONENT: - case ICAL_VFREEBUSY_COMPONENT: - case ICAL_VALARM_COMPONENT: - case ICAL_XAUDIOALARM_COMPONENT: - case ICAL_XDISPLAYALARM_COMPONENT: - case ICAL_XEMAILALARM_COMPONENT: - case ICAL_XPROCEDUREALARM_COMPONENT: - case ICAL_VTIMEZONE_COMPONENT: - case ICAL_XSTANDARD_COMPONENT: - case ICAL_XDAYLIGHT_COMPONENT: - case ICAL_X_COMPONENT: - case ICAL_VSCHEDULE_COMPONENT: - case ICAL_VQUERY_COMPONENT: - case ICAL_VREPLY_COMPONENT: - case ICAL_VCAR_COMPONENT: - case ICAL_VCOMMAND_COMPONENT: - case ICAL_XLICINVALID_COMPONENT: - case ICAL_XLICMIMEPART_COMPONENT: - break; - } -} -#endif - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/calendar/CalendarInvoker.h b/src/uscxml/plugins/invoker/calendar/CalendarInvoker.h deleted file mode 100644 index be50575..0000000 --- a/src/uscxml/plugins/invoker/calendar/CalendarInvoker.h +++ /dev/null @@ -1,99 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef CALENDARINVOKER_H_W09J90F0 -#define CALENDARINVOKER_H_W09J90F0 - -#include <uscxml/Interpreter.h> -extern "C" { -# include <libical/ical.h> -# include <libical/icalss.h> -} - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class CalendarEvent { -public: - CalendarEvent(icalcomponent* _icalComp); - ~CalendarEvent(); - icalcomponent* _icalComp; - icaltime_span _nextSpan; - bool _active; - struct icaltimetype _dtstart, _dtend; - time_t _dtduration; - - icaltime_span getNextDuration(time_t time); - std::string getId() { - return toStr((uintptr_t)this); - } - - std::map<icalproperty*, std::pair<icalrecur_iterator*, time_t> > _recIters; - operator Data(); -}; - -class CalendarInvoker : public InvokerImpl { -public: - CalendarInvoker(); - virtual ~CalendarInvoker(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("calendar"); - names.push_back("http://uscxml.tk.informatik.tu-darmstadt.de/#calendar"); - return names; - } - - virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void cancel(const std::string sendId); - virtual void invoke(const InvokeRequest& req); - - static void raiseEvent(void* userdata, const std::string eventId); - static Data toData(icalcomponent* comp); -protected: - icalcomponent* addIcal(const std::string& icalString); - void setupEvents(icalcomponent* comp); - void queueEvent(CalendarEvent* event); -#if 0 - void dumpComponent(icalcomponent* comp); -#endif - - tthread::recursive_mutex _mutex; - - std::string _calFile; - icalset* _icalSet; - icalcomponent* _icalComp; - - std::set<std::string> _eventIds; - std::map<std::string, CalendarEvent*> _events; -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(CalendarInvoker, InvokerImpl); -#endif - -} - - -#endif /* end of include guard: CALENDARINVOKER_H_W09J90F0 */ diff --git a/src/uscxml/plugins/invoker/expect/ExpectInvoker.cpp b/src/uscxml/plugins/invoker/expect/ExpectInvoker.cpp deleted file mode 100644 index 69ad686..0000000 --- a/src/uscxml/plugins/invoker/expect/ExpectInvoker.cpp +++ /dev/null @@ -1,360 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "ExpectInvoker.h" -#include <glog/logging.h> - -#include "uscxml/concurrency/DelayedEventQueue.h" - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -#include "uscxml/UUID.h" - -#undef USE_TCL_STUBS - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new ExpectInvokerProvider() ); - return true; -} -#endif - -Tcl_Interp* ExpectInvoker::_tcl = NULL; - -ExpectInvoker::ExpectInvoker() : _eventQueue(NULL) { -} - -ExpectInvoker::~ExpectInvoker() { - _eventQueue->stop(); -// if (_tcl) { -// Tcl_DeleteInterp(_tcl); -// } -}; - -boost::shared_ptr<InvokerImpl> ExpectInvoker::create(InterpreterImpl* interpreter) { - boost::shared_ptr<ExpectInvoker> invoker = boost::shared_ptr<ExpectInvoker>(new ExpectInvoker()); - return invoker; -} - -Data ExpectInvoker::getDataModelVariables() { - Data data; - return data; -} - -void ExpectInvoker::send(const SendRequest& req) { - EventContext* ctx = new EventContext(); - ctx->sendReq = req; - ctx->instance = this; - -// LOG(ERROR) << "################ " << req; - - std::string eventId = UUID::getUUID(); - _eventQueue->addEvent(eventId, ExpectInvoker::send, 0, ctx); - -// send(ctx, ""); -} - -void ExpectInvoker::send(void *userdata, const std::string event) { - - EventContext* ctx = (EventContext*)userdata; - if (!ctx) - return; - - if (!ctx->instance) { - delete(ctx); - return; - } - - const SendRequest& req = ctx->sendReq; - - if (iequals(req.name, "expect.match")) { - int nrCases = req.params.size(); - struct exp_case *cases = (struct exp_case*)malloc(sizeof(struct exp_case) * (nrCases + 1)); - memset(cases, 0, sizeof(exp_case) * (nrCases + 1)); - - /** - exp_end: indicates that no more patterns appear. - exp_glob: indicates that the pattern is a glob-style string pattern. - exp_exact: indicates that the pattern is an exact string. - exp_regexp: indicates that the pattern is a regexp-style string pattern. - exp_compiled: indicates that the pattern is a regexp-style string pattern, and that its compiled form is also provided. - exp_null: indicates that the pattern is a null (for debugging purposes, a string pattern must also follow). - */ - - Event::params_t::const_iterator paramIter = req.params.begin(); - int index = 0; - while (paramIter != req.params.end()) { - struct exp_case* expCase = &cases[index]; - size_t colonPos = paramIter->first.find(":"); - if (colonPos != std::string::npos) { - if (paramIter->first.substr(0, colonPos) == "regex") { - expCase->type = exp_regexp; - } else if(paramIter->first.substr(0, colonPos) == "glob") { - expCase->type = exp_glob; - } else if(paramIter->first.substr(0, colonPos) == "exact") { - expCase->type = exp_exact; - } else { - // if we can't make sense of the type - expCase->type = exp_exact; - } - } else { - expCase->type = exp_regexp; - } - - expCase->pattern = strdup(paramIter->second.atom.c_str()); -// LOG(ERROR) << "################ " << expCase->pattern; - - if (expCase->type == exp_regexp) { - expCase->re = TclRegComp(expCase->pattern); - if (expCase->re == NULL) { - LOG(ERROR) << TclGetRegError(); - expCase->type = exp_null; - } - } - expCase->value = index + 1; - paramIter++; - index++; - } - - assert(index == nrCases); - - cases[nrCases].type = exp_end; - - /** - * The functions wait until the output from a process matches one of the - * patterns, a specified time period has passed, or an EOF is seen. - */ - - int rc = 0; - // exp_fexpectv won't return on timeout when called in thread -// rc = exp_fexpectv(ctx->instance->_cmdFP, cases); - rc = exp_expectv(ctx->instance->_cmdFD, cases); - - if (rc == EXP_EOF) { - Event ev; - ev.name = "expect.match.eof"; - ev.data.compound["buffer"] = Data(exp_buffer, Data::VERBATIM); - ctx->instance->returnEvent(ev); - } else if (rc == EXP_TIMEOUT) { - Event ev; - ev.name = "expect.match.timeout"; - ev.data.compound["buffer"] = Data(exp_buffer, Data::VERBATIM); - ctx->instance->returnEvent(ev); - } else if (rc == EXP_FULLBUFFER) { - Event ev; - ev.name = "expect.match.fullbuffer"; - ev.data.compound["buffer"] = Data(exp_buffer, Data::VERBATIM); - ctx->instance->returnEvent(ev); - } else if (rc > 0) { - rc--; // we started at 1 - paramIter = req.params.begin(); - while(rc > 0) { - if (paramIter == req.params.end()) - break; - paramIter++; - rc--; - } - if (paramIter != req.params.end()) { - Event event; - - size_t colonPos = paramIter->first.find(":"); - if (colonPos != std::string::npos) { - std::string eventName = paramIter->first; - event.name = std::string("expect.match.") + eventName.substr(colonPos + 1, eventName.length() - (colonPos + 1)); - event.data.compound["type"] = Data(paramIter->first.substr(0, colonPos), Data::VERBATIM); - - } else { - event.name = std::string("expect.match.") + paramIter->first; - event.data.compound["type"] = Data("regex", Data::VERBATIM); - } - - event.data.compound["pattern"] = Data(paramIter->second.atom, Data::VERBATIM); - event.data.compound["buffer"] = Data(exp_buffer, Data::VERBATIM); - event.data.compound["start"] = Data((int)(exp_match - exp_buffer)); - event.data.compound["end"] = Data((int)(exp_match_end - exp_buffer)); - event.data.compound["match"] = Data(std::string(exp_buffer).substr(exp_match - exp_buffer, exp_match_end - exp_match), Data::VERBATIM); - ctx->instance->returnEvent(event); - } else { - // exp_fexpectl returned gibberish - assert(false); - } - } else { - // exp_fexpectl returned gibberish - assert(false); - } - - // free our memory - for (int i = 0; i < nrCases; i++) { - if (cases[i].pattern != NULL) - free(cases[i].pattern); - if (cases[i].re != NULL) - free(cases[i].re); - } - free(cases); - - } else if (iequals(req.name, "expect.send")) { - std::string toSend = unescape(req.content); - ctx->instance->_interpreter->getDataModel().replaceExpressions(toSend); - fwrite(toSend.c_str(), toSend.length(), 1, ctx->instance->_cmdFP); - } - - delete(ctx); -} - -void ExpectInvoker::cancel(const std::string sendId) { -} - -void ExpectInvoker::invoke(const InvokeRequest& req) { - if (_eventQueue == NULL) { - _eventQueue = new DelayedEventQueue(); - _eventQueue->start(); - } - - EventContext* ctx = new EventContext(); - ctx->invokeReq = req; - ctx->instance = this; - - //_eventQueue->addEvent(req.sendid, ExpectInvoker::invoke, 0, ctx); - invoke(ctx, ""); - -} - -void ExpectInvoker::invoke(void *userdata, const std::string event) { - EventContext* ctx = (EventContext*)userdata; - - if (!ctx) - return; - - if (!ctx->instance) { - delete(ctx); - return; - } - - const InvokeRequest& req = ctx->invokeReq; - - // moved here for thread local storage - if (ctx->instance->_tcl == NULL) { - ctx->instance->_tcl = Tcl_CreateInterp(); - if (ctx->instance->_tcl) { - Tcl_Init(ctx->instance->_tcl); - Expect_Init(ctx->instance->_tcl); - } - ctx->instance->_cmdFP = NULL; - - bool debug = false; - Event::getParam(req.params, "debug", debug); - if (debug) { - exp_is_debugging = 1; - } else { - exp_is_debugging = 0; - } - - int timeout = 20; - Event::getParam(req.params, "timeout", timeout); - exp_timeout = timeout; - - bool logUser = false; - Event::getParam(req.params, "loguser", logUser); - if (logUser) { - exp_loguser = 1; - } else { - exp_loguser = 0; - } - - // exp_interactive = 1; - exp_logfile = 0; - // exp_remove_nulls = 1; - // exp_ttyinit = 1; - - } else { -// assert(false); - } - - char* cmd = NULL; - char** args = NULL; - int nrArgs = 0; - - if (req.params.count("spawn")) { - // get command - std::string command; - Event::getParam(req.params, "spawn", command); - cmd = strdup(command.c_str()); - - // get arguments - nrArgs = req.params.count("argument"); - args = (char**)malloc(sizeof(char*) * nrArgs + 2); - args[0] = strdup(command.c_str()); - - size_t index = 1; - std::pair<Event::params_t::const_iterator, Event::params_t::const_iterator> argIterRange = req.params.equal_range("argument"); - Event::params_t::const_iterator argIter = argIterRange.first; - while(argIter != argIterRange.second) { - args[index] = strdup(argIter->second.atom.c_str()); - argIter++; - index++; - } - args[index] = (char*)0; - } else if(req.params.count("command")) { - - } - - // open socket - ctx->instance->_cmdFD = exp_spawnv(cmd, args); - if (ctx->instance->_cmdFD > 0) { - ctx->instance->_cmdFP = fdopen(ctx->instance->_cmdFD, "r+"); - - if (ctx->instance->_cmdFP) { - // disable buffering - setbuf(ctx->instance->_cmdFP,(char *)0); - Event event; - event.name = "spawn.success"; - ctx->instance->returnEvent(event); - } - } - - if (ctx->instance->_cmdFP == NULL || ctx->instance->_cmdFD <= 0) { - Event event; - event.name = "spawn.failed"; - event.data.compound["cause"] = Data(strerror(errno), Data::VERBATIM); - Tcl_Obj *infoObj = Tcl_GetVar2Ex(_tcl, "errorInfo", NULL, TCL_GLOBAL_ONLY); - if (infoObj) { - event.data.compound["errorInfo"] = Data(Tcl_GetString(infoObj), Data::VERBATIM); - } - - ctx->instance->returnEvent(event); - } - - if (cmd) - free(cmd); - - if (args) { - for (int i = 0; i < nrArgs + 1; i++) { - free(args[i]); - } - free(args); - } - -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/expect/ExpectInvoker.h b/src/uscxml/plugins/invoker/expect/ExpectInvoker.h deleted file mode 100644 index 25a2517..0000000 --- a/src/uscxml/plugins/invoker/expect/ExpectInvoker.h +++ /dev/null @@ -1,79 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef EXPECTINVOKER_H_W02590F0 -#define EXPECTINVOKER_H_W02590F0 - -#include <uscxml/Interpreter.h> - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -#include <tcl.h> -#include <expect_tcl.h> -#include <expect.h> - -namespace uscxml { - -class ExpectInvoker : public InvokerImpl { -public: - struct EventContext { - InvokeRequest invokeReq; - SendRequest sendReq; - ExpectInvoker* instance; - }; - - ExpectInvoker(); - virtual ~ExpectInvoker(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("expect"); - names.push_back("http://uscxml.tk.informatik.tu-darmstadt.de/#expect"); - return names; - } - - virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void cancel(const std::string sendId); - virtual void invoke(const InvokeRequest& req); - -protected: - - static void send(void *userdata, const std::string event); - static void invoke(void *userdata, const std::string event); - - static Tcl_Interp* _tcl; - FILE* _cmdFP; - int _cmdFD; - - DelayedEventQueue* _eventQueue; - -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(ExpectInvoker, InvokerImpl); -#endif - -} - - -#endif /* end of include guard: EXPECTINVOKER_H_W02590F0 */ diff --git a/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.cpp b/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.cpp deleted file mode 100644 index f67e58f..0000000 --- a/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.cpp +++ /dev/null @@ -1,463 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include <boost/algorithm/string.hpp> - -#include "FFMPEGInvoker.h" -#include "uscxml/messages/Blob.h" - -#include <glog/logging.h> - -#include <libavutil/imgutils.h> -#include <libavcodec/avcodec.h> -#include <fstream> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -#define STREAM_FRAME_RATE 25 /* 25 images/s */ -#define BMP_FORMAT PIX_FMT_BGR24 - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new FFMPEGInvokerProvider() ); - return true; -} -#endif - -FFMPEGInvoker::FFMPEGInvoker() { -} - -FFMPEGInvoker::~FFMPEGInvoker() { -}; - -boost::shared_ptr<InvokerImpl> FFMPEGInvoker::create(InterpreterImpl* interpreter) { - boost::shared_ptr<FFMPEGInvoker> invoker = boost::shared_ptr<FFMPEGInvoker>(new FFMPEGInvoker()); - // Register all formats and codecs - this ought to be done just once - av_register_all(); - return invoker; -} - -Data FFMPEGInvoker::getDataModelVariables() { - Data data; - - AVCodec* codec = NULL; - while((codec = av_codec_next(codec))) { - AVCodec* codecInst = avcodec_find_encoder(codec->id); - if (!codecInst) - continue; - - switch (codec->type) { - case AVMEDIA_TYPE_VIDEO: { - Data codecData; - codecData.compound["name"] = Data(codec->name, Data::VERBATIM); - codecData.compound["longName"] = Data(codec->long_name, Data::VERBATIM); - data.compound["video"].compound[codec->name] = codecData; - break; - } - case AVMEDIA_TYPE_AUDIO: { - Data codecData; - codecData.compound["name"] = Data(codec->name, Data::VERBATIM); - codecData.compound["longName"] = Data(codec->long_name, Data::VERBATIM); - data.compound["audio"].compound[codec->name] = codecData; - break; - } - default: - break; - } - } - - return data; -} - -void FFMPEGInvoker::invoke(const InvokeRequest& req) { - int nrThreads = 1; - Event::getParam(req.params, "threads", nrThreads); - - _isRunning = true; - for (size_t i = 0; i < nrThreads; i++) { - _threads.insert(new tthread::thread(FFMPEGInvoker::run, this)); - } -} - -void FFMPEGInvoker::send(const SendRequest& req) { - SendRequest reqCopy = req; - - if (iequals(req.name, "render.start")) { - // create a new encoding context - int ret; - EncodingContext* ctx = new EncodingContext(); - tthread::lock_guard<tthread::recursive_mutex> lock(ctx->mutex); - - std::string context; - Event::getParam(req.params, "context", context); - - ctx->extension = "mpeg"; - Event::getParam(req.params, "format", ctx->extension); - - Event::getParam(req.params, "width", ctx->width); - Event::getParam(req.params, "height", ctx->height); - - if (!ctx->width || !ctx->height) - return; - - ctx->filename = URL::getTmpFilename(); - - /* allocate the output media context */ - avformat_alloc_output_context2(&ctx->formatCtx, NULL, ctx->extension.c_str(), ctx->filename.c_str()); - if (!ctx->formatCtx) { - printf("Could not deduce output format from file extension: using MPEG.\n"); - avformat_alloc_output_context2(&ctx->formatCtx, NULL, "mpeg", ctx->filename.c_str()); - } - if (!ctx->formatCtx) { - return; - } - ctx->format = ctx->formatCtx->oformat; - - /* Add the audio and video streams using the default format codecs - * and initialize the codecs. */ - ctx->videoStream = NULL; - - if (ctx->format->video_codec != AV_CODEC_ID_NONE) { - ctx->videoStream = addStream(ctx, ctx->formatCtx, &ctx->videoCodec, ctx->format->video_codec); - } - - /* Now that all the parameters are set, we can open the audio and - * video codecs and allocate the necessary encode buffers. */ - if (ctx->videoStream) - openVideo(ctx, ctx->formatCtx, ctx->videoCodec, ctx->videoStream); - - /* open the output file, if needed */ - if (!(ctx->format->flags & AVFMT_NOFILE)) { - ret = avio_open(&ctx->formatCtx->pb, ctx->filename.c_str(), AVIO_FLAG_WRITE); - if (ret < 0) { - // fprintf(stderr, "Could not open '%s': %s\n", ctx->filename.c_str(), - // av_err2str(ret)); - return; - } - } - - /* Write the stream header, if any. */ - ret = avformat_write_header(ctx->formatCtx, NULL); - if (ret < 0) { - // fprintf(stderr, "Error occurred when opening output file: %s\n", - // av_err2str(ret)); - return; - } - - if (ctx->frame) - ctx->frame->pts = 0; - - _encoders[context] = ctx; - } else if(iequals(req.name, "render.frame")) { - _workQueue.push(req); - } else if(iequals(req.name, "render.end")) { - _workQueue.push(req); - } -} - -void FFMPEGInvoker::cancel(const std::string sendId) { -} - -void FFMPEGInvoker::run(void* instance) { - FFMPEGInvoker* INSTANCE = (FFMPEGInvoker*)instance; - while(true) { - SendRequest req = INSTANCE->_workQueue.pop(); - if (INSTANCE->_isRunning) { - INSTANCE->process(req); - } else { - return; - } - } -} - -void FFMPEGInvoker::finish(EncodingContext* ctx, const SendRequest& req) { - av_write_trailer(ctx->formatCtx); - - /* Close each codec. */ - if (ctx->videoStream) - closeVideo(ctx, ctx->formatCtx, ctx->videoStream); - - if (!(ctx->formatCtx->oformat->flags & AVFMT_NOFILE)) - /* Close the output file. */ - avio_close(ctx->formatCtx->pb); - - /* free the stream */ - avformat_free_context(ctx->formatCtx); - - // read file - std::ifstream movieFile(ctx->filename.c_str()); - movieFile.seekg(0, std::ios::end); - size_t length = movieFile.tellg(); - movieFile.seekg(0, std::ios::beg); - - char* movieBuffer = (char*)malloc(length); - movieFile.read(movieBuffer, length); - - // move to desktop for checking -// int err = rename(ctx->filename.c_str(), "/Users/sradomski/Desktop/foo.mpg"); -// if (err) { -// printf("%s", strerror(errno)); -// } - - std::string context; - Event::getParam(req.params, "context", context); - - Event event; - event.name = "render.done"; - event.data.compound["context"] = Data(context, Data::INTERPRETED); - event.data.compound["movie"] = Data(movieBuffer, length, "video/mpeg", true); - event.data.compound["filename"] = Data(std::string("movie.") + ctx->extension, Data::VERBATIM); - - returnEvent(event); -} - -void FFMPEGInvoker::process(const SendRequest& req) { - - std::string context; - Event::getParam(req.params, "context", context); - if (_encoders.find(context) == _encoders.end()) { - return; - } - - EncodingContext* ctx = _encoders[context]; - tthread::lock_guard<tthread::recursive_mutex> lock(ctx->mutex); - - // finish encoding and return - if(iequals(req.name, "render.end")) { - finish(ctx, req); - delete _encoders[context]; - _encoders.erase(context); - } - - Data image; - Event::getParam(req.params, "frame", image); - if (image.empty()) { - return; - } - - std::string format = "bmp"; - Event::getParam(req.params, "format", format); - - writeVideoFrame(ctx, ctx->formatCtx, ctx->videoStream, image.binary); - ctx->frame->pts += av_rescale_q(1, ctx->videoStream->codec->time_base, ctx->videoStream->time_base); - -} - -AVStream* FFMPEGInvoker::addStream(EncodingContext* ctx, AVFormatContext *oc, AVCodec **codec, - enum AVCodecID codec_id) { - AVCodecContext *c; - AVStream *st; - - /* find the encoder */ - *codec = avcodec_find_encoder(codec_id); - if (!(*codec)) { - fprintf(stderr, "Could not find encoder for '%s'\n", - avcodec_get_name(codec_id)); - return NULL; - } - - st = avformat_new_stream(oc, *codec); - ctx->videoPixFmt = (*codec)->pix_fmts[0]; - if (!st) { - fprintf(stderr, "Could not allocate stream\n"); - return NULL; - } - st->id = oc->nb_streams-1; - c = st->codec; - - switch ((*codec)->type) { - case AVMEDIA_TYPE_AUDIO: - c->sample_fmt = AV_SAMPLE_FMT_FLTP; - c->bit_rate = 64000; - c->sample_rate = 44100; - c->channels = 2; - break; - - case AVMEDIA_TYPE_VIDEO: - c->codec_id = codec_id; - - c->bit_rate = 800000; - /* Resolution must be a multiple of two. */ - c->width = ctx->width; - c->height = ctx->height; - /* timebase: This is the fundamental unit of time (in seconds) in terms - * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/framerate and timestamp increments should be - * identical to 1. */ - c->time_base.den = STREAM_FRAME_RATE; - c->time_base.num = 1; - c->gop_size = 12; /* emit one intra frame every twelve frames at most */ - c->pix_fmt = ctx->videoPixFmt; - if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) { - /* just for testing, we also add B frames */ - c->max_b_frames = 2; - } - if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) { - /* Needed to avoid using macroblocks in which some coeffs overflow. - * This does not happen with normal video, it just happens here as - * the motion of the chroma plane does not match the luma plane. */ - c->mb_decision = 2; - } - break; - - default: - break; - } - - /* Some formats want stream headers to be separate. */ - if (oc->oformat->flags & AVFMT_GLOBALHEADER) - c->flags |= CODEC_FLAG_GLOBAL_HEADER; - - return st; -} - -void FFMPEGInvoker::openVideo(EncodingContext* ctx, AVFormatContext *oc, AVCodec *codec, AVStream *st) { - int ret; - AVCodecContext *c = st->codec; - - /* open the codec */ - ret = avcodec_open2(c, codec, NULL); - if (ret < 0) { - // fprintf(stderr, "Could not open video codec: %s\n", av_err2str(ret)); - return; - } - - /* allocate and init a re-usable frame */ - ctx->frame = avcodec_alloc_frame(); - if (!ctx->frame) { - fprintf(stderr, "Could not allocate video frame\n"); - return; - } - - /* Allocate the encoded raw picture. */ - ret = avpicture_alloc(&ctx->dst_picture, c->pix_fmt, c->width, c->height); - if (ret < 0) { -// fprintf(stderr, "Could not allocate picture: %s\n", av_err2str(ret)); - return; - } - - /* If the output format is not YUV420P, then a temporary YUV420P - * picture is needed too. It is then converted to the required - * output format. */ - if (c->pix_fmt != BMP_FORMAT) { - ret = avpicture_alloc(&ctx->src_picture, BMP_FORMAT, c->width, c->height); - if (ret < 0) { - // fprintf(stderr, "Could not allocate temporary picture: %s\n", - // av_err2str(ret)); - return; - } - } - - /* copy data and linesize picture pointers to frame */ - *((AVPicture *)ctx->frame) = ctx->dst_picture; -} - -void FFMPEGInvoker::writeVideoFrame(EncodingContext* ctx, AVFormatContext *oc, AVStream *st, Blob image) { - int ret; - AVCodecContext *c = st->codec; - - if (c->pix_fmt != BMP_FORMAT) { - /* as we only generate a YUV420P picture, we must convert it - * to the codec pixel format if needed */ - if (!ctx->sws_ctx) { - ctx->sws_ctx = sws_getContext(c->width, c->height, BMP_FORMAT, - c->width, c->height, c->pix_fmt, - ctx->sws_flags, NULL, NULL, NULL); - if (!ctx->sws_ctx) { - fprintf(stderr, - "Could not initialize the conversion context\n"); - return; - } - } - - uint32_t headerOffset = 0; - headerOffset += image._impl->data[10] << 0; - headerOffset += image._impl->data[11] << 8; - headerOffset += image._impl->data[12] << 16; - headerOffset += image._impl->data[13] << 24; - -// std::cout << headerOffset + (c->width * c->height) << " / " << image->_size << std::endl; - - ret = avpicture_fill(&ctx->src_picture, (uint8_t*)(image._impl->data + headerOffset), BMP_FORMAT, c->width, c->height); - if (ret < 0) { - fprintf(stderr, - "Could not fill image from given bitmap\n"); - } - sws_scale(ctx->sws_ctx, - (const uint8_t * const *)ctx->src_picture.data, ctx->src_picture.linesize, - 0, c->height, ctx->dst_picture.data, ctx->dst_picture.linesize); - } else { - avpicture_fill(&ctx->dst_picture, (uint8_t*)image._impl->data, c->pix_fmt, c->width, c->height); - } - - if (oc->oformat->flags & AVFMT_RAWPICTURE) { - /* Raw video case - directly store the picture in the packet */ - AVPacket pkt; - av_init_packet(&pkt); - - pkt.flags |= AV_PKT_FLAG_KEY; - pkt.stream_index = st->index; - pkt.data = ctx->dst_picture.data[0]; - pkt.size = sizeof(AVPicture); - - ret = av_interleaved_write_frame(oc, &pkt); - } else { - AVPacket pkt = { 0 }; - int got_packet; - av_init_packet(&pkt); - - /* encode the image */ - ret = avcodec_encode_video2(c, &pkt, ctx->frame, &got_packet); - if (ret < 0) { - // fprintf(stderr, "Error encoding video frame: %s\n", av_err2str(ret)); - return; - } - /* If size is zero, it means the image was buffered. */ - - if (!ret && got_packet && pkt.size) { - pkt.stream_index = st->index; - - /* Write the compressed frame to the media file. */ -// ret = av_write_frame(oc, &pkt); - ret = av_interleaved_write_frame(oc, &pkt); - } else { - ret = 0; - } - } - if (ret != 0) { -// fprintf(stderr, "Error while writing video frame: %s\n", av_err2str(ret)); - return; - } - ctx->frame_count++; -} - -void FFMPEGInvoker::closeVideo(EncodingContext* ctx, AVFormatContext *oc, AVStream *st) { - avcodec_close(st->codec); -// av_free(ctx->src_picture.data[0]); - av_free(ctx->dst_picture.data[0]); - av_free(ctx->frame); -} - - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.h b/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.h deleted file mode 100644 index 81589bb..0000000 --- a/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.h +++ /dev/null @@ -1,115 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef FFMPEGINVOKER_H_VQD1V1C2 -#define FFMPEGINVOKER_H_VQD1V1C2 - -#include <uscxml/Interpreter.h> - -extern "C" { -#include <libavutil/avutil.h> -#include <libavformat/avformat.h> -#include <libswscale/swscale.h> -} - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class FFMPEGInvoker : public InvokerImpl { -public: - FFMPEGInvoker(); - virtual ~FFMPEGInvoker(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("ffmpeg"); - names.push_back("http://uscxml.tk.informatik.tu-darmstadt.de/#ffmpeg"); - return names; - } - - virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void cancel(const std::string sendId); - virtual void invoke(const InvokeRequest& req); - -protected: - class EncodingContext { - public: - EncodingContext() : - format(NULL), - formatCtx(NULL), - audioStream(NULL), videoStream(NULL), - audioCodec(NULL), videoCodec(NULL), - audioTime(0), videoTime(0), - frame(NULL), - frame_count(0), - width(0), - height(0), - sws_flags(SWS_BICUBIC), - sws_ctx(NULL) {} - - virtual ~EncodingContext() { - if (sws_ctx) - sws_freeContext(sws_ctx); - } - - tthread::recursive_mutex mutex; - PixelFormat videoPixFmt; - std::string filename; - AVOutputFormat* format; - AVFormatContext* formatCtx; - AVStream *audioStream, *videoStream; - AVCodec *audioCodec, *videoCodec, *imageCodec; - double audioTime, videoTime; - AVFrame *frame; - AVPicture src_picture, dst_picture; - int frame_count; - size_t width, height; - int sws_flags; - SwsContext *sws_ctx; - std::string extension; - }; - - AVStream* addStream(EncodingContext* ctx, AVFormatContext *oc, AVCodec **codec, enum AVCodecID codec_id); - void openVideo(EncodingContext* ctx, AVFormatContext *oc, AVCodec *codec, AVStream *st); - void writeVideoFrame(EncodingContext* ctx, AVFormatContext *oc, AVStream *st, Blob image); - void closeVideo(EncodingContext* ctx, AVFormatContext *oc, AVStream *st); - - static void run(void*); - void finish(EncodingContext* ctx, const SendRequest& req); - void process(const SendRequest& req); - - std::set<tthread::thread*> _threads; - uscxml::concurrency::BlockingQueue<SendRequest> _workQueue; - bool _isRunning; - std::map<std::string, EncodingContext*> _encoders; -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(FFMPEGInvoker, InvokerImpl); -#endif - -} - - -#endif /* end of include guard: FFMPEGINVOKER_H_VQD1V1C2 */ diff --git a/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp b/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp deleted file mode 100644 index 63d1628..0000000 --- a/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp +++ /dev/null @@ -1,443 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include <boost/algorithm/string.hpp> - -#include "DirMonInvoker.h" -#include <glog/logging.h> - -#include "uscxml/config.h" - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -#include <sys/stat.h> -#ifndef WIN32 -#include <dirent.h> -#else -#include <strsafe.h> -#endif - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new DirMonInvokerProvider() ); - return true; -} -#endif - -DirMonInvoker::DirMonInvoker() : - _reportExisting(true), - _reportHidden(false), - _recurse(false), - _thread(NULL), - _watcher(NULL) { -} - -DirMonInvoker::~DirMonInvoker() { - _isRunning = false; - if (_thread) { - _thread->join(); - delete _thread; - } - if (_watcher) - delete(_watcher); -}; - -boost::shared_ptr<InvokerImpl> DirMonInvoker::create(InterpreterImpl* interpreter) { - boost::shared_ptr<DirMonInvoker> invoker = boost::shared_ptr<DirMonInvoker>(new DirMonInvoker()); - invoker->_interpreter = interpreter; - return invoker; -} - -Data DirMonInvoker::getDataModelVariables() { - tthread::lock_guard<tthread::recursive_mutex> lock(_mutex); - - Data data; - data.compound["dir"] = Data(_dir, Data::VERBATIM); - - std::set<std::string>::iterator suffixIter = _suffixes.begin(); - while(suffixIter != _suffixes.end()) { - data.compound["suffixes"].array.push_back(Data(*suffixIter, Data::VERBATIM)); - suffixIter++; - } - - std::map<std::string, struct stat> entries = _watcher->getAllEntries(); - std::map<std::string, struct stat>::iterator entryIter = entries.begin(); - while(entryIter != entries.end()) { - data.compound["file"].compound[entryIter->first].compound["mtime"] = Data(toStr(entryIter->second.st_mtime), Data::INTERPRETED); - data.compound["file"].compound[entryIter->first].compound["ctime"] = Data(toStr(entryIter->second.st_mtime), Data::INTERPRETED); - data.compound["file"].compound[entryIter->first].compound["atime"] = Data(toStr(entryIter->second.st_mtime), Data::INTERPRETED); - data.compound["file"].compound[entryIter->first].compound["size"] = Data(toStr(entryIter->second.st_mtime), Data::INTERPRETED); - entryIter++; - } - - return data; -} - -void DirMonInvoker::send(const SendRequest& req) { -} - -void DirMonInvoker::cancel(const std::string sendId) { -} - -void DirMonInvoker::invoke(const InvokeRequest& req) { - if (req.params.find("dir") == req.params.end()) { - LOG(ERROR) << "No dir param given"; - return; - } - - if (req.params.find("reportexisting") != req.params.end() && - iequals(req.params.find("reportexisting")->second.atom, "false")) - _reportExisting = false; - if (req.params.find("recurse") != req.params.end() && - iequals(req.params.find("recurse")->second.atom, "true")) - _recurse = true; - if (req.params.find("reporthidden") != req.params.end() && - iequals(req.params.find("reporthidden")->second.atom, "true")) - _reportHidden = true; - - std::string suffixList; - if (req.params.find("suffix") != req.params.end()) { - suffixList = req.params.find("suffix")->second.atom; - } else if (req.params.find("suffixes") != req.params.end()) { - suffixList = req.params.find("suffixes")->second.atom; - } - - if (suffixList.size() > 0) { - // seperate path into components - std::stringstream ss(suffixList); - std::string item; - while(std::getline(ss, item, ' ')) { - if (item.length() == 0) - continue; - _suffixes.insert(item); - } - } - - std::multimap<std::string, Data>::const_iterator dirIter = req.params.find("dir"); - while(dirIter != req.params.upper_bound("dir")) { - // this is simplified - Data might be more elaborate than a simple string atom - URL url(dirIter->second.atom); - if (!url.toAbsolute(_interpreter->getBaseURL(req.elem)) || !iequals(url.scheme(), "file")) { - LOG(ERROR) << "Given directory '" << dirIter->second << "' cannot be transformed to absolute path"; - } else { - _dir = url.path(); - } - break; - } - - _watcher = new DirectoryWatch(_dir, _recurse); - _watcher->addMonitor(this); - _watcher->updateEntries(true); - - _isRunning = true; - _thread = new tthread::thread(DirMonInvoker::run, this); -} - -void DirMonInvoker::run(void* instance) { - while(((DirMonInvoker*)instance)->_isRunning) { - { - tthread::lock_guard<tthread::recursive_mutex> lock(((DirMonInvoker*)instance)->_mutex); - ((DirMonInvoker*)instance)->_watcher->updateEntries(); - } - tthread::this_thread::sleep_for(tthread::chrono::milliseconds(20)); - } -} - -void DirMonInvoker::handleChanges(DirectoryWatch::Action action, const std::string reportedDir, const std::string reportedFilename, struct stat fileStat) { - -// std::cout << action << " on " << reportedFilename << std::endl; - - std::string path; // complete path to the file including filename - std::string relPath; // path relative to monitored directory including filename - std::string dir; // the name of the directory we monitor - std::string relDir; // the directory from dir to the actual directory where we found a file - std::string basename; // filename including suffix - std::string strippedName; // filename without the suffix - std::string extension; // the extension - - dir = reportedDir; - - path = dir + reportedFilename; - boost::algorithm::replace_all(path, "\\", "/"); - boost::algorithm::replace_all(path, "//", "/"); - - assert(boost::algorithm::starts_with(path, dir)); - relPath = path.substr(dir.length()); - assert(boost::equal(path, dir + relPath)); - - size_t lastSep; - if ((lastSep = path.find_last_of(PATH_SEPERATOR)) != std::string::npos) { - lastSep++; - basename = path.substr(lastSep, path.length() - lastSep); - } else { - assert(false); - } - assert(boost::algorithm::ends_with(relPath, basename)); - - // extension is the suffix and strippedName the basename without the suffix - size_t lastDot; - if ((lastDot = basename.find_last_of(".")) != std::string::npos) { - if (lastDot == 0) { - // hidden file - strippedName = basename; - } else { - extension = basename.substr(lastDot + 1); - strippedName = basename.substr(0, lastDot); - } - } else { - strippedName = basename; - } - - relDir = relPath.substr(0, relPath.length() - basename.length()); - assert(boost::equal(path, dir + relDir + basename)); - - // return if this is a hidden file - if (boost::algorithm::starts_with(basename, ".") && !_reportHidden) - return; - - // ilter suffixes - if (_suffixes.size() > 0) { - bool validSuffix = false; - std::set<std::string>::iterator suffixIter = _suffixes.begin(); - while(suffixIter != _suffixes.end()) { - if (boost::algorithm::ends_with(path, *suffixIter)) { - validSuffix = true; - break; - } - suffixIter++; - } - if (!validSuffix) - return; - } - - Event event; - event.invokeid = _invokeId; - - switch (action) { - case DirectoryWatch::EXISTING: - event.name = "file.existing"; - break; - case DirectoryWatch::ADDED: - event.name = "file.added"; - break; - case DirectoryWatch::DELETED: - event.name = "file.deleted"; - break; - case DirectoryWatch::MODIFIED: - event.name = "file.modified"; - break; - default: - break; - } - - if (action != DirectoryWatch::DELETED) { - event.data.compound["file"].compound["mtime"] = Data(toStr(fileStat.st_mtime), Data::INTERPRETED); - event.data.compound["file"].compound["ctime"] = Data(toStr(fileStat.st_ctime), Data::INTERPRETED); - event.data.compound["file"].compound["atime"] = Data(toStr(fileStat.st_atime), Data::INTERPRETED); - event.data.compound["file"].compound["size"] = Data(toStr(fileStat.st_size), Data::INTERPRETED); - } - - event.data.compound["file"].compound["name"] = Data(basename, Data::VERBATIM); - event.data.compound["file"].compound["extension"] = Data(extension, Data::VERBATIM); - event.data.compound["file"].compound["strippedName"] = Data(strippedName, Data::VERBATIM); - event.data.compound["file"].compound["relPath"] = Data(relPath, Data::VERBATIM); - event.data.compound["file"].compound["relDir"] = Data(relDir, Data::VERBATIM); - event.data.compound["file"].compound["path"] = Data(path, Data::VERBATIM); - event.data.compound["file"].compound["dir"] = Data(dir, Data::VERBATIM); - - returnEvent(event); -} - -DirectoryWatch::~DirectoryWatch() { - std::map<std::string, DirectoryWatch*>::iterator dirIter = _knownDirs.begin(); - while(dirIter != _knownDirs.end()) { - delete(dirIter->second); - dirIter++; - } - -} - -void DirectoryWatch::reportAsDeleted() { - std::map<std::string, struct stat>::iterator fileIter = _knownEntries.begin(); - while(fileIter != _knownEntries.end()) { - if (fileIter->second.st_mode & S_IFDIR) { - _knownDirs[fileIter->first]->reportAsDeleted(); - delete _knownDirs[fileIter->first]; - _knownDirs.erase(fileIter->first); - } else { - _monitors_t::iterator monIter = _monitors.begin(); - while(monIter != _monitors.end()) { - (*monIter)->handleChanges(DELETED, _dir, _relDir + PATH_SEPERATOR + fileIter->first, fileIter->second); - monIter++; - } - } - _knownEntries.erase(fileIter++); -// fileIter++; - } - assert(_knownDirs.size() == 0); - assert(_knownEntries.size() == 0); -} - -void DirectoryWatch::updateEntries(bool reportAsExisting) { - _monitors_t::iterator monIter; - if (_dir[_dir.length() - 1] == PATH_SEPERATOR) - _dir = _dir.substr(0, _dir.length() - 1); - - // stat directory for modification date - struct stat dirStat; - if (stat((_dir + _relDir).c_str(), &dirStat) != 0) { - LOG(ERROR) << "Error with stat on directory " << _dir << ": " << strerror(errno); - return; - } - - if ((unsigned)dirStat.st_mtime >= (unsigned)_lastChecked) { -// std::cout << "dirStat.st_mtime: " << dirStat.st_mtime << " / _lastChecked: " << _lastChecked << std::endl; - - // there are changes in the directory - std::set<std::string> currEntries; - -#ifndef WIN32 - DIR *dp; - dp = opendir((_dir + _relDir).c_str()); - if (dp == NULL) { - LOG(ERROR) << "Error opening directory " << _dir + _relDir << ": " << strerror(errno); - return; - } - // iterate all entries and see what changed - struct dirent* entry; - while((entry = readdir(dp))) { - std::string dname = entry->d_name; -#else - WIN32_FIND_DATA ffd; - HANDLE hFind = INVALID_HANDLE_VALUE; - TCHAR szDir[MAX_PATH]; - StringCchCopy(szDir, MAX_PATH, _dir.c_str()); - StringCchCat(szDir, MAX_PATH, TEXT("\\*")); - - hFind = FindFirstFile(szDir, &ffd); - do { - std::string dname = ffd.cFileName; -#endif - - // see if the file was changed - std::string filename = _dir + _relDir + "/" + dname; -// asprintf(&filename, "%s/%s", (_dir + _relDir).c_str(), dname.c_str()); - - struct stat fileStat; - if (stat(filename.c_str(), &fileStat) != 0) { - LOG(ERROR) << "Error with stat on directory entry: " << filename << ": " << strerror(errno); - continue; - } - - if (fileStat.st_mode & S_IFDIR) { - if (boost::equals(dname, ".") || boost::equals(dname, "..")) { - continue; // do not report . or .. - } - } - - currEntries.insert(dname); - - if (_knownEntries.find(dname) != _knownEntries.end()) { - // we have seen this entry before - struct stat oldStat = _knownEntries[dname]; - if (oldStat.st_mtime < fileStat.st_mtime) { - monIter = _monitors.begin(); - while(monIter != _monitors.end()) { - (*monIter)->handleChanges(MODIFIED, _dir, _relDir + PATH_SEPERATOR + dname, fileStat); - monIter++; - } - } - } else { - // we have not yet seen this entry - if (fileStat.st_mode & S_IFDIR) { - _knownDirs[dname] = new DirectoryWatch(_dir, _relDir + PATH_SEPERATOR + dname); - monIter = _monitors.begin(); - while(monIter != _monitors.end()) { - _knownDirs[dname]->addMonitor(*monIter); - monIter++; - } - } else { - monIter = _monitors.begin(); - while(monIter != _monitors.end()) { - if (reportAsExisting) { - (*monIter)->handleChanges(EXISTING, _dir, _relDir + PATH_SEPERATOR + dname, fileStat); - } else { - (*monIter)->handleChanges(ADDED, _dir, _relDir + PATH_SEPERATOR + dname, fileStat); - } - monIter++; - } - } - } - - _knownEntries[dname] = fileStat; // gets copied on insertion -#ifndef WIN32 - } - closedir(dp); -#else - } - while (FindNextFile(hFind, &ffd) != 0); - FindClose(hFind); -#endif - // are there any known entries we have not seen this time around? - std::map<std::string, struct stat>::iterator fileIter = _knownEntries.begin(); - while(fileIter != _knownEntries.end()) { - if (currEntries.find(fileIter->first) == currEntries.end()) { - // we used to know this file - if (fileIter->second.st_mode & S_IFDIR) { - if (_recurse) { - _knownDirs[fileIter->first]->reportAsDeleted(); - delete _knownDirs[fileIter->first]; - _knownDirs.erase(fileIter->first); - } - } else { - monIter = _monitors.begin(); - while(monIter != _monitors.end()) { - (*monIter)->handleChanges(DELETED, _dir, _relDir + PATH_SEPERATOR + fileIter->first, fileIter->second); - monIter++; - } - } - _knownEntries.erase(fileIter++); - } else { - fileIter++; - } - } - // remember when we last checked the directory for modifications -#ifndef WIN32 - time(&_lastChecked); -#else - // TODO: this will fail with sub-millisecond updates to the directory - _lastChecked = dirStat.st_mtime + 1; -#endif - // update all directories - } - if (_recurse) { - std::map<std::string, DirectoryWatch*>::iterator dirIter = _knownDirs.begin(); - while(dirIter != _knownDirs.end()) { - dirIter->second->updateEntries(); - dirIter++; - } - } -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.h b/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.h deleted file mode 100644 index 85f5174..0000000 --- a/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.h +++ /dev/null @@ -1,139 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef DIRMONINVOKER_H_W09J90F0 -#define DIRMONINVOKER_H_W09J90F0 - -#include <uscxml/config.h> -#include <uscxml/Interpreter.h> -#include <map> -#include <sys/stat.h> - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class DirectoryWatchMonitor; - -class DirectoryWatch { -public: - enum Action { - ADDED = 1, - MODIFIED = 2, - DELETED = 4, - EXISTING = 8 - }; - - DirectoryWatch(const std::string& dir, bool recurse = false) : _dir(dir), _recurse(recurse), _lastChecked(0) {} - ~DirectoryWatch(); - - void addMonitor(DirectoryWatchMonitor* monitor) { - _monitors.insert(monitor); - } - void removeMonitor(DirectoryWatchMonitor* monitor) { - _monitors.erase(monitor); - } - void updateEntries(bool reportAsExisting = false); - void reportAsDeleted(); - - std::map<std::string, struct stat> getAllEntries() { - std::map<std::string, struct stat> entries; - entries.insert(_knownEntries.begin(), _knownEntries.end()); - - std::map<std::string, DirectoryWatch*>::iterator dirIter = _knownDirs.begin(); - while(dirIter != _knownDirs.end()) { - std::map<std::string, struct stat> dirEntries = dirIter->second->getAllEntries(); - std::map<std::string, struct stat>::iterator dirEntryIter = dirEntries.begin(); - while(dirEntryIter != dirEntries.end()) { - entries[dirIter->first + '/' + dirEntryIter->first] = dirEntryIter->second; - dirEntryIter++; - } - dirIter++; - } - - return entries; - } - -protected: - DirectoryWatch(const std::string& dir, const std::string& relDir) : _dir(dir), _relDir(relDir), _recurse(true), _lastChecked(0) {} - - std::string _dir; - std::string _relDir; - - bool _recurse; - std::map<std::string, struct stat> _knownEntries; - std::map<std::string, DirectoryWatch*> _knownDirs; - std::set<DirectoryWatchMonitor*> _monitors; - typedef std::set<DirectoryWatchMonitor*> _monitors_t; - time_t _lastChecked; -}; - -class DirectoryWatchMonitor { -public: - virtual void handleChanges(DirectoryWatch::Action action, const std::string dir, const std::string file, struct stat fileStat) = 0; -}; - -class DirMonInvoker : public InvokerImpl, public DirectoryWatchMonitor { -public: - DirMonInvoker(); - virtual ~DirMonInvoker(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("dirmon"); - names.push_back("DirectoryMonitor"); - names.push_back("http://uscxml.tk.informatik.tu-darmstadt.de/#dirmon"); - return names; - } - - virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void cancel(const std::string sendId); - virtual void invoke(const InvokeRequest& req); - - virtual void handleChanges(DirectoryWatch::Action action, const std::string dir, const std::string file, struct stat fileStat); - - static void run(void* instance); - -protected: - bool _reportExisting; - bool _reportHidden; - bool _recurse; - - std::string _dir; - std::set<std::string> _suffixes; - - bool _isRunning; - tthread::thread* _thread; - tthread::recursive_mutex _mutex; - - DirectoryWatch* _watcher; -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(DirMonInvoker, InvokerImpl); -#endif - -} - - -#endif /* end of include guard: DIRMONINVOKER_H_W09J90F0 */ diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.cpp b/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.cpp deleted file mode 100644 index bf4fac7..0000000 --- a/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "CompositeDisplay.h" -#if 0 -#ifdef MACOSX -USE_GRAPICSWINDOW_IMPLEMENTATION(Cocoa) -#else -USE_GRAPHICSWINDOW() -#endif -#endif - -CompositeDisplay::CompositeDisplay(unsigned int x, - unsigned int y, - unsigned int width, - unsigned int height, - int screenId) { - _waitForViewOp = false; - unsigned int tWidth = 0; - unsigned int tHeight = 0; - getResolution(tWidth, tHeight, screenId); - - osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits; - traits->doubleBuffer = true; - traits->sharedContext = 0; - traits->screenNum = screenId; - - if (width == 0 || height == 0 || (width == tWidth && height == tHeight)) { - // fullscreen - traits->windowDecoration = false; - traits->width = tWidth; - traits->height = tHeight; - traits->x = 0; - traits->y = 0; - } else { - // Start with given resolution - traits->windowDecoration = true; - traits->x = x; - traits->y = y; - traits->width = width; - traits->height = height; - } - - _gc = osg::GraphicsContext::createGraphicsContext(traits.get()); - if (_gc.valid()) { - _gc->setClearColor(osg::Vec4f(1.0f,1.0f,1.0f,1.0f)); - _gc->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - } - - _width = traits->width; - _height = traits->height; - - setRunMaxFrameRate(30); -// setRunFrameScheme(osgViewer::ViewerBase::ON_DEMAND); - setThreadingModel(osgViewer::Viewer::AutomaticSelection); -} - -CompositeDisplay::~CompositeDisplay() {} - -void CompositeDisplay::frame(double simulationTime) { - tthread::lock_guard<tthread::recursive_mutex> lock(_mutex); - CompositeViewer::frame(); -} - -bool CompositeDisplay::checkNeedToDoFrame() { - return CompositeViewer::checkNeedToDoFrame(); -} - -void CompositeDisplay::addView(const std::string& name, osg::Viewport* v, osgViewer::View* view) { - tthread::lock_guard<tthread::recursive_mutex> lock(_mutex); - _viewports[name] = v; - - _views[name] = view; - _views[name]->setName(name); - _views[name]->getCamera()->setName(name); - _views[name]->setCameraManipulator(new osgGA::TrackballManipulator); - - // add the state manipulator - osg::ref_ptr<osgGA::StateSetManipulator> statesetManipulator = new osgGA::StateSetManipulator; - statesetManipulator->setStateSet(_views[name]->getCamera()->getOrCreateStateSet()); - _views[name]->addEventHandler( statesetManipulator.get() ); - - _views[name]->addEventHandler( new osgViewer::StatsHandler ); - _views[name]->addEventHandler( new osgViewer::HelpHandler ); - _views[name]->addEventHandler( new osgViewer::WindowSizeHandler ); - _views[name]->addEventHandler( new osgViewer::ThreadingHandler ); - - _views[name]->getCamera()->setViewport(v); - - // set graphic context - _views[name]->getCamera()->setGraphicsContext(_gc.get()); - CompositeViewer::addView(_views[name]); - -} - -void CompositeDisplay::moveView(const std::string& name, osg::Viewport* v) { - tthread::lock_guard<tthread::recursive_mutex> lock(_mutex); - const osg::GraphicsContext::Traits* traits = _gc->getTraits(); - osg::Viewport* absoluteVp = new osg::Viewport(v->x() * (traits->width/100.0), - v->y() * (traits->height/100.0), - v->width() * (traits->width/100.0), - v->height() * (traits->height/100.0)); - _views[name]->getCamera()->setViewport(absoluteVp); -} - -void CompositeDisplay::removeView(const std::string& name) { - tthread::lock_guard<tthread::recursive_mutex> lock(_mutex); - - _views[name]->getCamera()->setGraphicsContext(NULL); - _views[name]->getCamera()->setViewport(NULL); - - CompositeViewer::removeView(_views[name]); - - if (_views.find(name) != _views.end()) { - _views.erase(name); - } - if (_viewports.find(name) != _viewports.end()) - _viewports.erase(name); -} - -osg::GraphicsContext::WindowingSystemInterface* CompositeDisplay::wsi = NULL; -void CompositeDisplay::getResolution(unsigned int& width, unsigned int& height, int screenId) { - if (!wsi) - wsi = osg::GraphicsContext::getWindowingSystemInterface(); - if (wsi) { - wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(screenId), width, height); - } else { - width = 800; - height = 600; - } -} diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.h b/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.h deleted file mode 100644 index 6c2adac..0000000 --- a/src/uscxml/plugins/invoker/graphics/openscenegraph/CompositeDisplay.h +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef COMPOSITEDISPLAY_H_W2MX9CXP -#define COMPOSITEDISPLAY_H_W2MX9CXP - -#include "uscxml/concurrency/tinythread.h" -#include <osgGA/TrackballManipulator> -#include <osgViewer/Viewer> -#include <osgViewer/CompositeViewer> -#include <osgViewer/ViewerEventHandlers> -#include <osgGA/StateSetManipulator> -#include <assert.h> -#include <iostream> - -class CompositeDisplay : public osgViewer::CompositeViewer { -public: - CompositeDisplay(unsigned int x, - unsigned int y, - unsigned int width, - unsigned int height, - int screenId); - virtual ~CompositeDisplay(); - - virtual void addView(const std::string& name, osg::Viewport* v, osgViewer::View* view); - virtual void moveView(const std::string& name, osg::Viewport* v); - virtual void removeView(const std::string& name); - - virtual void frame(double simulationTime); - virtual bool checkNeedToDoFrame(); - - int getWidth() { - return _width; - } - int getHeight() { - return _height; - } - - static void getResolution(unsigned int& width, unsigned int& height, int screenId); - -protected: - tthread::recursive_mutex _mutex; - tthread::condition_variable _monitor; - bool _waitForViewOp; - std::map<std::string, osgViewer::View*> _views; - std::map<std::string, osg::Viewport*> _viewports; - osg::ref_ptr<osg::GraphicsContext> _gc; - - static osg::GraphicsContext::WindowingSystemInterface* wsi; - int _width, _height; -}; - - -#endif /* end of include guard: COMPOSITEDISPLAY_H_W2MX9CXP */ diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.cpp b/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.cpp deleted file mode 100644 index d2bf74d..0000000 --- a/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.cpp +++ /dev/null @@ -1,722 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include <boost/algorithm/string.hpp> - -#include "OSGInvoker.h" -#include "uscxml/URL.h" -#include "uscxml/UUID.h" -#include "uscxml/dom/DOMUtils.h" -#include <glog/logging.h> - -#include <osg/Shape> -#include <osg/ShapeDrawable> -#include <osg/Material> -#include <osg/Depth> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -#define OSG_SET_MATERIAL \ -osg::ref_ptr<osg::Material> mat = getMaterial(element); \ -if (mat) { \ - osg::ref_ptr<osg::StateSet> nodeSS = geode->getOrCreateStateSet(); \ -\ - nodeSS->setAttribute(mat.get()); \ - nodeSS->setMode( GL_BLEND, osg::StateAttribute::ON ); \ -/* nodeSS->setRenderingHint( osg::StateSet::TRANSPARENT_BIN ); \ - nodeSS->setMode( GL_DEPTH_TEST, osg::StateAttribute::ON ); \ - osg::Depth* depth = new osg::Depth; \ - depth->setWriteMask( false ); \ - nodeSS->setAttributeAndModes( depth, osg::StateAttribute::ON ); \ - nodeSS->setMode( GL_LIGHTING, osg::StateAttribute::OFF );*/ \ -} - -#define OSG_SET_COLOR \ -bool validColor = true; \ -osg::Vec4 color = getColor(element, "color", validColor); \ -if (validColor) \ -drawable->setColor(color); - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new OSGInvokerProvider() ); - return true; -} -#endif - -#define OSG_TAG_HANDLE(tagName, procFunc) \ -} else if (iequals(LOCALNAME(childElem), tagName) && \ - validChildren.find(tagName) != validChildren.end()) { \ - procFunc(childElem);\ - - -OSGInvoker::OSGInvoker() { -} - -OSGInvoker::~OSGInvoker() { -}; - -boost::shared_ptr<InvokerImpl> OSGInvoker::create(InterpreterImpl* interpreter) { - boost::shared_ptr<OSGInvoker> invoker = boost::shared_ptr<OSGInvoker> (new OSGInvoker()); - invoker->_interpreter = interpreter; - return invoker; -} - -Data OSGInvoker::getDataModelVariables() { - Data data; - return data; -} - -void OSGInvoker::send(const SendRequest& req) { - if (iequals(req.name, "intersect")) { - - } -} - -void OSGInvoker::cancel(const std::string sendId) { -} - -void OSGInvoker::invoke(const InvokeRequest& req) { - tthread::lock_guard<tthread::recursive_mutex> lock(_mutex); - - setupColors(); - -// std::cout << req.dom; - - // register default event handlers - Arabica::DOM::Events::EventTarget<std::string> evTarget = Arabica::DOM::Events::EventTarget<std::string>(req.dom); - evTarget.addEventListener("DOMSubtreeModified", *this, false); - evTarget.addEventListener("DOMNodeInserted", *this, false); - evTarget.addEventListener("DOMNodeRemoved", *this, false); - evTarget.addEventListener("DOMAttrModified", *this, false); - - std::set<std::string> validChilds; - validChilds.insert("display"); - - // this is somewhat unfortunate, if content contains a single child, we will get that, otherwise its parent (<content>) - if (iequals(LOCALNAME(req.dom), "display")) { - processChildren(validChilds, req.dom.getParentNode()); - } else { - processChildren(validChilds, req.dom); - } -} - -void OSGInvoker::setupColors() { - _colors["red"] = osg::Vec4(1.0, 0.0, 0.0, 1.0); - _colors["cyan"] = osg::Vec4(0.0, 1.0, 1.0, 1.0); - _colors["blue"] = osg::Vec4(0.0, 0.0, 1.0, 1.0); - _colors["darkblue"] = osg::Vec4(0.0, 0.0, 0.625, 1.0); - _colors["lightblue"] = osg::Vec4(0.675, 0.84375,0.89844,1.0); - _colors["purple"] = osg::Vec4(0.5, 0.0, 0.5, 1.0); - _colors["yellow"] = osg::Vec4(1.0, 1.0, 0.0, 1.0); - _colors["lime"] = osg::Vec4(0.0, 1.0, 0.0, 1.0); - _colors["magenta"] = osg::Vec4(1.0, 0.0, 1.0, 1.0); - _colors["white"] = osg::Vec4(1.0, 1.0, 1.0, 1.0); - _colors["silver"] = osg::Vec4(0.75, 0.75, 0.75, 1.0); - _colors["grey"] = osg::Vec4(0.5, 0.5, 0.5, 1.0); - _colors["gray"] = osg::Vec4(0.5, 0.5, 0.5, 1.0); - _colors["black"] = osg::Vec4(0.0, 0.0, 0.0, 1.0); - _colors["orange"] = osg::Vec4(1.0, 0.644, 0.0, 1.0); - _colors["brown"] = osg::Vec4(0.644, 0.164, 0.164, 1.0); - _colors["maroon"] = osg::Vec4(0.5, 0.0, 0.0, 1.0); - _colors["green"] = osg::Vec4(0.0, 0.5, 0.0, 1.0); - _colors["olive"] = osg::Vec4(0.5, 0.5, 0.0, 1.0); -} - -void OSGInvoker::runOnMainThread() { - _displays_t::iterator dispIter = _displays.begin(); - if (_mutex.try_lock()) { - while(dispIter != _displays.end()) { - dispIter->second->osgViewer::ViewerBase::frame(); - dispIter++; - } - _mutex.unlock(); - } -} - -void OSGInvoker::handleEvent(Arabica::DOM::Events::Event<std::string>& event) { -// std::cout << "Handling Event!" << std::endl; - Arabica::DOM::Node<std::string> node(event.getTarget()); - if (_nodes.find(node) != _nodes.end()) { - osg::ref_ptr<osg::Node> osgNode = _nodes[node]; - if (false) { - } else if (iequals(LOCALNAME(node), "rotation")) { - updateRotation(osgNode, event); - } - } -} - -void OSGInvoker::processDisplay(const Arabica::DOM::Element<std::string>& element) { -// std::cout << element << std::endl; - - if (_displays.find(element) == _displays.end()) { - - int screenId = 0; - unsigned int actualX = 0; - unsigned int actualY = 0; - unsigned int actualWidth = 0; - unsigned int actualHeight = 0; - getViewport(element, actualX, actualY, actualWidth, actualHeight, screenId); - - CompositeDisplay* compDisp = new CompositeDisplay(actualX, actualY, actualWidth, actualHeight, screenId); - _displays[element] = compDisp; - - std::set<std::string> validChilds; - validChilds.insert("viewport"); - processChildren(validChilds, element); - } -} - -void OSGInvoker::processViewport(const Arabica::DOM::Element<std::string>& element) { - if (_displays.find(element.getParentNode()) == _displays.end()) - return; - - CompositeDisplay* compDisp = _displays[element.getParentNode()]; - osgViewer::View* sceneView = new osgViewer::View(); - _views[element] = sceneView; - - osg::Group* group = new osg::Group(); - _nodes[element] = group; - sceneView->setSceneData(group); - - std::string name = (HAS_ATTR(element, "id") ? ATTR(element, "id") : UUID::getUUID()); - - unsigned int actualX = 0; - unsigned int actualY = 0; - unsigned int actualWidth = 0; - unsigned int actualHeight = 0; - - getViewport(element, actualX, actualY, actualWidth, actualHeight, compDisp); - osg::Viewport* viewPort = new osg::Viewport(actualX, actualY, actualWidth, actualHeight); - compDisp->addView(name, viewPort, sceneView); - - bool hasBGColor; - osg::Vec4 bgColor = getColor(element, "bgcolor", hasBGColor); - if (hasBGColor) { - sceneView->getCamera()->setClearColor(bgColor); - } else { - sceneView->getCamera()->setClearColor(_colors["white"]); - } - - std::set<std::string> validChilds; - validChilds.insert("camera"); - validChilds.insert("translation"); - validChilds.insert("rotation"); - validChilds.insert("scale"); - validChilds.insert("node"); - validChilds.insert("sphere"); - validChilds.insert("box"); - validChilds.insert("capsule"); - validChilds.insert("cone"); - validChilds.insert("cylinder"); - processChildren(validChilds, element); -} - -void OSGInvoker::processCamera(const Arabica::DOM::Node<std::string>& element) {} -void OSGInvoker::updateCamera(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::Event<std::string>& event) {} - -void OSGInvoker::processTranslation(const Arabica::DOM::Element<std::string>& element) { - assert(_nodes.find(element.getParentNode()) != _nodes.end()); - osg::ref_ptr<osg::Node> node = _nodes[element.getParentNode()]; - - double x = 0, y = 0, z = 0; - if (HAS_ATTR(element, "x")) - x = strTo<float>(ATTR(element, "x")); - if (HAS_ATTR(element, "y")) - y = strTo<float>(ATTR(element, "y")); - if (HAS_ATTR(element, "z")) - z = strTo<float>(ATTR(element, "z")); - - osg::Matrix translate; - translate.makeTranslate(x, y, z); - - osg::MatrixTransform* transform = new osg::MatrixTransform(); - transform->setMatrix(translate); - node->asGroup()->addChild(transform); - _nodes[element] = transform; - - std::set<std::string> validChilds; - validChilds.insert("translation"); - validChilds.insert("rotation"); - validChilds.insert("scale"); - validChilds.insert("node"); - validChilds.insert("sphere"); - validChilds.insert("box"); - validChilds.insert("capsule"); - validChilds.insert("cone"); - validChilds.insert("cylinder"); - processChildren(validChilds, element); -} - -void OSGInvoker::processRotation(const Arabica::DOM::Element<std::string>& element) { - assert(_nodes.find(element.getParentNode()) != _nodes.end()); - osg::ref_ptr<osg::Node> node = _nodes[element.getParentNode()]; - - osg::Matrix rotation = rotationFromElement(element); - osg::MatrixTransform* transform = new osg::MatrixTransform(); - transform->setMatrix(rotation); - node->asGroup()->addChild(transform); - _nodes[element] = transform; - - std::set<std::string> validChilds; - validChilds.insert("translation"); - validChilds.insert("rotation"); - validChilds.insert("scale"); - validChilds.insert("node"); - validChilds.insert("sphere"); - validChilds.insert("box"); - validChilds.insert("capsule"); - validChilds.insert("cone"); - validChilds.insert("cylinder"); - processChildren(validChilds, element); -} - -void OSGInvoker::updateRotation(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::Event<std::string>& event) { - osg::ref_ptr<osg::MatrixTransform> transform = static_cast<osg::MatrixTransform*>(node->asTransform()); - if (false) { - } else if (iequals(event.getType(), "DOMAttrModified")) { - osg::Matrix rotation = rotationFromElement(Arabica::DOM::Element<std::string>(Arabica::DOM::Node<std::string>(event.getTarget()))); - transform->setMatrix(rotation); - } -} - -osg::Matrix OSGInvoker::rotationFromElement(const Arabica::DOM::Element<std::string>& element) { - double pitch = 0, roll = 0, yaw = 0; - if (HAS_ATTR(element, "pitch")) { - NumAttr pitchAttr = NumAttr(ATTR(element, "pitch")); - if (iequals(pitchAttr.unit, "deg")) { - pitch = osg::DegreesToRadians(strTo<float>(pitchAttr.value)); - } else if (iequals(pitchAttr.unit, "%")) { - pitch = osg::DegreesToRadians((strTo<float>(pitchAttr.value) * 360) / 100); - } else { - pitch = strTo<float>(pitchAttr.value); - } - } - if (HAS_ATTR(element, "roll")) { - NumAttr rollAttr = NumAttr(ATTR(element, "roll")); - if (iequals(rollAttr.unit, "deg")) { - roll = osg::DegreesToRadians(strTo<float>(rollAttr.value)); - } else if (iequals(rollAttr.unit, "%")) { - roll = osg::DegreesToRadians((strTo<float>(rollAttr.value) * 360) / 100); - } else { - roll = strTo<float>(rollAttr.value); - } - } - if (HAS_ATTR(element, "yaw")) { - NumAttr yawAttr = NumAttr(ATTR(element, "yaw")); - if (iequals(yawAttr.unit, "deg")) { - yaw = osg::DegreesToRadians(strTo<float>(yawAttr.value)); - } else if (iequals(yawAttr.unit, "%")) { - yaw = osg::DegreesToRadians((strTo<float>(yawAttr.value) * 360) / 100); - } else { - yaw = strTo<float>(yawAttr.value); - } - } - - osg::Matrix rotation; - rotation.makeRotate(roll, osg::Vec3(0,1,0), // roll - pitch, osg::Vec3(1,0,0) , // pitch - yaw, osg::Vec3(0,0,1) ); // heading - - return rotation; -} - -void OSGInvoker::processScale(const Arabica::DOM::Element<std::string>& element) { - assert(_nodes.find(element.getParentNode()) != _nodes.end()); - osg::ref_ptr<osg::Node> node = _nodes[element.getParentNode()]; - - double x = 1, y = 1, z = 1; - if (HAS_ATTR(element, "x")) - x = strTo<float>(ATTR(element, "x")); - if (HAS_ATTR(element, "y")) - y = strTo<float>(ATTR(element, "y")); - if (HAS_ATTR(element, "z")) - z = strTo<float>(ATTR(element, "z")); - - osg::Matrix scale; - scale.makeScale(x, y, z); - - osg::MatrixTransform* transform = new osg::MatrixTransform(); - transform->setMatrix(scale); - node->asGroup()->addChild(transform); - _nodes[element] = transform; - - std::set<std::string> validChilds; - validChilds.insert("translation"); - validChilds.insert("rotation"); - validChilds.insert("scale"); - validChilds.insert("node"); - validChilds.insert("sphere"); - validChilds.insert("box"); - validChilds.insert("capsule"); - validChilds.insert("cone"); - validChilds.insert("cylinder"); - processChildren(validChilds, element); -} - -void OSGInvoker::processNode(const Arabica::DOM::Element<std::string>& element) { - _nodes_t::iterator nodeIter = _nodes.find(element.getParentNode()); - assert(nodeIter != _nodes.end()); - - assert(_nodes.find(element.getParentNode()) != _nodes.end()); - osg::ref_ptr<osg::Node> parent = _nodes[element.getParentNode()]; - - std::string filename; - if (HAS_ATTR(element, "src")) { - filename = ATTR(element, "src"); - - if (filename.length() > 0) { - std::string extension; - size_t extensionStart = filename.find_last_of("."); - if (extensionStart != std::string::npos) { - extension = filename.substr(extensionStart); - } - - URL srcURI(filename); - if (!srcURI.toAbsolute(_interpreter->getBaseURL(element))) { - LOG(ERROR) << "invoke element has relative src URI with no baseURI set."; - return; - } - filename = srcURI.asLocalFile(extension); - osg::ref_ptr<osg::Node> model = osgDB::readNodeFile(filename); - if (model.get()) - parent->asGroup()->addChild(model); - - } - } -} - -void OSGInvoker::processSphere(const Arabica::DOM::Element<std::string>& element) { - assert(_nodes.find(element.getParentNode()) != _nodes.end()); - osg::ref_ptr<osg::Node> parent = _nodes[element.getParentNode()]; - - float radius = 1; - osg::Vec3 center(0,0,0); - - if (HAS_ATTR(element, "radius")) { - radius = strTo<float>(ATTR(element, "radius")); - } - - osg::ref_ptr<osg::Sphere> sphere = new osg::Sphere(center, radius); - osg::ref_ptr<osg::ShapeDrawable> drawable = new osg::ShapeDrawable(sphere); - osg::ref_ptr<osg::Geode> geode = new osg::Geode(); - geode->addDrawable(drawable); - - OSG_SET_COLOR; - OSG_SET_MATERIAL; - - _nodes[element] = geode; - - parent->asGroup()->addChild(geode); -} - -void OSGInvoker::updateSphere(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::Event<std::string>& event) { -} - -void OSGInvoker::processBox(const Arabica::DOM::Element<std::string>& element) { - assert(_nodes.find(element.getParentNode()) != _nodes.end()); - osg::ref_ptr<osg::Node> parent = _nodes[element.getParentNode()]; - - float x = 1; - float y = 1; - float z = 1; - osg::Vec3 center(0,0,0); - - if (HAS_ATTR(element, "x")) x = strTo<float>(ATTR(element, "x")); - if (HAS_ATTR(element, "y")) y = strTo<float>(ATTR(element, "y")); - if (HAS_ATTR(element, "z")) z = strTo<float>(ATTR(element, "z")); - - osg::ref_ptr<osg::Box> box = new osg::Box(center, x, y, z); - osg::ref_ptr<osg::ShapeDrawable> drawable = new osg::ShapeDrawable(box); - osg::ref_ptr<osg::Geode> geode = new osg::Geode(); - geode->addDrawable(drawable); - - OSG_SET_COLOR; - OSG_SET_MATERIAL; - - _nodes[element] = geode; - - parent->asGroup()->addChild(geode); - -} -void OSGInvoker::updateBox(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::Event<std::string>& event) { -} -void OSGInvoker::processCapsule(const Arabica::DOM::Element<std::string>& element) { - assert(_nodes.find(element.getParentNode()) != _nodes.end()); - osg::ref_ptr<osg::Node> parent = _nodes[element.getParentNode()]; - - float radius = 1; - float height = 1; - osg::Vec3 center(0,0,0); - - if (HAS_ATTR(element, "radius")) radius = strTo<float>(ATTR(element, "radius")); - if (HAS_ATTR(element, "height")) height = strTo<float>(ATTR(element, "height")); - - osg::ref_ptr<osg::Capsule> capsule = new osg::Capsule(center, radius, height); - osg::ref_ptr<osg::ShapeDrawable> drawable = new osg::ShapeDrawable(capsule); - osg::ref_ptr<osg::Geode> geode = new osg::Geode(); - geode->addDrawable(drawable); - - OSG_SET_COLOR; - OSG_SET_MATERIAL; - - _nodes[element] = geode; - parent->asGroup()->addChild(geode); -} -void OSGInvoker::updateCapsule(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::Event<std::string>& event) { -} - -void OSGInvoker::processCone(const Arabica::DOM::Element<std::string>& element) { - assert(_nodes.find(element.getParentNode()) != _nodes.end()); - osg::ref_ptr<osg::Node> parent = _nodes[element.getParentNode()]; - - float radius = 1; - float height = 1; - osg::Vec3 center(0,0,0); - - if (HAS_ATTR(element, "radius")) radius = strTo<float>(ATTR(element, "radius")); - if (HAS_ATTR(element, "height")) height = strTo<float>(ATTR(element, "height")); - - osg::ref_ptr<osg::Cone> cone = new osg::Cone(center, radius, height); - osg::ref_ptr<osg::ShapeDrawable> drawable = new osg::ShapeDrawable(cone); - osg::ref_ptr<osg::Geode> geode = new osg::Geode(); - geode->addDrawable(drawable); - - OSG_SET_COLOR; - OSG_SET_MATERIAL; - - _nodes[element] = geode; - - parent->asGroup()->addChild(geode); - -} -void OSGInvoker::updateCone(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::Event<std::string>& event) { -} - -void OSGInvoker::processCylinder(const Arabica::DOM::Element<std::string>& element) { - assert(_nodes.find(element.getParentNode()) != _nodes.end()); - osg::ref_ptr<osg::Node> parent = _nodes[element.getParentNode()]; - - float radius = 1; - float height = 1; - osg::Vec3 center(0,0,0); - - if (HAS_ATTR(element, "radius")) radius = strTo<float>(ATTR(element, "radius")); - if (HAS_ATTR(element, "height")) height = strTo<float>(ATTR(element, "height")); - - osg::ref_ptr<osg::Cylinder> cylinder = new osg::Cylinder(center, radius, height); - osg::ref_ptr<osg::ShapeDrawable> drawable = new osg::ShapeDrawable(cylinder); - osg::ref_ptr<osg::Geode> geode = new osg::Geode(); - geode->addDrawable(drawable); - - OSG_SET_COLOR; - OSG_SET_MATERIAL; - - _nodes[element] = geode; - - parent->asGroup()->addChild(geode); - -} -void OSGInvoker::updateCylinder(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::Event<std::string>& event) { -} - -osg::Vec4 OSGInvoker::getColor(const Arabica::DOM::Element<std::string>& element, const std::string& attr, bool& valid) { - if (HAS_ATTR(element, attr)) { - std::string color = ATTR(element, attr); - - // is this one of the predefined colors? - if (_colors.find(color) != _colors.end()) { - valid = true; - return _colors[color]; - } - - // otherwise try to parse as rgba values - int i; - osg::Vec4 colorVec = parseVec4(color, i); - - if (i == 1) { - // only a single value was given, interpret as grey value - colorVec[1] = colorVec[2] = colorVec[0]; - colorVec[3] = 1.0; - valid = true; - return colorVec; - } - - if (i == 3) { - // three values were given, set opacity to max - colorVec[3] = 1.0; - valid = true; - return colorVec; - } - } - - // return empty reference - valid = false; - return osg::Vec4(); -} - -osg::ref_ptr<osg::Material> OSGInvoker::getMaterial(const Arabica::DOM::Element<std::string>& element) { - - osg::ref_ptr<osg::Material> nodeMat; - - // material color - bool hasMatColor; - osg::Vec4 matColor = getColor(element, "materialcolor", hasMatColor); - if (hasMatColor) { - if (!nodeMat) - nodeMat = new osg::Material; - nodeMat->setDiffuse(osg::Material::FRONT, matColor); - nodeMat->setDiffuse(osg::Material::BACK, matColor); - } - - // translucency - if (HAS_ATTR(element, "transparency")) { - std::string transparency = ATTR(element, "transparency"); - float trans = strTo<float>(transparency); - if (!nodeMat) - nodeMat = new osg::Material; - nodeMat->setTransparency(osg::Material::FRONT, trans); - nodeMat->setTransparency(osg::Material::BACK, trans); - } - - return nodeMat; -} - -osg::Vec4 OSGInvoker::parseVec4(const std::string& coeffs, int& i) { - - // otherwise try to parse as rgba values - std::string coeff; - std::stringstream coeffSS(coeffs); - - osg::Vec4 vec; - - i = 0; - while(std::getline(coeffSS, coeff, ',')) { - boost::trim(coeff); - if (coeff.length() == 0) - continue; - if (!isNumeric(coeff.c_str(), 10)) - continue; - - vec[i] = strTo<float>(coeff); - i++; - } - return vec; -} - -void OSGInvoker::processChildren(const std::set<std::string>& validChildren, const Arabica::DOM::Node<std::string>& element) { - Arabica::DOM::NodeList<std::string> childs = element.getChildNodes(); - for (int i = 0; i < childs.getLength(); ++i) { - if (childs.item(i).getNodeType() != Arabica::DOM::Node_base::ELEMENT_NODE) - continue; - Arabica::DOM::Element<std::string> childElem = Arabica::DOM::Element<std::string>(childs.item(i)); - if (false) { - OSG_TAG_HANDLE("node", processNode); - OSG_TAG_HANDLE("translation", processTranslation); - OSG_TAG_HANDLE("rotation", processRotation); - OSG_TAG_HANDLE("scale", processScale); - OSG_TAG_HANDLE("viewport", processViewport); - OSG_TAG_HANDLE("camera", processCamera); - OSG_TAG_HANDLE("display", processDisplay); - OSG_TAG_HANDLE("sphere", processSphere); - OSG_TAG_HANDLE("box", processBox); - OSG_TAG_HANDLE("cone", processCone); - OSG_TAG_HANDLE("capsule", processCapsule); - OSG_TAG_HANDLE("cylinder", processCylinder); - } else { - LOG(INFO) << "Unknown XML element " << TAGNAME(childElem); - } - } -} - -void OSGInvoker::getViewport(const Arabica::DOM::Element<std::string>& element, - unsigned int& x, - unsigned int& y, - unsigned int& width, - unsigned int& height, - CompositeDisplay* display) { - getViewport(element, x, y, width, height, display->getWidth(), display->getHeight()); - -} - -void OSGInvoker::getViewport(const Arabica::DOM::Element<std::string>& element, - unsigned int& x, - unsigned int& y, - unsigned int& width, - unsigned int& height, - int& screenId) { - - screenId = (HAS_ATTR(element, "screenId") ? strTo<int>(ATTR(element, "screenId")) : 0); - - unsigned int fullWidth = 0; - unsigned int fullHeight = 0; - CompositeDisplay::getResolution(fullWidth, fullHeight, screenId); - getViewport(element, x, y, width, height, fullWidth, fullHeight); -} - -void OSGInvoker::getViewport(const Arabica::DOM::Element<std::string>& element, - unsigned int& x, - unsigned int& y, - unsigned int& width, - unsigned int& height, - unsigned int fullWidth, - unsigned int fullHeight) { - if (HAS_ATTR(element, "x")) { - NumAttr xAttr = NumAttr(ATTR(element, "x")); - x = strTo<float>(xAttr.value); - if (iequals(xAttr.unit, "%")) - x = (x * fullWidth) / 100; - } - if (HAS_ATTR(element, "y")) { - NumAttr yAttr = NumAttr(ATTR(element, "y")); - y = strTo<float>(yAttr.value); - if (iequals(yAttr.unit, "%")) - y = (y * fullHeight) / 100; - } - if (HAS_ATTR(element, "width")) { - NumAttr widthAttr = NumAttr(ATTR(element, "width")); - width = strTo<float>(widthAttr.value); - if (iequals(widthAttr.unit, "%")) - width = (width * fullWidth) / 100; - } - if (HAS_ATTR(element, "height")) { - NumAttr heightAttr = NumAttr(ATTR(element, "height")); - height = strTo<float>(heightAttr.value); - if (iequals(heightAttr.unit, "%")) - height = (height * fullHeight) / 100; - } -} - -osgViewer::View* OSGInvoker::getView(const Arabica::DOM::Node<std::string>& element) { - Arabica::DOM::Node<std::string> curr = element; - while(curr && !iequals(LOCALNAME(curr), "viewport")) { - curr = curr.getParentNode(); - } - if (curr && _views.find(curr) != _views.end()) - return _views[curr]; - return NULL; -} - - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.h b/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.h deleted file mode 100644 index 30be8ca..0000000 --- a/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.h +++ /dev/null @@ -1,148 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef OSGINVOKER_H_H6T4R8HU -#define OSGINVOKER_H_H6T4R8HU - -#include <uscxml/Interpreter.h> -#include <DOM/Events/MutationEvent.hpp> -#include <DOM/Events/EventListener.hpp> -#include <DOM/Events/Event.hpp> - -#include "CompositeDisplay.h" -#include <osg/MatrixTransform> -#include <osg/Material> -#include <osgDB/ReadFile> - -#include <set> - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class OSGInvoker : public InvokerImpl, public Arabica::DOM::Events::EventListener<std::string> { -public: - OSGInvoker(); - virtual ~OSGInvoker(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("3d"); - names.push_back("scenegraph"); - names.push_back("http://uscxml.tk.informatik.tu-darmstadt.de/#3d"); - return names; - } - - virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void cancel(const std::string sendId); - virtual void invoke(const InvokeRequest& req); - virtual void handleEvent(Arabica::DOM::Events::Event<std::string>& event); - - virtual void runOnMainThread(); - -protected: - void processDisplay(const Arabica::DOM::Element<std::string>& element); - void updateDisplay(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::Event<std::string>& event); - void processViewport(const Arabica::DOM::Element<std::string>& element); - void updateViewport(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::Event<std::string>& event); - void processCamera(const Arabica::DOM::Node<std::string>& element); - void updateCamera(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::Event<std::string>& event); - - void processTranslation(const Arabica::DOM::Element<std::string>& element); - void updateTranslation(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::Event<std::string>& event); - - void processRotation(const Arabica::DOM::Element<std::string>& element); - void updateRotation(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::Event<std::string>& event); - static osg::Matrix rotationFromElement(const Arabica::DOM::Element<std::string>& element); - - void processScale(const Arabica::DOM::Element<std::string>& element); - void updateScale(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::Event<std::string>& event); - - void processNode(const Arabica::DOM::Element<std::string>& element); - void updateNode(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::Event<std::string>& event); - - void processSphere(const Arabica::DOM::Element<std::string>& element); - void updateSphere(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::Event<std::string>& event); - void processBox(const Arabica::DOM::Element<std::string>& element); - void updateBox(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::Event<std::string>& event); - void processCapsule(const Arabica::DOM::Element<std::string>& element); - void updateCapsule(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::Event<std::string>& event); - void processCone(const Arabica::DOM::Element<std::string>& element); - void updateCone(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::Event<std::string>& event); - void processCylinder(const Arabica::DOM::Element<std::string>& element); - void updateCylinder(osg::ref_ptr<osg::Node> node, Arabica::DOM::Events::Event<std::string>& event); - - osg::Vec4 getColor(const Arabica::DOM::Element<std::string>& element, const std::string& attr, bool& valid); - osg::ref_ptr<osg::Material> getMaterial(const Arabica::DOM::Element<std::string>& element); - osg::Vec4 parseVec4(const std::string& coeffs, int& number); - - void processChildren(const std::set<std::string>& validChildren, const Arabica::DOM::Node<std::string>& element); - - void getViewport(const Arabica::DOM::Element<std::string>& element, - unsigned int& x, - unsigned int& y, - unsigned int& width, - unsigned int& height, - int& screenId); - - void getViewport(const Arabica::DOM::Element<std::string>& element, - unsigned int& x, - unsigned int& y, - unsigned int& width, - unsigned int& height, - CompositeDisplay* display); - - void getViewport(const Arabica::DOM::Element<std::string>& element, - unsigned int& x, - unsigned int& y, - unsigned int& width, - unsigned int& height, - unsigned int fullWidth, - unsigned int fullHeight); - - osgViewer::View* getView(const Arabica::DOM::Node<std::string>& element); - - std::map<Arabica::DOM::Node<std::string>, CompositeDisplay*> _displays; - typedef std::map<Arabica::DOM::Node<std::string>, CompositeDisplay*> _displays_t; - - std::map<Arabica::DOM::Node<std::string>, osgViewer::View*> _views; - typedef std::map<Arabica::DOM::Node<std::string>, osgViewer::View*> _views_t; - - std::map<Arabica::DOM::Node<std::string>, osg::ref_ptr<osg::Node> > _nodes; - typedef std::map<Arabica::DOM::Node<std::string>, osg::ref_ptr<osg::Node> > _nodes_t; - - void setupColors(); - std::map<std::string, osg::Vec4> _colors; - typedef std::map<std::string, osg::Vec4> _colors_t; - - tthread::recursive_mutex _mutex; -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(OSGInvoker, InvokerImpl); -#endif - -} - - -#endif /* end of include guard: OSGINVOKER_H_H6T4R8HU */ diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp b/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp deleted file mode 100644 index 2a68be7..0000000 --- a/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp +++ /dev/null @@ -1,611 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "OSGConverter.h" -#include <glog/logging.h> -#include "uscxml/config.h" - -#include <osg/MatrixTransform> -#include <osg/Node> -#include <osg/Group> -#include <osg/ComputeBoundsVisitor> -#include <osgUtil/Optimizer> -#include <osgDB/ReadFile> -#include <osgDB/WriteFile> -#include <osgDB/Registry> -#include <osgGA/TrackballManipulator> -#include <osgGA/AnimationPathManipulator> -#include <osg/ShapeDrawable> - -#include <boost/lexical_cast.hpp> -#include <boost/algorithm/string.hpp> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -#define EVAL_PARAM_EXPR(param, expr, key) \ -if (param.find(key) == param.end() && param.find(expr) != param.end() && _interpreter->getDataModel()) \ - param.insert(std::make_pair(key, Data(_interpreter->getDataModel().evalAsString(param.find(expr)->second.atom), Data::INTERPRETED))); - -#define CAST_PARAM(param, var, key, type) \ -if (param.find(key) != param.end()) { \ - try { var = boost::lexical_cast<type>(param.find(key)->second.atom); } \ - catch(...) { LOG(ERROR) << "Attribute " key " of sendrequest to osgconverter is of invalid format: " << param.find(key)->second.atom; } \ -} - - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new OSGConverterProvider() ); - return true; -} -#endif - -OSGConverter::OSGConverter() : _isRunning(false) { -// osg::setNotifyLevel(osg::DEBUG_FP); - osg::setNotifyLevel(osg::FATAL); -} - -OSGConverter::~OSGConverter() { - _isRunning = false; - std::set<tthread::thread*>::iterator threadIter = _threads.begin(); - while(threadIter != _threads.end()) { - (*threadIter)->join(); - } -}; - -boost::shared_ptr<InvokerImpl> OSGConverter::create(InterpreterImpl* interpreter) { - boost::shared_ptr<OSGConverter> invoker = boost::shared_ptr<OSGConverter>(new OSGConverter()); - invoker->_interpreter = interpreter; - return invoker; -} - -Data OSGConverter::getDataModelVariables() { - Data data; - return data; -} - -void OSGConverter::send(const SendRequest& req) { - - /** - * we have to resolve all datamodel dependent strings first as - * we cannot access the datamodel from within another thread without locking - */ - - // make a copy - SendRequest actualReq(req); - - if (actualReq.params.find("source") == actualReq.params.end()) { - // no explicit source - if (actualReq.params.find("sourceexpr") != actualReq.params.end() && _interpreter->getDataModel()) { - actualReq.params.insert(std::make_pair("source", _interpreter->getDataModel().getStringAsData(actualReq.params.find("sourceexpr")->second))); - } else { - LOG(ERROR) << "SendRequests for osginvoker missing source or sourceExpr and datamodel"; - reportFailure(req); - return; - } - } - - if (actualReq.params.find("dest") == actualReq.params.end()) { - // no explicit destination - if (actualReq.params.find("destexpr") != actualReq.params.end() && _interpreter->getDataModel()) { - actualReq.params.insert(std::make_pair("dest", _interpreter->getDataModel().getStringAsData(actualReq.params.find("destexpr")->second))); - boost::algorithm::replace_all(actualReq.params.find("dest")->second.atom, "//", "/"); - boost::algorithm::replace_all(actualReq.params.find("dest")->second.atom, "\\\\", "\\"); - } - } - - if (actualReq.params.find("autorotate") == actualReq.params.end()) { - if (actualReq.params.find("autorotateexpr") != actualReq.params.end()) { - if (_interpreter->getDataModel()) { - actualReq.params.insert(std::make_pair("autorotate", _interpreter->getDataModel().getStringAsData(actualReq.params.find("autorotateexpr")->second))); - } else { - LOG(ERROR) << "SendRequests for osginvoker ncludes autorotateexpr but no datamodel is specified"; - reportFailure(req); - return; - } - } - } - - // support for multiple formats at the same time - std::list<Data> formats; - Event::getParam(req.params, "format", formats); - for (std::list<Data>::const_iterator formatIter = formats.begin(); formatIter != formats.end(); formatIter++) { - actualReq.params.insert(std::make_pair("format", *formatIter)); - } - - // format given as expression - std::list<Data> formatExprs; - Event::getParam(req.params, "formatexpr", formatExprs); - for (std::list<Data>::const_iterator formatIter = formatExprs.begin(); formatIter != formatExprs.end(); formatIter++) { - actualReq.params.insert(std::make_pair("format", _interpreter->getDataModel().getStringAsData(*formatIter))); - } - - if (actualReq.params.find("format") == actualReq.params.end()) { - // no explicit format, try to get from destination - std::string dest; - if (Event::getParam(actualReq.params, "dest", dest)) { - std::string format; - size_t lastDot; - if ((lastDot = dest.find_last_of(".")) != std::string::npos) { - lastDot++; - format = dest.substr(lastDot, dest.length() - lastDot); - actualReq.params.insert(std::make_pair("format", Data(format, Data::VERBATIM))); - } - } - } - - if (actualReq.params.find("format") == actualReq.params.end()) { - LOG(ERROR) << "missing format"; - reportFailure(req); - return; - } - - EVAL_PARAM_EXPR(actualReq.params, "heightexpr", "height"); - EVAL_PARAM_EXPR(actualReq.params, "widthexpr", "width"); - EVAL_PARAM_EXPR(actualReq.params, "pitchexpr", "pitch"); - EVAL_PARAM_EXPR(actualReq.params, "rollexpr", "roll"); - EVAL_PARAM_EXPR(actualReq.params, "yawexpr", "yaw"); - EVAL_PARAM_EXPR(actualReq.params, "zoomexpr", "zoom"); - EVAL_PARAM_EXPR(actualReq.params, "xexpr", "x"); - EVAL_PARAM_EXPR(actualReq.params, "yexpr", "y"); - EVAL_PARAM_EXPR(actualReq.params, "zexpr", "z"); - -// process(actualReq); - _workQueue.push(actualReq); -} - -void OSGConverter::cancel(const std::string sendId) { -} - -void OSGConverter::invoke(const InvokeRequest& req) { - int nrThreads = 1; - - if (req.params.find("threads") != req.params.end() && isNumeric(req.params.find("threads")->second.atom.c_str(), 10)) { - nrThreads = strTo<int>(req.params.find("threads")->second); - } - - _isRunning = true; - for (int i = 0; i < nrThreads; i++) { - _threads.insert(new tthread::thread(OSGConverter::run, this)); - } -} - -void OSGConverter::run(void* instance) { - OSGConverter* INSTANCE = (OSGConverter*)instance; - while(true) { - SendRequest req = INSTANCE->_workQueue.pop(); - if (INSTANCE->_isRunning) { - INSTANCE->process(req); - } else { - return; - } - } -} - -void OSGConverter::process(const SendRequest& req) { - -// std::cout << req; - - int width = 640; - int height = 480; - Event::getParam(req.params, "width", width); - Event::getParam(req.params, "height", height); - - assert(req.params.find("source") != req.params.end()); - assert(req.params.find("format") != req.params.end()); - - std::string source; - if (!Event::getParam(req.params, "source", source)) { - reportFailure(req); - LOG(ERROR) << "No source given for convert request"; - return; - } - - std::string dest; - Event::getParam(req.params, "dest", dest); - - std::list<Data> formats; - if (!Event::getParam(req.params, "format", formats)) { - reportFailure(req); - LOG(ERROR) << "No format given for convert request"; - return; - } - - bool autoRotate = true; - if (req.params.find("autorotate") != req.params.end()) { - if (iequals(req.params.find("autorotate")->second.atom, "off") || - iequals(req.params.find("autorotate")->second.atom, "0") || - iequals(req.params.find("autorotate")->second.atom, "false")) { - autoRotate = false; - } - } - - bool optimizeGeometry = false; - if (req.params.find("optimizegeometry") != req.params.end()) { - if (iequals(req.params.find("optimizegeometry")->second.atom, "on") || - iequals(req.params.find("optimizegeometry")->second.atom, "1") || - iequals(req.params.find("optimizegeometry")->second.atom, "true")) { - optimizeGeometry = true; - } - } - - bool antiAliased = true; - if (req.params.find("antialiased") != req.params.end()) { - if (iequals(req.params.find("antialiased")->second.atom, "off") || - iequals(req.params.find("antialiased")->second.atom, "0") || - iequals(req.params.find("antialiased")->second.atom, "false")) { - antiAliased = false; - } - } - - // get the 3D scene - osg::ref_ptr<osg::Node> model = setupGraph(source, autoRotate); - if (model->asGroup()->getNumChildren() == 0) { - reportFailure(req); - LOG(ERROR) << "Could not setup scenegraph"; - return; - } - - if (optimizeGeometry) { - osgUtil::Optimizer optimizer; - optimizer.optimize(model, osgUtil::Optimizer::ALL_OPTIMIZATIONS); - } - - Data retContent; - - // setup scenegraph - osg::ref_ptr<osg::Group> sceneGraph = new osg::Group(); - sceneGraph->addChild(model); - ((osg::MatrixTransform*)model.get())->setMatrix(requestToModelPose(req)); - osg::BoundingSphere bs = model->getBound(); - - for (std::list<Data>::iterator formatIter = formats.begin(); formatIter != formats.end(); formatIter++) { - std::string format = *formatIter; - - osg::ref_ptr<osgDB::ReaderWriter> writer = osgDB::Registry::instance()->getReaderWriterForExtension(format); - - if (writer.valid()) { - // conversion from 3d model to 3d model - std::stringstream ss; - osgDB::ReaderWriter::WriteResult result; - osgDB::ReaderWriter::Options* rwOptions = new osgDB::ReaderWriter::Options(); - - // pass option to disable tristrips when writing osgjs files - if (strcmp(format.c_str(), "osgjs") == 0) - rwOptions->setOptionString("disableTriStrip"); - - result = writer->writeNode(*sceneGraph, ss, rwOptions); - if (result.success()) { - if (dest.length() > 0) { - std::ofstream outFile(dest.c_str()); - outFile << ss.str(); - } - retContent.compound[format] = Data(ss.str().c_str(), ss.str().size(), URL::getMimeType(format), false); - continue; - } - } - - // conversion from 3d model to image - tthread::lock_guard<tthread::recursive_mutex> lock(_viewerMutex); - osgViewer::Viewer viewer; - osg::Camera *camera = viewer.getCamera(); - - osg::ref_ptr<osg::GraphicsContext::Traits> traits = new - osg::GraphicsContext::Traits; - traits->width = width; - traits->height = height; - traits->pbuffer = true; - - traits->readDISPLAY(); - if (antiAliased) { - traits->samples = 4; // to make anti-aliased. - osg::DisplaySettings* ds = osg::DisplaySettings::instance(); - ds->setNumMultiSamples(4); - viewer.setDisplaySettings(ds); - } - osg::GraphicsContext *gc = - osg::GraphicsContext::createGraphicsContext(traits.get()); - - camera->setGraphicsContext(gc); - camera->setDrawBuffer(GL_FRONT); - camera->setViewport(new osg::Viewport(0, 0, width, height)); - - viewer.setSceneData(sceneGraph); - - viewer.setCameraManipulator(new osgGA::TrackballManipulator()); - viewer.getCamera()->setClearColor(osg::Vec4f(1.0f,1.0f,1.0f,1.0f)); - viewer.getCamera()->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - double zoom = 1; - CAST_PARAM(req.params, zoom, "zoom", double); - - viewer.getCameraManipulator()->setByMatrix(osg::Matrix::lookAt(osg::Vec3d(0,0,bs.radius() * (-3.4 * zoom)), // eye - (osg::Vec3d)bs.center(), // center - osg::Vec3d(0,0,1))); // up - - osg::Image *image = new osg::Image(); - camera->attach(osg::Camera::COLOR_BUFFER0, image); - - viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded); - viewer.realize(); - viewer.frame(); - - std::string tempFile = URL::getTmpFilename(format); - - if (!osgDB::writeImageFile(*image, tempFile)) { - LOG(ERROR) << "Could write image file at " << tempFile; - return; - } - - // read file into buffer - char* buffer = NULL; - size_t length = 0; - { - std::ifstream file(tempFile.c_str()); - - file.seekg(0, std::ios::end); - length = file.tellg(); - file.seekg(0, std::ios::beg); - buffer = (char*)malloc(length); - file.read(buffer, length); - } - - retContent.compound[format] = Data(buffer, length, URL::getMimeType(format), false); - } - - if (retContent.compound.size()) { - reportSuccess(req, retContent); - } else { - reportFailure(req); - } - return; -} - -void OSGConverter::reportSuccess(const SendRequest& req, const Data& content) { - Event event(req); - -// for (Event::params_t::const_iterator paramIter = req.params.begin(); paramIter != req.params.end(); paramIter++) { -// Data foo = paramIter->second; -// std::cout << paramIter->first << " = " << foo << std::endl; -// } - - if (event.name.length() == 0) - event.name = "convert"; - event.name += ".success"; - - if (!content.empty()) - event.data.compound["content"] = content; - returnEvent(event); -} - -void OSGConverter::reportFailure(const SendRequest& req) { - Event event(req); - if (event.name.length() == 0) - event.name = "convert"; - event.name += ".failure"; - returnEvent(event); -} - -osg::Matrix OSGConverter::requestToModelPose(const SendRequest& req) { - double pitch = 0; - double roll = 0; - double yaw = 0; - double x = 0; - double y = 0; - double z = 0; - CAST_PARAM(req.params, pitch, "pitch", double); - CAST_PARAM(req.params, roll, "roll", double); - CAST_PARAM(req.params, yaw, "yaw", double); - CAST_PARAM(req.params, x, "x", double); - CAST_PARAM(req.params, y, "y", double); - CAST_PARAM(req.params, z, "z", double); - - osg::Matrix m = eulerToMatrix(pitch, roll, yaw) * osg::Matrix::translate(-1 * x, -1 * y, -1 * z); -#if 0 - dumpMatrix(m); -#endif - return m; -} - -osg::Matrix OSGConverter::requestToCamPose(const SendRequest& req) { -// double zoom = 1; -// CAST_PARAM(req.params, zoom, "zoom", double); -// osg::Matrix scale = osg::Matrix::scale(zoom, zoom, zoom); -// return scale; - osg::Matrix identity; - identity.makeIdentity(); - return identity; -} - -osg::ref_ptr<osg::Node> OSGConverter::setupGraph(const std::string filename, bool autoRotate) { - - // get some privacy - tthread::lock_guard<tthread::recursive_mutex> lock(_cacheMutex); - - /** - * root (model pose) - * - rotate (autoRotate to face largest side) - * - modelCenter (center model) - * - model (actual model) - */ - - long now = tthread::chrono::system_clock::now(); - - { - - // do we have it in the cache? - if (_models.find(filename) == _models.end()) { - osg::ref_ptr<osg::Node> model = osgDB::readNodeFile(filename); - if (!model.valid()) { - LOG(ERROR) << "Cannot load model from " << filename; - return new osg::MatrixTransform(); - } - _models[filename] = std::make_pair(now, model); - } - _models[filename].first = now; - -#if 1 - // remove old models from cache - std::map<std::string, std::pair<long, osg::ref_ptr<osg::Node> > >::iterator modelIter = _models.begin(); - while(modelIter != _models.end()) { - // delete every model unused for 1 minutes - if (now - modelIter->second.first > 6000) { - _models.erase(modelIter++); - } else { - modelIter++; - } - } - -#endif - } - - osg::ref_ptr<osg::MatrixTransform> root = new osg::MatrixTransform(); - osg::ref_ptr<osg::MatrixTransform> rotate = new osg::MatrixTransform(); - osg::ref_ptr<osg::Node> model = _models[filename].second; - - // translation matrix to move model into center - osg::ref_ptr<osg::MatrixTransform> modelCenter = new osg::MatrixTransform(); - modelCenter->addChild(model); - rotate->addChild(modelCenter); - - // move bounding sphere center into origin - osg::BoundingSphere bs = model->getBound(); - modelCenter->setMatrix(osg::Matrix::translate(bs.center() *= -1)); - - // get bounding box - osg::ComputeBoundsVisitor cbv; - osg::BoundingBox& bb(cbv.getBoundingBox()); - modelCenter->accept(cbv); - - if (autoRotate) { - double depth = bb.zMax() - bb.zMin(); - double width = bb.xMax() - bb.xMin(); - double height = bb.yMax() - bb.yMin(); - - double frontArea = width * height; - double sideArea = depth * height; - double topArea = depth * width; - - // rotate by multiples of 90deg to face largest area - if (frontArea < sideArea || frontArea < topArea) { - if (sideArea < topArea) { - // top needs to come to front -> rotate on x - rotate->setMatrix(osg::Matrix::rotate(M_PI_2, osg::Vec3f(1.0,0,0))); - } else { - // side needs to come to front - rotate->setMatrix(osg::Matrix::rotate(M_PI_2, osg::Vec3f(0,1.0,0))); - } - } - } - - // add rotation to root - root->addChild(rotate); - return root; -} - -osg::ref_ptr<osg::Node> OSGConverter::getOrigin() { - osg::Geode* geode = new osg::Geode(); -// osg::StateSet* stateset = new osg::StateSet(); -// stateset->setMode(GL_LIGHTING, osg::StateAttribute::ON); -// geode->setStateSet(stateset); - - geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(0.0f,0.0f,0.0f),1))); - geode->addDrawable(new osg::ShapeDrawable(new osg::Box(osg::Vec3(10.0f,0.0f,0.0f),0.5))); - geode->addDrawable(new osg::ShapeDrawable(new osg::Box(osg::Vec3(0.0f,10.0f,0.0f),2))); - geode->addDrawable(new osg::ShapeDrawable(new osg::Box(osg::Vec3(0.0f,0.0f,10.0f),4))); - // geode->addDrawable(new osg::ShapeDrawable(new osg::Cone(osg::Vec3(4.0f,0.0f,0.0f),radius,height),hints)); - - return geode; -} - -osg::Matrix OSGConverter::eulerToMatrix(double pitch, double roll, double yaw) { - // see http://www.flipcode.com/documents/matrfaq.html#Q36 - osg::Matrix m; - m.makeIdentity(); - - double A = cos(pitch); - double B = sin(pitch); - double C = cos(roll); - double D = sin(roll); - double E = cos(yaw); - double F = sin(yaw); - - double AD = A * D; - double BD = B * D; - - m(0,0) = C * E; - m(0,1) = -C * F; - m(0,2) = -D; - m(1,0) = -BD * E + A * F; - m(1,1) = BD * F + A * E; - m(1,2) = -B * C; - m(2,0) = AD * E + B * F; - m(2,1) = -AD * F + B * E; - m(2,2) = A * C; - - m(0,3) = m(1,3) = m(2,3) = m(3,0) = m(3,1) = m(3,2) = 0; - m(3,3) = 1; - - return m; -} - -void OSGConverter::matrixToEuler(const osg::Matrix& m, double& pitch, double& roll, double& yaw) { - // see: http://www.flipcode.com/documents/matrfaq.html#Q37 - double angle_x, angle_z; - double D = -1 * asin(m(0,2)); /* Calculate Y-axis angle */ - double angle_y = D; - double C = cos(angle_y); - - /* Gimball lock? */ - if ( fabs( C ) > 0.005 ) { - double tr_x = m(2,2) / C; /* No, so get X-axis angle */ - double tr_y = -1 * m(1,2) / C; - angle_x = atan2( tr_y, tr_x ); - tr_x = m(0,0) / C; /* Get Z-axis angle */ - tr_y = -1 * m(0,1) / C; - angle_z = atan2( tr_y, tr_x ); - } else { - /* Gimball lock has occurred */ - angle_x = 0; /* Set X-axis angle to zero */ - double tr_x = m(1,1); /* And calculate Z-axis angle */ - double tr_y = m(1,0); - angle_z = atan2( tr_y, tr_x ); - } - - pitch = fmod(angle_x, 2 * M_PI ); /* Clamp all angles to range */ - roll = fmod( angle_y, 2 * M_PI ); - yaw = fmod( angle_z, 2 * M_PI ); -} - -void OSGConverter::dumpMatrix(const osg::Matrix& m) { - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 4; j++) { - std::cout << ", " << m(i, j); - } - std::cout << std::endl; - } -} - - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.h b/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.h deleted file mode 100644 index 10e6fc9..0000000 --- a/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.h +++ /dev/null @@ -1,89 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef OSGCONVERTER_H_W09J90F0 -#define OSGCONVERTER_H_W09J90F0 - -#include <uscxml/Interpreter.h> -#include <osg/Node> -#include <osgViewer/ViewerEventHandlers> - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class OSGConverter : public InvokerImpl { -public: - OSGConverter(); - virtual ~OSGConverter(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("osgconverter"); - names.push_back("osgconvert"); - names.push_back("http://uscxml.tk.informatik.tu-darmstadt.de/#osgconverter"); - names.push_back("http://uscxml.tk.informatik.tu-darmstadt.de/#osgconvert"); - return names; - } - - virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void cancel(const std::string sendId); - virtual void invoke(const InvokeRequest& req); - - void reportSuccess(const SendRequest& req, const Data& content); - void reportFailure(const SendRequest& req); - - osg::Matrix requestToModelPose(const SendRequest& req); - osg::Matrix requestToCamPose(const SendRequest& req); - - static void dumpMatrix(const osg::Matrix& m); - static osg::Matrix eulerToMatrix(double pitch, double roll, double yaw); - static void matrixToEuler(const osg::Matrix& m, double& pitch, double& roll, double& yaw); - -protected: - - uscxml::concurrency::BlockingQueue<SendRequest> _workQueue; - osg::ref_ptr<osg::Node> setupGraph(const std::string filename, bool autoRotate = false); - osg::ref_ptr<osg::Node> getOrigin(); - - tthread::recursive_mutex _viewerMutex; - - std::map<std::string, std::pair<long, osg::ref_ptr<osg::Node> > > _models; - tthread::recursive_mutex _cacheMutex; - - std::set<tthread::thread*> _threads; - - static void run(void*); - void process(const SendRequest& req); - - bool _isRunning; -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(OSGConverter, InvokerImpl); -#endif - -} - - -#endif /* end of include guard: OSGCONVERTER_H_W09J90F0 */ diff --git a/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.cpp b/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.cpp deleted file mode 100644 index 0b54228..0000000 --- a/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include <boost/algorithm/string.hpp> - -#include "HeartbeatInvoker.h" -#include "uscxml/dom/DOMUtils.h" -#include <glog/logging.h> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new HeartbeatInvokerProvider() ); - return true; -} -#endif - -HeartbeatInvoker::HeartbeatInvoker() { -} - -HeartbeatInvoker::~HeartbeatInvoker() { - cancel(""); -}; - -boost::shared_ptr<InvokerImpl> HeartbeatInvoker::create(InterpreterImpl* interpreter) { - boost::shared_ptr<HeartbeatInvoker> invoker = boost::shared_ptr<HeartbeatInvoker>(new HeartbeatInvoker()); - invoker->_interpreter = interpreter; - return invoker; -} - -Data HeartbeatInvoker::getDataModelVariables() { - Data data; - return data; -} - -void HeartbeatInvoker::send(const SendRequest& req) { -} - -void HeartbeatInvoker::cancel(const std::string sendId) { - HeartbeatDispatcher::getInstance()->cancelEvent(toStr(this)); -} - -void HeartbeatInvoker::invoke(const InvokeRequest& req) { - _invokeId = req.invokeid; - _event.invokeid = _invokeId; - std::string intervalStr; - double interval = 0; - unsigned long intervalMs = 0; - InvokeRequest::params_t::const_iterator paramIter = req.params.begin(); - while(paramIter != req.params.end()) { - if (iequals(paramIter->first, "interval")) { - intervalStr = paramIter->second.atom; - NumAttr intervalAttr(paramIter->second.atom); - interval = strTo<double>(intervalAttr.value); - if (false) { - } else if (iequals(intervalAttr.unit, "s")) { - intervalMs = interval * 1000; - } else if (iequals(intervalAttr.unit, "ms")) { - intervalMs = interval; - } else { - intervalMs = interval; - } - } - if (iequals(paramIter->first, "eventname")) { - _event.name = paramIter->second.atom; - } - paramIter++; - } - if (_event.name.length() == 0) - _event.name = std::string("heartbeat." + intervalStr); - - if (intervalMs > 0) { - HeartbeatDispatcher::getInstance()->addEvent(toStr(this), HeartbeatInvoker::dispatch, intervalMs, this, true); - } -} - -void HeartbeatInvoker::dispatch(void* instance, std::string name) { - HeartbeatInvoker* invoker = (HeartbeatInvoker*)instance; - invoker->returnEvent(invoker->_event); -} - -HeartbeatDispatcher* HeartbeatDispatcher::_instance = NULL; -HeartbeatDispatcher* HeartbeatDispatcher::getInstance() { - if (_instance == NULL) { - _instance = new HeartbeatDispatcher(); - _instance->start(); - } - return _instance; -} - -HeartbeatDispatcher::HeartbeatDispatcher() {} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.h b/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.h deleted file mode 100644 index f0bc32c..0000000 --- a/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.h +++ /dev/null @@ -1,72 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef HEARTBEATINVOKER_H_W09J90F0 -#define HEARTBEATINVOKER_H_W09J90F0 - -#include <uscxml/Interpreter.h> -#include "uscxml/concurrency/DelayedEventQueue.h" - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class HeartbeatInvoker : public InvokerImpl { -public: - HeartbeatInvoker(); - virtual ~HeartbeatInvoker(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("heartbeat"); - names.push_back("http://uscxml.tk.informatik.tu-darmstadt.de/#heartbeat"); - return names; - } - - virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void cancel(const std::string sendId); - virtual void invoke(const InvokeRequest& req); - - static void dispatch(void* instance, std::string name); - -protected: - Event _event; - -}; - -class HeartbeatDispatcher : public DelayedEventQueue { -public: - static HeartbeatDispatcher* getInstance(); -protected: - static HeartbeatDispatcher* _instance; - HeartbeatDispatcher(); -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(HeartbeatInvoker, InvokerImpl); -#endif - -} - - -#endif /* end of include guard: HEARTBEATINVOKER_H_W09J90F0 */ diff --git a/src/uscxml/plugins/invoker/http/HTTPServletInvoker.cpp b/src/uscxml/plugins/invoker/http/HTTPServletInvoker.cpp deleted file mode 100644 index 1e0fced..0000000 --- a/src/uscxml/plugins/invoker/http/HTTPServletInvoker.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "HTTPServletInvoker.h" -#include <glog/logging.h> - -#include "uscxml/config.h" - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new HTTPServletInvokerProvider() ); - return true; -} -#endif - -HTTPServletInvoker::HTTPServletInvoker() { -} - -HTTPServletInvoker::~HTTPServletInvoker() { - HTTPServer::unregisterServlet(this); - -}; - -boost::shared_ptr<InvokerImpl> HTTPServletInvoker::create(InterpreterImpl* interpreter) { - boost::shared_ptr<HTTPServletInvoker> invoker = boost::shared_ptr<HTTPServletInvoker>(new HTTPServletInvoker()); - invoker->_interpreter = interpreter; - return invoker; -} - -Data HTTPServletInvoker::getDataModelVariables() { - Data data; - assert(_url.length() > 0); - data.compound["location"] = Data(_url, Data::VERBATIM); - return data; -} - -void HTTPServletInvoker::send(const SendRequest& req) { - - if (req.name.find("reply.", 0, req.name.length())) { - // this is a reply - const std::string requestId = req.name.substr(6); - if (_requests.find(requestId) == _requests.end()) { - LOG(ERROR) << "Replying to non existing request " << requestId; - return; - } - - HTTPServer::Request httpRequest = _requests[requestId]; - HTTPServer::Reply httpReply(httpRequest); - httpReply.content = req.content; - - std::map<std::string, Data>::const_iterator nameListIter = req.namelist.begin(); - while(nameListIter != req.namelist.end()) { - httpReply.headers[nameListIter->first] = nameListIter->second.atom; - nameListIter++; - } - - std::multimap<std::string, Data>::const_iterator paramIter = req.params.begin(); - while(paramIter != req.params.end()) { - httpReply.headers[paramIter->first] = paramIter->second.atom; - paramIter++; - } - - HTTPServer::reply(httpReply); - return; - } -} - -void HTTPServletInvoker::cancel(const std::string sendId) { -} - -void HTTPServletInvoker::invoke(const InvokeRequest& req) { - - _invokeId = req.invokeid; - if (req.params.find("path") == req.params.end()) { - LOG(ERROR) << "Path parameter required with httpserver"; - } - _path = (*req.params.find("path")).second.atom; - - if (req.params.find("callback") != req.params.end()) { - _callback = (*req.params.find("callback")).second.atom; - } else { - _callback = _path; - std::replace(_callback.begin(), _callback.end(), '/', '.'); - } - - if (!HTTPServer::registerServlet(_path, this)) { - LOG(ERROR) << "Cannot register http servlet at " << _path << ": " << " already taken"; - } -} - -/** - * Receive a request and deliver it to the interpreter - */ -bool HTTPServletInvoker::httpRecvRequest(const HTTPServer::Request& req) { - tthread::lock_guard<tthread::recursive_mutex> lock(_mutex); - -// evhttp_request_own(req.curlReq); - - _requests[toStr((uintptr_t)req.evhttpReq)] = req; - - Event event = req; - - event.name = _callback; - event.data.compound["reqId"] = Data(toStr((uintptr_t)req.evhttpReq), Data::VERBATIM); - - returnEvent(event); - return true; -} - -std::string HTTPServletInvoker::getPath() { - return _path; -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/http/HTTPServletInvoker.h b/src/uscxml/plugins/invoker/http/HTTPServletInvoker.h deleted file mode 100644 index 59c25ca..0000000 --- a/src/uscxml/plugins/invoker/http/HTTPServletInvoker.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef HTTPSERVERINVOKER_H_OAAWX8NF -#define HTTPSERVERINVOKER_H_OAAWX8NF - -#include <uscxml/Interpreter.h> -#include <uscxml/server/HTTPServer.h> - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class HTTPServletInvoker : public InvokerImpl, public HTTPServlet { -public: - HTTPServletInvoker(); - virtual ~HTTPServletInvoker(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("httpservlet"); - names.push_back("http://uscxml.tk.informatik.tu-darmstadt.de/#httpserver"); - return names; - } - - virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void cancel(const std::string sendId); - virtual void invoke(const InvokeRequest& req); - - // HTTPServlet - virtual bool httpRecvRequest(const HTTPServer::Request& req); - virtual std::string getPath(); - virtual void setURL(const std::string& url) { - _url = url; - } - bool canAdaptPath() { - return false; - } - -protected: - tthread::recursive_mutex _mutex; - std::map<std::string, HTTPServer::Request> _requests; - std::string _path; - std::string _callback; - std::string _url; -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(HTTPServletInvoker, InvokerImpl); -#endif - -} - -#endif /* end of include guard: HTTPSERVERINVOKER_H_OAAWX8NF */ diff --git a/src/uscxml/plugins/invoker/im/IMConfig.h.in b/src/uscxml/plugins/invoker/im/IMConfig.h.in deleted file mode 100644 index b43fef6..0000000 --- a/src/uscxml/plugins/invoker/im/IMConfig.h.in +++ /dev/null @@ -1,4 +0,0 @@ -#define LIBPURPLE_VERSION_MAJOR @LIBPURPLE_VERSION_MAJOR@ -#define LIBPURPLE_VERSION_MINOR @LIBPURPLE_VERSION_MINOR@ -#define LIBPURPLE_VERSION_PATCH @LIBPURPLE_VERSION_PATCH@ -#define LIBPURPLE_VERSION "@LIBPURPLE_VERSION@" diff --git a/src/uscxml/plugins/invoker/im/IMInvoker.cpp b/src/uscxml/plugins/invoker/im/IMInvoker.cpp deleted file mode 100644 index f111743..0000000 --- a/src/uscxml/plugins/invoker/im/IMInvoker.cpp +++ /dev/null @@ -1,1409 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "IMInvoker.h" -#include <glog/logging.h> -#include "uscxml/UUID.h" -#include "uscxml/dom/DOMUtils.h" -#include "uscxml/dom/NameSpacingParser.h" -#include <boost/algorithm/string.hpp> - -#include "uscxml/concurrency/DelayedEventQueue.h" - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -#define GET_INSTANCE_IN_CALLBACK(account) \ -tthread::lock_guard<tthread::recursive_mutex> lock(_accountMutex); \ -IMInvoker* inst = NULL;\ -if (_accountInstances.find(account) == _accountInstances.end()) { \ - LOG(ERROR) << "Callback for unknown account called"; \ -} else {\ - inst = _accountInstances[account];\ -} - - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new IMInvokerProvider() ); - return true; -} -#endif - -Data IMInvoker::_pluginData; -GHashTable* IMInvoker::_uiInfo = NULL; -GRand* IMInvoker::_gRand = NULL; - -PurpleEventLoopUiOps IMInvoker::_uiEventLoopOps = { - purpleEventTimeoutAdd, - purpleEventTimeoutRemove, - purpleEventInputAdd, - purpleEventInputRemove, - purpleEventInputGetError, - purpleEventTimeoutAddSec, - NULL, - NULL, - NULL -}; - -PurpleDebugUiOps IMInvoker::_uiDebugOps = { - purpleDebugPrint, - purpleDebugIsEnabled, - NULL, NULL, NULL, NULL -}; - -PurpleAccountUiOps IMInvoker::_uiAccountOps = { - accountNotifyAdded, - accountStatusChanged, - accountRequestAdd, - accountRequestAuthorize, - accountCloseRequest, - NULL, - NULL, - NULL -}; - -PurpleBlistUiOps IMInvoker::_uiBuddyOps = { - purpleNewList, - purpleNewNode, - purpleShow, - NULL, // purpleUpdate, - NULL, // purpleRemove, - NULL, // purpleDestroy, - NULL, // purpleSetVisible, - purpleRequestAddBuddy, - purpleRequestAddChat, - purpleRequestAddGroup, - NULL, // purpleSaveNode, - NULL, // purpleRemoveNode, - NULL, // purpleSaveAccount, -}; - -// file transfer -PurpleXferUiOps IMInvoker::_uiXferOps = { - purpleNewXfer, - purpleDestroy, - purpleAddXfer, - purpleUpdateProgress, - purpleCancelLocal, - purpleCancelRemote, - purpleWrite, - purpleRead, - purpleDataNotSent, - purpleAddThumbnail -}; - -// connection info -PurpleConnectionUiOps IMInvoker::_uiConnectOps = { - purpleConnectProgress, - purpleConnected, - purpleDisonnected, - purpleNotice, -#if LIBPURPLE_VERSION_MAJOR >= 3 - purpleNetworkConnected, - purpleNetworkDisconnected, - purpleReportDisconnect, - NULL, - NULL, - NULL -#else - purpleReportDisconnect, - purpleNetworkConnected, - purpleNetworkDisconnected, - NULL, - NULL, - NULL -#endif -}; - -//libpurple conversation operations -PurpleConversationUiOps IMInvoker::_uiConvOps = { - NULL, //purpleCreateConversation, - NULL, //purpleDestroyConversation, - NULL, //purpleWriteChat, - NULL, //purpleWriteIm, - purpleWriteConv, - NULL, //purpleChatRenameUser, - NULL, //purpleChatRemoveUsers, - NULL, //purpleChatUpdateUser, - NULL, //purplePresentConversation, - NULL, //purpleHasFocus, - NULL, //purpleCustomSmileyAdd, - NULL, //purpleCustomSmileyWrite, - NULL, //purpleCustomSmileyClose, - NULL, //purpleSendConfirm, - NULL, - NULL, - NULL, - NULL -}; - -PurpleNotifyUiOps IMInvoker::_uiNotifyOps = { - purpeNotifyMessage, - purpeNotifyEmail, - purpeNotifyEmails, - purpeNotifyFormatted, - purpeNotifySearchResults, - purpeNotifySearchResultsNewRows, - purpeNotifyUserInfo, - purpeNotifyURI, - purpeNotifyClose, - NULL, - NULL, - NULL, - NULL -}; - -#if LIBPURPLE_VERSION_MAJOR < 3 -PurplePrivacyUiOps IMInvoker::_uiPrivacyOps = { - purplePermitAdded, - purplePermitRemoved, - purpleDebyAdded, - purpleDenyRemoved, - NULL, - NULL, - NULL, - NULL -}; -#endif - -#if LIBPURPLE_VERSION_MAJOR >= 3 -PurpleRequestFeature IMInvoker::_features; -#endif -PurpleRequestUiOps IMInvoker::_uiRequestOps = { -#if LIBPURPLE_VERSION_MAJOR >= 3 - _features, - purpleRequestInput, - purpleRequestChoice, - purpleRequestAction, - purpleRequestWait, - purpleRequestWaitUpdate, - purpleRequestFields, - purpleRequestFile, - purpleRequestFolder, - purpleRequestClose, - NULL, - NULL, - NULL, - NULL -#else - purpleRequestInput, - purpleRequestChoice, - purpleRequestAction, - purpleRequestFields, - purpleRequestFile, - purpleRequestClose, - purpleRequestFolder, - purpleRequestActionWithIcon, - NULL, - NULL, - NULL - -#endif - -}; - -PurpleWhiteboardUiOps IMInvoker::_uiWhiteboardOps = { - purpleCreateWB, - purpleDestroyWB, - purpleSetDimensions, - purpleSetBrush, - purpleDrawPont, - purpleDrawLine, - purpleClearWB, - NULL, - NULL, - NULL, - NULL -}; - -PurpleCoreUiOps IMInvoker::_uiCoreOps = { - purplePrefsInit, - NULL, - purpleUIInit, - NULL, - NULL, - NULL, - NULL, - NULL -}; - -DelayedEventQueue* IMInvoker::_eventQueue = NULL; - -tthread::mutex IMInvoker::_initMutex; -tthread::condition_variable IMInvoker::_initCond; - -tthread::recursive_mutex IMInvoker::_accountMutex; -std::map<PurpleAccount*, IMInvoker*> IMInvoker::_accountInstances; - -void IMInvoker::setupPurpleSignals() { - int handle; - // connection signals - purple_signal_connect(purple_connections_get_handle(), "signed-on", &handle, PURPLE_CALLBACK(signedOnCB), NULL); - - // conversation signals - purple_signal_connect(purple_conversations_get_handle(), "conversation-created", &handle, PURPLE_CALLBACK(conversationCreatedCB), NULL); - purple_signal_connect(purple_conversations_get_handle(), "chat-joined", &handle, PURPLE_CALLBACK(chatJoinedCB), NULL); - purple_signal_connect(purple_conversations_get_handle(), "chat-join-failed", &handle, PURPLE_CALLBACK(chatJoinFailedCB), NULL); - purple_signal_connect(purple_conversations_get_handle(), "buddy-typing", &handle, PURPLE_CALLBACK(buddyTypingCB), NULL); - purple_signal_connect(purple_conversations_get_handle(), "buddy-typed", &handle, PURPLE_CALLBACK(buddyTypedCB), NULL); - purple_signal_connect(purple_conversations_get_handle(), "buddy-typing-stopped", &handle, PURPLE_CALLBACK(buddyTypingStoppedCB), NULL); - - // buddy signals - purple_signal_connect(purple_blist_get_handle(), "buddy-signed-on", &handle, PURPLE_CALLBACK(buddyEventCB), GINT_TO_POINTER(PURPLE_BUDDY_SIGNON)); - purple_signal_connect(purple_blist_get_handle(), "buddy-signed-off", &handle, PURPLE_CALLBACK(buddyEventCB), GINT_TO_POINTER(PURPLE_BUDDY_SIGNOFF)); - purple_signal_connect(purple_blist_get_handle(), "buddy-got-login-time", &handle, PURPLE_CALLBACK(buddyEventCB), GINT_TO_POINTER(PURPLE_BUDDY_SIGNON_TIME)); - purple_signal_connect(purple_blist_get_handle(), "buddy-idle-changed", &handle, PURPLE_CALLBACK(buddyIdleChangedCB), NULL); - purple_signal_connect(purple_blist_get_handle(), "buddy-status-changed", &handle, PURPLE_CALLBACK(buddyStatusChangedCB), NULL); - purple_signal_connect(purple_blist_get_handle(), "buddy-icon-changed", &handle, PURPLE_CALLBACK(buddyEventCB), GINT_TO_POINTER(PURPLE_BUDDY_ICON)); - purple_signal_connect(purple_blist_get_handle(), "buddy-added", &handle, PURPLE_CALLBACK(buddyAddedCB), NULL); - purple_signal_connect(purple_blist_get_handle(), "buddy-removed", &handle, PURPLE_CALLBACK(buddyRemovedCB), NULL); - purple_signal_connect(purple_blist_get_handle(), "blist-node-aliased", &handle, PURPLE_CALLBACK(blistNodeAliasedCB), NULL); - purple_signal_connect(purple_blist_get_handle(), "buddy-caps-changed", &handle, PURPLE_CALLBACK(buddyCapsChangedCB), NULL); - - // xfer signals - purple_signal_connect(purple_xfers_get_handle(), "file-recv-request", &handle, PURPLE_CALLBACK(fileRecvRequestCB), NULL); - -} - -void IMInvoker::initLibPurple(void *userdata, const std::string event) { - _initMutex.lock(); - - _uiInfo = g_hash_table_new(g_str_hash, g_str_equal); -// g_hash_table_insert(_uiInfo, "name", (char*)"uscxml"); -// g_hash_table_insert(_uiInfo, "version", "0.0.3"); -// g_hash_table_insert(_uiInfo, "website", "http://uscxml.tk.informatik.tu-darmstadt.de"); -// g_hash_table_insert(_uiInfo, "dev_website", "http://uscxml.tk.informatik.tu-darmstadt.de"); -// g_hash_table_insert(_uiInfo, "client_type", "pc"); - - _gRand = g_rand_new(); - - /* Set a custom user directory (optional) */ - //purple_util_set_user_dir(CUSTOM_USER_DIRECTORY); - - /* We do not want any debugging for now to keep the noise to a minimum. */ - purple_debug_set_enabled(false); - - purple_core_set_ui_ops(&_uiCoreOps); - purple_eventloop_set_ui_ops(&_uiEventLoopOps); - - purple_plugins_add_search_path("/usr/local/lib/purple-3"); - // purple_plugins_probe(G_MODULE_SUFFIX); - - if (!purple_core_init("uscxml")) { - LOG(ERROR) << "libpurple initialization failed." << std::endl; - return; - } - - /* Load the preferences. */ - purple_prefs_load(); - purple_plugins_load_saved("/purple/uscxml/plugins/saved"); - - GList *l; - PurplePlugin *plugin; - - for (l = purple_plugins_get_all(); l != NULL; l = l->next) { - plugin = (PurplePlugin *)l->data; - - Data pluginData; - if (plugin->info->id) pluginData.compound["id"] = Data(plugin->info->id, Data::VERBATIM); - if (plugin->info->homepage) pluginData.compound["homepage"] = Data(plugin->info->homepage, Data::VERBATIM); - if (plugin->info->author) pluginData.compound["author"] = Data(plugin->info->author, Data::VERBATIM); - if (plugin->info->description) pluginData.compound["description"] = Data(plugin->info->description, Data::VERBATIM); - if (plugin->info->name) pluginData.compound["name"] = Data(plugin->info->name, Data::VERBATIM); - if (plugin->info->summary) pluginData.compound["summary"] = Data(plugin->info->summary, Data::VERBATIM); - if (plugin->info->version) pluginData.compound["version"] = Data(plugin->info->version, Data::VERBATIM); - if (plugin->info->major_version) pluginData.compound["majorVersion"] = Data(toStr(plugin->info->major_version), Data::VERBATIM); - if (plugin->info->minor_version) pluginData.compound["minorVersion"] = Data(toStr(plugin->info->minor_version), Data::VERBATIM); - - if (plugin->info->type == PURPLE_PLUGIN_PROTOCOL) { - _pluginData.compound["protocol"].compound[plugin->info->id] = pluginData; - } else if (plugin->info->type == PURPLE_PLUGIN_STANDARD) { -// _pluginData.compound["standard"].compound[plugin->info->id] = pluginData; - } else if (plugin->info->type == PURPLE_PLUGIN_LOADER) { -// _pluginData.compound["loader"].compound[plugin->info->id] = pluginData; - } - } - - _initMutex.unlock(); - _initCond.notify_all(); -} - -// purple event callbacks -void IMInvoker::signedOnCB(PurpleConnection *gc, gpointer null) { - PurpleAccount *account = purple_connection_get_account(gc); - GET_INSTANCE_IN_CALLBACK(account); - if (!inst) - return; - -#if 0 - GSList *buddies = purple_find_buddies(purple_connection_get_account(gc), NULL); - GSList *cur; - for (cur = buddies; cur; cur = cur->next) { - buddyAddedCB((PurpleBuddy *)cur->data); - } - g_slist_free(buddies); -#endif - - // set my status to active - PurpleSavedStatus* status = purple_savedstatus_new(NULL, PURPLE_STATUS_AVAILABLE); - purple_savedstatus_activate(status); - - Event retEv("im.signed.on"); - inst->returnEvent(retEv); -} - -void IMInvoker::conversationCreatedCB(PurpleConversation *conv, void *data) {} -void IMInvoker::chatJoinedCB(PurpleConversation *conv, void *data) {} -void IMInvoker::chatJoinFailedCB(PurpleConnection *gc, GHashTable *components) {} -void IMInvoker::buddyTypingCB(PurpleAccount *account, const char *name, void *data) { - std::cout << "buddyTypingCB" << std::endl; -} -void IMInvoker::buddyTypedCB(PurpleAccount *account, const char *name, void *data) { - std::cout << "buddyTypedCB" << std::endl; -} -void IMInvoker::buddyTypingStoppedCB(PurpleAccount *account, const char *name, void *data) { - std::cout << "buddyTypingStoppedCB" << std::endl; -} - -void IMInvoker::buddyEventCB(PurpleBuddy *buddy, PurpleBuddyEvent event) { - if (!buddy) - return; - - PurpleAccount *account = purple_buddy_get_account(buddy); - GET_INSTANCE_IN_CALLBACK(account); - if (!inst) - return; - - switch (event) { - case PURPLE_BUDDY_SIGNOFF: - case PURPLE_BUDDY_SIGNON: { - PurplePresence* presence = purple_buddy_get_presence(buddy); - PurpleStatus* status = purple_presence_get_active_status(presence); - buddyStatusChangedCB(buddy, NULL, status, event); - break; - } - case PURPLE_BUDDY_ICON: - break; - - default: - break; - } - -} - -void IMInvoker::buddyIdleChangedCB(PurpleBuddy *buddy, gboolean old_idle, gboolean idle, PurpleBuddyEvent event) { -} - -void IMInvoker::buddyStatusChangedCB(PurpleBuddy *buddy, PurpleStatus *old, PurpleStatus *newstatus, PurpleBuddyEvent event) { - PurpleAccount *account = purple_buddy_get_account(buddy); - GET_INSTANCE_IN_CALLBACK(account); - - std::string buddyName = purple_buddy_get_name(buddy); - Data buddyData = buddyToData(buddy); - inst->_dataModelVars.compound["buddies"].compound[buddyName] = buddyData; - - Event retEv("im.buddy.status.changed"); - retEv.data = buddyData; - inst->returnEvent(retEv); - -} - -void IMInvoker::buddyAddedCB(PurpleBuddy* buddy) { - PurpleAccount *account = purple_buddy_get_account(buddy); - GET_INSTANCE_IN_CALLBACK(account); - if (!inst) - return; - - std::string buddyName = purple_buddy_get_name(buddy); - - Event retEv("im.buddy.added"); - retEv.data.compound["name"] = Data(buddyName, Data::VERBATIM); - inst->returnEvent(retEv); - - buddyStatusChangedCB(buddy, NULL, purple_presence_get_active_status(purple_buddy_get_presence(buddy)), PURPLE_BUDDY_NONE); - -} - -void IMInvoker::buddyRemovedCB(PurpleBuddy* buddy) { - PurpleAccount *account = purple_buddy_get_account(buddy); - GET_INSTANCE_IN_CALLBACK(account); - std::string buddyName = purple_buddy_get_name(buddy); - - Event retEv("im.buddy.removed"); - retEv.data.compound["name"] = Data(buddyName, Data::VERBATIM); - inst->returnEvent(retEv); - - inst->_dataModelVars.compound["buddies"].compound.erase(buddyName); - -} - -void IMInvoker::blistNodeAliasedCB(PurpleBlistNode *node, char *old_alias) { -} - -void IMInvoker::fileRecvRequestCB(PurpleXfer *xfer) { - purple_xfer_set_local_filename(xfer, ""); -} - - -void IMInvoker::buddyCapsChangedCB(PurpleBuddy* buddy, PurpleMediaCaps newcaps, PurpleMediaCaps oldcaps) { - PurpleAccount *account = purple_buddy_get_account(buddy); - GET_INSTANCE_IN_CALLBACK(account); -} - -Data IMInvoker::statusToData(PurpleStatus *status) { - Data data; - const char* statusName = purple_status_get_name(status); - if (statusName) data.compound["name"] = Data(statusName, Data::VERBATIM); - - PurpleStatusType* statusType = PURPLE_STATUS_GET_TYPE(status); - - GList *statusAttrElem; - PURPLE_STATUS_ATTR* statusAttr; - GList *statusAttrList = purple_status_type_get_attrs(statusType); - - for(statusAttrElem = statusAttrList; statusAttrElem; statusAttrElem = statusAttrElem->next) { - statusAttr = (PURPLE_STATUS_ATTR*)statusAttrElem->data; - const char* statusAttrId = PURPLE_STATUS_ATTR_GET_ID(statusAttr); - PURPLE_VALUE* statusValue = purple_status_get_attr_value(status, statusAttrId); - if (statusValue) { - data.compound[statusAttrId] = purpleValueToData(statusValue); - } - } - - data.compound["active"] = Data((bool)purple_status_is_active(status)); - data.compound["available"] = Data((bool)purple_status_is_available(status)); - data.compound["exclusive"] = Data((bool)purple_status_is_exclusive(status)); - data.compound["active"] = Data((bool)purple_status_is_active(status)); - data.compound["independent"] = Data((bool)purple_status_is_independent(status)); - data.compound["online"] = Data((bool)purple_status_is_online(status)); - - return data; -} - -Data IMInvoker::buddyToData(PurpleBuddy *buddy) { - Data data; - std::string buddyName = purple_buddy_get_name(buddy); - - if (purple_buddy_get_name(buddy)) data.compound["name"] = Data(purple_buddy_get_name(buddy), Data::VERBATIM); - if (purple_buddy_get_alias(buddy)) data.compound["alias"] = Data(purple_buddy_get_alias(buddy), Data::VERBATIM); - if (purple_buddy_get_alias_only(buddy)) data.compound["aliasOnly"] = Data(purple_buddy_get_alias_only(buddy), Data::VERBATIM); - if (purple_buddy_get_server_alias(buddy)) data.compound["server"] = Data(purple_buddy_get_server_alias(buddy), Data::VERBATIM); - - PurpleGroup* group = purple_buddy_get_group(buddy); - if (group) { - if (purple_group_get_name(group)) data.compound["group"] = Data(purple_group_get_name(group), Data::VERBATIM); - } - - PurpleBuddyIcon* icon = purple_buddy_get_icon(buddy); - if (icon) { - size_t iconSize = 0; - gconstpointer iconData = purple_buddy_icon_get_data(icon, &iconSize); - data.compound["icon"] = Data((char*)iconData, iconSize, "application/octet-stream", false); - } - - PurplePresence* presence = purple_buddy_get_presence(buddy); - - if (presence) { - GList *statusElem; - GList *statusList = purple_presence_get_statuses(presence); - PurpleStatus* status; - - for(statusElem = statusList; statusElem; statusElem = statusElem->next) { - status = (PurpleStatus*)statusElem->data; - const char* statusId = purple_status_get_id(status); - PurpleStatusPrimitive statusPrimitive = purple_primitive_get_type_from_id(statusId); - - // only include active states - if(statusPrimitive == PURPLE_STATUS_UNSET || !purple_presence_is_status_primitive_active(presence, statusPrimitive)) - continue; - data.compound["status"].compound[statusId] = statusToData(status); - } - } - - return data; -} - -Data IMInvoker::purpleValueToData(PURPLE_VALUE* value) { - Data data; - -#if LIBPURPLE_VERSION_MAJOR >= 3 - if (false) { - } else if (g_type_check_value_holds(value, G_TYPE_CHAR)) { - data = Data(g_value_get_schar(value), Data::VERBATIM); - - } else if (g_type_check_value_holds(value, G_TYPE_UCHAR)) { - data = Data(g_value_get_uchar(value), Data::VERBATIM); - - } else if (g_type_check_value_holds(value, G_TYPE_BOOLEAN)) { - data = Data(g_value_get_boolean(value)); - - } else if (g_type_check_value_holds(value, G_TYPE_INT)) { - data = Data(g_value_get_int(value)); - - } else if (g_type_check_value_holds(value, G_TYPE_UINT)) { - data = Data(g_value_get_uint(value)); - - } else if (g_type_check_value_holds(value, G_TYPE_LONG)) { - data = Data(g_value_get_long(value)); - - } else if (g_type_check_value_holds(value, G_TYPE_ULONG)) { - data = Data(g_value_get_ulong(value)); - - } else if (g_type_check_value_holds(value, G_TYPE_INT64)) { - data = Data(g_value_get_int64(value)); - - } else if (g_type_check_value_holds(value, G_TYPE_FLOAT)) { - data = Data(g_value_get_float(value)); - - } else if (g_type_check_value_holds(value, G_TYPE_DOUBLE)) { - data = Data(g_value_get_double(value)); - - } else if (g_type_check_value_holds(value, G_TYPE_STRING)) { - const gchar* tmp = g_value_get_string(value); - if (tmp == NULL) { - data = Data("", Data::VERBATIM); - } else { - data = Data(g_value_get_string(value), Data::VERBATIM); - } - - } else if (g_type_check_value_holds(value, G_TYPE_OBJECT) || - g_type_check_value_holds(value, G_TYPE_PARAM) || - g_type_check_value_holds(value, G_TYPE_POINTER) || - g_type_check_value_holds(value, G_TYPE_FLAGS) || - g_type_check_value_holds(value, G_TYPE_ENUM)) { - LOG(ERROR) << "purple thingy not supported"; - } else { - LOG(ERROR) << "purple thingy unknown"; - } -#else - switch (purple_value_get_type(value)) { - case PURPLE_TYPE_BOOLEAN: - if (purple_value_get_boolean(value)) - data = Data("true"); - data = Data("false"); - break; - case PURPLE_TYPE_STRING: - if (purple_value_get_string(value)) { - data = Data(purple_value_get_string(value), Data::VERBATIM); - } - break; - case PURPLE_TYPE_CHAR: - Data(purple_value_get_char(value)); - break; - case PURPLE_TYPE_UCHAR: - Data(purple_value_get_uchar(value)); - break; - case PURPLE_TYPE_SHORT: - Data(purple_value_get_short(value)); - break; - case PURPLE_TYPE_USHORT: - Data(purple_value_get_ushort(value)); - break; - case PURPLE_TYPE_INT: - Data(purple_value_get_int(value)); - break; - case PURPLE_TYPE_UINT: - Data(purple_value_get_uint(value)); - break; - case PURPLE_TYPE_LONG: - Data(purple_value_get_long(value)); - break; - case PURPLE_TYPE_ULONG: - Data(purple_value_get_ulong(value)); - break; - case PURPLE_TYPE_INT64: - Data(purple_value_get_int64(value)); - break; - case PURPLE_TYPE_UINT64: - Data(purple_value_get_uint64(value)); - break; - case PURPLE_TYPE_OBJECT: - case PURPLE_TYPE_POINTER: - case PURPLE_TYPE_ENUM: - case PURPLE_TYPE_BOXED: - case PURPLE_TYPE_UNKNOWN: - case PURPLE_TYPE_SUBTYPE: - LOG(ERROR) << "purple thingy not supported"; - break; - } -#endif - return data; -} - -IMInvoker::IMInvoker() { - _account = NULL; -} - -IMInvoker::~IMInvoker() { - if (_account) { - _accountMutex.lock(); - _accountInstances.erase(_account); -// purple_account_destroy(_account); - _accountMutex.unlock(); - } -}; - -boost::shared_ptr<InvokerImpl> IMInvoker::create(InterpreterImpl* interpreter) { - boost::shared_ptr<IMInvoker> invoker = boost::shared_ptr<IMInvoker>(new IMInvoker()); - - if (!_eventQueue) { - tthread::lock_guard<tthread::mutex> lock(_initMutex); - _eventQueue = new DelayedEventQueue(); - _eventQueue->addEvent("initLibPurple", IMInvoker::initLibPurple, 0, NULL); - _eventQueue->start(); - // make sure to have the shebang initialized when we leave - _initCond.wait(_initMutex); - } - - invoker->_dataModelVars.compound["plugins"] = _pluginData; - return invoker; -} - -Data IMInvoker::getDataModelVariables() { - tthread::lock_guard<tthread::recursive_mutex> lock(_accountMutex); - return _dataModelVars; -} - -void IMInvoker::send(const SendRequest& req) { - EventContext* ctx = new EventContext(); - ctx->sendReq = req; - ctx->instance = this; - - std::string eventId = UUID::getUUID(); - _eventQueue->addEvent(eventId, IMInvoker::send, 0, ctx); - return; -} - -void IMInvoker::send(void *userdata, const std::string event) { - // we are in the thread that manages all of libpurple - EventContext* ctx = (EventContext*)userdata; - - if (!ctx) - return; - - if (!ctx->instance || !ctx->instance->_account) { - ctx->instance->returnErrorExecution("No account available"); - delete(ctx); - return; - } - - if (iequals(ctx->sendReq.name, "im.send")) { - std::string receiver; - Event::getParam(ctx->sendReq.params, "receiver", receiver); - - Data data; - Event::getParam(ctx->sendReq.params, "data", data); - -#if LIBPURPLE_VERSION_MAJOR >= 3 - PurpleIMConversation* conv = purple_im_conversation_new(ctx->instance->_account, receiver.c_str()); - if (ctx->sendReq.content.length() > 0) - purple_conversation_send(PURPLE_CONVERSATION(conv), ctx->sendReq.content.c_str()); -#else - PurpleConversation* conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, ctx->instance->_account, receiver.c_str()); - if (ctx->sendReq.content.length() > 0) - purple_conv_im_send(purple_conversation_get_im_data(conv), ctx->sendReq.content.c_str()); -#endif - -#if 0 - if (data.binary) { - PurpleConnection *gc = purple_account_get_connection(ctx->instance->_account); - PurplePlugin *prpl; - PurplePluginProtocolInfo *prpl_info; - - - if (gc) { - prpl = purple_connection_get_prpl(gc); - prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); - -// if (prpl_info && prpl_info->new_xfer) { -// PurpleXfer* xfer = (prpl_info->new_xfer)(purple_account_get_connection(ctx->instance->_account), receiver.c_str()); -// purple_xfer_set_local_filename(xfer, "/Users/sradomski/Documents/W3C Standards.pdf"); -// purple_xfer_set_filename(xfer, "asdfadsf.pdf"); -// purple_xfer_request(xfer); -// purple_xfer_request_accepted(xfer, "/Users/sradomski/Documents/W3C Standards.pdf"); -// } - - //Set the filename -// purple_xfer_set_local_filename(xfer, [[fileTransfer localFilename] UTF8String]); -// purple_xfer_set_filename(xfer, [[[fileTransfer localFilename] lastPathComponent] UTF8String]); -// xfer->ui_data -// purple_xfer_request(xfer); - - serv_send_file(gc, "sradomski@localhost", "/Users/sradomski/Documents/W3C Standards.pdf"); -// if (prpl_info->send_file && (prpl_info->can_receive_file && prpl_info->can_receive_file(gc, receiver.c_str()))) { -// prpl_info->send_file(gc, receiver.c_str(), "/Users/sradomski/Documents/W3C Standards.pdf"); -// } -// prpl_info->send_raw(gc, data.binary->data, data.binary->size); - } - - } -#endif - } else if (iequals(ctx->sendReq.name, "im.buddy.add")) { - std::string buddyName; - Event::getParam(ctx->sendReq.params, "name", buddyName); - - std::string reqMsg; - Event::getParam(ctx->sendReq.params, "msg", reqMsg); - - PurpleBuddy* buddy = purple_buddy_new(ctx->instance->_account, buddyName.c_str(), NULL); - purple_blist_add_buddy(buddy, NULL, NULL, NULL); -#if LIBPURPLE_VERSION_MAJOR >= 3 - purple_account_add_buddy(ctx->instance->_account, buddy, reqMsg.c_str()); -#else - purple_account_add_buddy(ctx->instance->_account, buddy); -#endif - - } else if (iequals(ctx->sendReq.name, "im.buddy.remove")) { - std::string buddyName; - Event::getParam(ctx->sendReq.params, "name", buddyName); - -#if LIBPURPLE_VERSION_MAJOR >= 3 - PurpleBuddy* buddy = purple_blist_find_buddy(ctx->instance->_account, buddyName.c_str()); - if (PURPLE_IS_BUDDY(buddy)) { - purple_account_remove_buddy(ctx->instance->_account, buddy, purple_buddy_get_group(buddy)); - purple_blist_remove_buddy(buddy); - } -#else - PurpleBuddy* buddy = purple_find_buddy(ctx->instance->_account, buddyName.c_str()); - purple_account_remove_buddy(ctx->instance->_account, buddy, purple_buddy_get_group(buddy)); - purple_blist_remove_buddy(buddy); - -#endif - } - - delete(ctx); -} - -void IMInvoker::cancel(const std::string sendId) { -} - -void IMInvoker::invoke(const InvokeRequest& req) { - - EventContext* ctx = new EventContext(); - ctx->invokeReq = req; - ctx->instance = this; - _eventQueue->addEvent(req.sendid, IMInvoker::invoke, 0, ctx); - return; -} - -void IMInvoker::invoke(void *userdata, const std::string event) { - _accountMutex.lock(); - - EventContext* ctx = (EventContext*)userdata; - IMInvoker* instance = ctx->instance; - - std::string username; - Event::getParam(ctx->invokeReq.params, "username", username); - std::string protocolId; - Event::getParam(ctx->invokeReq.params, "protocol", protocolId); - std::string password; - Event::getParam(ctx->invokeReq.params, "password", password); - - instance->_account = purple_account_new(username.c_str(), protocolId.c_str()); - _accountInstances[instance->_account] = instance; - -#if LIBPURPLE_VERSION_MAJOR >= 3 - purple_account_set_password(instance->_account, password.c_str(), NULL, NULL); -#else - purple_account_set_password(instance->_account, password.c_str()); -#endif - purple_account_set_enabled(instance->_account, "uscxml", true); - - GSList* buddies = purple_blist_get_buddies(); - GSList *cur; - for (cur = buddies; cur; cur = cur->next) { - std::string buddyName = purple_buddy_get_name((PurpleBuddy *)cur->data); - Data buddyData = buddyToData((PurpleBuddy *)cur->data); - instance->_dataModelVars.compound["buddies"].compound[buddyName] = buddyData; - } - g_slist_free(buddies); - - - - delete(ctx); - _accountMutex.unlock(); -} - -guint IMInvoker::purpleEventTimeoutAdd(guint interval, GSourceFunc function, gpointer data) { - PurpleEventContext* ctx = new PurpleEventContext(); - ctx->function = function; - ctx->input = NULL; - ctx->data = data; - uintptr_t ptr = reinterpret_cast<uintptr_t>(ctx); - - _eventQueue->addEvent(toStr(ptr), purpleCallback, interval, ctx); - return ptr; -} - -gboolean IMInvoker::purpleEventTimeoutRemove(guint handle) { - _eventQueue->cancelEvent(toStr(handle)); - return true; -} - -guint IMInvoker::purpleEventTimeoutAddSec(guint interval, GSourceFunc function, gpointer data) { - return purpleEventTimeoutAdd(interval * 1000, function, data); -} - -guint IMInvoker::purpleEventInputAdd(int fd, PurpleInputCondition cond, PurpleInputFunction func, gpointer data) { - PurpleEventContext* ctx = new PurpleEventContext(); - ctx->function = NULL; - ctx->input = func; - ctx->inputFD = fd; - ctx->cond = cond; - ctx->data = data; - - short opMask = 0; - if (cond & PURPLE_INPUT_READ) - opMask |= DelayedEventQueue::DEQ_READ; - if (cond & PURPLE_INPUT_WRITE) - opMask |= DelayedEventQueue::DEQ_WRITE; - - guint eventId = g_rand_int(_gRand); -// std::cout << "-- Input add " << eventId << " --------" << fd << std::endl; - _eventQueue->addEvent(toStr(eventId), fd, opMask, purpleCallback, ctx, true); - return eventId; -} - -gboolean IMInvoker::purpleEventInputRemove(guint handle) { -// std::cout << "-- Input del " << handle << std::endl; - _eventQueue->cancelEvent(toStr(handle)); - return true; -} - -int IMInvoker::purpleEventInputGetError(int fd, int *error) { - int ret; - socklen_t len; - len = sizeof(*error); - - ret = getsockopt(fd, SOL_SOCKET, SO_ERROR, error, &len); - if (!ret && !(*error)) { - /* - * Taken from Fire's FaimP2PConnection.m: - * The job of this function is to detect if the connection failed or not - * There has to be a better way to do this - * - * Any socket that fails to connect will select for reading and writing - * and all reads and writes will fail - * Any listening socket will select for reading, and any read will fail - * So, select for writing, if you can write, and the write fails, not connected - */ - - { - fd_set thisfd; - struct timeval timeout; - - FD_ZERO(&thisfd); - FD_SET(fd, &thisfd); - timeout.tv_sec = 0; - timeout.tv_usec = 0; - select(fd+1, NULL, &thisfd, NULL, &timeout); - if(FD_ISSET(fd, &thisfd)) { - ssize_t length = 0; - char buffer[4] = {0, 0, 0, 0}; - - length = write(fd, buffer, length); - if(length == -1) { - /* Not connected */ - ret = -1; - *error = ENOTCONN; - } - } - } - } - - return ret; -} - -void IMInvoker::purpleCallback(void *userdata, const std::string event) { - PurpleEventContext* ctx = (PurpleEventContext*)userdata; - if (ctx->function) { - ctx->function(ctx->data); - delete ctx; - } else if(ctx->input) { -// std::cout << "operating on " << ctx->inputFD << std::endl; - ctx->input(ctx->data, ctx->inputFD, ctx->cond); - } -} - -void IMInvoker::purplePrefsInit(void) { - purple_prefs_add_bool("/auto-login", false); -} - -void IMInvoker::purpleDebugInit(void) {} - -void IMInvoker::purpleUIInit(void) { - purple_accounts_set_ui_ops(&_uiAccountOps); -// purple_xfers_set_ui_ops(&_uiXferOps); -// purple_blist_set_ui_ops(&_uiBuddyOps); -// purple_notify_set_ui_ops(&_uiNotifyOps); -// purple_privacy_set_ui_ops(&_uiPrivacyOps); -// purple_request_set_ui_ops(&_uiRequestOps); -// purple_connections_set_ui_ops(&_uiConnectOps); -// purple_whiteboard_set_ui_ops(&_uiWhiteboardOps); - purple_conversations_set_ui_ops(&_uiConvOps); - purple_debug_set_ui_ops(&_uiDebugOps); - - setupPurpleSignals(); - -} -void IMInvoker::purpleQuit(void) {} - -GHashTable* IMInvoker::purpleGetUIInfo(void) { - return _uiInfo; -} - -void IMInvoker::accountNotifyAdded(PurpleAccount *account, - const char *remote_user, - const char *id, - const char *alias, - const char *message) { - std::cout << "accountNotifyAdded" << std::endl; -} - -void IMInvoker::accountStatusChanged(PurpleAccount *account, - PurpleStatus *status) { - std::cout << "accountStatusChanged" << std::endl; - -} - -void IMInvoker::accountRequestAdd(PurpleAccount *account, - const char *remote_user, - const char *id, - const char *alias, - const char *message) { - std::cout << "accountRequestAdd" << std::endl; -} - -void* IMInvoker::accountRequestAuthorize(PurpleAccount *account, - const char *remote_user, - const char *id, - const char *alias, - const char *message, - gboolean on_list, - PurpleAccountRequestAuthorizationCb authorize_cb, - PurpleAccountRequestAuthorizationCb deny_cb, - void *user_data) { - // always accept all "may I add you as a buddy?" requests -#if LIBPURPLE_VERSION_MAJOR >= 3 - authorize_cb(message, user_data); -#else - authorize_cb(user_data); -#endif - return user_data; -} - -void IMInvoker::accountCloseRequest(void *ui_handle) { - std::cout << "accountCloseRequest" << std::endl; -} - -//libpurple conversation operations -void IMInvoker::purpleCreateConversation(PurpleConversation *conv) {} -void IMInvoker::purpleDestroyConversation(PurpleConversation *conv) {} -void IMInvoker::purpleWriteChat(PurpleConversation *conv, const char *who, const char *message, PurpleMessageFlags flags, time_t mtime) { - std::cout << "purpleWriteChat" << std::endl; -} -void IMInvoker::purpleWriteIm(PurpleConversation *conv, const char *who, const char *message, PurpleMessageFlags flags, time_t mtime) { - std::cout << "purpleWriteIm" << std::endl; -} -void IMInvoker::purpleWriteConv(PurpleConversation *conv, const char *name, const char *alias, const char *message, PurpleMessageFlags flags, time_t mtime) { - - GET_INSTANCE_IN_CALLBACK(purple_conversation_get_account(conv)); - if (inst == NULL) - return; - - Event msgRcvdEv; - if (flags & PURPLE_MESSAGE_SEND) - msgRcvdEv.name = "im.send.conv"; - if (flags & PURPLE_MESSAGE_RECV) - msgRcvdEv.name = "im.rcvd.conv"; - - if (alias && *alias) - msgRcvdEv.data.compound["alias"] = Data(alias, Data::VERBATIM); - if (name && *name) - msgRcvdEv.data.compound["name"] = Data(name, Data::VERBATIM); - - msgRcvdEv.data.compound["conversation"] = Data(purple_conversation_get_name(conv), Data::VERBATIM); - msgRcvdEv.data.compound["timestamp"] = Data(mtime); - msgRcvdEv.data.compound["time"] = Data(purple_utf8_strftime("%T", localtime(&mtime)), Data::VERBATIM); - msgRcvdEv.data.compound["date"] = Data(purple_utf8_strftime("%F", localtime(&mtime)), Data::VERBATIM); - msgRcvdEv.data.compound["datetime"] = Data(purple_utf8_strftime("%c", localtime(&mtime)), Data::VERBATIM); - - msgRcvdEv.data.compound["raw"] = Data(message, Data::VERBATIM); - if (flags & PURPLE_MESSAGE_RAW) { - msgRcvdEv.data.compound["message"] = Data(message, Data::VERBATIM); - } else { - bool successParse = false; // unfortunate code layout as parsers operator= is private :( - std::string origErrors; - - // try to parse as XHTML - { - NameSpacingParser parser = NameSpacingParser::fromXML(message); - if (!parser.errorsReported()) { - msgRcvdEv.data.compound["message"].node = parser.getDocument().getDocumentElement(); - successParse = true; - } else { - origErrors = parser.errors(); - } - } - - // try again with added XHTML tags - if (!successParse) { - NameSpacingParser parser = NameSpacingParser::fromXML(std::string("<html xmlns='http://jabber.org/protocol/xhtml-im'>") + - std::string("<body xmlns='http://www.w3.org/1999/xhtml'>") + - message + - std::string("</body>") + - std::string("</html>")); - if (!parser.errorsReported()) { - msgRcvdEv.data.compound["message"].node = parser.getDocument().getDocumentElement(); - successParse = true; - } else { - LOG(ERROR) << "Cannot parse message as XHTML: " << origErrors << std::endl << message; - } - } - - if (successParse) { - // prepare stripped message content - std::list<Arabica::DOM::Node<std::string> > texts = DOMUtils::getElementsByType(msgRcvdEv.data.compound["message"].node, Arabica::DOM::Node_base::TEXT_NODE); - std::stringstream ssTexts; - std::string seperator; - while(texts.size() > 0) { - ssTexts << seperator << texts.front().getNodeValue(); - texts.pop_front(); - if (ssTexts.str().length() > 0 && isspace(ssTexts.str()[ssTexts.str().length() - 1])) { - seperator = ""; - } else { - seperator = " "; - } - } - - msgRcvdEv.data.compound["stripped"] = Data(ssTexts.str(), Data::VERBATIM); - } - // erase for now as JS dump croaks on dom nodes with cycles - msgRcvdEv.data.compound.erase("message"); - } - - msgRcvdEv.data.compound["flags"].compound["send"] = Data((bool)(flags & PURPLE_MESSAGE_SEND)); - msgRcvdEv.data.compound["flags"].compound["rcvd"] = Data((bool)(flags & PURPLE_MESSAGE_RECV)); - msgRcvdEv.data.compound["flags"].compound["system"] = Data((bool)(flags & PURPLE_MESSAGE_SYSTEM)); - msgRcvdEv.data.compound["flags"].compound["auoresponse"] = Data((bool)(flags & PURPLE_MESSAGE_AUTO_RESP)); - msgRcvdEv.data.compound["flags"].compound["activeonly"] = Data((bool)(flags & PURPLE_MESSAGE_ACTIVE_ONLY)); - msgRcvdEv.data.compound["flags"].compound["containsnick"] = Data((bool)(flags & PURPLE_MESSAGE_NICK)); - msgRcvdEv.data.compound["flags"].compound["nolog"] = Data((bool)(flags & PURPLE_MESSAGE_NO_LOG)); - msgRcvdEv.data.compound["flags"].compound["whisper"] = Data((bool)(flags & PURPLE_MESSAGE_WHISPER)); - msgRcvdEv.data.compound["flags"].compound["error"] = Data((bool)(flags & PURPLE_MESSAGE_ERROR)); - msgRcvdEv.data.compound["flags"].compound["delayed"] = Data((bool)(flags & PURPLE_MESSAGE_DELAYED)); - msgRcvdEv.data.compound["flags"].compound["raw"] = Data((bool)(flags & PURPLE_MESSAGE_RAW)); - msgRcvdEv.data.compound["flags"].compound["images"] = Data((bool)(flags & PURPLE_MESSAGE_IMAGES)); - msgRcvdEv.data.compound["flags"].compound["notify"] = Data((bool)(flags & PURPLE_MESSAGE_NOTIFY)); - msgRcvdEv.data.compound["flags"].compound["nolinkify"] = Data((bool)(flags & PURPLE_MESSAGE_NO_LINKIFY)); - msgRcvdEv.data.compound["flags"].compound["invisible"] = Data((bool)(flags & PURPLE_MESSAGE_INVISIBLE)); - - inst->returnEvent(msgRcvdEv); -} -void IMInvoker::purpleChatAddUsers(PurpleConversation *conv, GList *cbuddies, gboolean new_arrivals) {} -void IMInvoker::purpleChatRenameUser(PurpleConversation *conv, const char *old_name, const char *new_name, const char *new_alias) {} -void IMInvoker::purpleChatRemoveUsers(PurpleConversation *conv, GList *users) {} -void IMInvoker::purpleChatUpdateUser(PurpleConversation *conv, const char *user) {} -void IMInvoker::purplePresentConversation(PurpleConversation *conv) {} -gboolean IMInvoker::purpleHasFocus(PurpleConversation *conv) { - return true; -} -gboolean IMInvoker::purpleCustomSmileyAdd(PurpleConversation *conv, const char *smile, gboolean remote) { - return true; -} -void IMInvoker::purpleCustomSmileyWrite(PurpleConversation *conv, const char *smile, const guchar *data, gsize size) {} -void IMInvoker::purpleCustomSmileyClose(PurpleConversation *conv, const char *smile) {} -void IMInvoker::purpleSendConfirm(PurpleConversation *conv, const char *message) {} - -// buddy operations -void IMInvoker::purpleNewList(PurpleBuddyList *list) { - std::cout << "purpleNewList" << std::endl; -} -void IMInvoker::purpleNewNode(PurpleBlistNode *node) { - std::cout << "purpleNewNode" << std::endl; -} -void IMInvoker::purpleShow(PurpleBuddyList *list) { - std::cout << "purpleShow" << std::endl; -} -void IMInvoker::purpleUpdate(PurpleBuddyList *list, PurpleBlistNode *node) { -} -void IMInvoker::purpleRemove(PurpleBuddyList *list, PurpleBlistNode *node) {} -void IMInvoker::purpleDestroy(PurpleBuddyList *list) {} -void IMInvoker::purpleSetVisible(PurpleBuddyList *list, gboolean show) {} -void IMInvoker::purpleRequestAddBuddy(PurpleAccount *account, const char *username, const char *group, const char *alias) { - std::cout << "purpleRequestAddBuddy" << std::endl; -} -void IMInvoker::purpleRequestAddChat(PurpleAccount *account, PurpleGroup *group, const char *alias, const char *name) { - std::cout << "purpleRequestAddChat" << std::endl; -} -void IMInvoker::purpleRequestAddGroup(void) { - std::cout << "purpleRequestAddGroup" << std::endl; -} -void IMInvoker::purpleSaveNode(PurpleBlistNode *node) {} -void IMInvoker::purpleRemoveNode(PurpleBlistNode *node) {} -void IMInvoker::purpleSaveAccount(PurpleAccount *account) {} - -// file transfer operations -void IMInvoker::purpleNewXfer(PurpleXfer *xfer) { - std::cout << "purpleNewXfer" << std::endl; -} -void IMInvoker::purpleDestroy(PurpleXfer *xfer) { - std::cout << "purpleDestroy" << std::endl; -} -void IMInvoker::purpleAddXfer(PurpleXfer *xfer) { - std::cout << "purpleAddXfer" << std::endl; -} -void IMInvoker::purpleUpdateProgress(PurpleXfer *xfer, double percent) { - std::cout << "purpleUpdateProgress" << std::endl; -} -void IMInvoker::purpleCancelLocal(PurpleXfer *xfer) { - std::cout << "purpleCancelLocal" << std::endl; -} -void IMInvoker::purpleCancelRemote(PurpleXfer *xfer) { - std::cout << "purpleCancelRemote" << std::endl; -} -gssize IMInvoker::purpleWrite(PurpleXfer *xfer, const guchar *buffer, gssize size) { - std::cout << "purpleWrite" << std::endl; - return 0; -} -gssize IMInvoker::purpleRead(PurpleXfer *xfer, guchar **buffer, gssize size) { - std::cout << "purpleRead" << std::endl; - return 0; -} -void IMInvoker::purpleDataNotSent(PurpleXfer *xfer, const guchar *buffer, gsize size) { - std::cout << "purpleDataNotSent" << std::endl; -} -void IMInvoker::purpleAddThumbnail(PurpleXfer *xfer, const gchar *formats) { - std::cout << "purpleAddThumbnail" << std::endl; -} - -// notification operations -#if LIBPURPLE_VERSION_MAJOR >= 3 -void* IMInvoker::purpeNotifyMessage(PurpleNotifyMsgType type, const char *title, const char *primary, const char *secondary, PurpleRequestCommonParameters *cpar) { -#else -void* IMInvoker::purpeNotifyMessage(PurpleNotifyMsgType type, const char *title, const char *primary, const char *secondary) { -#endif - return NULL; -} -void* IMInvoker::purpeNotifyEmail(PurpleConnection *gc, const char *subject, const char *from, const char *to, const char *url) { - return NULL; -} -void* IMInvoker::purpeNotifyEmails(PurpleConnection *gc, size_t count, gboolean detailed, const char **subjects, const char **froms, const char **tos, const char **urls) { - return NULL; -} -void* IMInvoker::purpeNotifyFormatted(const char *title, const char *primary, const char *secondary, const char *text) { - return NULL; -} -void* IMInvoker::purpeNotifySearchResults(PurpleConnection *gc, const char *title, const char *primary, const char *secondary, PurpleNotifySearchResults *results, gpointer user_data) { - return NULL; -} -void IMInvoker::purpeNotifySearchResultsNewRows(PurpleConnection *gc, PurpleNotifySearchResults *results, void *data) {} -void* IMInvoker::purpeNotifyUserInfo(PurpleConnection *gc, const char *who, PurpleNotifyUserInfo *user_info) { - return NULL; -} -void* IMInvoker::purpeNotifyURI(const char *uri) { - return NULL; -} -void IMInvoker::purpeNotifyClose(PurpleNotifyType type, void *ui_handle) {} - -// privacy ui operations -void IMInvoker::purplePermitAdded(PurpleAccount *account, const char *name) {} -void IMInvoker::purplePermitRemoved(PurpleAccount *account, const char *name) {} -void IMInvoker::purpleDebyAdded(PurpleAccount *account, const char *name) {} -void IMInvoker::purpleDenyRemoved(PurpleAccount *account, const char *name) {} - - -// request ui operations -#if LIBPURPLE_VERSION_MAJOR >= 3 - -void* IMInvoker::purpleRequestInput(const char *title, const char *primary, - const char *secondary, const char *default_value, - gboolean multiline, gboolean masked, gchar *hint, - const char *ok_text, GCallback ok_cb, - const char *cancel_text, GCallback cancel_cb, - PurpleRequestCommonParameters *cpar, void *user_data) { - return NULL; -} -void* IMInvoker::purpleRequestChoice(const char *title, const char *primary, - const char *secondary, gpointer default_value, - const char *ok_text, GCallback ok_cb, const char *cancel_text, - GCallback cancel_cb , PurpleRequestCommonParameters *cpar, - void *user_data, va_list choices) { - return NULL; -} -void* IMInvoker::purpleRequestAction(const char *title, const char *primary, - const char *secondary, int default_action, - PurpleRequestCommonParameters *cpar, void *user_data, - size_t action_count, va_list actions) { - return NULL; -} - -void* IMInvoker::purpleRequestWait(const char *title, const char *primary, - const char *secondary, gboolean with_progress, - PurpleRequestCancelCb cancel_cb, - PurpleRequestCommonParameters *cpar, void *user_data) { - return NULL; -} - -void IMInvoker::purpleRequestWaitUpdate(void *ui_handle, gboolean pulse, gfloat fraction) { -} - -void* IMInvoker::purpleRequestFields(const char *title, const char *primary, - const char *secondary, PurpleRequestFields *fields, - const char *ok_text, GCallback ok_cb, - const char *cancel_text, GCallback cancel_cb, - PurpleRequestCommonParameters *cpar, void *user_data) { - return NULL; -} -void* IMInvoker::purpleRequestFile(const char *title, const char *filename, - gboolean savedialog, GCallback ok_cb, GCallback cancel_cb, - PurpleRequestCommonParameters *cpar, void *user_data) { - // click ok - PurpleXfer *xfer = (PurpleXfer *)user_data; - PurpleXferType xferType = purple_xfer_get_xfer_type(xfer); - if (xferType == PURPLE_XFER_TYPE_RECEIVE) { - ((PurpleRequestFileCb)ok_cb)(user_data, filename); - } else if (xferType == PURPLE_XFER_TYPE_SEND) { - if (purple_xfer_get_local_filename(xfer) != NULL && purple_xfer_get_filename(xfer) != NULL) { - ((PurpleRequestFileCb)ok_cb)(user_data, purple_xfer_get_local_filename(xfer)); - } else { - ((PurpleRequestFileCb)cancel_cb)(user_data, purple_xfer_get_local_filename(xfer)); - } - } - return NULL; -} - -void* IMInvoker::purpleRequestFolder(const char *title, const char *dirname, - GCallback ok_cb, GCallback cancel_cb - , PurpleRequestCommonParameters *cpar, void *user_data) { - return NULL; -} - -void IMInvoker::purpleRequestClose(PurpleRequestType type, void *ui_handle) { - -} -#else - -void* IMInvoker::purpleRequestInput(const char *title, const char *primary, - const char *secondary, const char *default_value, - gboolean multiline, gboolean masked, gchar *hint, - const char *ok_text, GCallback ok_cb, - const char *cancel_text, GCallback cancel_cb, - PurpleAccount *account, const char *who, - PurpleConversation *conv, void *user_data) { - return NULL; -} - -void* IMInvoker::purpleRequestChoice(const char *title, const char *primary, - const char *secondary, int default_value, - const char *ok_text, GCallback ok_cb, - const char *cancel_text, GCallback cancel_cb, - PurpleAccount *account, const char *who, - PurpleConversation *conv, void *user_data, - va_list choices) { - return NULL; -} - -void* IMInvoker::purpleRequestAction(const char *title, const char *primary, - const char *secondary, int default_action, - PurpleAccount *account, const char *who, - PurpleConversation *conv, void *user_data, - size_t action_count, va_list actions) { - return NULL; -} - -void* IMInvoker::purpleRequestFields(const char *title, const char *primary, - const char *secondary, PurpleRequestFields *fields, - const char *ok_text, GCallback ok_cb, - const char *cancel_text, GCallback cancel_cb, - PurpleAccount *account, const char *who, - PurpleConversation *conv, void *user_data) { - return NULL; -} - -void* IMInvoker::purpleRequestFile(const char *title, const char *filename, - gboolean savedialog, GCallback ok_cb, - GCallback cancel_cb, PurpleAccount *account, - const char *who, PurpleConversation *conv, - void *user_data) { - return NULL; -} - -void IMInvoker::purpleRequestClose(PurpleRequestType type, void *ui_handle) { -} - -void* IMInvoker::purpleRequestFolder(const char *title, const char *dirname, - GCallback ok_cb, GCallback cancel_cb, - PurpleAccount *account, const char *who, - PurpleConversation *conv, void *user_data) { - return NULL; -} - -void* IMInvoker::purpleRequestActionWithIcon(const char *title, const char *primary, - const char *secondary, int default_action, - PurpleAccount *account, const char *who, - PurpleConversation *conv, - gconstpointer icon_data, gsize icon_size, - void *user_data, - size_t action_count, va_list actions) { - return NULL; -} - -#endif - - -// connection ui operations -void IMInvoker::purpleConnectProgress(PurpleConnection *gc, const char *text, size_t step, size_t step_count) {} -void IMInvoker::purpleConnected(PurpleConnection *gc) {} -void IMInvoker::purpleDisonnected(PurpleConnection *gc) {} -void IMInvoker::purpleNotice(PurpleConnection *gc, const char *text) {} -void IMInvoker::purpleNetworkConnected(void) {} -void IMInvoker::purpleNetworkDisconnected(void) {} - -#if LIBPURPLE_VERSION_MAJOR >= 3 -void IMInvoker::purpleReportDisconnect(PurpleConnection *gc, PurpleConnectionError reason, const char *text) { -#else -void IMInvoker::purpleReportDisconnect(PurpleConnection *gc, const char *text) { -#endif -} -// whiteboard ui operations -void IMInvoker::purpleCreateWB(PurpleWhiteboard *wb) {} -void IMInvoker::purpleDestroyWB(PurpleWhiteboard *wb) {} -void IMInvoker::purpleSetDimensions(PurpleWhiteboard *wb, int width, int height) {} -void IMInvoker::purpleSetBrush(PurpleWhiteboard *wb, int size, int color) {} -void IMInvoker::purpleDrawPont(PurpleWhiteboard *wb, int x, int y, int color, int size) {} -void IMInvoker::purpleDrawLine(PurpleWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size) {} -void IMInvoker::purpleClearWB(PurpleWhiteboard *wb) {} - -// debug ui operations -void IMInvoker::purpleDebugPrint(PurpleDebugLevel level, const char *category, const char *arg_s) { -// std::cout << category << ": " << arg_s << std::endl; -} - -gboolean IMInvoker::purpleDebugIsEnabled(PurpleDebugLevel level, const char *category) { - return true; -} - - -} diff --git a/src/uscxml/plugins/invoker/im/IMInvoker.h b/src/uscxml/plugins/invoker/im/IMInvoker.h deleted file mode 100644 index 82d5762..0000000 --- a/src/uscxml/plugins/invoker/im/IMInvoker.h +++ /dev/null @@ -1,377 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef IMINVOKER_H_FNWG0XCQ -#define IMINVOKER_H_FNWG0XCQ - -#include <uscxml/Interpreter.h> - -extern "C" { -#include <purple.h> -} - -#include "uscxml/IMConfig.h" - -#if LIBPURPLE_VERSION_MAJOR < 3 -#define PURPLE_STATUS_GET_TYPE purple_status_get_type -#define PURPLE_STATUS_ATTR_GET_ID purple_status_attr_get_id -#define PURPLE_STATUS_ATTR PurpleStatusAttr -#define PURPLE_VALUE PurpleValue -#else -#define PURPLE_STATUS_GET_TYPE purple_status_get_status_type -#define PURPLE_STATUS_ATTR_GET_ID purple_status_attribute_get_id -#define PURPLE_STATUS_ATTR PurpleStatusAttribute -#define PURPLE_VALUE GValue -#endif - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -typedef enum { - PURPLE_BUDDY_NONE = 0x00, /**< No events. */ - PURPLE_BUDDY_SIGNON = 0x01, /**< The buddy signed on. */ - PURPLE_BUDDY_SIGNOFF = 0x02, /**< The buddy signed off. */ - PURPLE_BUDDY_INFO_UPDATED = 0x10, /**< The buddy's information (profile) changed. */ - PURPLE_BUDDY_ICON = 0x40, /**< The buddy's icon changed. */ - PURPLE_BUDDY_MISCELLANEOUS = 0x80, /**< The buddy's service-specific miscalleneous info changed. */ - PURPLE_BUDDY_SIGNON_TIME = 0x11, /**< The buddy's signon time changed. */ - PURPLE_BUDDY_EVIL = 0x12, /**< The buddy's warning level changed. */ - PURPLE_BUDDY_DIRECTIM_CONNECTED = 0x14, /**< Connected to the buddy via DirectIM. */ - PURPLE_BUDDY_DIRECTIM_DISCONNECTED = 0x18, /**< Disconnected from the buddy via DirectIM. */ - PURPLE_BUDDY_NAME = 0x20 /**<Buddy name (UID) changed. */ -} PurpleBuddyEvent; - -class IMInvoker : public InvokerImpl { -public: - struct EventContext { - InvokeRequest invokeReq; - SendRequest sendReq; - IMInvoker* instance; - }; - - IMInvoker(); - virtual ~IMInvoker(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("im"); - names.push_back("instant-messaging"); - names.push_back("http://uscxml.tk.informatik.tu-darmstadt.de/#instant-messaging"); - return names; - } - - virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void cancel(const std::string sendId); - virtual void invoke(const InvokeRequest& req); - -private: - static bool _libPurpleIsInitialized; - static Data _pluginData; - - Data _dataModelVars; - - static Data buddyToData(PurpleBuddy *buddy); - static Data statusToData(PurpleStatus *status); - static Data purpleValueToData(PURPLE_VALUE* value); - - static PurpleAccountUiOps _uiAccountOps; - static PurpleEventLoopUiOps _uiEventLoopOps; - static PurpleCoreUiOps _uiCoreOps; - static PurpleConversationUiOps _uiConvOps; - static PurpleBlistUiOps _uiBuddyOps; - static PurpleXferUiOps _uiXferOps; - static PurpleNotifyUiOps _uiNotifyOps; -#if LIBPURPLE_VERSION_MAJOR < 3 - static PurplePrivacyUiOps _uiPrivacyOps; -#endif - static PurpleRequestUiOps _uiRequestOps; - static PurpleConnectionUiOps _uiConnectOps; - static PurpleWhiteboardUiOps _uiWhiteboardOps; - static PurpleDebugUiOps _uiDebugOps; - -#if LIBPURPLE_VERSION_MAJOR >= 3 - static PurpleRequestFeature _features; -#endif - - static GHashTable* _uiInfo; - static GRand* _gRand; - - static tthread::recursive_mutex _accountMutex; - static std::map<PurpleAccount*, IMInvoker*> _accountInstances; - static tthread::mutex _initMutex; - static tthread::condition_variable _initCond; - static DelayedEventQueue* _eventQueue; - - // libpurple event callbacks - static void signedOnCB(PurpleConnection *gc, gpointer null); - static void conversationCreatedCB(PurpleConversation *conv, void *data); - static void chatJoinedCB(PurpleConversation *conv, void *data); - static void chatJoinFailedCB(PurpleConnection *gc, GHashTable *components); - static void buddyTypingCB(PurpleAccount *account, const char *name, void *data); - static void buddyTypedCB(PurpleAccount *account, const char *name, void *data); - static void buddyTypingStoppedCB(PurpleAccount *account, const char *name, void *data); - static void buddyIdleChangedCB(PurpleBuddy *buddy, gboolean old_idle, gboolean idle, PurpleBuddyEvent event); - static void blistNodeAliasedCB(PurpleBlistNode *node, char *old_alias); - static void buddyEventCB(PurpleBuddy *buddy, PurpleBuddyEvent event); - static void buddyStatusChangedCB(PurpleBuddy *buddy, PurpleStatus *oldstatus, PurpleStatus *newstatus, PurpleBuddyEvent event); - static void buddyAddedCB(PurpleBuddy* buddy); - static void buddyRemovedCB(PurpleBuddy* buddy); - static void fileRecvRequestCB(PurpleXfer *xfer); - static void buddyCapsChangedCB(PurpleBuddy* buddy, PurpleMediaCaps newcaps, PurpleMediaCaps oldcaps); - - // these are only being called from the delayed queue's thread - static void initLibPurple(void *userdata, const std::string event); - static void setupPurpleSignals(); - - static void send(void *userdata, const std::string event); - static void invoke(void *userdata, const std::string event); - - // libpurple ui operations - static guint purpleEventTimeoutAdd(guint interval, GSourceFunc function, gpointer data); - static gboolean purpleEventTimeoutRemove(guint handle); - static guint purpleEventInputAdd(int fd, PurpleInputCondition cond, PurpleInputFunction func, gpointer user_data); - static gboolean purpleEventInputRemove(guint handle); - static int purpleEventInputGetError(int fd, int *error); - static guint purpleEventTimeoutAddSec(guint interval, GSourceFunc function, gpointer data); - - // callback contexts - struct PurpleEventContext { - PurpleInputFunction input; - PurpleInputCondition cond; - int inputFD; - GSourceFunc function; - gpointer data; - }; - static void purpleCallback(void *userdata, const std::string event); - - // libpurple debug - static void purpleDebugPrint(PurpleDebugLevel level, const char *category, const char *arg_s); - static gboolean purpleDebugIsEnabled(PurpleDebugLevel level, const char *category); - - - // libpurple core operations - static void purplePrefsInit(void); - static void purpleDebugInit(void); - static void purpleUIInit(void); - static void purpleQuit(void); - static GHashTable* purpleGetUIInfo(void); - - //libpurple conversation operations - static void purpleCreateConversation(PurpleConversation *conv); - static void purpleDestroyConversation(PurpleConversation *conv); - static void purpleWriteChat(PurpleConversation *conv, const char *who, const char *message, PurpleMessageFlags flags, time_t mtime); - static void purpleWriteIm(PurpleConversation *conv, const char *who, const char *message, PurpleMessageFlags flags, time_t mtime); - static void purpleWriteConv(PurpleConversation *conv, const char *name, const char *alias, const char *message, PurpleMessageFlags flags, time_t mtime); - static void purpleChatAddUsers(PurpleConversation *conv, GList *cbuddies, gboolean new_arrivals); - static void purpleChatRenameUser(PurpleConversation *conv, const char *old_name, const char *new_name, const char *new_alias); - static void purpleChatRemoveUsers(PurpleConversation *conv, GList *users); - static void purpleChatUpdateUser(PurpleConversation *conv, const char *user); - static void purplePresentConversation(PurpleConversation *conv); - static gboolean purpleHasFocus(PurpleConversation *conv); - static gboolean purpleCustomSmileyAdd(PurpleConversation *conv, const char *smile, gboolean remote); - static void purpleCustomSmileyWrite(PurpleConversation *conv, const char *smile, const guchar *data, gsize size); - static void purpleCustomSmileyClose(PurpleConversation *conv, const char *smile); - static void purpleSendConfirm(PurpleConversation *conv, const char *message); - - // buddy operations - static void purpleNewList(PurpleBuddyList *list); - static void purpleNewNode(PurpleBlistNode *node); - static void purpleShow(PurpleBuddyList *list); - static void purpleUpdate(PurpleBuddyList *list, PurpleBlistNode *node); - static void purpleRemove(PurpleBuddyList *list, PurpleBlistNode *node); - static void purpleDestroy(PurpleBuddyList *list); - static void purpleSetVisible(PurpleBuddyList *list, gboolean show); - static void purpleRequestAddBuddy(PurpleAccount *account, const char *username, const char *group, const char *alias); - static void purpleRequestAddChat(PurpleAccount *account, PurpleGroup *group, const char *alias, const char *name); - static void purpleRequestAddGroup(void); - static void purpleSaveNode(PurpleBlistNode *node); - static void purpleRemoveNode(PurpleBlistNode *node); - static void purpleSaveAccount(PurpleAccount *account); - - // file transfer operations - static void purpleNewXfer(PurpleXfer *xfer); - static void purpleDestroy(PurpleXfer *xfer); - static void purpleAddXfer(PurpleXfer *xfer); - static void purpleUpdateProgress(PurpleXfer *xfer, double percent); - static void purpleCancelLocal(PurpleXfer *xfer); - static void purpleCancelRemote(PurpleXfer *xfer); - static gssize purpleWrite(PurpleXfer *xfer, const guchar *buffer, gssize size); - static gssize purpleRead(PurpleXfer *xfer, guchar **buffer, gssize size); - static void purpleDataNotSent(PurpleXfer *xfer, const guchar *buffer, gsize size); - static void purpleAddThumbnail(PurpleXfer *xfer, const gchar *formats); - - // notification operations -#if LIBPURPLE_VERSION_MAJOR >= 3 - static void* purpeNotifyMessage(PurpleNotifyMsgType type, const char *title, const char *primary, const char *secondary , PurpleRequestCommonParameters *cpar); -#else - static void* purpeNotifyMessage(PurpleNotifyMsgType type, const char *title, const char *primary, const char *secondary); -#endif - static void* purpeNotifyEmail(PurpleConnection *gc, const char *subject, const char *from, const char *to, const char *url); - static void* purpeNotifyEmails(PurpleConnection *gc, size_t count, gboolean detailed, const char **subjects, const char **froms, const char **tos, const char **urls); - static void* purpeNotifyFormatted(const char *title, const char *primary, const char *secondary, const char *text); - static void* purpeNotifySearchResults(PurpleConnection *gc, const char *title, const char *primary, const char *secondary, PurpleNotifySearchResults *results, gpointer user_data); - static void purpeNotifySearchResultsNewRows(PurpleConnection *gc, PurpleNotifySearchResults *results, void *data); - static void* purpeNotifyUserInfo(PurpleConnection *gc, const char *who, PurpleNotifyUserInfo *user_info); - static void* purpeNotifyURI(const char *uri); - static void purpeNotifyClose(PurpleNotifyType type, void *ui_handle); - - // account operations - static void accountNotifyAdded(PurpleAccount *account, const char *remote_user, const char *id, const char *alias, const char *message); - static void accountStatusChanged(PurpleAccount *account, PurpleStatus *status); - static void accountRequestAdd(PurpleAccount *account, const char *remote_user, const char *id, const char *alias, const char *message); - static void* accountRequestAuthorize(PurpleAccount *account, const char *remote_user, const char *id, const char *alias, const char *message, gboolean on_list, PurpleAccountRequestAuthorizationCb authorize_cb, PurpleAccountRequestAuthorizationCb deny_cb, void *user_data); - static void accountCloseRequest(void *ui_handle); - - // privacy ui operations - static void purplePermitAdded(PurpleAccount *account, const char *name); - static void purplePermitRemoved(PurpleAccount *account, const char *name); - static void purpleDebyAdded(PurpleAccount *account, const char *name); - static void purpleDenyRemoved(PurpleAccount *account, const char *name); - - // request ui operations -#if LIBPURPLE_VERSION_MAJOR >= 3 - - static void* purpleRequestInput(const char *title, const char *primary, - const char *secondary, const char *default_value, - gboolean multiline, gboolean masked, gchar *hint, - const char *ok_text, GCallback ok_cb, - const char *cancel_text, GCallback cancel_cb, - PurpleRequestCommonParameters *cpar, void *user_data); - static void* purpleRequestChoice(const char *title, const char *primary, - const char *secondary, gpointer default_value, - const char *ok_text, GCallback ok_cb, const char *cancel_text, - GCallback cancel_cb , PurpleRequestCommonParameters *cpar, - void *user_data, va_list choices); - static void* purpleRequestAction(const char *title, const char *primary, - const char *secondary, int default_action, - PurpleRequestCommonParameters *cpar, void *user_data, - size_t action_count, va_list actions); - static void* purpleRequestWait(const char *title, const char *primary, - const char *secondary, gboolean with_progress, - PurpleRequestCancelCb cancel_cb, - PurpleRequestCommonParameters *cpar, void *user_data); - - static void purpleRequestWaitUpdate(void *ui_handle, gboolean pulse, gfloat fraction); - - static void* purpleRequestFields(const char *title, const char *primary, - const char *secondary, PurpleRequestFields *fields, - const char *ok_text, GCallback ok_cb, - const char *cancel_text, GCallback cancel_cb, - PurpleRequestCommonParameters *cpar, void *user_data); - static void* purpleRequestFile(const char *title, const char *filename, - gboolean savedialog, GCallback ok_cb, GCallback cancel_cb, - PurpleRequestCommonParameters *cpar, void *user_data); - static void* purpleRequestFolder(const char *title, const char *dirname, - GCallback ok_cb, GCallback cancel_cb, - PurpleRequestCommonParameters *cpar, void *user_data); - static void purpleRequestClose(PurpleRequestType type, void *ui_handle); -#else - - static void* purpleRequestInput(const char *title, const char *primary, - const char *secondary, const char *default_value, - gboolean multiline, gboolean masked, gchar *hint, - const char *ok_text, GCallback ok_cb, - const char *cancel_text, GCallback cancel_cb, - PurpleAccount *account, const char *who, - PurpleConversation *conv, void *user_data); - - static void* purpleRequestChoice(const char *title, const char *primary, - const char *secondary, int default_value, - const char *ok_text, GCallback ok_cb, - const char *cancel_text, GCallback cancel_cb, - PurpleAccount *account, const char *who, - PurpleConversation *conv, void *user_data, - va_list choices); - - static void* purpleRequestAction(const char *title, const char *primary, - const char *secondary, int default_action, - PurpleAccount *account, const char *who, - PurpleConversation *conv, void *user_data, - size_t action_count, va_list actions); - - static void* purpleRequestFields(const char *title, const char *primary, - const char *secondary, PurpleRequestFields *fields, - const char *ok_text, GCallback ok_cb, - const char *cancel_text, GCallback cancel_cb, - PurpleAccount *account, const char *who, - PurpleConversation *conv, void *user_data); - - static void* purpleRequestFile(const char *title, const char *filename, - gboolean savedialog, GCallback ok_cb, - GCallback cancel_cb, PurpleAccount *account, - const char *who, PurpleConversation *conv, - void *user_data); - - static void purpleRequestClose(PurpleRequestType type, void *ui_handle); - - static void* purpleRequestFolder(const char *title, const char *dirname, - GCallback ok_cb, GCallback cancel_cb, - PurpleAccount *account, const char *who, - PurpleConversation *conv, void *user_data); - - static void* purpleRequestActionWithIcon(const char *title, const char *primary, - const char *secondary, int default_action, - PurpleAccount *account, const char *who, - PurpleConversation *conv, - gconstpointer icon_data, gsize icon_size, - void *user_data, - size_t action_count, va_list actions); - -#endif - - - // connection ui operations - static void purpleConnectProgress(PurpleConnection *gc, const char *text, size_t step, size_t step_count); - static void purpleConnected(PurpleConnection *gc); - static void purpleDisonnected(PurpleConnection *gc); - static void purpleNotice(PurpleConnection *gc, const char *text); - static void purpleNetworkConnected(void); - static void purpleNetworkDisconnected(void); -#if LIBPURPLE_VERSION_MAJOR >= 3 - static void purpleReportDisconnect(PurpleConnection *gc, PurpleConnectionError reason, const char *text); -#else - static void purpleReportDisconnect(PurpleConnection *gc, const char *text); -#endif - - // whiteboard ui operations - static void purpleCreateWB(PurpleWhiteboard *wb); - static void purpleDestroyWB(PurpleWhiteboard *wb); - static void purpleSetDimensions(PurpleWhiteboard *wb, int width, int height); - static void purpleSetBrush(PurpleWhiteboard *wb, int size, int color); - static void purpleDrawPont(PurpleWhiteboard *wb, int x, int y, int color, int size); - static void purpleDrawLine(PurpleWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size); - static void purpleClearWB(PurpleWhiteboard *wb); - - - PurpleAccount* _account; -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(IMInvoker, InvokerImpl); -#endif - -} - - -#endif /* end of include guard: IMINVOKER_H_FNWG0XCQ */ diff --git a/src/uscxml/plugins/invoker/imap/IMAPInvoker.cpp b/src/uscxml/plugins/invoker/imap/IMAPInvoker.cpp deleted file mode 100644 index d3686f9..0000000 --- a/src/uscxml/plugins/invoker/imap/IMAPInvoker.cpp +++ /dev/null @@ -1,495 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#define NOMINMAX // and have MSVC die in a fire for defining min macro -#include "IMAPInvoker.h" -#include <glog/logging.h> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -#include <boost/algorithm/string.hpp> -#include "uscxml/UUID.h" - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new IMAPInvokerProvider() ); - return true; -} -#endif - -IMAPInvoker::IMAPInvoker() { -} - -IMAPInvoker::~IMAPInvoker() { -}; - -boost::shared_ptr<InvokerImpl> IMAPInvoker::create(InterpreterImpl* interpreter) { - boost::shared_ptr<IMAPInvoker> invoker = boost::shared_ptr<IMAPInvoker>(new IMAPInvoker()); - return invoker; -} - -Data IMAPInvoker::getDataModelVariables() { - Data data; - return data; -} - -void IMAPInvoker::run(void* instance) { - IMAPInvoker* INSTANCE = (IMAPInvoker*)instance; - while(true) { - IMAPContext* req = INSTANCE->_workQueue.pop(); - if (INSTANCE->_isRunning) { - INSTANCE->process(req); - } else { - return; - } - } -} - -size_t IMAPInvoker::writeCurlData(void *ptr, size_t size, size_t nmemb, void *userdata) { - if (!userdata) - return 0; - - IMAPContext* ctx = (IMAPContext*)userdata; - - size_t toWrite = (std::min)(ctx->outContent.length() - ctx->readPtr, size * nmemb); - if (toWrite > 0) { - memcpy (ptr, ctx->outContent.c_str() + ctx->readPtr, toWrite); - ctx->readPtr += toWrite; - } - - return toWrite; -} - -size_t IMAPInvoker::readCurlData(void *ptr, size_t size, size_t nmemb, void *userdata) { - if (!userdata) - return 0; - - IMAPContext* ctx = (IMAPContext*)userdata; - ctx->inContent << std::string((char*)ptr, size * nmemb); - - return size * nmemb; -} - - -void IMAPInvoker::send(const SendRequest& req) { - IMAPContext* ctx = NULL; - - if (false) { - } else if (iequals(req.name, "select")) { - IMAPContext::Select* args = new IMAPContext::Select(); - Event::getParam(req.params, "mailbox", args->mailbox); - - ctx = new IMAPContext(); - ctx->command = IMAPContext::IMAP_SELECT; - ctx->arguments = args; - - } else if (iequals(req.name, "examine")) { - IMAPContext::Examine* args = new IMAPContext::Examine(); - Event::getParam(req.params, "mailbox", args->mailbox); - - ctx = new IMAPContext(); - ctx->command = IMAPContext::IMAP_EXAMINE; - ctx->arguments = args; - - } else if (iequals(req.name, "delete")) { - IMAPContext::Delete* args = new IMAPContext::Delete(); - Event::getParam(req.params, "mailbox", args->mailbox); - - ctx = new IMAPContext(); - ctx->command = IMAPContext::IMAP_DELETE; - ctx->arguments = args; - - } else if (iequals(req.name, "rename")) { - IMAPContext::Rename* args = new IMAPContext::Rename(); - Event::getParam(req.params, "mailbox", args->mailbox); - Event::getParam(req.params, "name", args->newName); - - ctx = new IMAPContext(); - ctx->command = IMAPContext::IMAP_RENAME; - ctx->arguments = args; - - } else if (iequals(req.name, "subscribe")) { - IMAPContext::Subscribe* args = new IMAPContext::Subscribe(); - Event::getParam(req.params, "mailbox", args->mailbox); - - ctx = new IMAPContext(); - ctx->command = IMAPContext::IMAP_SUBSCRIBE; - ctx->arguments = args; - - } else if (iequals(req.name, "unsubscribe")) { - IMAPContext::Unsubscribe* args = new IMAPContext::Unsubscribe(); - Event::getParam(req.params, "mailbox", args->mailbox); - - ctx = new IMAPContext(); - ctx->command = IMAPContext::IMAP_UNSUBSCRIBE; - ctx->arguments = args; - - } else if (iequals(req.name, "list")) { - IMAPContext::List* args = new IMAPContext::List(); - Event::getParam(req.params, "mailbox", args->mailbox); - Event::getParam(req.params, "reference", args->refName); - - ctx = new IMAPContext(); - ctx->command = IMAPContext::IMAP_LIST; - ctx->arguments = args; - - } else if (iequals(req.name, "lsub")) { - IMAPContext::LSub* args = new IMAPContext::LSub(); - Event::getParam(req.params, "mailbox", args->mailbox); - Event::getParam(req.params, "reference", args->refName); - - ctx = new IMAPContext(); - ctx->command = IMAPContext::IMAP_LSUB; - ctx->arguments = args; - - } else if (iequals(req.name, "status")) { - IMAPContext::Status* args = new IMAPContext::Status(); - Event::getParam(req.params, "mailbox", args->mailbox); - Event::getParam(req.params, "dataitems", args->dataItems); - - ctx = new IMAPContext(); - ctx->command = IMAPContext::IMAP_STATUS; - ctx->arguments = args; - - } else if (iequals(req.name, "append")) { - IMAPContext::Append* args = new IMAPContext::Append(); - Event::getParam(req.params, "mailbox", args->mailbox); - Event::getParam(req.params, "flags", args->flags); - Event::getParam(req.params, "datetime", args->dateTime); - - if (!Event::getParam(req.params, "message", args->literal)) { - args->literal = req.content; - } - - ctx = new IMAPContext(); - ctx->command = IMAPContext::IMAP_APPEND; - ctx->arguments = args; - - } else if (iequals(req.name, "check")) { - IMAPContext::Check* args = new IMAPContext::Check(); - - ctx = new IMAPContext(); - ctx->command = IMAPContext::IMAP_CHECK; - ctx->arguments = args; - - } else if (iequals(req.name, "close")) { - IMAPContext::Close* args = new IMAPContext::Close(); - - ctx = new IMAPContext(); - ctx->command = IMAPContext::IMAP_CLOSE; - ctx->arguments = args; - - } else if (iequals(req.name, "expunge")) { - IMAPContext::Expunge* args = new IMAPContext::Expunge(); - - ctx = new IMAPContext(); - ctx->command = IMAPContext::IMAP_EXPUNGE; - ctx->arguments = args; - - } else if (iequals(req.name, "search")) { - IMAPContext::Search* args = new IMAPContext::Search(); - Event::getParam(req.params, "charset", args->charSet); - Event::getParam(req.params, "criteria", args->criteria); - - ctx = new IMAPContext(); - ctx->command = IMAPContext::IMAP_SEARCH; - ctx->arguments = args; - - } else if (iequals(req.name, "fetch")) { - IMAPContext::Fetch* args = new IMAPContext::Fetch(); - Event::getParam(req.params, "sequence", args->sequence); - Event::getParam(req.params, "itemnames", args->itemNames); - - ctx = new IMAPContext(); - ctx->command = IMAPContext::IMAP_FETCH; - ctx->arguments = args; - - } else if (iequals(req.name, "store")) { - IMAPContext::Store* args = new IMAPContext::Store(); - Event::getParam(req.params, "sequence", args->sequence); - Event::getParam(req.params, "itemnames", args->itemNames); - Event::getParam(req.params, "values", args->values); - - ctx = new IMAPContext(); - ctx->command = IMAPContext::IMAP_STORE; - ctx->arguments = args; - - } else if (iequals(req.name, "copy")) { - IMAPContext::Copy* args = new IMAPContext::Copy(); - Event::getParam(req.params, "mailbox", args->mailbox); - Event::getParam(req.params, "sequence", args->sequence); - - ctx = new IMAPContext(); - ctx->command = IMAPContext::IMAP_COPY; - ctx->arguments = args; - - } else if (iequals(req.name, "uid")) { - IMAPContext::UId* args = new IMAPContext::UId(); - Event::getParam(req.params, "command", args->command); - Event::getParam(req.params, "arguments", args->arguments); - - ctx = new IMAPContext(); - ctx->command = IMAPContext::IMAP_UID; - ctx->arguments = args; - - } else if (boost::istarts_with(req.name, "x")) { - IMAPContext::XExtension* args = new IMAPContext::XExtension(); - args->command = req.name; - Event::getParam(req.params, "arguments", args->arguments); - - ctx = new IMAPContext(); - ctx->command = IMAPContext::IMAP_XEXTENSION; - ctx->arguments = args; - - } - - if (ctx == NULL) { - returnErrorExecution("Event '" + req.name + "' not known"); - return; - } - - Event::getParam(req.params, "verbose", ctx->verbose); - Event::getParam(req.params, "ssl", ctx->useSSL); - - ctx->invoker = this; - ctx->sendReq = req; - - _workQueue.push(ctx); -} - -void IMAPInvoker::process(IMAPContext* ctx) { - CURL* _curl; - CURLcode curlError; - - // see http://curl.haxx.se/libcurl/c/imap-tls.html - _curl = curl_easy_init(); - if(_curl) { - (curlError = curl_easy_setopt(_curl, CURLOPT_USERNAME, _username.c_str())) == CURLE_OK || - LOG(ERROR) << "Cannot set username: " << curl_easy_strerror(curlError); - (curlError = curl_easy_setopt(_curl, CURLOPT_PASSWORD, _password.c_str())) == CURLE_OK || - LOG(ERROR) << "Cannot set password: " << curl_easy_strerror(curlError); - (curlError = curl_easy_setopt(_curl, CURLOPT_URL, _server.c_str())) == CURLE_OK || - LOG(ERROR) << "Cannot set server string: " << curl_easy_strerror(curlError); - - if (ctx->useSSL) { - (curlError = curl_easy_setopt(_curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL)) == CURLE_OK || - LOG(ERROR) << "Cannot use SSL: " << curl_easy_strerror(curlError); -#if 1 - (curlError = curl_easy_setopt(_curl, CURLOPT_SSL_VERIFYPEER, 0L)) == CURLE_OK || - LOG(ERROR) << "Cannot unset verify peer with SSL: " << curl_easy_strerror(curlError); - (curlError = curl_easy_setopt(_curl, CURLOPT_SSL_VERIFYHOST, 0L)) == CURLE_OK || - LOG(ERROR) << "Cannot unset verify host with SSL: " << curl_easy_strerror(curlError); -#else - (curlError = curl_easy_setopt(_curl, CURLOPT_CAINFO, "/path/to/certificate.pem")) == CURLE_OK || - LOG(ERROR) << "Cannot set CA info path: " << curl_easy_strerror(curlError); -#endif - - } - - (curlError = curl_easy_setopt(_curl, CURLOPT_READFUNCTION, IMAPInvoker::writeCurlData)) == CURLE_OK || - LOG(ERROR) << "Cannot register read function: " << curl_easy_strerror(curlError); - (curlError = curl_easy_setopt(_curl, CURLOPT_READDATA, ctx)) == CURLE_OK || - LOG(ERROR) << "Cannot register userdata for read function: " << curl_easy_strerror(curlError); - (curlError = curl_easy_setopt(_curl, CURLOPT_WRITEFUNCTION, IMAPInvoker::readCurlData)) == CURLE_OK || - LOG(ERROR) << "Cannot register read function: " << curl_easy_strerror(curlError); - (curlError = curl_easy_setopt(_curl, CURLOPT_WRITEDATA, ctx)) == CURLE_OK || - LOG(ERROR) << "Cannot register userdata for write function: " << curl_easy_strerror(curlError); - - if (ctx->verbose) { - (curlError = curl_easy_setopt(_curl, CURLOPT_VERBOSE, 1L)) == CURLE_OK || - LOG(ERROR) << "Cannot set curl to verbose: " << curl_easy_strerror(curlError); - } - - std::stringstream cmdSS; - switch (ctx->command) { - case IMAPContext::IMAP_SELECT: { - IMAPContext::Select* cmd = (IMAPContext::Select*)ctx->arguments; - cmdSS << "SELECT " << "\"" << cmd->mailbox << "\""; - break; - } - case IMAPContext::IMAP_EXAMINE: { - IMAPContext::Examine* cmd = (IMAPContext::Examine*)ctx->arguments; - cmdSS << "EXAMINE " << "\"" << cmd->mailbox << "\""; - break; - } - case IMAPContext::IMAP_CREATE: { - IMAPContext::Create* cmd = (IMAPContext::Create*)ctx->arguments; - cmdSS << "CREATE " << "\"" << cmd->mailbox << "\""; - break; - } - case IMAPContext::IMAP_DELETE: { - IMAPContext::Delete* cmd = (IMAPContext::Delete*)ctx->arguments; - cmdSS << "DELETE " << "\"" << cmd->mailbox << "\""; - break; - } - case IMAPContext::IMAP_RENAME: { - IMAPContext::Rename* cmd = (IMAPContext::Rename*)ctx->arguments; - cmdSS << "RENAME " << "\"" << cmd->mailbox << "\" \"" << cmd->newName << "\""; - break; - } - case IMAPContext::IMAP_SUBSCRIBE: { - IMAPContext::Subscribe* cmd = (IMAPContext::Subscribe*)ctx->arguments; - cmdSS << "SUBSCRIBE " << "\"" << cmd->mailbox << "\""; - break; - } - case IMAPContext::IMAP_UNSUBSCRIBE: { - IMAPContext::Unsubscribe* cmd = (IMAPContext::Unsubscribe*)ctx->arguments; - cmdSS << "UNSUBSCRIBE " << "\"" << cmd->mailbox << "\""; - break; - } - case IMAPContext::IMAP_LIST: { - IMAPContext::List* cmd = (IMAPContext::List*)ctx->arguments; - cmdSS << "LIST " << "\"" << cmd->mailbox << "\" \"" << cmd->refName << "\""; - break; - } - case IMAPContext::IMAP_LSUB: { - IMAPContext::LSub* cmd = (IMAPContext::LSub*)ctx->arguments; - cmdSS << "LSUB " << "\"" << cmd->mailbox << "\" \"" << cmd->refName << "\""; - break; - } - case IMAPContext::IMAP_STATUS: { - IMAPContext::Status* cmd = (IMAPContext::Status*)ctx->arguments; - cmdSS << "STATUS " << "\"" << cmd->mailbox << "\" (" << cmd->dataItems << ")"; - break; - } - case IMAPContext::IMAP_APPEND: { - IMAPContext::Append* cmd = (IMAPContext::Append*)ctx->arguments; - cmdSS << "APPEND " << "\"" << cmd->mailbox << "\" (" << cmd->flags << ") {" << cmd->dateTime << "}"; - break; - } - case IMAPContext::IMAP_CHECK: { - cmdSS << "CHECK"; - break; - } - case IMAPContext::IMAP_CLOSE: { - cmdSS << "CLOSE"; - break; - } - case IMAPContext::IMAP_EXPUNGE: { - cmdSS << "EXPUNGE"; - break; - } - case IMAPContext::IMAP_SEARCH: { - IMAPContext::Search* cmd = (IMAPContext::Search*)ctx->arguments; - cmdSS << "SEARCH "; - if (cmd->charSet.size() > 0) { - cmdSS << "CHARSET " << cmd->charSet << " "; - } - cmdSS << cmd->criteria; - break; - } - case IMAPContext::IMAP_FETCH: { - IMAPContext::Fetch* cmd = (IMAPContext::Fetch*)ctx->arguments; - cmdSS << "FETCH " << cmd->sequence << " " << cmd->itemNames; - break; - } - case IMAPContext::IMAP_STORE: { - IMAPContext::Store* cmd = (IMAPContext::Store*)ctx->arguments; - cmdSS << "STORE " << cmd->sequence << " " << cmd->itemNames << " " << cmd->values; - break; - } - case IMAPContext::IMAP_COPY: { - IMAPContext::Copy* cmd = (IMAPContext::Copy*)ctx->arguments; - cmdSS << "COPY " << "\"" << cmd->mailbox << "\" " << cmd->sequence; - break; - } - case IMAPContext::IMAP_UID: { - IMAPContext::UId* cmd = (IMAPContext::UId*)ctx->arguments; - cmdSS << "UID " << cmd->command << " " << cmd->arguments; - break; - } - case IMAPContext::IMAP_XEXTENSION: { - IMAPContext::XExtension* cmd = (IMAPContext::XExtension*)ctx->arguments; - cmdSS << cmd->command << " " << cmd->arguments; - break; - } - default: - break; - } - curl_easy_setopt(_curl, CURLOPT_CUSTOMREQUEST, cmdSS.str().c_str()); - - CURLcode res = curl_easy_perform(_curl); - - /* Check for errors */ - if(res != CURLE_OK) { - LOG(ERROR) << "curl_easy_perform() failed: " << curl_easy_strerror(res); - returnErrorExecution("error.mail.send"); - } else { - - Event e; - -#if 0 - switch (ctx->command) { - case IMAPContext::LIST: - e.data = parseListReponse(ctx->inContent.str()); - break; - default: - break; - } -#endif - - e.name = ctx->sendReq.name + ".success"; - e.data.compound["raw"] = Data(ctx->inContent.str(), Data::VERBATIM); - - returnEvent(e); - } - - /* Always cleanup */ - curl_easy_cleanup(_curl); - - } -} - -#if 0 -Data IMAPInvoker::parseListReponse(const std::string& response) { - Data data; - - std::string line; - std::istringstream inSS(response); - - while(std::getline(inSS, line, '\n')) { - // individual lines - size_t lastSep = line.find_last_of("\" "); - if (lastSep != std::string::npos) { - - } - } - - return data; -} -#endif - -void IMAPInvoker::cancel(const std::string sendId) { -} - -void IMAPInvoker::invoke(const InvokeRequest& req) { - Event::getParam(req.params, "username", _username); - Event::getParam(req.params, "password", _password); - Event::getParam(req.params, "server", _server); - - _isRunning = true; - _thread = new tthread::thread(IMAPInvoker::run, this); -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/imap/IMAPInvoker.h b/src/uscxml/plugins/invoker/imap/IMAPInvoker.h deleted file mode 100644 index bf2b3e9..0000000 --- a/src/uscxml/plugins/invoker/imap/IMAPInvoker.h +++ /dev/null @@ -1,171 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef IMAPINVOKER_H_W09JFED0 -#define IMAPINVOKER_H_W09JFED0 - -#include <uscxml/Interpreter.h> -#include <uscxml/concurrency/BlockingQueue.h> - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -#include <curl/curl.h> - -namespace uscxml { - -class IMAPInvoker : public InvokerImpl { -public: - IMAPInvoker(); - virtual ~IMAPInvoker(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("imap"); - names.push_back("http://uscxml.tk.informatik.tu-darmstadt.de/#imap"); - return names; - } - - virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void cancel(const std::string sendId); - virtual void invoke(const InvokeRequest& req); - -protected: - - class IMAPContext { - - public: - enum Cmd { - // valid in authenticated state - IMAP_SELECT, - IMAP_EXAMINE, - IMAP_CREATE, - IMAP_DELETE, - IMAP_RENAME, - IMAP_SUBSCRIBE, - IMAP_UNSUBSCRIBE, - IMAP_LIST, - IMAP_LSUB, - IMAP_STATUS, - IMAP_APPEND, - // valid in selected state - IMAP_CHECK, - IMAP_CLOSE, - IMAP_EXPUNGE, - IMAP_SEARCH, - IMAP_FETCH, - IMAP_STORE, - IMAP_COPY, - IMAP_UID, - IMAP_XEXTENSION, - }; - - struct MailboxOp { - std::string mailbox; - }; - - struct Select : MailboxOp {}; - struct Examine : MailboxOp {}; - struct Create : MailboxOp {}; - struct Delete : MailboxOp {}; - struct Rename : MailboxOp { - std::string newName; - }; - struct Subscribe : MailboxOp {}; - struct Unsubscribe : MailboxOp {}; - struct List : MailboxOp { - std::string refName; - }; - struct LSub : List {}; - struct Status : MailboxOp { - std::string dataItems; - }; - struct Append : MailboxOp { - std::string flags; - std::string dateTime; - std::string literal; - }; - struct Check {}; - struct Close {}; - struct Expunge {}; - struct Search { - std::string charSet; - std::string criteria; - }; - struct Fetch { - std::string sequence; - std::string itemNames; - }; - struct Store : Fetch { - std::string values; - }; - struct Copy : MailboxOp { - std::string sequence; - }; - struct UId { - std::string command; - std::string arguments; - }; - struct XExtension : UId {}; - - - IMAPContext() : readPtr(0) {} - - void* arguments; - Cmd command; - - IMAPInvoker* invoker; - SendRequest sendReq; - std::stringstream inContent; - std::string outContent; - size_t readPtr; - bool verbose; - bool useSSL; - - }; - -protected: - std::string _username; - std::string _password; - std::string _server; - - static void run(void*); - - tthread::thread* _thread; - uscxml::concurrency::BlockingQueue<IMAPContext*> _workQueue; - bool _isRunning; - - void process(IMAPContext* ctx); - static size_t writeCurlData(void *ptr, size_t size, size_t nmemb, void *userdata); - static size_t readCurlData(void *ptr, size_t size, size_t nmemb, void *userdata); - -// Data parseListReponse(const std::string& response); -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(IMAPInvoker, InvokerImpl); -#endif - -} - - -#endif /* end of include guard: IMAPINVOKER_H_W09JFED0 */ diff --git a/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp b/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp deleted file mode 100644 index 7b12ddd..0000000 --- a/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp +++ /dev/null @@ -1,1097 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include <boost/algorithm/string.hpp> - -#include "MilesSessionInvoker.h" -#include "uscxml/server/HTTPServer.h" -#include <glog/logging.h> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -#include <inttypes.h> -#include <stdlib.h> /* srand, rand */ - -#ifdef _WIN32 -#define strdup _strdup -#endif - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new MilesSessionInvokerProvider() ); - return true; -} -#endif - -MilesSessionInvoker::MilesSessionInvoker() { - /* Initialize Miles */ - miles_init(); - - _isRunning = false; - _imageSeq = 0; - num_connected = 0; -} - -MilesSessionInvoker::~MilesSessionInvoker() { - free_media_buffers(); -}; - -boost::shared_ptr<InvokerImpl> MilesSessionInvoker::create(InterpreterImpl* interpreter) { - boost::shared_ptr<MilesSessionInvoker> invoker = boost::shared_ptr<MilesSessionInvoker>(new MilesSessionInvoker()); - invoker->_interpreter = interpreter; - return invoker; -} - -Data MilesSessionInvoker::getDataModelVariables() { - Data data; - return data; -} - -void MilesSessionInvoker::init_media_buffers() { - video_out_buf = NULL; - video_conv_buf = NULL; - encoded_out_img = NULL; - audio_in_buf = NULL; - render_img = NULL; - render_img_size = 0; - audio_data = NULL; - encoded_out_audio = NULL; - audio_read_buf = NULL; - video_data = (char *)malloc(1000000); - text_msg_buf = (char *)malloc(1000); - text_msg_available = 0; -} - -void MilesSessionInvoker::free_media_buffers() { - if(video_out_buf) - free(video_out_buf); - video_out_buf = NULL; - if(video_conv_buf) - free(video_conv_buf); - video_conv_buf = NULL; - if(encoded_out_img) - free(encoded_out_img); - encoded_out_img = NULL; - if(audio_in_buf) - free(audio_in_buf); - audio_in_buf = NULL; - if(render_img) - free(render_img); - render_img = NULL; - render_img_size = 0; - if(audio_data) - free(audio_data); - audio_data = NULL; - if(video_data) - free(video_data); - video_data = NULL; - if(encoded_out_audio) - free(encoded_out_audio); - encoded_out_audio = NULL; - if(audio_read_buf) - free(audio_read_buf); - audio_read_buf = NULL; - if(text_msg_buf) - free(text_msg_buf); - text_msg_buf = NULL; - text_msg_available = 0; -} - -void MilesSessionInvoker::free_video_buffers() { - if(video_out_buf) - free(video_out_buf); - video_out_buf = NULL; - if(video_conv_buf) - free(video_conv_buf); - video_conv_buf = NULL; - if(encoded_out_img) - free(encoded_out_img); - encoded_out_img = NULL; - if(render_img) - free(render_img); - render_img = NULL; - render_img_size = 0; - if(video_data) - free(video_data); - video_data = NULL; -} - -void MilesSessionInvoker::free_audio_buffers() { - if(audio_in_buf) - free(audio_in_buf); - audio_in_buf = NULL; - if(audio_data) - free(audio_data); - audio_data = NULL; - video_data = NULL; - if(encoded_out_audio) - free(encoded_out_audio); - encoded_out_audio = NULL; - if(audio_read_buf) - free(audio_read_buf); - audio_read_buf = NULL; -} - -void MilesSessionInvoker::free_text_buffers() { - if(text_msg_buf) - free(text_msg_buf); - text_msg_buf = NULL; - text_msg_available = 0; -} - -// Yes, sort of ugly... -char confero_text_msg_buf[1000]; -int confero_text_msg_available = 0; - -int receive_text_message_callback(u_int32_t ssrc, char *pkt, int length) { - char cname[100]; - int i=0, j; - - while(pkt[i]) { - cname[i] = pkt[i]; - i++; - } - cname[i++] = 0; - j = i; - while(pkt[j] && j<length) { - if(pkt[j]=='<' || pkt[j]=='>' || pkt[j]=='\r' || pkt[j]=='\n') - pkt[j] = ' '; - j++; - } - memcpy(confero_text_msg_buf, pkt+i, length-i); - //printf("RTCP app depacketizer called, cname = %s, msg = %s\n", cname, confero_text_msg_buf); - confero_text_msg_available = 1; - return length; -} - -void MilesSessionInvoker::send(const SendRequest& req) { -// std::cout << req; - std::string origin; - Event::getParam(req.params, "origin", origin); - - if (false) { - } else if (iequals(req.name, "start")) { - - std::string userId, reflector, session; - Event::getParam(req.params, "userid", userId); - Event::getParam(req.params, "reflector", reflector); - Event::getParam(req.params, "session", session); - processEventStart(origin, userId, reflector, session); - - } else if (iequals(req.name, "stop")) { - - processEventStop(origin); - - } else if (iequals(req.name, "participants")) { - - processEventParticipants(origin); - - } else if (iequals(req.name, "thumbnail")) { - - std::string userId; - Event::getParam(req.params, "userid", userId); - processEventThumbnail(origin, userId); - - } else if (iequals(req.name, "videoon")) { - - std::string userId; - Event::getParam(req.params, "userid", userId); - processEventVideoOn(origin, userId); - - } else if (iequals(req.name, "videooff")) { - - std::string userId; - Event::getParam(req.params, "userid", userId); - processEventVideoOff(origin, userId); - - } else if (iequals(req.name, "audioon")) { - - std::string userId; - Event::getParam(req.params, "userid", userId); - processEventAudioOn(origin, userId); - - } else if (iequals(req.name, "audiooff")) { - - std::string userId; - Event::getParam(req.params, "userid", userId); - processEventAudioOff(origin, userId); - - } else if (iequals(req.name, "sendvideo")) { - - std::string userId, compression; - size_t height, width, framerate; - Event::getParam(req.params, "userid", userId); - Event::getParam(req.params, "height", height); - Event::getParam(req.params, "width", width); - Event::getParam(req.params, "framerate", framerate); - processEventSendVideo(origin, width, height, framerate, compression); - - } else if (iequals(req.name, "sendvideooff")) { - - processEventSendVideoOff(origin); - - } else if (iequals(req.name, "sendaudio")) { - - std::string userId, encoding; - Event::getParam(req.params, "userid", userId); - Event::getParam(req.params, "encoding", encoding); - processEventSendAudio(origin, encoding); - - } else if (iequals(req.name, "sendaudiooff")) { - - processEventSendAudioOff(origin); - - } else if (iequals(req.name, "gettext")) { - - processEventGetText(origin); - - } else if (iequals(req.name, "posttext")) { - - std::string userId, message; - Event::getParam(req.params, "userid", userId); - Event::getParam(req.params, "message", message); - processEventPostText(origin, userId, message); - - } else { - LOG(ERROR) << "Do not know how to handle event " << req.name; - } - -} - -void MilesSessionInvoker::processEventStart(const std::string& origin, const std::string& userid, const std::string& reflector, const std::string& session) { - - Event ev; - ev.data.compound["origin"] = Data(origin, Data::INTERPRETED); - //std::cout << req; - if(num_connected>0) { - num_connected++; - ev.name = "start.reply"; - returnEvent(ev); - return; - } - - LOG(ERROR) << "miles/start called, reflector ip = " << reflector << " session name = " << session << " userid = " << userid; - - int rv; - rv = miles_connect_reflector_session((char*)reflector.c_str(), (char*)session.c_str()); - if (!rv) { - LOG(ERROR) << "Could not setup reflector session"; - ev.name = "start.error"; - returnEvent(ev); - return; - } - LOG(ERROR) << "session set up"; - - /* set up media buffers */ - init_media_buffers(); - - /* Set up audio and video RTP sockets */ - video_rtp_in_socket = miles_net_setup_udp_socket((char*)reflector.c_str(), video_port, video_port, 10, 16000); - audio_rtp_in_socket = miles_net_setup_udp_socket((char*)reflector.c_str(), audio_port, audio_port, 10, 16000); - video_rtp_out_socket = video_rtp_in_socket; - audio_rtp_out_socket = audio_rtp_in_socket; - - - /* Set up audio and video RTCP sockets */ - video_rtcp_in_socket = miles_net_setup_udp_socket((char*)reflector.c_str(), video_port+1, video_port+1, 10, 16000); - audio_rtcp_in_socket = miles_net_setup_udp_socket((char*)reflector.c_str(), audio_port+1, audio_port+1, 10, 16000); - video_rtcp_out_socket = video_rtcp_in_socket; - audio_rtcp_out_socket = audio_rtcp_in_socket; - - /* Set up RTP audio and video sessions */ - video_session = miles_rtp_setup_session(video_rtp_in_socket, MILES_RTP_MEDIA_TYPE_VIDEO); - audio_session = miles_rtp_setup_session(audio_rtp_in_socket, MILES_RTP_MEDIA_TYPE_AUDIO); - - /* Set up RTCP audio and video sessions */ - video_session->rtcp_session = miles_rtp_setup_rtcp_session(video_session, video_rtcp_in_socket); - audio_session->rtcp_session = miles_rtp_setup_rtcp_session(audio_session, audio_rtcp_in_socket); - - /* Set up video capture */ - video_grabber_available = setup_video_grabber(); - if(video_grabber_available) - sendvideo_enabled = 1; - - /* Set up audio capture/playback */ - audio_available = setup_audio(); - if(audio_available) - sendaudio_enabled = 1; - - /* Set up outgoing RTP stream for video */ - if(video_grabber_available) { - out_rtp_video_stream = miles_rtp_setup_outgoing_stream(video_session, video_rtp_out_socket, 0, MILES_RTP_PAYLOAD_TYPE_JPEG); - out_rtp_video_stream->codec_ctx = video_encoder; - out_rtcp_video_stream = miles_rtp_setup_outgoing_rtcp_stream(video_session->rtcp_session, video_rtcp_out_socket, out_rtp_video_stream->ssrc); - if(out_rtp_video_stream->sdes.cname) - free(out_rtp_video_stream->sdes.cname); - out_rtp_video_stream->sdes.cname = strdup(userid.c_str()); - } - - /* Set up outgoing RTP stream for audio */ - if(audio_available) { - out_rtp_audio_stream = miles_rtp_setup_outgoing_stream(audio_session, audio_rtp_out_socket, 0, MILES_RTP_PAYLOAD_TYPE_L16); - if(out_rtp_audio_stream->sdes.cname) - free(out_rtp_audio_stream->sdes.cname); - out_rtp_audio_stream->sdes.cname = strdup(userid.c_str()); - - /* Associate RTP stream with codec context */ - out_rtp_audio_stream->codec_ctx = audio_encoder; - - /* Set up outgoing RTCP streams for audio */ - out_rtcp_audio_stream = miles_rtp_setup_outgoing_rtcp_stream(audio_session->rtcp_session, audio_rtcp_out_socket, out_rtp_audio_stream->ssrc); - } - - /* Register RTCP APP handler for text messages */ - rv = miles_rtp_register_rtcp_app_handler("text", NULL, receive_text_message_callback, 0); - if(rv==0) { - LOG(ERROR) << "Error registering text message callback"; - } - memset(confero_text_msg_buf, 0, 1000); - - _isRunning = true; - num_connected=1; - _reflector = reflector; - _userId = userid; - _session = session; - - if(audio_available) - _audioThread = new tthread::thread(MilesSessionInvoker::runAudio, this); - _videoThread = new tthread::thread(MilesSessionInvoker::runVideo, this); - ev.name = "start.reply"; - returnEvent(ev); -} - -void MilesSessionInvoker::processEventStop(const std::string& origin) { - Event ev; - ev.data.compound["origin"] = Data(origin, Data::INTERPRETED); - - if(num_connected==0) { - LOG(ERROR) << "not connected"; - ev.name = "stop.error"; - returnEvent(ev); - return; - } - num_connected--; - if(num_connected>0) { - ev.name = "stop.reply"; - returnEvent(ev); - return; - } - int rv = miles_disconnect_reflector_session((char*)_reflector.c_str(), (char*)_session.c_str()); - if (!rv) { - LOG(ERROR) << "Could not disconnect from reflector session"; - ev.name = "stop.error"; - returnEvent(ev); - return; - } - /* Unregister RTCP APP handler for text messages */ - rv = miles_rtp_unregister_rtcp_app_handler("text"); - if(rv==0) { - LOG(ERROR) << "Error registering text message callback"; - } - _isRunning = false; - free_text_buffers(); - ev.name = "stop.reply"; - returnEvent(ev); - LOG(ERROR) << "disconnected from reflector session"; -} - -void MilesSessionInvoker::processEventParticipants(const std::string& origin) { - - Event ev; - ev.data.compound["origin"] = Data(origin, Data::INTERPRETED); - if(num_connected==0) { - LOG(ERROR) << "not connected"; - ev.name = "participants.error"; - returnEvent(ev); - return; - } - // create an array with objects inside - for (int i = 0; i < 5; i++) { - Data userInfo; - userInfo.compound["name"] = Data("username" + toStr(i), Data::VERBATIM); - userInfo.compound["email"] = Data("usermail" + toStr(i), Data::VERBATIM); - ev.data.compound["participants"].array.push_back(userInfo); - } - - ev.name = "participants.reply"; - returnEvent(ev); -} - -void MilesSessionInvoker::processEventThumbnail(const std::string& origin, const std::string& userid) { - Event ev; - ev.data.compound["origin"] = Data(origin, Data::INTERPRETED); - if(num_connected==0) { - LOG(ERROR) << "not connected"; - ev.name = "thumbnail.error"; - returnEvent(ev); - return; - } - - _imageSeq++; - if (_imageSeq > 4) - _imageSeq = 1; - - std::stringstream testImageName; - testImageName << "test" << _imageSeq << ".jpeg"; - - URL imageURL(testImageName.str()); - imageURL.toAbsolute(_interpreter->getBaseURL()); - std::stringstream ssImage; - ssImage << imageURL; - std::string imageContent = ssImage.str(); - - ev.name = "thumbnail.reply"; - - struct thumb_entry *use_thumb = NULL; - struct miles_list *p; - struct thumb_entry *te; - _mutex.lock(); - // Find thumbnail of user - p = thumb_list; - while(p) { - te = (struct thumb_entry *)p->item; - if(te->userid && strcmp(te->userid, userid.c_str()) == 0) { - use_thumb = te; - break; - } - if(te->userid==NULL && use_thumb == NULL) { - use_thumb = te; - } - p = p->next; - } - if(!p && use_thumb) - use_thumb->userid = strdup(userid.c_str()); - if(use_thumb) { - ev.data.compound["image"] = Data(use_thumb->img_buf, use_thumb->img_size, "image/jpeg"); - } else { - // Return empty face image - ev.data.compound["image"] = Data(imageContent.data(), imageContent.size(), "image/jpeg"); - } - _mutex.unlock(); - - returnEvent(ev); -} - -void MilesSessionInvoker::processEventVideoOn(const std::string& origin, const std::string& userid) { - Event ev; - ev.name = "videoon.reply"; - ev.data.compound["origin"] = Data(origin, Data::INTERPRETED); - returnEvent(ev); -} -void MilesSessionInvoker::processEventVideoOff(const std::string& origin, const std::string& userid) { - Event ev; - ev.name = "videooff.reply"; - ev.data.compound["origin"] = Data(origin, Data::INTERPRETED); - returnEvent(ev); -} -void MilesSessionInvoker::processEventAudioOn(const std::string& origin, const std::string& userid) { - Event ev; - ev.name = "audioon.reply"; - ev.data.compound["origin"] = Data(origin, Data::INTERPRETED); - returnEvent(ev); -} -void MilesSessionInvoker::processEventAudioOff(const std::string& origin, const std::string& userid) { - Event ev; - ev.name = "audiooff.reply"; - ev.data.compound["origin"] = Data(origin, Data::INTERPRETED); - returnEvent(ev); -} -void MilesSessionInvoker::processEventSendVideo(const std::string& origin, size_t width, size_t height, size_t framerate, const std::string& compression) { - Event ev; - ev.name = "sendvideo.reply"; - ev.data.compound["origin"] = Data(origin, Data::INTERPRETED); - sendvideo_enabled = 1; - returnEvent(ev); -} -void MilesSessionInvoker::processEventSendVideoOff(const std::string& origin) { - Event ev; - ev.name = "sendvideooff.reply"; - ev.data.compound["origin"] = Data(origin, Data::INTERPRETED); - returnEvent(ev); - sendvideo_enabled = 0; -} -void MilesSessionInvoker::processEventSendAudio(const std::string& origin, const std::string& encoding) { - Event ev; - ev.name = "sendaudio.reply"; - ev.data.compound["origin"] = Data(origin, Data::INTERPRETED); - returnEvent(ev); - sendaudio_enabled = 1; -} -void MilesSessionInvoker::processEventSendAudioOff(const std::string& origin) { - Event ev; - ev.name = "sendaudiooff.reply"; - ev.data.compound["origin"] = Data(origin, Data::INTERPRETED); - returnEvent(ev); - sendaudio_enabled = 0; -} -void MilesSessionInvoker::processEventPostText(const std::string& origin, const std::string& userid, const std::string& message) { - char msgbuf[1000]; - char pkt[1000]; - char *cname = "user@all"; // for now - int n, length; - Event ev; - - ev.data.compound["origin"] = Data(origin, Data::INTERPRETED); - if(num_connected==0) { - LOG(ERROR) << "not connected"; - ev.name = "posttext.error"; - returnEvent(ev); - return; - } - ev.name = "posttext.reply"; - returnEvent(ev); - if(out_rtcp_video_stream==NULL) - return; - //printf("sending message %s\n", message.c_str()); - memcpy(msgbuf, cname, strlen(cname)+1); - sprintf(msgbuf+strlen(cname)+1, "<%s>: %s", userid.c_str(), message.c_str()); - n = strlen(cname)+1 + userid.length() + 4 + message.length(); - length = miles_rtp_make_rtcp_app(pkt, out_rtcp_video_stream->ssrc, "text", n, msgbuf); - if(length>0 && out_rtcp_video_stream) - out_rtcp_video_stream->send_packet(out_rtcp_video_stream->socket, pkt, length, 0); -} - -void MilesSessionInvoker::processEventGetText(const std::string& origin) { - Event ev; - ev.data.compound["origin"] = Data(origin, Data::INTERPRETED); - if(num_connected==0) { - LOG(ERROR) << "not connected"; - ev.name = "gettext.error"; - returnEvent(ev); - return; - } - - ev.name = "gettext.reply"; - if(confero_text_msg_available) { - strcpy(text_msg_buf, confero_text_msg_buf); - ev.data.compound["message"] = Data(text_msg_buf, Data::VERBATIM); - //ev.data.compound["message"] = Data(base64_encode(text_msg_buf, strlen(text_msg_buf)), Data::VERBATIM); - ev.data.compound["user"] = Data("username1", Data::VERBATIM); - memset(confero_text_msg_buf, 0, 1000); - confero_text_msg_available = 0; - } - - returnEvent(ev); -} - -void MilesSessionInvoker::runAudio(void* instance) { - ((MilesSessionInvoker*)instance)->processAudio(); -} - -void MilesSessionInvoker::runVideo(void* instance) { - ((MilesSessionInvoker*)instance)->processVideo(); -} - -void MilesSessionInvoker::processVideo() { - while(_isRunning) { - rtp_video_receiver(video_session); - if(video_grabber_available && sendvideo_enabled) - video_transmitter(video_grabber, video_encoder, out_rtp_video_stream, out_rtcp_video_stream); - } - /* done, clean up */ - if(video_grabber_available) { - miles_rtp_destroy_out_stream(out_rtp_video_stream); - miles_video_grabber_destroy(video_grabber); - miles_video_codec_destroy_encoder(video_encoder); - video_grabber_available = 0; - sendvideo_enabled = 0; - } - miles_rtp_destroy_session(video_session); - miles_list_destroy(thumb_list); - thumb_list = NULL; - miles_net_socket_close(video_rtp_in_socket); - miles_net_socket_close(video_rtcp_in_socket); - - free_video_buffers(); -} - -void MilesSessionInvoker::processAudio() { - while(_isRunning) { - rtp_audio_receiver(audio_session); - if(audio_available && sendaudio_enabled) - audio_transmitter(audio_dev, audio_encoder, out_rtp_audio_stream, out_rtcp_audio_stream); - } - /* done, clean up */ - if(audio_available) { - miles_rtp_destroy_out_stream(out_rtp_audio_stream); - if(audio_dev_playback) - miles_audio_device_close(MILES_AUDIO_IO_OPENAL, audio_dev_playback, 0); - if(audio_dev) - miles_audio_device_close(MILES_AUDIO_IO_OPENAL, audio_dev, 1); - miles_audio_codec_destroy_encoder(audio_encoder); - audio_available = 0; - sendaudio_enabled = 0; - } - miles_rtp_destroy_session(audio_session); - miles_net_socket_close(audio_rtp_in_socket); - miles_net_socket_close(audio_rtcp_in_socket); - - free_video_buffers(); -} - -int MilesSessionInvoker::setup_audio() { - /* Check that we have OpeanAL audio */ - if(!miles_audio_io_is_supported(MILES_AUDIO_IO_OPENAL)) { - fprintf(stderr, "OpenAL audio i/o not supported on this platform.\n"); - return 0; - } - - /* Initialize and configure audio encoder */ - audio_encoder = miles_audio_codec_init_encoder(); - audio_encoder->codec_id = miles_audio_codec_get_encoder_for_rtp_payload_type(MILES_RTP_PAYLOAD_TYPE_L16); - audio_encoder->sample_rate = 16000; - audio_encoder->bytes_per_sample = 2; - audio_encoder->chunk_size = 320; /* 20 ms */ - audio_encoder->input_format = MILES_AUDIO_FORMAT_PCM; - int rv = miles_audio_codec_setup_encoder(audio_encoder); - if(rv == 0) { - /* Couldn't set up audio codec */ - LOG(ERROR) << "Couldn't set up audio codec"; - return 0; - } - - /* Set up audio grabber */ - int n = miles_audio_device_get_supported_devices(MILES_AUDIO_IO_OPENAL, &supported_audio_devices); - if(n<=0) { - /* No audio device available */ - LOG(ERROR) << "No audio device available"; - return 0; - } - /* Use first device that supports capture */ - for(int i=0; i<n; i++) { - audio_dev = miles_audio_device_open(MILES_AUDIO_IO_OPENAL, supported_audio_devices[i].id, MILES_AUDIO_FORMAT_PCM, 16000, 2, 1, 640, 1); - if(audio_dev) - break; - } - if(audio_dev == NULL) { - LOG(ERROR) << "No audio device supporting capture available"; - return 0; - } - - /* Find first audio device that supports playback */ - for(int i=0; i<n; i++) { - audio_dev_playback = miles_audio_device_open(MILES_AUDIO_IO_OPENAL, supported_audio_devices[i].id, MILES_AUDIO_FORMAT_PCM, 16000, 2, 1, 640, 0); - if(audio_dev_playback) { - audio_dev_playback_id = supported_audio_devices[i].id; - break; - } - } - if(audio_dev_playback == NULL) { - LOG(ERROR) << "No audio device supporting playback available"; - return 0; - } - - audio_in_buf = (char *)malloc(audio_encoder->sample_rate*audio_encoder->bytes_per_sample); - encoded_out_audio = (char *)malloc(audio_encoder->sample_rate*audio_encoder->bytes_per_sample); - audio_read_buf = (char *)malloc(audio_encoder->sample_rate*audio_encoder->bytes_per_sample); - audio_data = (char *)malloc(1000000); - - LOG(ERROR) << "audio device set up"; - return 1; -} - -int MilesSessionInvoker::setup_video_grabber() { - struct miles_video_grabber_description *grabber_description; - - /* Set up video grabber */ - int n = miles_video_grabber_get_supported_grabbers(&supported_video_grabbers); - if(n<=0) { - /* No video grabber available */ - LOG(ERROR) << "No video grabber available"; - return 0; - } - int use_grabber = 0; - if(n>1) { - /* If more than one grabber, select one that is not 'Test' */ - for(int i=0; i<n; i++) { - grabber_description = miles_video_grabber_get_description(supported_video_grabbers[i]); - if(strcmp(grabber_description->name, "Test") != 0) { - /* Make sure there is a device */ - if(grabber_description->devices != NULL) { - use_grabber = i; - free(grabber_description); - break; - } - } - free(grabber_description); - } - } - grabber_description = miles_video_grabber_get_description(supported_video_grabbers[use_grabber]); - printf("Using video grabber %s\n", grabber_description->name); - video_grabber = miles_video_grabber_create_context(supported_video_grabbers[use_grabber]); - video_grabber->width = 320; - video_grabber->height = 240; - video_grabber->frame_rate = 25*100; - /* Select first supported image format */ - struct miles_video_grabber_device *dev; - dev = (struct miles_video_grabber_device *)grabber_description->devices->item; - struct miles_int_struct *img_format; - img_format = (struct miles_int_struct *)dev->capabilities->formats->item; - video_grabber->image_format = img_format->value; - miles_video_grabber_setup(video_grabber); - free(supported_video_grabbers); - free(grabber_description); - - /* Initialize and configure video encoder */ - video_encoder = miles_video_codec_init_encoder(); - video_encoder->codec_id = miles_video_codec_get_encoder_for_rtp_payload_type(MILES_RTP_PAYLOAD_TYPE_JPEG); - video_encoder->width = video_grabber->width = 320; - video_encoder->height = video_grabber->height = 240; - video_encoder->qfactor = 50; - //video_encoder->input_format = MILES_IMAGE_RGB; //video_grabber->image_format; - int rv = miles_video_codec_setup_encoder(video_encoder); - if (!rv) { - LOG(ERROR) << "Could not setup video encoder"; - return 0; - } - - video_out_buf = (char *)malloc(video_encoder->width*video_encoder->height*4); - encoded_out_img = (char *)malloc(video_encoder->width*video_encoder->height*4); - - return 1; -} - -void MilesSessionInvoker::cancel(const std::string sendId) { -} - -void MilesSessionInvoker::invoke(const InvokeRequest& req) { - video_port = 5566; - audio_port = 5568; - thumb_list = NULL; - save_image = 0; -} - -/** - * Render video image in a window - */ -void MilesSessionInvoker::render_video_image(char *img, int width, int height, int img_format) { - char *img_buf_ptr; - - if(img_format != MILES_IMAGE_RGB) { - if(render_img==NULL || render_img_size < width*height*4) { - if(render_img) - free(render_img); - render_img_size = width*height*4; - render_img = (char *)malloc(render_img_size); - } - miles_image_convert(img, render_img, img_format, MILES_IMAGE_RGB, width, height); - img_buf_ptr = render_img; - } else { - img_buf_ptr = img; - } - - /* save image to disk */ - if(save_image) - miles_image_file_write(MILES_IMAGE_FILE_FORMAT_PNG, MILES_IMAGE_RGB, "image.png", width, height, img_buf_ptr); - - /* render image in window... to be implementd. */ -} - - -/** - * Send an audio chunk decoded from an RTP stream to an audio device - */ -void MilesSessionInvoker::playback_audio(u_int32_t ssrc, char *buf, int sample_rate, int bps, int audio_format, int size) { - - if(size<0) - return; - - /* re-configure audio device, if needed */ - if(audio_dev_playback == NULL || audio_dev_playback->chunk_size != size || audio_dev_playback->sample_rate != sample_rate || - audio_dev_playback->format != audio_format || audio_dev_playback->bytes_per_sample != bps) { - if(audio_dev_playback) - miles_audio_device_close(MILES_AUDIO_IO_OPENAL, audio_dev_playback, 0); - audio_dev_playback = miles_audio_device_open(MILES_AUDIO_IO_OPENAL, audio_dev_playback_id, audio_format, sample_rate, bps, 1, size, 0); - if(audio_dev_playback == NULL) - return; - } - - /* play audio */ - miles_audio_device_write(MILES_AUDIO_IO_OPENAL, audio_dev_playback, buf, size); -} - -/** - * Handle incoming video streams - */ - -int MilesSessionInvoker::video_receiver(struct miles_rtp_in_stream *rtp_stream, char *data, int bytes_read) { - int status, n; - struct miles_video_codec_decode_context *codec_ctx; - char *codec_name; - struct miles_list *p; - struct thumb_entry *te; - - codec_ctx = (struct miles_video_codec_decode_context *)rtp_stream->codec_ctx; - - if(codec_ctx == NULL || !miles_video_codec_decoder_supports_rtp_payload_type(codec_ctx, rtp_stream->payload_type)) { - if(codec_ctx) - miles_video_codec_destroy_decoder(codec_ctx); - codec_ctx = miles_video_codec_init_decoder(); - codec_ctx->codec_id = miles_video_codec_get_decoder_for_rtp_payload_type(rtp_stream->payload_type); - if(codec_ctx->codec_id == MILES_VIDEO_CODEC_UNKNOWN) { - /* Cannot decode the video stream */ - return 0; - } - - status = miles_video_codec_setup_decoder(codec_ctx); - if(status == 0) { - /* Cannot decode the video stream */ - return 0; - } - rtp_stream->codec_ctx = (void *)codec_ctx; - return 0; - } - - /* Find thumbnail list entry of the stream */ - _mutex.lock(); - p = thumb_list; - while(p) { - te = (struct thumb_entry *)p->item; - if(te->ssrc == rtp_stream->ssrc) { - break; - } - p = p->next; - } - if(p==NULL) { - // Create new thumbnail list entry - te = (struct thumb_entry *)malloc(sizeof(struct thumb_entry)); - if(thumb_list==NULL) - p = thumb_list = miles_list_create(te); - else - p = miles_list_append(thumb_list, te); - te->ssrc = rtp_stream->ssrc; - te->window_ctx = NULL; - te->userid = NULL; - te->img_buf = (char *)malloc(bytes_read); - te->buf_size = bytes_read; - te->img_size = 0; - te->decode_buf = NULL; - } - if(te->buf_size < bytes_read) { - // Need bigger image buffer - free(te->img_buf); - te->img_buf = (char *)malloc(bytes_read); - te->buf_size = bytes_read; - } - /* - * If codec is JPEG, thumbnail image can be saved without decoding - */ - codec_name = miles_video_codec_get_codec_name(codec_ctx->codec_id); - if(codec_name==NULL) { - _mutex.unlock(); - return 0; - } - if(strcmp(codec_name, "JPEG")==0) { - memcpy(te->img_buf, data, bytes_read); - te->img_size = bytes_read; - te->img_format = WEBCONFERO_THUMB_JPEG; - //miles_image_file_write(MILES_IMAGE_FILE_FORMAT_JPG, MILES_IMAGE_JPEG, "test.jpg", bytes_read, 1, data); - // If we're not going to render the video in a window, we're done now - if(te->window_ctx==NULL) { - _mutex.unlock(); - return 0; - } - } else { - te->img_format = WEBCONFERO_THUMB_PNG; - } - free(codec_name); - - if(te->decode_buf==NULL) { - te->decode_buf = (char *)malloc(1920*1080*4); - } - n = miles_video_codec_decode(codec_ctx, data, te->decode_buf, bytes_read); - if(n > 0) { - if(te->img_format==WEBCONFERO_THUMB_PNG) { - if(n > te->buf_size) { - free(te->img_buf); - te->img_buf = (char *)malloc(n); - te->buf_size = n; - } - // Need to insert a PNG header here... - memcpy(te->img_buf, te->decode_buf, n); - te->img_size = n; - } - if(te->window_ctx) - render_video_image(te->decode_buf, codec_ctx->width, codec_ctx->height, codec_ctx->output_format); - } - _mutex.unlock(); - - return n; -} - -/** - * Handle incoming audio streams - */ - -int MilesSessionInvoker::audio_receiver(struct miles_rtp_in_stream *rtp_stream, char *data, int bytes_read) { - int status, size; - struct miles_audio_codec_decode_context *codec_ctx; - - codec_ctx = (struct miles_audio_codec_decode_context *)rtp_stream->codec_ctx; - - if(codec_ctx == NULL || !miles_audio_codec_decoder_supports_rtp_payload_type(codec_ctx, rtp_stream->payload_type)) { - if(codec_ctx) - miles_audio_codec_destroy_decoder(codec_ctx); - codec_ctx = miles_audio_codec_init_decoder(); - codec_ctx->codec_id = miles_audio_codec_get_decoder_for_rtp_payload_type(rtp_stream->payload_type); - if(codec_ctx->codec_id == MILES_AUDIO_CODEC_UNKNOWN) { - /* Cannot decode the audio stream */ - return 0; - } - status = miles_audio_codec_setup_decoder(codec_ctx); - if(status == 0) { - /* Cannot decode the audio stream */ - return 0; - } - rtp_stream->codec_ctx = (void *)codec_ctx; - } - size = miles_audio_codec_decode(codec_ctx, data, audio_in_buf); - if(size > 0) { - playback_audio(rtp_stream->ssrc, audio_in_buf, codec_ctx->sample_rate, codec_ctx->bytes_per_sample, codec_ctx->output_format, size); - } - return size; -} - -/** - * Read and depacketize incoming RTP streams - */ - -void MilesSessionInvoker::rtp_audio_receiver(struct miles_rtp_session *rtp_session) { - int n; - struct miles_rtp_in_stream *rtp_stream; - - /* Poll RTP socket, read all available RTP packets */ - while (1) { - n = miles_net_wait_socket(rtp_session->socket, 10); - if(n<=0) return; - - /* Read RTP data */ - n = miles_rtp_recv(rtp_session, &rtp_stream, audio_data); - if(n>0) { - audio_receiver(rtp_stream, audio_data, n); - } - - /* Poll RTCP socket */ - n = miles_net_poll_socket(rtp_session->rtcp_session->socket); - if(n>0) { - /* Do RTCP packet processEventing */ - n = miles_rtp_recv_rtcp(rtp_session->rtcp_session); - } - } -} - -void MilesSessionInvoker::rtp_video_receiver(struct miles_rtp_session *rtp_session) { - int n; - struct miles_rtp_in_stream *rtp_stream; - - /* Poll RTP socket, read all available RTP packets */ - while (1) { - n = miles_net_wait_socket(rtp_session->socket, 10); - if(n<=0) return; - - /* Read RTP data */ - n = miles_rtp_recv(rtp_session, &rtp_stream, video_data); - if(n>0) { - video_receiver(rtp_stream, video_data, n); - } - - /* Poll RTCP socket */ - n = miles_net_poll_socket(rtp_session->rtcp_session->socket); - if(n>0) { - /* Do RTCP packet processEventing */ - n = miles_rtp_recv_rtcp(rtp_session->rtcp_session); - } - } -} - -/** - * Send RTP video stream - */ -int MilesSessionInvoker::video_transmitter(struct miles_video_grabber_context *grabber, struct miles_video_codec_encode_context *codec_ctx, struct miles_rtp_out_stream *rtp_stream, struct miles_rtcp_out_stream *out_rtcp_stream) { - int n; - static struct timeval last_time; - static int first_time=1; - struct timeval now; - int tbf; - char *video_buf_ptr; - -#ifndef WIN32 - // Need to fix gettimeofday() on Win - if (first_time) { - gettimeofday(&last_time, 0); - first_time = 0; - } - gettimeofday(&now, 0); - tbf = 100000 / grabber->frame_rate; - if (miles_elapsed_time(&last_time, &now) < tbf) - return 0; - - last_time = now; -#endif - - /* Send RTCP packets, if due */ - miles_rtp_send_rtcp(out_rtcp_stream); - - n = miles_video_grabber_grab(grabber, video_out_buf); - if(n <= 0) - return 0; - if(grabber->image_format != codec_ctx->input_format) { - /* image conversion ... */ - if(video_conv_buf==NULL) - video_conv_buf = (char *)malloc(codec_ctx->width*codec_ctx->height*4); - printf("converting video...\n"); - miles_image_convert(video_out_buf, video_conv_buf, grabber->image_format, codec_ctx->input_format, codec_ctx->width, codec_ctx->height); - video_buf_ptr = video_conv_buf; - } else { - video_buf_ptr = video_out_buf; - } - n = miles_video_codec_encode(codec_ctx, video_buf_ptr, encoded_out_img); - if(n<=0) - return 0; - return miles_rtp_send(rtp_stream, encoded_out_img, n); -} - -/** - * Send RTP audio stream - */ -int MilesSessionInvoker::audio_transmitter(struct miles_audio_device *dev, struct miles_audio_codec_encode_context *codec_ctx, struct miles_rtp_out_stream *rtp_stream, struct miles_rtcp_out_stream *out_rtcp_audio_stream) { - int n; - - /* Send RTCP packets, if due */ - miles_rtp_send_rtcp(out_rtcp_audio_stream); - - n = miles_audio_device_read(MILES_AUDIO_IO_OPENAL, dev, audio_read_buf, codec_ctx->chunk_size); - if(n <= 0) - return 0; - if(dev->format != codec_ctx->input_format) { - /* audio conversion needed ... */ - } - n = miles_audio_codec_encode(codec_ctx, audio_read_buf, encoded_out_audio); - if(n<=0) - return 0; - return miles_rtp_send(rtp_stream, encoded_out_audio, n); -} - - -} diff --git a/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.h b/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.h deleted file mode 100644 index 148be68..0000000 --- a/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.h +++ /dev/null @@ -1,174 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef MILESSESIONINVOKER_H_W09J90F0 -#define MILESSESIONINVOKER_H_W09J90F0 - -#include <uscxml/Interpreter.h> - -extern "C" { -#include "miles/miles.h" -#include "miles/network.h" -#include "miles/rtp.h" -#include "miles/audio_codec.h" -#include "miles/audio_io.h" -#include "miles/audio_device.h" -#include "miles/video_codec.h" -#include "miles/video_grabber.h" -#include "miles/session.h" -#include "miles/image.h" -#include "miles/list.h" - long miles_elapsed_time(struct timeval *before, struct timeval *after); -} -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -#define WEBCONFERO_THUMB_NONE 0 -#define WEBCONFERO_THUMB_JPEG 1 -#define WEBCONFERO_THUMB_PNG 2 - -struct thumb_entry { - char *img_buf; - int buf_size; // The size of the buffer malloced - int img_size; // The size of the image - int img_format; // JPEG or PNG image - char *decode_buf; - u_int32_t ssrc; - char *userid; // The user id assigned to the video stream - void *window_ctx; // The context of the window popped up when the thumbnail is clicked. -}; - -namespace uscxml { - -class MilesSessionInvoker : public InvokerImpl { -public: - MilesSessionInvoker(); - virtual ~MilesSessionInvoker(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("miles"); - names.push_back("http://uscxml.tk.informatik.tu-darmstadt.de/#miles"); - return names; - } - - virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void cancel(const std::string sendId); - virtual void invoke(const InvokeRequest& req); - -protected: - void processEventStart(const std::string& origin, const std::string& userid, const std::string& reflector, const std::string& session); - void processEventStop(const std::string& origin); - void processEventParticipants(const std::string& origin); - void processEventThumbnail(const std::string& origin, const std::string& userid); - void processEventVideoOn(const std::string& origin, const std::string& userid); - void processEventVideoOff(const std::string& origin, const std::string& userid); - void processEventAudioOn(const std::string& origin, const std::string& userid); - void processEventAudioOff(const std::string& origin, const std::string& userid); - void processEventSendVideo(const std::string& origin, size_t width, size_t height, size_t framerate, const std::string& compression); - void processEventSendVideoOff(const std::string& origin); - void processEventSendAudio(const std::string& origin, const std::string& encoding); - void processEventSendAudioOff(const std::string& origin); - void processEventPostText(const std::string& origin, const std::string& userid, const std::string& message); - void processEventGetText(const std::string& origin); - - int _imageSeq; - - int video_rtp_in_socket, audio_rtp_in_socket; - int video_rtp_out_socket, audio_rtp_out_socket; - int video_rtcp_in_socket, audio_rtcp_in_socket; - int video_rtcp_out_socket, audio_rtcp_out_socket; - struct miles_rtp_session *video_session, *audio_session; - struct miles_video_codec_encode_context *video_encoder; - struct miles_audio_codec_encode_context *audio_encoder; - int *supported_video_grabbers; - struct miles_video_grabber_context *video_grabber; - struct miles_rtp_out_stream *out_rtp_video_stream, *out_rtp_audio_stream; - struct miles_rtcp_out_stream *out_rtcp_video_stream, *out_rtcp_audio_stream; - struct miles_audio_device *audio_dev; - struct miles_audio_device_description *supported_audio_devices; - int video_port, audio_port; - std::string ip_address; - - char *video_out_buf; - char *video_conv_buf; - char *encoded_out_img; - char *audio_in_buf; - char *render_img; - int render_img_size; - char *audio_data; - char *video_data; - - char *encoded_out_audio; - char *audio_read_buf; - struct miles_list *thumb_list; - int save_image; - - char *text_msg_buf; - int text_msg_available; - - struct miles_audio_device *audio_dev_playback; - int audio_dev_playback_id; - int audio_available; - int video_grabber_available; - int sendvideo_enabled; - int sendaudio_enabled; - - static void runAudio(void* instance); - static void runVideo(void* instance); - void processVideo(); - void processAudio(); - int setup_video_grabber(); - int setup_audio(); - - void init_media_buffers(); - void free_media_buffers(); - void free_video_buffers(); - void free_audio_buffers(); - void free_text_buffers(); - - void render_video_image(char *img, int width, int height, int img_format); - void playback_audio(u_int32_t ssrc, char *buf, int sample_rate, int bps, int audio_format, int size); - int video_receiver(struct miles_rtp_in_stream *rtp_stream, char *data, int bytes_read); - int audio_receiver(struct miles_rtp_in_stream *rtp_stream, char *data, int bytes_read); - void rtp_audio_receiver(struct miles_rtp_session *rtp_session); - void rtp_video_receiver(struct miles_rtp_session *rtp_session); - int video_transmitter(struct miles_video_grabber_context *grabber, struct miles_video_codec_encode_context *codec_ctx, struct miles_rtp_out_stream *rtp_stream, struct miles_rtcp_out_stream *out_rtcp_stream); - int audio_transmitter(struct miles_audio_device *dev, struct miles_audio_codec_encode_context *codec_ctx, struct miles_rtp_out_stream *rtp_stream, struct miles_rtcp_out_stream *out_rtcp_audio_stream); - - - bool _isRunning; - int num_connected; - std::string _userId, _reflector, _session; - tthread::thread* _videoThread; - tthread::thread* _audioThread; - tthread::recursive_mutex _mutex; -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(MilesSessionInvoker, InvokerImpl); -#endif - -} - - -#endif /* end of include guard: MILESSESIONINVOKER_H_W09J90F0 */ diff --git a/src/uscxml/plugins/invoker/sample/SampleInvoker.cpp b/src/uscxml/plugins/invoker/sample/SampleInvoker.cpp deleted file mode 100644 index d91b14c..0000000 --- a/src/uscxml/plugins/invoker/sample/SampleInvoker.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @file - * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "SampleInvoker.h" -#include <glog/logging.h> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new SampleInvokerProvider() ); - return true; -} -#endif - -SampleInvoker::SampleInvoker() { -} - -SampleInvoker::~SampleInvoker() { -}; - -boost::shared_ptr<InvokerImpl> SampleInvoker::create(InterpreterImpl* interpreter) { - boost::shared_ptr<SampleInvoker> invoker = boost::shared_ptr<SampleInvoker>(new SampleInvoker()); - return invoker; -} - -Data SampleInvoker::getDataModelVariables() { - Data data; - return data; -} - -void SampleInvoker::send(const SendRequest& req) { -} - -void SampleInvoker::cancel(const std::string sendId) { -} - -void SampleInvoker::invoke(const InvokeRequest& req) { -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/sample/SampleInvoker.h b/src/uscxml/plugins/invoker/sample/SampleInvoker.h deleted file mode 100644 index f7bcb24..0000000 --- a/src/uscxml/plugins/invoker/sample/SampleInvoker.h +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @file - * @author 2012-2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef SAMPLEINVOKER_H_W09J90F0 -#define SAMPLEINVOKER_H_W09J90F0 - -#include <uscxml/Interpreter.h> - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class SampleInvoker : public InvokerImpl { -public: - SampleInvoker(); - virtual ~SampleInvoker(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("sample"); - names.push_back("http://uscxml.tk.informatik.tu-darmstadt.de/#sample"); - return names; - } - - virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void cancel(const std::string sendId); - virtual void invoke(const InvokeRequest& req); - -protected: -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(SampleInvoker, InvokerImpl); -#endif - -} - - -#endif /* end of include guard: SAMPLEINVOKER_H_W09J90F0 */ diff --git a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp index 62f7a1e..4d3c579 100644 --- a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp +++ b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp @@ -18,16 +18,22 @@ */ #include "USCXMLInvoker.h" -#include <glog/logging.h> -#include "uscxml/dom/DOMUtils.h" -#include <DOM/SAX2DOM/SAX2DOM.hpp> + +#include "uscxml/config.h" #ifdef BUILD_AS_PLUGINS #include <Pluma/Connector.hpp> #endif +#ifdef UNIX +#include <pthread.h> +#endif + namespace uscxml { +// msxml.h should die in a fire for polluting the global namespace +// using namespace xercesc; + #ifdef BUILD_AS_PLUGINS PLUMA_CONNECTOR bool pluginConnect(pluma::Host& host) { @@ -36,26 +42,88 @@ bool pluginConnect(pluma::Host& host) { } #endif -USCXMLInvoker::USCXMLInvoker() : _cancelled(false) { - _parentQueue._invoker = this; +USCXMLInvoker::USCXMLInvoker() { + _parentQueue = EventQueue(std::shared_ptr<ParentQueueImpl>(new ParentQueueImpl(this))); + _thread = NULL; + _isActive = false; + _isStarted = false; } USCXMLInvoker::~USCXMLInvoker() { + stop(); }; +void USCXMLInvoker::start() { + _isStarted = true; + _thread = new std::thread(USCXMLInvoker::run, this); +} + +void USCXMLInvoker::stop() { + _isStarted = false; + _isActive = false; + + if (_thread) { + /** + * We cannot join the invoked thread if it is blocking at an external + * receive. Cancel will finalize and unblock. + */ + _invokedInterpreter.cancel(); + _thread->join(); + delete _thread; + _thread = NULL; + } +} + void USCXMLInvoker::uninvoke() { - _cancelled = true; - Event event; - event.name = "unblock.and.die"; - if (_invokedInterpreter) + _isActive = false; + stop(); +} + +void USCXMLInvoker::eventFromSCXML(const Event& event) { + if (_isActive) { _invokedInterpreter.receive(event); + } +} + +void USCXMLInvoker::run(void* instance) { + USCXMLInvoker* INSTANCE = (USCXMLInvoker*)instance; + +#ifdef APPLE + std::string threadName; + threadName += "uscxml::"; + threadName += (INSTANCE->_invokedInterpreter.getImpl()->_name.size() > 0 ? INSTANCE->_invokedInterpreter.getImpl()->_name : "anon"); + threadName += ".scxml"; + + pthread_setname_np(threadName.c_str()); +#endif + InterpreterState state = USCXML_UNDEF; + while(state != USCXML_FINISHED) { + state = INSTANCE->_invokedInterpreter.step(true); + +// if (!INSTANCE->_isStarted) { +// // we have been cancelled +// INSTANCE->_isActive = false; +// return; +// } + } + + if (INSTANCE->_isActive) { + // we finished on our own and were not cancelled + Event e; + e.eventType = Event::PLATFORM; + e.invokeid = INSTANCE->_invokedInterpreter.getImpl()->getInvokeId(); + e.name = "done.invoke." + e.invokeid; + INSTANCE->_interpreter->enqueueExternal(e); + } + + INSTANCE->_isActive = false; } -boost::shared_ptr<InvokerImpl> USCXMLInvoker::create(InterpreterImpl* interpreter) { - boost::shared_ptr<USCXMLInvoker> invoker = boost::shared_ptr<USCXMLInvoker>(new USCXMLInvoker()); - invoker->_parentInterpreter = interpreter; +std::shared_ptr<InvokerImpl> USCXMLInvoker::create(InterpreterImpl* interpreter) { + std::shared_ptr<USCXMLInvoker> invoker(new USCXMLInvoker()); + invoker->_interpreter = interpreter; return invoker; } @@ -64,71 +132,65 @@ Data USCXMLInvoker::getDataModelVariables() { return data; } -void USCXMLInvoker::send(const SendRequest& req) { - if (_invokedInterpreter) - _invokedInterpreter.receive(req); -} - -void USCXMLInvoker::cancel(const std::string sendId) { - assert(false); -} +void USCXMLInvoker::invoke(const std::string& source, const Event& invokeEvent) { + if (source.length() > 0) { + _invokedInterpreter = Interpreter::fromURL(source); + } else if (invokeEvent.data.node) { + xercesc::DOMImplementation* implementation = xercesc::DOMImplementationRegistry::getDOMImplementation(X("core")); + xercesc::DOMDocument* document = implementation->createDocument(); -void USCXMLInvoker::invoke(const InvokeRequest& req) { - _cancelled = false; - if (req.src.length() > 0) { - _invokedInterpreter = Interpreter::fromURL(req.src); - } else if (req.dom) { - Arabica::DOM::DOMImplementation<std::string> domFactory = Arabica::SimpleDOM::DOMImplementation<std::string>::getDOMImplementation(); - Arabica::DOM::Document<std::string> dom = domFactory.createDocument(req.dom.getNamespaceURI(), "", 0); // we need to import the parent - to support xpath test150 - Arabica::DOM::Node<std::string> newNode = dom.importNode(req.dom, true); - dom.appendChild(newNode); + xercesc::DOMNode* newNode = document->importNode(invokeEvent.data.node, true); + document->appendChild(newNode); + +// std::cout << *document << std::endl; + // TODO: where do we get the namespace from? - _invokedInterpreter = Interpreter::fromDOM(dom, _interpreter->getNameSpaceInfo(), _interpreter->getSourceURL()); - } else if (req.content.size() > 0) { - _invokedInterpreter = Interpreter::fromXML(req.content, _interpreter->getSourceURL()); + _invokedInterpreter = Interpreter::fromDocument(document, _interpreter->getBaseURL()); + } else { - LOG(ERROR) << "Cannot invoke nested SCXML interpreter, neither src attribute nor content nor DOM is given"; + _isActive = false; + ERROR_PLATFORM_THROW("Cannot invoke nested SCXML interpreter, neither src attribute nor content nor DOM is given"); } - if (_invokedInterpreter) { - if (req.elem && HAS_ATTR(req.elem, "initial")) { - _invokedInterpreter.setInitalConfiguration(tokenize(ATTR(req.elem, "initial"))); - } - DataModel dataModel(_invokedInterpreter.getImpl()->getDataModel()); - _invokedInterpreter.getImpl()->setParentQueue(&_parentQueue); + if (_invokedInterpreter) { + _invokedInterpreter.getImpl()->_parentQueue = _parentQueue; + _invokedInterpreter.getImpl()->_invokeId = invokeEvent.invokeid; + _invokedInterpreter.getImpl()->_invokeReq = invokeEvent; // copy monitors - std::set<InterpreterMonitor*>::const_iterator monIter = _interpreter->_monitors.begin(); - while(monIter != _interpreter->_monitors.end()) { - if ((*monIter)->copyToInvokers()) { - _invokedInterpreter.getImpl()->_monitors.insert(*monIter); - } - monIter++; - } - - // transfer namespace prefixes - _invokedInterpreter.setNameSpaceInfo(_parentInterpreter->getNameSpaceInfo()); - _invokedInterpreter.getImpl()->_sessionId = req.invokeid; +// std::set<InterpreterMonitor*>::const_iterator monIter = _interpreter->_monitors.begin(); +// while(monIter != _interpreter->_monitors.end()) { +// if ((*monIter)->copyToInvokers()) { +// _invokedInterpreter.getImpl()->_monitors.insert(*monIter); +// } +// monIter++; +// } + /// test240 assumes that invoke request params will carry over to the datamodel - _invokedInterpreter.getImpl()->setInvokeRequest(req); +// _invokedInterpreter.getImpl()->setInvokeRequest(req); + _isActive = true; + + // we need to make sure it is at least setup to receive data! + _invokedInterpreter.getImpl()->init(); + + start(); - _invokedInterpreter.start(); } else { /// test 530 - _parentInterpreter->receive(Event("done.invoke." + _invokeId, Event::PLATFORM)); + Event e("done.invoke." + invokeEvent.invokeid, Event::PLATFORM); + eventToSCXML(e, USCXML_INVOKER_SCXML_TYPE, _invokeId); + _isActive = false; } } -void USCXMLInvoker::ParentQueue::push(const SendRequest& event) { +void USCXMLInvoker::ParentQueueImpl::enqueue(const Event& event) { // test 252 - if (_invoker->_cancelled) + if (!_invoker->_isActive) return; - SendRequest copyEvent(event); - // this is somewhat hidden here! - copyEvent.invokeid = _invoker->_invokeId; - _invoker->_parentInterpreter->receive(copyEvent); + Event copy(event); // TODO: can we get around a copy? + _invoker->eventToSCXML(copy, USCXML_INVOKER_SCXML_TYPE, _invoker->_invokeId); } }
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h index f5f8fbd..dac8d8b 100644 --- a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h +++ b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h @@ -21,56 +21,57 @@ #define USCXMLINVOKER_H_OQFA21IO #include <uscxml/Interpreter.h> -#include <boost/enable_shared_from_this.hpp> -#include "uscxml/concurrency/BlockingQueue.h" +#include "uscxml/interpreter/EventQueueImpl.h" #ifdef BUILD_AS_PLUGINS #include "uscxml/plugins/Plugins.h" #endif -namespace uscxml { +#define USCXML_INVOKER_SCXML_TYPE "http://www.w3.org/TR/scxml" -class Interpreter; -class USCXMLInvoker; +namespace uscxml { class USCXMLInvoker : public InvokerImpl, - public boost::enable_shared_from_this<USCXMLInvoker> { + public std::enable_shared_from_this<USCXMLInvoker> { public: - class ParentQueue : public concurrency::BlockingQueue<SendRequest> { + class ParentQueueImpl : public EventQueueImpl { public: - ParentQueue() {} - virtual void push(const SendRequest& event); + ParentQueueImpl(USCXMLInvoker* invoker) : _invoker(invoker) {} + virtual void enqueue(const Event& event); USCXMLInvoker* _invoker; }; USCXMLInvoker(); virtual ~USCXMLInvoker(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); + virtual std::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); + virtual std::list<std::string> getNames() { std::list<std::string> names; names.push_back("scxml"); names.push_back("uscxml"); - names.push_back("http://www.w3.org/TR/scxml"); + names.push_back(USCXML_INVOKER_SCXML_TYPE); names.push_back("http://www.w3.org/TR/scxml/"); return names; } - virtual bool deleteOnUninvoke() { - return false; - } + virtual void eventFromSCXML(const Event& event); virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void cancel(const std::string sendId); - virtual void invoke(const InvokeRequest& req); + virtual void invoke(const std::string& source, const Event& invokeEvent); virtual void uninvoke(); protected: - bool _cancelled; - ParentQueue _parentQueue; + + void start(); + void stop(); + static void run(void* instance); + + bool _isActive; + bool _isStarted; + std::thread* _thread; + EventQueue _parentQueue; Interpreter _invokedInterpreter; - InterpreterImpl* _parentInterpreter; }; #ifdef BUILD_AS_PLUGINS diff --git a/src/uscxml/plugins/invoker/smtp/SMTPInvoker.cpp b/src/uscxml/plugins/invoker/smtp/SMTPInvoker.cpp deleted file mode 100644 index 90b777c..0000000 --- a/src/uscxml/plugins/invoker/smtp/SMTPInvoker.cpp +++ /dev/null @@ -1,362 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "SMTPInvoker.h" -#include <glog/logging.h> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -#include <boost/algorithm/string.hpp> -#include "uscxml/UUID.h" -#include "uscxml/messages/Blob.h" - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new SMTPInvokerProvider() ); - return true; -} -#endif - -SMTPInvoker::SMTPInvoker() { -} - -SMTPInvoker::~SMTPInvoker() { -}; - -boost::shared_ptr<InvokerImpl> SMTPInvoker::create(InterpreterImpl* interpreter) { - boost::shared_ptr<SMTPInvoker> invoker = boost::shared_ptr<SMTPInvoker>(new SMTPInvoker()); - return invoker; -} - -Data SMTPInvoker::getDataModelVariables() { - Data data; - return data; -} - -size_t SMTPInvoker::writeCurlData(void *ptr, size_t size, size_t nmemb, void *userdata) { - if (!userdata) - return 0; - - SMTPContext* ctx = (SMTPContext*)userdata; - - size_t toWrite = (std::min)(ctx->content.length() - ctx->readPtr, size * nmemb); - if (toWrite > 0) { - memcpy (ptr, ctx->content.c_str() + ctx->readPtr, toWrite); - ctx->readPtr += toWrite; - } - - return toWrite; -} - -std::list<std::string> SMTPInvoker::getAtoms(std::list<Data> list) { - std::list<std::string> atoms; - - std::list<Data>::const_iterator iter = list.begin(); - while(iter != list.end()) { - const Data& data = *iter; - if (data.atom.size() > 0) { - atoms.push_back(data.atom); - } else if (data.array.size() > 0) { - std::list<Data>::const_iterator arrIter = data.array.begin(); - while(arrIter != data.array.end()) { - if (arrIter->atom.size() > 0) { - atoms.push_back(arrIter->atom); - arrIter++; - } - } - } - iter++; - } - return atoms; -} - -void SMTPInvoker::getAttachments(std::list<Data> list, std::list<Data>& attachments) { - // accumulate attachments with filename, mimetype and data - std::list<Data>::const_iterator iter = list.begin(); - while(iter != list.end()) { - const Data& data = *iter; - if (data.hasKey("data")) { - // compound structure with all information - Data att = data; - - if (!att.hasKey("mimetype")) { - if (att["data"].binary && att["data"].binary.getMimeType().size() > 0) { - att.compound["mimetype"] = Data(att["data"].binary.getMimeType(), Data::VERBATIM); - } else { - att.compound["mimetype"] = Data("text/plain", Data::VERBATIM); - } - } - - if (!att.hasKey("filename")) { - std::stringstream filenameSS; - filenameSS << "attachment" << attachments.size() + 1; - if (boost::starts_with(att.compound["mimetype"].atom, "text")) { - filenameSS << ".txt"; - } else { - filenameSS << ".bin"; - } - att.compound["filename"] = Data(filenameSS.str(), Data::VERBATIM); - } - - attachments.push_back(att); - - } else if (data.binary) { - // a single binary blob - Data att; - - att.compound["data"].binary = data.binary; - - if (data.binary.getMimeType().size() > 0) { - att.compound["mimetype"] = Data(attachments.back()["data"].binary.getMimeType(), Data::VERBATIM); - } else { - att.compound["mimetype"] = Data("application/octet-stream", Data::VERBATIM); - } - - std::stringstream filenameSS; - filenameSS << "attachment" << attachments.size() + 1; - if (boost::starts_with(att.compound["mimetype"].atom, "text")) { - filenameSS << ".txt"; - } else { - filenameSS << ".bin"; - } - att.compound["filename"] = Data(filenameSS.str(), Data::VERBATIM); - - attachments.push_back(att); - - } else if (data.compound.size() > 0) { - // data is some compound, descent to find attachment structures or binaries - std::map<std::string, Data>::const_iterator compIter = data.compound.begin(); - while(compIter != data.compound.end()) { - std::list<Data> tmp; - tmp.push_back(compIter->second); - getAttachments(tmp, attachments); - compIter++; - } - } else if (data.array.size() > 0) { - // descent into array - getAttachments(data.array, attachments); - } - iter++; - } -} - -void SMTPInvoker::send(const SendRequest& req) { - if (iequals(req.name, "mail.send")) { - - struct curl_slist* recipients = NULL; - CURLcode curlError; - std::string multipartSep; - - bool verbose; - std::string from; - std::string subject; - std::string contentType; - std::list<Data> headerParams; - std::list<Data> toParams; - std::list<Data> ccParams; - std::list<Data> bccParams; - std::list<Data> attachmentParams; - - Event::getParam(req.params, "verbose", verbose); - Event::getParam(req.params, "Content-Type", contentType); - Event::getParam(req.params, "attachment", attachmentParams); - Event::getParam(req.params, "from", from); - Event::getParam(req.params, "subject", subject); - Event::getParam(req.params, "header", headerParams); - Event::getParam(req.params, "to", toParams); - Event::getParam(req.params, "cc", ccParams); - Event::getParam(req.params, "bcc", bccParams); - - if (contentType.size() == 0) - contentType = "text/plain; charset=\"UTF-8\""; - - SMTPContext* ctx = new SMTPContext(); - std::stringstream contentSS; - - std::list<std::string>::const_iterator recIter; - std::list<std::string> to = getAtoms(toParams); - std::list<std::string> cc = getAtoms(ccParams); - std::list<std::string> bcc = getAtoms(bccParams); - std::list<std::string> headers = getAtoms(headerParams); - std::list<Data> attachments; - getAttachments(attachmentParams, attachments); - - if (to.size() == 0) - return; - - recIter = to.begin(); - recIter++; // skip first as we need it in CURLOPT_MAIL_RCPT - while(recIter != to.end()) { - contentSS << "TO: " << *recIter << std::endl; - recIter++; - } - recIter = cc.begin(); - while(recIter != cc.end()) { - contentSS << "CC: " << *recIter << std::endl; - recIter++; - } - recIter = bcc.begin(); - while(recIter != bcc.end()) { - contentSS << "BCC: " << *recIter << std::endl; - recIter++; - } - - recIter = headers.begin(); - while(recIter != headers.end()) { - contentSS << *recIter << std::endl; - recIter++; - } - - if (subject.length() > 0) { - boost::replace_all(subject, "\n\r", " "); - boost::replace_all(subject, "\r\n", " "); - boost::replace_all(subject, "\n", " "); - boost::replace_all(subject, "\r", " "); - contentSS << "Subject: " << subject << "\n"; - } - - // content type is different when we have attachments - if (attachments.size() > 0) { - multipartSep = UUID::getUUID(); - boost::replace_all(multipartSep, "-", ""); - contentSS << "Content-Type: multipart/mixed; boundary=\"" << multipartSep << "\"\n"; - contentSS << "MIME-Version: 1.0\n"; - contentSS << "\n"; - contentSS << "--" << multipartSep << "\n"; - contentSS << "Content-Type: " << contentType << "\n"; - } else { - // when we have no attachment, respect user-defined or use text/plain - contentSS << "Content-Type: " << contentType << "\n"; - } - - contentSS << "\n"; - contentSS << req.content; - - std::list<Data>::iterator attIter = attachments.begin(); - while(attIter != attachments.end()) { - // only send valid attachments - if(!attIter->hasKey("filename") || !attIter->hasKey("mimetype") || !attIter->hasKey("data")) { - LOG(ERROR) << "Not sending attachment as filename, mimetype or data is missing: " << *attIter; - } else { - contentSS << "\n\n"; - contentSS << "--" << multipartSep << "\n"; - contentSS << "Content-Disposition: attachment; filename=\"" << attIter->compound["filename"].atom << "\""; - contentSS << "\n"; - - contentSS << "Content-Type: " << attIter->compound["mimetype"].atom << "; "; - contentSS << "name=\"" << attIter->compound["filename"].atom << "\""; - contentSS << "\n"; - - if (attIter->compound["data"].binary) { - contentSS << "Content-Transfer-Encoding: base64"; - contentSS << "\n\n"; - contentSS << attIter->compound["data"].binary.base64(); - } else { - contentSS << "Content-Transfer-Encoding: 7Bit"; - contentSS << "\n\n"; - contentSS << attIter->compound["data"].atom; - } - } - attIter++; - } - - ctx->content = contentSS.str(); - ctx->invoker = this; - - - // see http://curl.haxx.se/libcurl/c/smtp-tls.html - _curl = curl_easy_init(); - if(_curl) { - (curlError = curl_easy_setopt(_curl, CURLOPT_USERNAME, _username.c_str())) == CURLE_OK || - LOG(ERROR) << "Cannot set username: " << curl_easy_strerror(curlError); - (curlError = curl_easy_setopt(_curl, CURLOPT_PASSWORD, _password.c_str())) == CURLE_OK || - LOG(ERROR) << "Cannot set password: " << curl_easy_strerror(curlError); - (curlError = curl_easy_setopt(_curl, CURLOPT_URL, _server.c_str())) == CURLE_OK || - LOG(ERROR) << "Cannot set server string: " << curl_easy_strerror(curlError); - (curlError = curl_easy_setopt(_curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL)) == CURLE_OK || - LOG(ERROR) << "Cannot use SSL: " << curl_easy_strerror(curlError); - - // this is needed, even if we have a callback function - recipients = curl_slist_append(recipients, to.begin()->c_str()); - (curlError = curl_easy_setopt(_curl, CURLOPT_MAIL_RCPT, recipients)) == CURLE_OK || - LOG(ERROR) << "Cannot set mail recipient: " << curl_easy_strerror(curlError); - - (curlError = curl_easy_setopt(_curl, CURLOPT_READFUNCTION, SMTPInvoker::writeCurlData)) == CURLE_OK || - LOG(ERROR) << "Cannot register read function: " << curl_easy_strerror(curlError); - (curlError = curl_easy_setopt(_curl, CURLOPT_READDATA, ctx)) == CURLE_OK || - LOG(ERROR) << "Cannot register userdata for read function: " << curl_easy_strerror(curlError); - (curlError = curl_easy_setopt(_curl, CURLOPT_UPLOAD, 1L)) == CURLE_OK || - LOG(ERROR) << "Cannot set upload parameter: " << curl_easy_strerror(curlError); - -#if 1 - (curlError = curl_easy_setopt(_curl, CURLOPT_SSL_VERIFYPEER, 0L)) == CURLE_OK || - LOG(ERROR) << "Cannot unset verify peer with SSL: " << curl_easy_strerror(curlError); - (curlError = curl_easy_setopt(_curl, CURLOPT_SSL_VERIFYHOST, 0L)) == CURLE_OK || - LOG(ERROR) << "Cannot unset verify host with SSL: " << curl_easy_strerror(curlError); -#else - (curlError = curl_easy_setopt(_curl, CURLOPT_CAINFO, "/path/to/certificate.pem")) == CURLE_OK || - LOG(ERROR) << "Cannot set CA info path: " << curl_easy_strerror(curlError); -#endif - - if (from.length() > 0) { - (curlError = curl_easy_setopt(_curl, CURLOPT_MAIL_FROM, from.c_str())) == CURLE_OK || - LOG(ERROR) << "Cannot set from parameter: " << curl_easy_strerror(curlError); - } - - if (verbose) { - (curlError = curl_easy_setopt(_curl, CURLOPT_VERBOSE, 1L)) == CURLE_OK || - LOG(ERROR) << "Cannot set curl to verbose: " << curl_easy_strerror(curlError); - } - - CURLcode res = curl_easy_perform(_curl); - - /* Check for errors */ - if(res != CURLE_OK) { - LOG(ERROR) << "curl_easy_perform() failed: " << curl_easy_strerror(res); - returnErrorExecution("error.mail.send"); - } else { - returnErrorExecution("success.mail.send"); - } - /* Free the list of recipients */ - if (recipients) - curl_slist_free_all(recipients); - - /* Always cleanup */ - curl_easy_cleanup(_curl); - - } - - } -} - -void SMTPInvoker::cancel(const std::string sendId) { -} - -void SMTPInvoker::invoke(const InvokeRequest& req) { - Event::getParam(req.params, "username", _username); - Event::getParam(req.params, "password", _password); - Event::getParam(req.params, "server", _server); -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/smtp/SMTPInvoker.h b/src/uscxml/plugins/invoker/smtp/SMTPInvoker.h deleted file mode 100644 index 5975b4b..0000000 --- a/src/uscxml/plugins/invoker/smtp/SMTPInvoker.h +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef SMTPINVOKER_H_W09J90F0 -#define SMTPINVOKER_H_W09J90F0 - -#include <uscxml/Interpreter.h> - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -#include <curl/curl.h> - -namespace uscxml { - -class SMTPInvoker : public InvokerImpl { -public: - SMTPInvoker(); - virtual ~SMTPInvoker(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("smtp"); - names.push_back("http://uscxml.tk.informatik.tu-darmstadt.de/#smtp"); - return names; - } - - virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void cancel(const std::string sendId); - virtual void invoke(const InvokeRequest& req); - -protected: - - class SMTPContext { - public: - SMTPContext() : readPtr(0) {} - std::string content; - size_t readPtr; - SMTPInvoker* invoker; - }; - - CURL* _curl; - std::string _username; - std::string _password; - std::string _server; - - std::list<std::string> getAtoms(std::list<Data> list); - void getAttachments(std::list<Data> list, std::list<Data>& attachments); - static size_t writeCurlData(void *ptr, size_t size, size_t nmemb, void *userdata); -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(SMTPInvoker, InvokerImpl); -#endif - -} - - -#endif /* end of include guard: SMTPINVOKER_H_W09J90F0 */ diff --git a/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.cpp b/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.cpp deleted file mode 100644 index debe371..0000000 --- a/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "Sqlite3Invoker.h" -#include <glog/logging.h> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new Sqlite3InvokerProvider() ); - return true; -} -#endif - -Sqlite3Invoker::Sqlite3Invoker() { -} - -Sqlite3Invoker::~Sqlite3Invoker() { -}; - -boost::shared_ptr<InvokerImpl> Sqlite3Invoker::create(InterpreterImpl* interpreter) { - boost::shared_ptr<Sqlite3Invoker> invoker = boost::shared_ptr<Sqlite3Invoker>(new Sqlite3Invoker()); - invoker->_interpreter = interpreter; - return invoker; -} - -Data Sqlite3Invoker::getDataModelVariables() { - Data data; - return data; -} - -void Sqlite3Invoker::send(const SendRequest& req) { -} - -void Sqlite3Invoker::cancel(const std::string sendId) { -} - -void Sqlite3Invoker::invoke(const InvokeRequest& req) { -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.h b/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.h deleted file mode 100644 index b6e5031..0000000 --- a/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.h +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef SQLITE3INVOKER_H_W09J90F0 -#define SQLITE3INVOKER_H_W09J90F0 - -#include <uscxml/Interpreter.h> - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class Sqlite3Invoker : public InvokerImpl { -public: - Sqlite3Invoker(); - virtual ~Sqlite3Invoker(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("sqlite3"); - names.push_back("http://uscxml.tk.informatik.tu-darmstadt.de/#sqlite3"); - return names; - } - - virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void cancel(const std::string sendId); - virtual void invoke(const InvokeRequest& req); - -protected: -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(Sqlite3Invoker, InvokerImpl); -#endif - -} - - -#endif /* end of include guard: SQLITE3INVOKER_H_W09J90F0 */ diff --git a/src/uscxml/plugins/invoker/system/SystemInvoker.cpp b/src/uscxml/plugins/invoker/system/SystemInvoker.cpp deleted file mode 100644 index c5f574f..0000000 --- a/src/uscxml/plugins/invoker/system/SystemInvoker.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "SystemInvoker.h" -#include <glog/logging.h> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add(new SystemInvokerProvider()); - return true; -} -#endif - -SystemInvoker::SystemInvoker() { -} - -SystemInvoker::~SystemInvoker() { -}; - -boost::shared_ptr<InvokerImpl> SystemInvoker::create(InterpreterImpl* interpreter) { - boost::shared_ptr<SystemInvoker> invoker = boost::shared_ptr<SystemInvoker>(new SystemInvoker()); - invoker->_interpreter = interpreter; - return invoker; -} - -Data SystemInvoker::getDataModelVariables() { - Data data; - return data; -} - -void SystemInvoker::send(const SendRequest& req) { -} - -void SystemInvoker::cancel(const std::string sendId) { -} - -void SystemInvoker::invoke(const InvokeRequest& req) { -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/system/SystemInvoker.h b/src/uscxml/plugins/invoker/system/SystemInvoker.h deleted file mode 100644 index a3d1451..0000000 --- a/src/uscxml/plugins/invoker/system/SystemInvoker.h +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef SYSTEMINVOKER_H_W09J90F0 -#define SYSTEMINVOKER_H_W09J90F0 - -#include <uscxml/Interpreter.h> - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class SystemInvoker : public InvokerImpl { -public: - SystemInvoker(); - virtual ~SystemInvoker(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("system"); - names.push_back("http://uscxml.tk.informatik.tu-darmstadt.de/#system"); - return names; - } - - virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void cancel(const std::string sendId); - virtual void invoke(const InvokeRequest& req); - -protected: -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(SystemInvoker, InvokerImpl); -#endif - -} - - -#endif /* end of include guard: SYSTEMINVOKER_H_W09J90F0 */ diff --git a/src/uscxml/plugins/invoker/umundo/JSON.pb.cc b/src/uscxml/plugins/invoker/umundo/JSON.pb.cc deleted file mode 100644 index 9e245c1..0000000 --- a/src/uscxml/plugins/invoker/umundo/JSON.pb.cc +++ /dev/null @@ -1,462 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: JSON.proto - -#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION -#include "JSON.pb.h" - -#include <algorithm> - -#include <google/protobuf/stubs/common.h> -#include <google/protobuf/stubs/once.h> -#include <google/protobuf/io/coded_stream.h> -#include <google/protobuf/wire_format_lite_inl.h> -#include <google/protobuf/descriptor.h> -#include <google/protobuf/generated_message_reflection.h> -#include <google/protobuf/reflection_ops.h> -#include <google/protobuf/wire_format.h> -// @@protoc_insertion_point(includes) - -namespace { - -const ::google::protobuf::Descriptor* JSONProto_descriptor_ = NULL; -const ::google::protobuf::internal::GeneratedMessageReflection* - JSONProto_reflection_ = NULL; - -} // namespace - - -void protobuf_AssignDesc_JSON_2eproto() { - protobuf_AddDesc_JSON_2eproto(); - const ::google::protobuf::FileDescriptor* file = - ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( - "JSON.proto"); - GOOGLE_CHECK(file != NULL); - JSONProto_descriptor_ = file->message_type(0); - static const int JSONProto_offsets_[4] = { - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(JSONProto, compound_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(JSONProto, key_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(JSONProto, atom_), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(JSONProto, verbatim_), - }; - JSONProto_reflection_ = - new ::google::protobuf::internal::GeneratedMessageReflection( - JSONProto_descriptor_, - JSONProto::default_instance_, - JSONProto_offsets_, - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(JSONProto, _has_bits_[0]), - GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(JSONProto, _unknown_fields_), - -1, - ::google::protobuf::DescriptorPool::generated_pool(), - ::google::protobuf::MessageFactory::generated_factory(), - sizeof(JSONProto)); -} - -namespace { - -GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); -inline void protobuf_AssignDescriptorsOnce() { - ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, - &protobuf_AssignDesc_JSON_2eproto); -} - -void protobuf_RegisterTypes(const ::std::string&) { - protobuf_AssignDescriptorsOnce(); - ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( - JSONProto_descriptor_, &JSONProto::default_instance()); -} - -} // namespace - -void protobuf_ShutdownFile_JSON_2eproto() { - delete JSONProto::default_instance_; - delete JSONProto_reflection_; -} - -void protobuf_AddDesc_JSON_2eproto() { - static bool already_here = false; - if (already_here) return; - already_here = true; - GOOGLE_PROTOBUF_VERIFY_VERSION; - - ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( - "\n\nJSON.proto\"V\n\tJSONProto\022\034\n\010compound\030\001 " - "\003(\0132\n.JSONProto\022\013\n\003key\030\002 \001(\t\022\014\n\004atom\030\003 \001" - "(\t\022\020\n\010verbatim\030\004 \001(\010", 100); - ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( - "JSON.proto", &protobuf_RegisterTypes); - JSONProto::default_instance_ = new JSONProto(); - JSONProto::default_instance_->InitAsDefaultInstance(); - ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_JSON_2eproto); -} - -// Force AddDescriptors() to be called at static initialization time. -struct StaticDescriptorInitializer_JSON_2eproto { - StaticDescriptorInitializer_JSON_2eproto() { - protobuf_AddDesc_JSON_2eproto(); - } -} static_descriptor_initializer_JSON_2eproto_; - -// =================================================================== - -#ifndef _MSC_VER -const int JSONProto::kCompoundFieldNumber; -const int JSONProto::kKeyFieldNumber; -const int JSONProto::kAtomFieldNumber; -const int JSONProto::kVerbatimFieldNumber; -#endif // !_MSC_VER - -JSONProto::JSONProto() - : ::google::protobuf::Message() { - SharedCtor(); -} - -void JSONProto::InitAsDefaultInstance() { -} - -JSONProto::JSONProto(const JSONProto& from) - : ::google::protobuf::Message() { - SharedCtor(); - MergeFrom(from); -} - -void JSONProto::SharedCtor() { - _cached_size_ = 0; - key_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - atom_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - verbatim_ = false; - ::memset(_has_bits_, 0, sizeof(_has_bits_)); -} - -JSONProto::~JSONProto() { - SharedDtor(); -} - -void JSONProto::SharedDtor() { - if (key_ != &::google::protobuf::internal::kEmptyString) { - delete key_; - } - if (atom_ != &::google::protobuf::internal::kEmptyString) { - delete atom_; - } - if (this != default_instance_) { - } -} - -void JSONProto::SetCachedSize(int size) const { - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); -} -const ::google::protobuf::Descriptor* JSONProto::descriptor() { - protobuf_AssignDescriptorsOnce(); - return JSONProto_descriptor_; -} - -const JSONProto& JSONProto::default_instance() { - if (default_instance_ == NULL) protobuf_AddDesc_JSON_2eproto(); - return *default_instance_; -} - -JSONProto* JSONProto::default_instance_ = NULL; - -JSONProto* JSONProto::New() const { - return new JSONProto; -} - -void JSONProto::Clear() { - if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) { - if (has_key()) { - if (key_ != &::google::protobuf::internal::kEmptyString) { - key_->clear(); - } - } - if (has_atom()) { - if (atom_ != &::google::protobuf::internal::kEmptyString) { - atom_->clear(); - } - } - verbatim_ = false; - } - compound_.Clear(); - ::memset(_has_bits_, 0, sizeof(_has_bits_)); - mutable_unknown_fields()->Clear(); -} - -bool JSONProto::MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input) { -#define DO_(EXPRESSION) if (!(EXPRESSION)) return false - ::google::protobuf::uint32 tag; - while ((tag = input->ReadTag()) != 0) { - switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { - // repeated .JSONProto compound = 1; - case 1: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { - parse_compound: - DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( - input, add_compound())); - } else { - goto handle_uninterpreted; - } - if (input->ExpectTag(10)) goto parse_compound; - if (input->ExpectTag(18)) goto parse_key; - break; - } - - // optional string key = 2; - case 2: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { - parse_key: - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_key())); - ::google::protobuf::internal::WireFormat::VerifyUTF8String( - this->key().data(), this->key().length(), - ::google::protobuf::internal::WireFormat::PARSE); - } else { - goto handle_uninterpreted; - } - if (input->ExpectTag(26)) goto parse_atom; - break; - } - - // optional string atom = 3; - case 3: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { - parse_atom: - DO_(::google::protobuf::internal::WireFormatLite::ReadString( - input, this->mutable_atom())); - ::google::protobuf::internal::WireFormat::VerifyUTF8String( - this->atom().data(), this->atom().length(), - ::google::protobuf::internal::WireFormat::PARSE); - } else { - goto handle_uninterpreted; - } - if (input->ExpectTag(32)) goto parse_verbatim; - break; - } - - // optional bool verbatim = 4; - case 4: { - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { - parse_verbatim: - DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< - bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( - input, &verbatim_))); - set_has_verbatim(); - } else { - goto handle_uninterpreted; - } - if (input->ExpectAtEnd()) return true; - break; - } - - default: { - handle_uninterpreted: - if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == - ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { - return true; - } - DO_(::google::protobuf::internal::WireFormat::SkipField( - input, tag, mutable_unknown_fields())); - break; - } - } - } - return true; -#undef DO_ -} - -void JSONProto::SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const { - // repeated .JSONProto compound = 1; - for (int i = 0; i < this->compound_size(); i++) { - ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( - 1, this->compound(i), output); - } - - // optional string key = 2; - if (has_key()) { - ::google::protobuf::internal::WireFormat::VerifyUTF8String( - this->key().data(), this->key().length(), - ::google::protobuf::internal::WireFormat::SERIALIZE); - ::google::protobuf::internal::WireFormatLite::WriteString( - 2, this->key(), output); - } - - // optional string atom = 3; - if (has_atom()) { - ::google::protobuf::internal::WireFormat::VerifyUTF8String( - this->atom().data(), this->atom().length(), - ::google::protobuf::internal::WireFormat::SERIALIZE); - ::google::protobuf::internal::WireFormatLite::WriteString( - 3, this->atom(), output); - } - - // optional bool verbatim = 4; - if (has_verbatim()) { - ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->verbatim(), output); - } - - if (!unknown_fields().empty()) { - ::google::protobuf::internal::WireFormat::SerializeUnknownFields( - unknown_fields(), output); - } -} - -::google::protobuf::uint8* JSONProto::SerializeWithCachedSizesToArray( - ::google::protobuf::uint8* target) const { - // repeated .JSONProto compound = 1; - for (int i = 0; i < this->compound_size(); i++) { - target = ::google::protobuf::internal::WireFormatLite:: - WriteMessageNoVirtualToArray( - 1, this->compound(i), target); - } - - // optional string key = 2; - if (has_key()) { - ::google::protobuf::internal::WireFormat::VerifyUTF8String( - this->key().data(), this->key().length(), - ::google::protobuf::internal::WireFormat::SERIALIZE); - target = - ::google::protobuf::internal::WireFormatLite::WriteStringToArray( - 2, this->key(), target); - } - - // optional string atom = 3; - if (has_atom()) { - ::google::protobuf::internal::WireFormat::VerifyUTF8String( - this->atom().data(), this->atom().length(), - ::google::protobuf::internal::WireFormat::SERIALIZE); - target = - ::google::protobuf::internal::WireFormatLite::WriteStringToArray( - 3, this->atom(), target); - } - - // optional bool verbatim = 4; - if (has_verbatim()) { - target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->verbatim(), target); - } - - if (!unknown_fields().empty()) { - target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( - unknown_fields(), target); - } - return target; -} - -int JSONProto::ByteSize() const { - int total_size = 0; - - if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) { - // optional string key = 2; - if (has_key()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::StringSize( - this->key()); - } - - // optional string atom = 3; - if (has_atom()) { - total_size += 1 + - ::google::protobuf::internal::WireFormatLite::StringSize( - this->atom()); - } - - // optional bool verbatim = 4; - if (has_verbatim()) { - total_size += 1 + 1; - } - - } - // repeated .JSONProto compound = 1; - total_size += 1 * this->compound_size(); - for (int i = 0; i < this->compound_size(); i++) { - total_size += - ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( - this->compound(i)); - } - - if (!unknown_fields().empty()) { - total_size += - ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( - unknown_fields()); - } - GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); - _cached_size_ = total_size; - GOOGLE_SAFE_CONCURRENT_WRITES_END(); - return total_size; -} - -void JSONProto::MergeFrom(const ::google::protobuf::Message& from) { - GOOGLE_CHECK_NE(&from, this); - const JSONProto* source = - ::google::protobuf::internal::dynamic_cast_if_available<const JSONProto*>( - &from); - if (source == NULL) { - ::google::protobuf::internal::ReflectionOps::Merge(from, this); - } else { - MergeFrom(*source); - } -} - -void JSONProto::MergeFrom(const JSONProto& from) { - GOOGLE_CHECK_NE(&from, this); - compound_.MergeFrom(from.compound_); - if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) { - if (from.has_key()) { - set_key(from.key()); - } - if (from.has_atom()) { - set_atom(from.atom()); - } - if (from.has_verbatim()) { - set_verbatim(from.verbatim()); - } - } - mutable_unknown_fields()->MergeFrom(from.unknown_fields()); -} - -void JSONProto::CopyFrom(const ::google::protobuf::Message& from) { - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void JSONProto::CopyFrom(const JSONProto& from) { - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool JSONProto::IsInitialized() const { - - return true; -} - -void JSONProto::Swap(JSONProto* other) { - if (other != this) { - compound_.Swap(&other->compound_); - std::swap(key_, other->key_); - std::swap(atom_, other->atom_); - std::swap(verbatim_, other->verbatim_); - std::swap(_has_bits_[0], other->_has_bits_[0]); - _unknown_fields_.Swap(&other->_unknown_fields_); - std::swap(_cached_size_, other->_cached_size_); - } -} - -::google::protobuf::Metadata JSONProto::GetMetadata() const { - protobuf_AssignDescriptorsOnce(); - ::google::protobuf::Metadata metadata; - metadata.descriptor = JSONProto_descriptor_; - metadata.reflection = JSONProto_reflection_; - return metadata; -} - - -// @@protoc_insertion_point(namespace_scope) - -// @@protoc_insertion_point(global_scope) diff --git a/src/uscxml/plugins/invoker/umundo/JSON.pb.h b/src/uscxml/plugins/invoker/umundo/JSON.pb.h deleted file mode 100644 index ff65656..0000000 --- a/src/uscxml/plugins/invoker/umundo/JSON.pb.h +++ /dev/null @@ -1,361 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: JSON.proto - -#ifndef PROTOBUF_JSON_2eproto__INCLUDED -#define PROTOBUF_JSON_2eproto__INCLUDED - -#include <string> - -#include <google/protobuf/stubs/common.h> - - -#include <google/protobuf/generated_message_util.h> -#include <google/protobuf/message.h> -#include <google/protobuf/repeated_field.h> -#include <google/protobuf/extension_set.h> -#include <google/protobuf/unknown_field_set.h> -// @@protoc_insertion_point(includes) - -// Internal implementation detail -- do not call these. -void protobuf_AddDesc_JSON_2eproto(); -void protobuf_AssignDesc_JSON_2eproto(); -void protobuf_ShutdownFile_JSON_2eproto(); - -class JSONProto; - -// =================================================================== - -class JSONProto : public ::google::protobuf::Message { -public: - JSONProto(); - virtual ~JSONProto(); - - JSONProto(const JSONProto& from); - - inline JSONProto& operator=(const JSONProto& from) { - CopyFrom(from); - return *this; - } - - inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { - return _unknown_fields_; - } - - inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { - return &_unknown_fields_; - } - - static const ::google::protobuf::Descriptor* descriptor(); - static const JSONProto& default_instance(); - - void Swap(JSONProto* other); - - // implements Message ---------------------------------------------- - - JSONProto* New() const; - void CopyFrom(const ::google::protobuf::Message& from); - void MergeFrom(const ::google::protobuf::Message& from); - void CopyFrom(const JSONProto& from); - void MergeFrom(const JSONProto& from); - void Clear(); - bool IsInitialized() const; - - int ByteSize() const; - bool MergePartialFromCodedStream( - ::google::protobuf::io::CodedInputStream* input); - void SerializeWithCachedSizes( - ::google::protobuf::io::CodedOutputStream* output) const; - ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; - int GetCachedSize() const { - return _cached_size_; - } -private: - void SharedCtor(); - void SharedDtor(); - void SetCachedSize(int size) const; -public: - - ::google::protobuf::Metadata GetMetadata() const; - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - // repeated .JSONProto compound = 1; - inline int compound_size() const; - inline void clear_compound(); - static const int kCompoundFieldNumber = 1; - inline const ::JSONProto& compound(int index) const; - inline ::JSONProto* mutable_compound(int index); - inline ::JSONProto* add_compound(); - inline const ::google::protobuf::RepeatedPtrField< ::JSONProto >& - compound() const; - inline ::google::protobuf::RepeatedPtrField< ::JSONProto >* - mutable_compound(); - - // optional string key = 2; - inline bool has_key() const; - inline void clear_key(); - static const int kKeyFieldNumber = 2; - inline const ::std::string& key() const; - inline void set_key(const ::std::string& value); - inline void set_key(const char* value); - inline void set_key(const char* value, size_t size); - inline ::std::string* mutable_key(); - inline ::std::string* release_key(); - inline void set_allocated_key(::std::string* key); - - // optional string atom = 3; - inline bool has_atom() const; - inline void clear_atom(); - static const int kAtomFieldNumber = 3; - inline const ::std::string& atom() const; - inline void set_atom(const ::std::string& value); - inline void set_atom(const char* value); - inline void set_atom(const char* value, size_t size); - inline ::std::string* mutable_atom(); - inline ::std::string* release_atom(); - inline void set_allocated_atom(::std::string* atom); - - // optional bool verbatim = 4; - inline bool has_verbatim() const; - inline void clear_verbatim(); - static const int kVerbatimFieldNumber = 4; - inline bool verbatim() const; - inline void set_verbatim(bool value); - - // @@protoc_insertion_point(class_scope:JSONProto) -private: - inline void set_has_key(); - inline void clear_has_key(); - inline void set_has_atom(); - inline void clear_has_atom(); - inline void set_has_verbatim(); - inline void clear_has_verbatim(); - - ::google::protobuf::UnknownFieldSet _unknown_fields_; - - ::google::protobuf::RepeatedPtrField< ::JSONProto > compound_; - ::std::string* key_; - ::std::string* atom_; - bool verbatim_; - - mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(4 + 31) / 32]; - - friend void protobuf_AddDesc_JSON_2eproto(); - friend void protobuf_AssignDesc_JSON_2eproto(); - friend void protobuf_ShutdownFile_JSON_2eproto(); - - void InitAsDefaultInstance(); - static JSONProto* default_instance_; -}; -// =================================================================== - - -// =================================================================== - -// JSONProto - -// repeated .JSONProto compound = 1; -inline int JSONProto::compound_size() const { - return compound_.size(); -} -inline void JSONProto::clear_compound() { - compound_.Clear(); -} -inline const ::JSONProto& JSONProto::compound(int index) const { - return compound_.Get(index); -} -inline ::JSONProto* JSONProto::mutable_compound(int index) { - return compound_.Mutable(index); -} -inline ::JSONProto* JSONProto::add_compound() { - return compound_.Add(); -} -inline const ::google::protobuf::RepeatedPtrField< ::JSONProto >& -JSONProto::compound() const { - return compound_; -} -inline ::google::protobuf::RepeatedPtrField< ::JSONProto >* -JSONProto::mutable_compound() { - return &compound_; -} - -// optional string key = 2; -inline bool JSONProto::has_key() const { - return (_has_bits_[0] & 0x00000002u) != 0; -} -inline void JSONProto::set_has_key() { - _has_bits_[0] |= 0x00000002u; -} -inline void JSONProto::clear_has_key() { - _has_bits_[0] &= ~0x00000002u; -} -inline void JSONProto::clear_key() { - if (key_ != &::google::protobuf::internal::kEmptyString) { - key_->clear(); - } - clear_has_key(); -} -inline const ::std::string& JSONProto::key() const { - return *key_; -} -inline void JSONProto::set_key(const ::std::string& value) { - set_has_key(); - if (key_ == &::google::protobuf::internal::kEmptyString) { - key_ = new ::std::string; - } - key_->assign(value); -} -inline void JSONProto::set_key(const char* value) { - set_has_key(); - if (key_ == &::google::protobuf::internal::kEmptyString) { - key_ = new ::std::string; - } - key_->assign(value); -} -inline void JSONProto::set_key(const char* value, size_t size) { - set_has_key(); - if (key_ == &::google::protobuf::internal::kEmptyString) { - key_ = new ::std::string; - } - key_->assign(reinterpret_cast<const char*>(value), size); -} -inline ::std::string* JSONProto::mutable_key() { - set_has_key(); - if (key_ == &::google::protobuf::internal::kEmptyString) { - key_ = new ::std::string; - } - return key_; -} -inline ::std::string* JSONProto::release_key() { - clear_has_key(); - if (key_ == &::google::protobuf::internal::kEmptyString) { - return NULL; - } else { - ::std::string* temp = key_; - key_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - return temp; - } -} -inline void JSONProto::set_allocated_key(::std::string* key) { - if (key_ != &::google::protobuf::internal::kEmptyString) { - delete key_; - } - if (key) { - set_has_key(); - key_ = key; - } else { - clear_has_key(); - key_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - } -} - -// optional string atom = 3; -inline bool JSONProto::has_atom() const { - return (_has_bits_[0] & 0x00000004u) != 0; -} -inline void JSONProto::set_has_atom() { - _has_bits_[0] |= 0x00000004u; -} -inline void JSONProto::clear_has_atom() { - _has_bits_[0] &= ~0x00000004u; -} -inline void JSONProto::clear_atom() { - if (atom_ != &::google::protobuf::internal::kEmptyString) { - atom_->clear(); - } - clear_has_atom(); -} -inline const ::std::string& JSONProto::atom() const { - return *atom_; -} -inline void JSONProto::set_atom(const ::std::string& value) { - set_has_atom(); - if (atom_ == &::google::protobuf::internal::kEmptyString) { - atom_ = new ::std::string; - } - atom_->assign(value); -} -inline void JSONProto::set_atom(const char* value) { - set_has_atom(); - if (atom_ == &::google::protobuf::internal::kEmptyString) { - atom_ = new ::std::string; - } - atom_->assign(value); -} -inline void JSONProto::set_atom(const char* value, size_t size) { - set_has_atom(); - if (atom_ == &::google::protobuf::internal::kEmptyString) { - atom_ = new ::std::string; - } - atom_->assign(reinterpret_cast<const char*>(value), size); -} -inline ::std::string* JSONProto::mutable_atom() { - set_has_atom(); - if (atom_ == &::google::protobuf::internal::kEmptyString) { - atom_ = new ::std::string; - } - return atom_; -} -inline ::std::string* JSONProto::release_atom() { - clear_has_atom(); - if (atom_ == &::google::protobuf::internal::kEmptyString) { - return NULL; - } else { - ::std::string* temp = atom_; - atom_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - return temp; - } -} -inline void JSONProto::set_allocated_atom(::std::string* atom) { - if (atom_ != &::google::protobuf::internal::kEmptyString) { - delete atom_; - } - if (atom) { - set_has_atom(); - atom_ = atom; - } else { - clear_has_atom(); - atom_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); - } -} - -// optional bool verbatim = 4; -inline bool JSONProto::has_verbatim() const { - return (_has_bits_[0] & 0x00000008u) != 0; -} -inline void JSONProto::set_has_verbatim() { - _has_bits_[0] |= 0x00000008u; -} -inline void JSONProto::clear_has_verbatim() { - _has_bits_[0] &= ~0x00000008u; -} -inline void JSONProto::clear_verbatim() { - verbatim_ = false; - clear_has_verbatim(); -} -inline bool JSONProto::verbatim() const { - return verbatim_; -} -inline void JSONProto::set_verbatim(bool value) { - set_has_verbatim(); - verbatim_ = value; -} - - -// @@protoc_insertion_point(namespace_scope) - -#ifndef SWIG -namespace google { -namespace protobuf { - - -} // namespace google -} // namespace protobuf -#endif // SWIG - -// @@protoc_insertion_point(global_scope) - -#endif // PROTOBUF_JSON_2eproto__INCLUDED diff --git a/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp b/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp deleted file mode 100644 index 0302d87..0000000 --- a/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp +++ /dev/null @@ -1,655 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include <boost/algorithm/string.hpp> - -#include "UmundoInvoker.h" -#include <glog/logging.h> -#include "uscxml/URL.h" - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new UmundoInvokerProvider() ); - return true; -} -#endif - -UmundoInvoker::UmundoInvoker() : _node(NULL), _discovery(NULL), _pub(NULL), _sub(NULL) { -} - -UmundoInvoker::~UmundoInvoker() { - if (_node) { - if (_sub) { - _node->removeSubscriber(*_sub); - delete _sub; - } - if (_pub) { - _node->removePublisher(*_pub); - delete _pub; - } - delete(_node); - } -}; - -boost::shared_ptr<InvokerImpl> UmundoInvoker::create(InterpreterImpl* interpreter) { - boost::shared_ptr<UmundoInvoker> invoker = boost::shared_ptr<UmundoInvoker>(new UmundoInvoker()); - invoker->_interpreter = interpreter; - return invoker; -} - -Data UmundoInvoker::getDataModelVariables() { - Data data; - return data; -} - -void UmundoInvoker::send(const SendRequest& req) { - umundo::Message msg; - - if (req.name.length() > 0) { - msg.putMeta("event", req.name); - } else { - msg.putMeta("event", "umundo"); - } - - try { - Data data = req.data; - - if (data.empty() && req.content.length()) - data = _interpreter->getDataModel().getStringAsData(req.content); - - if (data.empty()) { - LOG(ERROR) << "Cannot transform content to data object per datamodel or no data given"; - return; - } - -// std::cout << Data::toJSON(data) << std::endl; - - std::string type; - if (req.params.find("type") != req.params.end()) { - // we are supposed to build a typed object - type = req.params.find("type")->second.atom; - - const google::protobuf::Message* protoMsg = umundo::PBSerializer::getProto(type); - if (protoMsg == NULL) { - LOG(ERROR) << "No type '" << type << "' is known, pass a directory with proto .desc files via types param when invoking"; - return; - } - - google::protobuf::Message* pbMsg = protoMsg->New(); - if (!dataToProtobuf(pbMsg, data)) { - LOG(ERROR) << "Cannot create message from JSON - not sending"; - return; - } - - if (!_isService) { - // add all s11n properties - _pub->prepareMsg(&msg, type, pbMsg); - _pub->send(&msg); - } else { - // invoke as service - std::map<umundo::ServiceDescription, umundo::ServiceStub*>::iterator svcIter = _svcs.begin(); - while(svcIter != _svcs.end()) { - umundo::ServiceStub* stub = svcIter->second; - Event event; - void* rv = NULL; - stub->callStubMethod(req.name, pbMsg, type, rv, ""); - protobufToData(event.data, *(const google::protobuf::Message*)rv); - - event.name = _invokeId + ".reply." + req.name; - event.origin = msg.getMeta("um.channel"); - event.origintype = "umundo"; - event.eventType = Event::EXTERNAL; - - returnEvent(event); - svcIter++; - } - } - } else { - // just encode JSON - JSONProto* jsonProtoMsg = new JSONProto(); - if (!dataToJSONbuf(jsonProtoMsg, data)) { - LOG(ERROR) << "Cannot create message from JSON - not sending"; - return; - } - - if (!_isService) { - // add all s11n properties - _pub->prepareMsg(&msg, "JSON", jsonProtoMsg); - _pub->send(&msg); - } else { - LOG(ERROR) << "Cannot invoke services with untyped JSON"; - return; - } - - } - } catch (Event e) { - LOG(ERROR) << "Syntax error when invoking umundo:" << std::endl << e << std::endl; - return; - } -} - -void UmundoInvoker::cancel(const std::string sendId) { - assert(false); -} - -void UmundoInvoker::invoke(const InvokeRequest& req) { - - std::string domain; - std::string channelName; - std::string serviceName; - - if (req.params.find("channel") != req.params.end()) { - channelName = req.params.find("channel")->second.atom; - _isService = false; - } else if (req.params.find("service") != req.params.end()) { - serviceName = req.params.find("service")->second.atom; - _isService = true; - } else { - LOG(ERROR) << "Invoking umundo needs a service or a channel param"; - return; - } - if (req.params.find("domain") != req.params.end()) { - domain = req.params.find("domain")->second.atom; - } - _node = new umundo::Node(); - - umundo::DiscoveryConfigMDNS discOpts; - _discovery = new umundo::Discovery(&discOpts); - - _discovery->add(*_node); - - // add type from .proto or .desc files - std::list<std::string> type; - Event::getParam(req.params, "type", type); - std::list<std::string>::const_iterator typeIter = type.begin(); - while(typeIter != type.end()) { - URL typeURI(*typeIter); - if (typeURI.toAbsolute(_interpreter->getBaseURL(req.elem))) { - std::string filename = typeURI.asLocalFile(".proto"); - umundo::PBSerializer::addProto(filename); - } else { - LOG(ERROR) << "umundo invoker has relative type src but no baseURI set with interpreter."; - } - typeIter++; - } - - // add directory with .proto or .desc files - std::list<std::string> types; - Event::getParam(req.params, "type", types); - std::list<std::string>::const_iterator typesIter = types.begin(); - while(typesIter != types.end()) { - URL typeURI(*typesIter); - if (typeURI.toAbsolute(_interpreter->getBaseURL(req.elem))) { - umundo::PBSerializer::addProto(typeURI.path()); - } else { - LOG(ERROR) << "invoke element has relative src URI with no baseURI set."; - } - typesIter++; - } - - if (!_isService) { - // use umundo to publish objects on a channel - _pub = new umundo::TypedPublisher(channelName); - _sub = new umundo::TypedSubscriber(channelName, this); - - _pub->setGreeter(this); - _sub->registerType("JSON", new JSONProto()); - - _node->addPublisher(*_pub); - _node->addSubscriber(*_sub); - - } else if (serviceName.length() > 0) { - // use umundo to access services - _svcFilter = new umundo::ServiceFilter(serviceName); - _node->connect(_svcMgr); - _svcMgr->startQuery(*_svcFilter, this); - } -} - -void UmundoInvoker::welcome(umundo::TypedPublisher atPub, const umundo::SubscriberStub& sub) { - Event event; - event.name = "umundo.sub.added"; - event.data.compound["subId"] = Data(sub.getUUID(), Data::VERBATIM); - event.data.compound["channel"] = Data(atPub.getChannelName(), Data::VERBATIM); - event.data.compound["totalSubs"] = Data(toStr(atPub.waitForSubscribers(0)), Data::VERBATIM); - returnEvent(event); -} - -void UmundoInvoker::farewell(umundo::TypedPublisher fromPub, const umundo::SubscriberStub& sub) { - Event event; - event.name = "umundo.sub.removed"; - event.data.compound["subId"] = Data(sub.getUUID(), Data::VERBATIM); - event.data.compound["channel"] = Data(fromPub.getChannelName(), Data::VERBATIM); - event.data.compound["totalSubs"] = Data(toStr(fromPub.waitForSubscribers(0)), Data::VERBATIM); - returnEvent(event); -} - -void UmundoInvoker::receive(void* object, umundo::Message* msg) { - uscxml::Event event; - if (msg->getMeta().find("event") != msg->getMeta().end()) { - event.name = msg->getMeta("event"); - } else { - event.name = "umundo.rcvd"; - } - - event.invokeid = _invokeId; - event.origin = msg->getMeta("um.channel"); - event.origintype = "umundo"; - event.eventType = Event::EXTERNAL; - - if (object != NULL) { - if (msg->getMeta().find("um.s11n.type") != msg->getMeta().end() && - boost::equals(msg->getMeta().find("um.s11n.type")->second, "JSON")) { - jsonbufToData(event.data, *(JSONProto*)object); - } else { - protobufToData(event.data, *(const google::protobuf::Message*)object); - } - } - - // get meta fields into event - std::map<std::string, std::string>::const_iterator metaIter = msg->getMeta().begin(); - while(metaIter != msg->getMeta().end()) { - if (isNumeric(metaIter->second.c_str(), 10)) { - event.data.compound[metaIter->first] = Data(metaIter->second, Data::INTERPRETED); - } else { - event.data.compound[metaIter->first] = Data(metaIter->second, Data::VERBATIM); - } - metaIter++; - } - - if (msg->size() > 0) { - event.data.compound["protobuf"] = Data(msg->data(), msg->size(), "application/x-protobuf"); - } - - returnEvent(event); -} - -void UmundoInvoker::added(umundo::ServiceDescription desc) { - LOG(ERROR) << "Service found!"; - - umundo::ServiceStub* stub = new umundo::ServiceStub(desc); - _svcs[desc] = stub; - - Event addedEvent; - addedEvent.invokeid = _invokeId; - addedEvent.origin = desc.getName(); - addedEvent.origintype = "umundo"; - addedEvent.eventType = Event::EXTERNAL; - addedEvent.name = _invokeId + ".added"; - - std::map<std::string, std::string>::const_iterator propIter = desc.getProperties().begin(); - while(propIter != desc.getProperties().end()) { - addedEvent.data.compound[propIter->first] = Data(propIter->second, Data::VERBATIM); - propIter++; - } - - returnEvent(addedEvent); -} - -void UmundoInvoker::removed(umundo::ServiceDescription desc) { - LOG(ERROR) << "Service lost!"; - - if (_svcs.find(desc) == _svcs.end()) { - return; - } - - delete _svcs[desc]; - _svcs.erase(desc); - - Event addedEvent; - addedEvent.invokeid = _invokeId; - addedEvent.origin = desc.getName(); - addedEvent.origintype = "umundo"; - addedEvent.eventType = Event::EXTERNAL; - addedEvent.name = _invokeId + ".removed"; - - std::map<std::string, std::string>::const_iterator propIter = desc.getProperties().begin(); - while(propIter != desc.getProperties().end()) { - addedEvent.data.compound[propIter->first] = Data(propIter->second, Data::VERBATIM); - propIter++; - } - - returnEvent(addedEvent); -} - -void UmundoInvoker::changed(umundo::ServiceDescription desc, uint64_t what) { -} - -bool UmundoInvoker::jsonbufToData(Data& data, const JSONProto& json) { - if (json.compound_size() > 0) { - if (json.compound(0).key().size() > 0) { - // compound - for (int i = 0; i < json.compound_size(); i++) { - jsonbufToData(data.compound[json.compound(i).key()], json.compound(i)); - } - } else { - // array - for (int i = 0; i < json.compound_size(); i++) { - Data arrayData; - data.array.push_back(arrayData); - jsonbufToData(data.array.back(), json.compound(i)); - } - } - } else if (json.atom().size() > 0) { - data.atom = json.atom(); - if (json.verbatim()) { - data.type = Data::VERBATIM; - } else { - data.type = Data::INTERPRETED; - } - } - - return true; -} - -bool UmundoInvoker::protobufToData(Data& data, const google::protobuf::Message& msg) { - const google::protobuf::Descriptor* desc = msg.GetDescriptor(); - const google::protobuf::Reflection* reflect = msg.GetReflection(); - - data.compound["protobufType"] = Data(desc->name(), Data::VERBATIM); - - for (int i = 0; i < desc->field_count(); i++) { - const google::protobuf::FieldDescriptor* fieldDesc = desc->field(i); - std::string key = fieldDesc->name(); - - if (!fieldDesc->is_repeated() && !reflect->HasField(msg, fieldDesc)) - continue; - - switch(fieldDesc->type()) { - case google::protobuf::FieldDescriptor::TYPE_BOOL: - if (fieldDesc->is_repeated()) { - for (int j = 0; j < reflect->FieldSize(msg, fieldDesc); j++) { - data.compound[key].array.push_back(Data(reflect->GetRepeatedBool(msg, fieldDesc, j) ? "true" : "false")); - } - } else { - data.compound[key].atom = (reflect->GetBool(msg, fieldDesc) ? "true" : "false"); - } - break; - case google::protobuf::FieldDescriptor::TYPE_BYTES: - case google::protobuf::FieldDescriptor::TYPE_STRING: - if (fieldDesc->is_repeated()) { - for (int j = 0; j < reflect->FieldSize(msg, fieldDesc); j++) { - data.compound[key].array.push_back(Data(toStr(reflect->GetRepeatedString(msg, fieldDesc, j)), Data::VERBATIM)); - } - } else { - data.compound[key].atom = toStr(reflect->GetString(msg, fieldDesc)); - data.compound[key].type = Data::VERBATIM; - } - break; - case google::protobuf::FieldDescriptor::TYPE_DOUBLE: - if (fieldDesc->is_repeated()) { - for (int j = 0; j < reflect->FieldSize(msg, fieldDesc); j++) { - data.compound[key].array.push_back(Data(toStr(reflect->GetRepeatedDouble(msg, fieldDesc, j)), Data::INTERPRETED)); - } - } else { - data.compound[key].atom = toStr(reflect->GetDouble(msg, fieldDesc)); - } - break; - case google::protobuf::FieldDescriptor::TYPE_ENUM: - if (fieldDesc->is_repeated()) { - for (int j = 0; j < reflect->FieldSize(msg, fieldDesc); j++) { - const google::protobuf::EnumValueDescriptor* enumDesc = reflect->GetRepeatedEnum(msg, fieldDesc, j); - data.compound[key].array.push_back(Data(toStr(enumDesc->name()), Data::VERBATIM)); - } - } else { - const google::protobuf::EnumValueDescriptor* enumDesc = reflect->GetEnum(msg, fieldDesc); - data.compound[key] = Data(enumDesc->name(), Data::VERBATIM); - } - break; - case google::protobuf::FieldDescriptor::TYPE_FIXED32: - case google::protobuf::FieldDescriptor::TYPE_UINT32: - if (fieldDesc->is_repeated()) { - for (int j = 0; j < reflect->FieldSize(msg, fieldDesc); j++) { - data.compound[key].array.push_back(Data(toStr(reflect->GetRepeatedUInt32(msg, fieldDesc, j)), Data::INTERPRETED)); - } - } else { - data.compound[key].atom = toStr(reflect->GetUInt32(msg, fieldDesc)); - } - break; - case google::protobuf::FieldDescriptor::TYPE_FIXED64: - case google::protobuf::FieldDescriptor::TYPE_UINT64: - if (fieldDesc->is_repeated()) { - for (int j = 0; j < reflect->FieldSize(msg, fieldDesc); j++) { - data.compound[key].array.push_back(Data(toStr(reflect->GetRepeatedUInt64(msg, fieldDesc, j)), Data::INTERPRETED)); - } - } else { - data.compound[key].atom = toStr(reflect->GetUInt64(msg, fieldDesc)); - } - break; - case google::protobuf::FieldDescriptor::TYPE_FLOAT: - if (fieldDesc->is_repeated()) { - for (int j = 0; j < reflect->FieldSize(msg, fieldDesc); j++) { - data.compound[key].array.push_back(Data(toStr(reflect->GetRepeatedFloat(msg, fieldDesc, j)), Data::INTERPRETED)); - } - } else { - data.compound[key].atom = toStr(reflect->GetFloat(msg, fieldDesc)); - } - break; - case google::protobuf::FieldDescriptor::TYPE_GROUP: - LOG(ERROR) << "TYPE_GROUP is unimplemented" << std::endl; - break; - case google::protobuf::FieldDescriptor::TYPE_INT32: - case google::protobuf::FieldDescriptor::TYPE_SINT32: - case google::protobuf::FieldDescriptor::TYPE_SFIXED32: - if (fieldDesc->is_repeated()) { - for (int j = 0; j < reflect->FieldSize(msg, fieldDesc); j++) { - data.compound[key].array.push_back(Data(toStr(reflect->GetRepeatedInt32(msg, fieldDesc, j)), Data::INTERPRETED)); - } - } else { - data.compound[key].atom = toStr(reflect->GetInt32(msg, fieldDesc)); - } - break; - case google::protobuf::FieldDescriptor::TYPE_INT64: - case google::protobuf::FieldDescriptor::TYPE_SINT64: - case google::protobuf::FieldDescriptor::TYPE_SFIXED64: - if (fieldDesc->is_repeated()) { - for (int j = 0; j < reflect->FieldSize(msg, fieldDesc); j++) { - data.compound[key].array.push_back(Data(toStr(reflect->GetRepeatedInt64(msg, fieldDesc, j)), Data::INTERPRETED)); - } - } else { - data.compound[key].atom = toStr(reflect->GetInt64(msg, fieldDesc)); - } - break; - case google::protobuf::FieldDescriptor::TYPE_MESSAGE: - if (fieldDesc->is_repeated()) { - for (int j = 0; j < reflect->FieldSize(msg, fieldDesc); j++) { - data.compound[key].array.push_back(Data()); - protobufToData(data.compound[key].array.back(), reflect->GetRepeatedMessage(msg, fieldDesc, j)); - } - } else { - protobufToData(data.compound[key], reflect->GetMessage(msg, fieldDesc)); - } - break; - } - } - return true; -} - -bool UmundoInvoker::dataToJSONbuf(JSONProto* msg, Data& data) { - const google::protobuf::Descriptor* desc = msg->GetDescriptor(); - const google::protobuf::Reflection* reflect = msg->GetReflection(); - - if (!data.compound.empty()) { - const google::protobuf::FieldDescriptor* fieldDesc = desc->FindFieldByName("compound"); - - std::map<std::string, Data>::iterator compoundIter = data.compound.begin(); - while(compoundIter != data.compound.end()) { - JSONProto* compoundMsg = (JSONProto*)reflect->AddMessage(msg, fieldDesc); - dataToJSONbuf(compoundMsg, compoundIter->second); - compoundMsg->set_key(compoundIter->first); - compoundIter++; - } - } else if (!data.array.empty()) { - const google::protobuf::FieldDescriptor* fieldDesc = desc->FindFieldByName("compound"); - - std::list<Data>::iterator arrayIter = data.array.begin(); - while(arrayIter != data.array.end()) { - JSONProto* arrayMsg = (JSONProto*)reflect->AddMessage(msg, fieldDesc); - dataToJSONbuf(arrayMsg, *arrayIter); - arrayIter++; - } - } else if (!data.atom.empty()) { - const google::protobuf::FieldDescriptor* atomDesc = desc->FindFieldByName("atom"); - const google::protobuf::FieldDescriptor* verbDesc = desc->FindFieldByName("verbatim"); - - if (data.type == Data::VERBATIM) { - reflect->SetBool(msg, verbDesc, true); - } else { - reflect->SetBool(msg, verbDesc, false); - } - reflect->SetString(msg, atomDesc, data.atom); - } - return true; -} - -bool UmundoInvoker::dataToProtobuf(google::protobuf::Message* msg, Data& data) { - const google::protobuf::Descriptor* desc = msg->GetDescriptor(); - const google::protobuf::Reflection* reflect = msg->GetReflection(); - - for (int i = 0; i < desc->field_count(); i++) { - const google::protobuf::FieldDescriptor* fieldDesc = desc->field(i); - std::string key = fieldDesc->name(); - - if (data.compound.find(key) == data.compound.end()) { - if (fieldDesc->is_required()) { - LOG(ERROR) << "required field " << key << " not given"; - return false; - } - continue; - } - - std::list<Data>::iterator arrayIter = data.compound[key].array.begin(); - - switch(fieldDesc->type()) { - case google::protobuf::FieldDescriptor::TYPE_BOOL: - if (fieldDesc->is_repeated()) { - while(arrayIter != data.compound[key].array.end()) { - reflect->AddBool(msg, fieldDesc, arrayIter->atom.compare("false") == 0 ? false : true); - arrayIter++; - } - } else { - reflect->SetBool(msg, fieldDesc, (data.compound[key].atom.compare("false") == 0 ? false : true)); - } - break; - case google::protobuf::FieldDescriptor::TYPE_BYTES: - case google::protobuf::FieldDescriptor::TYPE_STRING: - if (fieldDesc->is_repeated()) { - while(arrayIter != data.compound[key].array.end()) { - reflect->AddString(msg, fieldDesc, arrayIter->atom); - arrayIter++; - } - } else { - reflect->SetString(msg, fieldDesc, data.compound[key].atom); - } - break; - case google::protobuf::FieldDescriptor::TYPE_DOUBLE: - if (fieldDesc->is_repeated()) { - while(arrayIter != data.compound[key].array.end()) { - reflect->AddDouble(msg, fieldDesc, strTo<double>(arrayIter->atom)); - arrayIter++; - } - } else { - reflect->SetDouble(msg, fieldDesc, strTo<double>(data.compound[key].atom)); - } - break; - case google::protobuf::FieldDescriptor::TYPE_ENUM: - LOG(ERROR) << "TYPE_ENUM is unimplemented" << std::endl; - break; - case google::protobuf::FieldDescriptor::TYPE_FIXED32: - case google::protobuf::FieldDescriptor::TYPE_UINT32: - if (fieldDesc->is_repeated()) { - while(arrayIter != data.compound[key].array.end()) { - reflect->AddUInt32(msg, fieldDesc, strTo<uint32_t>(arrayIter->atom)); - arrayIter++; - } - } else { - reflect->SetUInt32(msg, fieldDesc, strTo<uint32_t>(data.compound[key].atom)); - } - break; - case google::protobuf::FieldDescriptor::TYPE_FIXED64: - case google::protobuf::FieldDescriptor::TYPE_UINT64: - if (fieldDesc->is_repeated()) { - while(arrayIter != data.compound[key].array.end()) { - reflect->AddUInt64(msg, fieldDesc, strTo<uint64_t>(arrayIter->atom)); - arrayIter++; - } - } else { - reflect->SetUInt64(msg, fieldDesc, strTo<uint64_t>(data.compound[key].atom)); - } - break; - case google::protobuf::FieldDescriptor::TYPE_FLOAT: - if (fieldDesc->is_repeated()) { - while(arrayIter != data.compound[key].array.end()) { - reflect->AddFloat(msg, fieldDesc, strTo<float>(arrayIter->atom)); - arrayIter++; - } - } else { - reflect->SetFloat(msg, fieldDesc, strTo<float>(data.compound[key].atom)); - } - break; - case google::protobuf::FieldDescriptor::TYPE_GROUP: - LOG(ERROR) << "TYPE_GROUP is unimplemented" << std::endl; - break; - case google::protobuf::FieldDescriptor::TYPE_INT32: - case google::protobuf::FieldDescriptor::TYPE_SINT32: - case google::protobuf::FieldDescriptor::TYPE_SFIXED32: - if (fieldDesc->is_repeated()) { - while(arrayIter != data.compound[key].array.end()) { - reflect->AddInt32(msg, fieldDesc, strTo<int32_t>(arrayIter->atom)); - arrayIter++; - } - } else { - reflect->SetInt32(msg, fieldDesc, strTo<int32_t>(data.compound[key].atom)); - } - break; - case google::protobuf::FieldDescriptor::TYPE_INT64: - case google::protobuf::FieldDescriptor::TYPE_SINT64: - case google::protobuf::FieldDescriptor::TYPE_SFIXED64: - if (fieldDesc->is_repeated()) { - while(arrayIter != data.compound[key].array.end()) { - reflect->AddInt64(msg, fieldDesc, strTo<int64_t>(arrayIter->atom)); - arrayIter++; - } - } else { - reflect->SetInt64(msg, fieldDesc, strTo<int64_t>(data.compound[key].atom)); - } - break; - case google::protobuf::FieldDescriptor::TYPE_MESSAGE: - if (fieldDesc->is_repeated()) { - while(arrayIter != data.compound[key].array.end()) { - dataToProtobuf(reflect->AddMessage(msg, fieldDesc), *arrayIter); - arrayIter++; - } - } else { - dataToProtobuf(reflect->MutableMessage(msg, fieldDesc), data.compound[key]); - } - break; - } - } - return true; -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/umundo/UmundoInvoker.h b/src/uscxml/plugins/invoker/umundo/UmundoInvoker.h deleted file mode 100644 index 4c0e988..0000000 --- a/src/uscxml/plugins/invoker/umundo/UmundoInvoker.h +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef UMUNDOINVOKER_H_77YXQGU7 -#define UMUNDOINVOKER_H_77YXQGU7 - -#include <uscxml/Interpreter.h> -#include <google/protobuf/message.h> -#include <umundo/core.h> -#include <umundo/s11n.h> -#include <umundo/rpc.h> -#include <umundo/s11n/protobuf/PBSerializer.h> - -#include "JSON.pb.h" - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class Interpreter; - -class UmundoInvoker : public InvokerImpl, public umundo::TypedReceiver, public umundo::ResultSet<umundo::ServiceDescription>, public umundo::TypedGreeter { -public: - UmundoInvoker(); - virtual ~UmundoInvoker(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("umundo"); - names.push_back("http://umundo.tk.informatik.tu-darmstadt.de/"); - names.push_back("http://umundo.tk.informatik.tu-darmstadt.de"); - return names; - } - - virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void cancel(const std::string sendId); - virtual void invoke(const InvokeRequest& req); - - virtual void receive(void* object, umundo::Message* msg); - - virtual void added(umundo::ServiceDescription); - virtual void removed(umundo::ServiceDescription); - virtual void changed(umundo::ServiceDescription, uint64_t what); - - virtual void welcome(umundo::TypedPublisher atPub, const umundo::SubscriberStub& sub); - virtual void farewell(umundo::TypedPublisher fromPub, const umundo::SubscriberStub& sub); - -protected: - bool _isService; - - bool dataToJSONbuf(JSONProto* msg, Data& data); - bool dataToProtobuf(google::protobuf::Message* msg, Data& data); - - bool jsonbufToData(Data& data, const JSONProto& json); - bool protobufToData(Data& data, const google::protobuf::Message& msg); - - umundo::Node* _node; - umundo::Discovery* _discovery; - umundo::TypedPublisher* _pub; - umundo::TypedSubscriber* _sub; - - umundo::ServiceFilter* _svcFilter; - umundo::ServiceManager* _svcMgr; - std::map<umundo::ServiceDescription, umundo::ServiceStub*> _svcs; -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(UmundoInvoker, InvokerImpl); -#endif - -} - - -#endif /* end of include guard: UMUNDOINVOKER_H_77YXQGU7 */ diff --git a/src/uscxml/plugins/invoker/vxml/VoiceXMLInvoker.cpp b/src/uscxml/plugins/invoker/vxml/VoiceXMLInvoker.cpp deleted file mode 100644 index 4c56a14..0000000 --- a/src/uscxml/plugins/invoker/vxml/VoiceXMLInvoker.cpp +++ /dev/null @@ -1,269 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "VoiceXMLInvoker.h" -#include <glog/logging.h> -#include "uscxml/UUID.h" - -#include <DOM/io/Stream.hpp> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -#define ISSUE_REQUEST(name, block) {\ - Arabica::DOM::Document<std::string> name##XML = name.toXML(true);\ - name##XML.getDocumentElement().setPrefix("mmi");\ - std::stringstream name##XMLSS;\ - name##XMLSS << name##XML;\ - URL name##URL(name.target);\ - std::cout << "SEND: " << name##XMLSS.str() << std::endl; \ - name##URL.setOutContent(name##XMLSS.str());\ - name##URL.addOutHeader("Content-type", "application/xml");\ - name##URL.download(block);\ -} - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new VoiceXMLInvokerProvider() ); - return true; -} -#endif - -VoiceXMLInvoker::VoiceXMLInvoker() { - _thread = NULL; -} - -VoiceXMLInvoker::~VoiceXMLInvoker() { -}; - -boost::shared_ptr<InvokerImpl> VoiceXMLInvoker::create(InterpreterImpl* interpreter) { - boost::shared_ptr<VoiceXMLInvoker> invoker = boost::shared_ptr<VoiceXMLInvoker>(new VoiceXMLInvoker()); - invoker->_interpreter = interpreter; - return invoker; -} - -bool VoiceXMLInvoker::httpRecvRequest(const HTTPServer::Request& request) { - tthread::lock_guard<tthread::mutex> lock(_mutex); - - if (!request.data.hasKey("content") || !request.data.at("content").node) { - HTTPServer::Reply reply(request); - reply.status = 500; - HTTPServer::reply(reply); - } - - const Arabica::DOM::Node<std::string>& node = request.data.at("content").node; -// std::cout << "RCVD: " << node << std::endl; - - switch(MMIEvent::getType(node)) { - case MMIEvent::NEWCONTEXTRESPONSE: { - NewContextResponse resp = NewContextResponse::fromXML(node); - if (_context.size() == 0) { - _compState = MMI_IDLE; - _context = resp.context; - - StartRequest startReq; - startReq.context = _context; - startReq.source = _url; - startReq.target = _target; - startReq.requestId = uscxml::UUID::getUUID(); - - if (_invokeReq.src.size() > 0) { - startReq.contentURL.href = _invokeReq.src; - } else if(_invokeReq.content.size()) { - startReq.content = _invokeReq.content; - } else if(_invokeReq.dom) { - std::stringstream contentSS; - startReq.contentDOM = _invokeReq.dom; - } - ISSUE_REQUEST(startReq, false); - - } else { - // already got a context! - } - break; - } - case MMIEvent::STARTRESPONSE: { - StartResponse resp = StartResponse::fromXML(node); - _compState = MMI_RUNNING; - break; - } - - case MMIEvent::DONENOTIFICATION: { - DoneNotification resp = DoneNotification::fromXML(node); - _compState = MMI_IDLE; - break; - } - - case MMIEvent::STATUSRESPONSE: { - StatusResponse resp = StatusResponse::fromXML(node); - switch (resp.status) { - case StatusResponse::DEAD: - _compState = MMI_DEAD; - case StatusResponse::FAILURE: { - Event ev = resp; - returnEvent(ev); - break; - } - default: - break; - } - break; - } - - case MMIEvent::EXTENSIONNOTIFICATION: { - Event resp = ExtensionNotification::fromXML(node); - returnEvent(resp); - } - - default: - break; - } - - - HTTPServer::Reply reply(request); - HTTPServer::reply(reply); - return true; -} - -void VoiceXMLInvoker::setURL(const std::string& url) { - _url = url; -// boost::replace_first(_url, "epikur-2.local", "178.4.230.252"); -} - -Data VoiceXMLInvoker::getDataModelVariables() { - Data data; - return data; -} - -void VoiceXMLInvoker::send(const SendRequest& req) { - _workQueue.push(req); -} - -void VoiceXMLInvoker::invoke(const InvokeRequest& req) { - tthread::lock_guard<tthread::mutex> lock(_mutex); - - HTTPServer::getInstance()->registerServlet(req.invokeid, this); - - Event::getParam(req.params, "target", _target); - if (_target.size() == 0) { - LOG(ERROR) << "No target parameter given!"; - return; - } - - _invokeReq = req; - - NewContextRequest newCtxReq; - newCtxReq.source = _url; - newCtxReq.target = _target; - newCtxReq.requestId = uscxml::UUID::getUUID(); - ISSUE_REQUEST(newCtxReq, false); - - _isRunning = true; - _thread = new tthread::thread(VoiceXMLInvoker::run, this); - -} - -void VoiceXMLInvoker::uninvoke() { - - ClearContextRequest clrCtxReq; - clrCtxReq.source = _url; - clrCtxReq.target = _target; - clrCtxReq.requestId = uscxml::UUID::getUUID(); - ISSUE_REQUEST(clrCtxReq, false); - - if (_isRunning) - _isRunning = false; - - // unblock queue - SendRequest req; - _workQueue.push(req); - - if (_thread) { - _thread->join(); - delete _thread; - } - - HTTPServer::getInstance()->unregisterServlet(this); - _context = ""; - -} - -void VoiceXMLInvoker::run(void* instance) { - VoiceXMLInvoker* INSTANCE = (VoiceXMLInvoker*)instance; - while(true) { - SendRequest req = INSTANCE->_workQueue.pop(); - if (INSTANCE->_isRunning) { - INSTANCE->process(req); - } else { - return; - } - } -} - -void VoiceXMLInvoker::process(SendRequest& req) { - tthread::lock_guard<tthread::mutex> lock(_mutex); - while(_context.size() == 0 && _isRunning) - _cond.wait_for(_mutex, 200); - - if (_context.size() == 0) { - // we never acquired a context - return; - } - - if (_compState != MMI_RUNNING) - // remote component is not running - return; - - // dispatch over send request - // Is there something special to do here? - - // if we did nothing else, send as ExtensionNotification - ExtensionNotification extNotif; - extNotif.context = _context; - extNotif.source = _url; - extNotif.target = _target; - extNotif.requestId = uscxml::UUID::getUUID(); - extNotif.name = req.name; - - if (!req.namelist.empty()) { - for (Event::namelist_t::iterator iter = req.namelist.begin(); iter != req.namelist.end(); iter++) { - req.data.compound[iter->first] = iter->second; - } - } else if (!req.params.empty()) { - for(Event::params_t::iterator it = req.params.begin(), end = req.params.end(); it != end; it = req.params.upper_bound(it->first)) { - Event::getParam(req.params, it->first, req.data.compound[it->first]); - } - } - - if (req.dom) { - extNotif.dataDOM = req.dom; - } else if (req.content.size() > 0) { - extNotif.data = req.content; - } else if (!req.data.empty()) { - extNotif.data = Data::toJSON(req.data); - } - - ISSUE_REQUEST(extNotif, false); -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/vxml/VoiceXMLInvoker.h b/src/uscxml/plugins/invoker/vxml/VoiceXMLInvoker.h deleted file mode 100644 index d6078cd..0000000 --- a/src/uscxml/plugins/invoker/vxml/VoiceXMLInvoker.h +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef VOICEXMLINVOKER_H_W09J90F0 -#define VOICEXMLINVOKER_H_W09J90F0 - -#include <uscxml/Interpreter.h> -#include <uscxml/messages/MMIMessages.h> -#include "uscxml/server/HTTPServer.h" - -// #include <uscxml/plugins/ioprocessor/modality/MMIProtoBridge.h> - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class VoiceXMLInvoker : public InvokerImpl, public HTTPServlet { -public: - enum ComponentState { - MMI_IDLE, - MMI_PAUSED, - MMI_RUNNING, - MMI_DEAD - }; - - VoiceXMLInvoker(); - virtual ~VoiceXMLInvoker(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("vxml"); - names.push_back("voicexml"); - names.push_back("http://www.w3.org/TR/voicexml21/"); - return names; - } - - bool deleteOnUninvoke() { - return false; - } - - bool httpRecvRequest(const HTTPServer::Request& request); - void setURL(const std::string& url); - - virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void invoke(const InvokeRequest& req); - virtual void uninvoke(); - - static void run(void*); - void process(SendRequest& ctx); - -protected: - std::string _url; - std::string _context; - std::string _target; - - InvokeRequest _invokeReq; - - ComponentState _compState; - - tthread::thread* _thread; - tthread::condition_variable _cond; - tthread::mutex _mutex; - concurrency::BlockingQueue<SendRequest> _workQueue; - bool _isRunning; -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(VoiceXMLInvoker, InvokerImpl); -#endif - -} - - -#endif /* end of include guard: VOICEXMLINVOKER_H_W09J90F0 */ diff --git a/src/uscxml/plugins/invoker/webrtc/WebRTCInvoker.cpp b/src/uscxml/plugins/invoker/webrtc/WebRTCInvoker.cpp deleted file mode 100644 index 2d871c8..0000000 --- a/src/uscxml/plugins/invoker/webrtc/WebRTCInvoker.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @file - * @author 2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "WebRTCInvoker.h" -#include <glog/logging.h> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -//#include "talk/app/webrtc/peerconnection.h" - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new WebRTCInvokerProvider() ); - return true; -} -#endif - -WebRTCInvoker::WebRTCInvoker() { -} - -WebRTCInvoker::~WebRTCInvoker() { -}; - -boost::shared_ptr<InvokerImpl> WebRTCInvoker::create(InterpreterImpl* interpreter) { - boost::shared_ptr<WebRTCInvoker> invoker = boost::shared_ptr<WebRTCInvoker>(new WebRTCInvoker()); - return invoker; -} - -Data WebRTCInvoker::getDataModelVariables() { - Data data; - return data; -} - -void WebRTCInvoker::send(const SendRequest& req) { -} - -void WebRTCInvoker::cancel(const std::string sendId) { -} - -void WebRTCInvoker::invoke(const InvokeRequest& req) { -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/webrtc/WebRTCInvoker.h b/src/uscxml/plugins/invoker/webrtc/WebRTCInvoker.h deleted file mode 100644 index e4d7775..0000000 --- a/src/uscxml/plugins/invoker/webrtc/WebRTCInvoker.h +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @file - * @author 2014 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef WEBRTCINVOKER_H_1E704623 -#define WEBRTCINVOKER_H_1E704623 - -#include <uscxml/Interpreter.h> - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class WebRTCInvoker : public InvokerImpl { -public: - WebRTCInvoker(); - virtual ~WebRTCInvoker(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("webrtc"); - names.push_back("http://uscxml.tk.informatik.tu-darmstadt.de/#webrtc"); - return names; - } - - virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void cancel(const std::string sendId); - virtual void invoke(const InvokeRequest& req); - -protected: -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(WebRTCInvoker, InvokerImpl); -#endif - -} - - -#endif /* end of include guard: WEBRTCINVOKER_H_1E704623 */ diff --git a/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.cpp b/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.cpp deleted file mode 100644 index 9c85f37..0000000 --- a/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.cpp +++ /dev/null @@ -1,290 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include <boost/algorithm/string.hpp> - -#include <uscxml/config.h> -#include "XHTMLInvoker.h" -#include <glog/logging.h> -#include "uscxml/dom/DOMUtils.h" -#include <uscxml/plugins/ioprocessor/comet/CometIOProcessor.h> -#include <DOM/io/Stream.hpp> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -#if __APPLE__ -# if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR -# else -# include <CoreFoundation/CFBundle.h> -# include <ApplicationServices/ApplicationServices.h> -# endif -#endif - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new XHTMLInvokerProvider() ); - return true; -} -#endif - -XHTMLInvoker::XHTMLInvoker() { -} - -XHTMLInvoker::~XHTMLInvoker() { - HTTPServer::unregisterServlet(this); -}; - -boost::shared_ptr<InvokerImpl> XHTMLInvoker::create(InterpreterImpl* interpreter) { - boost::shared_ptr<XHTMLInvoker> invoker = boost::shared_ptr<XHTMLInvoker>(new XHTMLInvoker()); - invoker->_interpreter = interpreter; - return invoker; -} - -bool XHTMLInvoker::httpRecvRequest(const HTTPServer::Request& req) { - tthread::lock_guard<tthread::recursive_mutex> lock(_mutex); - - // these are the XHR requests - if (iequals(req.data.at("header").at("X-Requested-With").atom, "XMLHttpRequest")) { - if (iequals(req.data.at("type").atom, "get")) { - // this is the incoming the long-polling GET - if (_longPoll) { - // cancel old longPoller - evhttp_send_error(_longPoll.evhttpReq, 204, NULL); - _longPoll.evhttpReq = NULL; - } - - _longPoll = req; - if (!_outQueue.empty()) { - // do we have some send requests pending? - HTTPServer::Reply reply =_outQueue.front(); - reply.setRequest(_longPoll); - HTTPServer::reply(reply); - _outQueue.pop_front(); - _longPoll.evhttpReq = NULL; - } - return true; - - } else { - // an incomping event per POST request - Event ev(req); - if (ev.data["header"].hasKey("X-SCXML-Name")) { - ev.name = ev.data["header"]["X-SCXML-Name"].atom; - } else { - ev.name = req.data.at("type").atom; - } - - // initialize data - ev.data = req.data.at("content"); - ev.eventType = Event::EXTERNAL; - - HTTPServer::Reply reply(req); - HTTPServer::reply(reply); - - returnEvent(ev); - return true; - } - } - - // initial request for a document - if (!req.data.hasKey("query") && // no query parameters - iequals(req.data.at("type").atom, "get") && // request type is GET - req.content.length() == 0) { // no content - - // send template to establish long polling - HTTPServer::Reply reply(req); - - // _invokeReq.content will contain the actual content as we needed to replace expressions in the interpreter thread - - if (!_invokeReq.data.empty()) { - // just reply with given data as json, this time and for ever - reply.content = _invokeReq.content; - reply.headers["Content-type"] = "application/json"; - HTTPServer::reply(reply); - return true; - - } else if (_invokeReq.dom) { - // there is some XML given with the content - if (HAS_ATTR_CAST(_invokeReq.dom, "type")) { - // it's special XML to send per Comet later on, default to sending template and enqueue - _longPoll.evhttpReq = NULL; - _outQueue = std::deque<HTTPServer::Reply>(); - - HTTPServer::Reply reply; - reply.content = _invokeReq.content; - reply.headers["Content-type"] = "application/xml"; - _outQueue.push_back(reply); - - // no return here - we wan to send the template below - - } else { - // it's plain XML now and forever - reply.content = _invokeReq.content; - reply.headers["Content-type"] = "application/xml"; - HTTPServer::reply(reply); - return true; - } - } else if (_invokeReq.content.size() > 0) { - - // just reply as text this time and for ever - reply.content = _invokeReq.content; - reply.headers["Content-type"] = "text/plain"; - HTTPServer::reply(reply); - return true; - } - - /* - * Return our template to establish a two way communication via comet - * If we want to replace expressions in the temaplte, we have to do it in invoke() - * for thread safety of the datamodel. - */ - - // this file is generated from template/xhtml-invoker.xhtml via xxd -#include "template/xhtml-invoker.inc.h" - - // aggressive caching in IE will return all XHR get requests instantenously otherwise - reply.headers["Cache-Control"] = "no-cache"; - reply.headers["Content-Type"] = "text/html; charset=utf-8"; - - reply.content = std::string((const char*)template_xhtml_invoker_html, template_xhtml_invoker_html_len); - HTTPServer::reply(reply); - return true; - } - - // don't know what to do with other requests - return false; -} - -Data XHTMLInvoker::getDataModelVariables() { - Data data; - return data; -} - -void XHTMLInvoker::send(const SendRequest& req) { - tthread::lock_guard<tthread::recursive_mutex> lock(_mutex); - - HTTPServer::Reply reply; - - if (req.dom) { - // XML - std::stringstream ss; - if (req.dom.getNodeType() == Arabica::DOM::Node_base::ELEMENT_NODE) { - Arabica::DOM::Element<std::string> contentElem = Arabica::DOM::Element<std::string>(req.dom); - - if (HAS_ATTR(contentElem, "type")) - reply.headers["X-SCXML-Type"] = ATTR(contentElem, "type"); - if (HAS_ATTR(contentElem, "xpath")) - reply.headers["X-SCXML-XPath"] = ATTR(contentElem, "xpath"); - if (HAS_ATTR(contentElem, "attr")) - reply.headers["X-SCXML-Attr"] = ATTR(contentElem, "attr"); - } - - ss << req.dom; - reply.content = ss.str(); - reply.headers["Content-Type"] = "application/xml"; - - } else if (!req.data.empty()) { - // JSON - reply.content = Data::toJSON(req.data); - reply.headers["Content-Type"] = "application/json"; - } else if (req.content.length() > 0) { - reply.content = req.content; - reply.headers["Content-Type"] = "text/plain"; - } - - // TODO: Params to set variables? - - _interpreter->getDataModel().replaceExpressions(reply.content); - - if (!_longPoll) { - _outQueue.push_back(reply); - return; - } - reply.setRequest(_longPoll); - HTTPServer::reply(reply); - _longPoll.evhttpReq = NULL; -} - -void XHTMLInvoker::cancel(const std::string sendId) { - HTTPServer::unregisterServlet(this); -} - -void XHTMLInvoker::invoke(const InvokeRequest& req) { - _invokeReq = req; - - // make sure _invokeReq.content contains correct and substituted string - if (!_invokeReq.data.empty()) { - _invokeReq.content = Data::toJSON(_invokeReq.data); - } else if (_invokeReq.dom) { - std::stringstream ss; - ss << _invokeReq.dom; - _invokeReq.content = ss.str(); - } - _interpreter->getDataModel().replaceExpressions(_invokeReq.content); - - std::string browserURL; - if (req.src.size() > 0) { - // no src given, send browser off to some remote url - browserURL = req.src; - } else { - // invoke to talk to us - HTTPServer::registerServlet(_interpreter->getName() + "/" + req.invokeid + ".html", this); - if (_url.size() == 0) { - returnErrorExecution("No HTTP server running"); - } - browserURL = _url.c_str(); - } -#if __APPLE__ -# if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR -# else - // see http://stackoverflow.com/questions/4177744/c-osx-open-default-browser - CFURLRef url = CFURLCreateWithBytes ( - NULL, // allocator - (UInt8*)browserURL.c_str(), // URLBytes - browserURL.length(), // length - kCFStringEncodingASCII, // encoding - NULL // baseURL - ); - if (LSOpenCFURLRef(url,0) == errSecSuccess) { - if (url) - CFRelease(url); - return; - } -# endif -#endif -#ifdef _WIN32 -// see http://support.microsoft.com/kb/224816 - ShellExecute(NULL, "open", browserURL.c_str(), NULL, NULL, SW_SHOWNORMAL); - return; -#endif -#ifdef HAS_XDG_OPEN - std::string systemCmd; - systemCmd = "xdg-open "; - systemCmd += browserURL; - if (system(systemCmd.c_str()) >= 0) - return; -#endif - LOG(ERROR) << "Could not open a HTML browser, access '" << browserURL << "' yourself."; -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.h b/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.h deleted file mode 100644 index 386af3d..0000000 --- a/src/uscxml/plugins/invoker/xhtml/XHTMLInvoker.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef XHTMLINVOKER_H_W09J90F0 -#define XHTMLINVOKER_H_W09J90F0 - -#include <uscxml/Interpreter.h> -#include "uscxml/server/HTTPServer.h" - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class XHTMLInvoker : public InvokerImpl, public HTTPServlet { -public: - XHTMLInvoker(); - virtual ~XHTMLInvoker(); - virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("xhtml"); - names.push_back("http://www.w3.org/1999/xhtml"); - return names; - } - - virtual Data getDataModelVariables(); - virtual void send(const SendRequest& req); - virtual void cancel(const std::string sendId); - virtual void invoke(const InvokeRequest& req); - - // HTTPServlet - virtual bool httpRecvRequest(const HTTPServer::Request& request); - virtual void setURL(const std::string& url) { - _url = url; - } - - void reply(const SendRequest& req, const HTTPServer::Request& longPoll); - -protected: - HTTPServer::Request _longPoll; - std::deque<HTTPServer::Reply> _outQueue; - - tthread::recursive_mutex _mutex; - InvokeRequest _invokeReq; - - std::string _url; -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(XHTMLInvoker, InvokerImpl); -#endif - -} - - -#endif /* end of include guard: XHTMLINVOKER_H_W09J90F0 */ diff --git a/src/uscxml/plugins/invoker/xhtml/template/xhtml-invoker.html b/src/uscxml/plugins/invoker/xhtml/template/xhtml-invoker.html deleted file mode 100644 index 6d31b11..0000000 --- a/src/uscxml/plugins/invoker/xhtml/template/xhtml-invoker.html +++ /dev/null @@ -1,246 +0,0 @@ -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> - - <!-- Get domLoaded event across browsers --> - <script type="text/javascript"> - // see http://stackoverflow.com/questions/1206937/javascript-domready - var domLoaded = function(callback) { - /* Internet Explorer */ - /*@cc_on - @if (@_win32 || @_win64) - document.write('<script id="ieScriptLoad" defer src="//:"><\/script>'); - document.getElementById('ieScriptLoad').onreadystatechange = function() { - if (this.readyState == 'complete') { - var head= document.getElementsByTagName('head')[0]; - var script= document.createElement('script'); - script.type= 'text/javascript'; - script.src= 'http://wicked-good-xpath.googlecode.com/files/wgxpath.install.js'; - head.appendChild(script); - wgxpath.install(); - - // see http://stackoverflow.com/questions/1811116/ie-support-for-dom-importnode - document.importNode = function(node, allChildren) { - switch (node.nodeType) { - case document.ELEMENT_NODE: - var newNode = document.createElementNS(node.namespaceURI, node.nodeName); - if(node.attributes && node.attributes.length > 0) - for(var i = 0, il = node.attributes.length; i < il; i++) - newNode.setAttribute(node.attributes[i].nodeName, node.getAttribute(node.attributes[i].nodeName)); - if(allChildren && node.childNodes && node.childNodes.length > 0) - for(var i = 0, il = node.childNodes.length; i < il; i++) - newNode.appendChild(document.importNode(node.childNodes[i], allChildren)); - return newNode; - break; - case document.TEXT_NODE: - case document.CDATA_SECTION_NODE: - case document.COMMENT_NODE: - return document.createTextNode(node.nodeValue); - break; - } - } - - callback(); - } - }; - @end @*/ - /* Mozilla, Chrome, Opera */ - if (document.addEventListener) { - document.addEventListener('DOMContentLoaded', callback, false); - return; - } - /* Safari, iCab, Konqueror */ - if (/KHTML|WebKit|iCab/i.test(navigator.userAgent)) { - var DOMLoadTimer = setInterval(function () { - if (/loaded|complete/i.test(document.readyState)) { - callback(); - clearInterval(DOMLoadTimer); - } - }, 10); - return; - } - /* Other web browsers */ - window.onload = callback; - }; - </script> - - <script type="text/javascript"> - - function CometSession(options) { - /** - * Support for two-channel asynchronous http communication - */ - for (var key in options) { - if (options.hasOwnProperty(key)) { - this[key] = options[key]; - } - } - var self = this; - - this.xhr = (window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("MSXML2.XMLHTTP.3.0")); - this.cometPoll = (window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("MSXML2.XMLHTTP.3.0")); - - this.createUUID = function() { - // http://www.ietf.org/rfc/rfc4122.txt - var s = []; - var hexDigits = "0123456789abcdef"; - for (var i = 0; i < 36; i++) { - s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); - } - s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010 - s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01 - s[8] = s[13] = s[18] = s[23] = "-"; - var uuid = s.join(""); - return uuid; - } - - this.longpoll = function() { - self.cometPoll.onreadystatechange = function() { - if (self.cometPoll.readyState === 4) { - if (self.cometPoll.status !== 200) { - self.longpoll(); - return; - } - self.onRcvd(self.cometPoll); - self.longpoll(); - } - }; - // use token until we have a context - self.cometPoll.open("GET", self.server + (self.query ? "?" + self.query : "")); - self.cometPoll.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - // self.cometPoll.setRequestHeader("Connection", "close"); - self.cometPoll.send(null); - }; - - this.disconnect = function() { - self.xhr.open("POST", self.server + (self.query ? "?" + self.query : ""), false); - self.xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - self.xhr.setRequestHeader('X-SCXML-Name', "done.invoke"); - self.xhr.send(NULL); - }; - - this.post = function(name, data, contentType) { - self.xhr.open("POST", self.server + (self.query ? "?" + self.query : "")); - self.xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - self.xhr.setRequestHeader('X-SCXML-Name', name); - if (contentType) { - self.xhr.setRequestHeader('Content-Type', contentType); - } - self.xhr.send(data); - } - - // serialize an object to be send - this.send = function(name, thing) { - var data; - // see also: https://raw.github.com/douglascrockford/JSON-js/master/cycle.js - // dispatch over thingy type here - if (typeof thing === "object") { - var seen = []; - // will not work on opera as thing is checked for cycles first - data = JSON.stringify(thing, function(key, val) { - if (isNode(val)) { - // return a selection of attributes - return { - id: val.id, - tagName: val.tagName, - localName: val.localName - }; - } - if (isWindow(val)) { - return; - } - if (typeof val === "object") { - if (seen.indexOf(val) >= 0) - return; - seen.push(val) - } - return val - }); - } else { - data = thing; - } - this.post(name, data, "application/json"); - } - - // helper function to determine whether something is a html node - var isNode = function(o){ - return ( - typeof Node === "object" ? o instanceof Node : - o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName==="string" - ); - } - - // helper function to determine whether something is a window - var isWindow = function(o){ - return ( - typeof Window === "object" ? o instanceof Window : - o && typeof o === "object" && typeof o.menubar === "object" - ); - } - - } - - </script> - - <script type="text/javascript"> - domLoaded(function () { - scxml = new CometSession({ - //element: document.getElementById("${scxml.invokeId}"), - server: document.URL, - onRcvd : function(data) { - if (data.responseXML) { - var type = data.getResponseHeader("X-SCXML-Type") || "replacechildren"; - var domTarget = data.getResponseHeader("X-SCXML-XPath") || "/html/body"; - var domAttr = data.getResponseHeader("X-SCXML-Attr"); - var result = document.evaluate(domTarget, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); - - for (var i = 0, l = result.snapshotLength; i < l; i++) { - var item = result.snapshotItem(i); - var node = document.importNode(data.responseXML.firstChild, true); - switch (type) { - case "firstchild": - item.insertBefore(node, item.firstChild); - break; - case "lastchild": - item.appendChild(node); - break; - case "previoussibling": - item.parentNode.insertBefore(node, item); - break; - case "nextsibling": - item.parentNode.insertBefore(node, item.nextSibling); - break; - case "replace": - item.parentNode.replaceChild(node, item); - break; - case "delete": - item.parentNode.removeChild(item); - break; - case "addattribute": - item.setAttribute(domAttr, node); - break; - case "replacechildren": - while(item.hasChildNodes()) { - item.removeChild(item.firstChild); - } - item.appendChild(node); - default: - break; - } - } - } - } - }); - scxml.longpoll(); - _parent = scxml; - - window.onbeforeunload = function (e) { - scxml.disconnect(); - // return 'You have unsaved changes!'; - }; - }); - </script> - - </head> - <body></body> -</html> diff --git a/src/uscxml/plugins/invoker/xhtml/template/xhtml-invoker.inc.h b/src/uscxml/plugins/invoker/xhtml/template/xhtml-invoker.inc.h deleted file mode 100644 index 971260b..0000000 --- a/src/uscxml/plugins/invoker/xhtml/template/xhtml-invoker.inc.h +++ /dev/null @@ -1,691 +0,0 @@ -unsigned char template_xhtml_invoker_html[] = { - 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3d, - 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, - 0x77, 0x33, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x31, 0x39, 0x39, 0x39, 0x2f, - 0x78, 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x3e, 0x0a, 0x09, 0x3c, 0x68, 0x65, - 0x61, 0x64, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x20, - 0x68, 0x74, 0x74, 0x70, 0x2d, 0x65, 0x71, 0x75, 0x69, 0x76, 0x3d, 0x22, - 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, - 0x22, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x3d, 0x22, 0x74, - 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3b, 0x63, 0x68, 0x61, - 0x72, 0x73, 0x65, 0x74, 0x3d, 0x75, 0x74, 0x66, 0x2d, 0x38, 0x22, 0x20, - 0x2f, 0x3e, 0x0a, 0x0a, 0x09, 0x09, 0x3c, 0x21, 0x2d, 0x2d, 0x20, 0x47, - 0x65, 0x74, 0x20, 0x64, 0x6f, 0x6d, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x64, - 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x20, 0x61, 0x63, 0x72, 0x6f, 0x73, - 0x73, 0x20, 0x62, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, 0x73, 0x20, 0x2d, - 0x2d, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x74, 0x65, 0x78, 0x74, 0x2f, - 0x6a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0x3e, - 0x0a, 0x09, 0x09, 0x09, 0x2f, 0x2f, 0x20, 0x73, 0x65, 0x65, 0x20, 0x68, - 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x6f, - 0x76, 0x65, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x31, 0x32, - 0x30, 0x36, 0x39, 0x33, 0x37, 0x2f, 0x6a, 0x61, 0x76, 0x61, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x2d, 0x64, 0x6f, 0x6d, 0x72, 0x65, 0x61, 0x64, - 0x79, 0x0a, 0x09, 0x09, 0x09, 0x76, 0x61, 0x72, 0x20, 0x64, 0x6f, 0x6d, - 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, - 0x63, 0x6b, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x2f, 0x2a, - 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x45, 0x78, - 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x20, 0x2a, 0x2f, 0x0a, 0x09, 0x09, - 0x09, 0x09, 0x2f, 0x2a, 0x40, 0x63, 0x63, 0x5f, 0x6f, 0x6e, 0x0a, 0x09, - 0x09, 0x09, 0x09, 0x40, 0x69, 0x66, 0x20, 0x28, 0x40, 0x5f, 0x77, 0x69, - 0x6e, 0x33, 0x32, 0x20, 0x7c, 0x7c, 0x20, 0x40, 0x5f, 0x77, 0x69, 0x6e, - 0x36, 0x34, 0x29, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x77, - 0x72, 0x69, 0x74, 0x65, 0x28, 0x27, 0x3c, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x69, 0x65, 0x53, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x22, 0x20, 0x64, 0x65, 0x66, 0x65, - 0x72, 0x20, 0x73, 0x72, 0x63, 0x3d, 0x22, 0x2f, 0x2f, 0x3a, 0x22, 0x3e, - 0x3c, 0x5c, 0x2f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3e, 0x27, 0x29, - 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, - 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x42, 0x79, 0x49, 0x64, 0x28, 0x27, 0x69, 0x65, 0x53, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x27, 0x29, 0x2e, 0x6f, - 0x6e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x73, 0x74, 0x61, 0x74, 0x65, 0x63, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, - 0x72, 0x65, 0x61, 0x64, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x20, 0x3d, - 0x3d, 0x20, 0x27, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x27, - 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x76, - 0x61, 0x72, 0x20, 0x68, 0x65, 0x61, 0x64, 0x3d, 0x20, 0x64, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x54, 0x61, 0x67, 0x4e, 0x61, - 0x6d, 0x65, 0x28, 0x27, 0x68, 0x65, 0x61, 0x64, 0x27, 0x29, 0x5b, 0x30, - 0x5d, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x76, 0x61, - 0x72, 0x20, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3d, 0x20, 0x64, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x27, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x27, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x74, 0x79, - 0x70, 0x65, 0x3d, 0x20, 0x27, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x6a, 0x61, - 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x27, 0x3b, 0x0a, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x2e, 0x73, 0x72, 0x63, 0x3d, 0x20, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, - 0x2f, 0x2f, 0x77, 0x69, 0x63, 0x6b, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x6f, - 0x64, 0x2d, 0x78, 0x70, 0x61, 0x74, 0x68, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, - 0x69, 0x6c, 0x65, 0x73, 0x2f, 0x77, 0x67, 0x78, 0x70, 0x61, 0x74, 0x68, - 0x2e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x2e, 0x6a, 0x73, 0x27, - 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x68, 0x65, 0x61, - 0x64, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, - 0x64, 0x28, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x29, 0x3b, 0x0a, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x77, 0x67, 0x78, 0x70, 0x61, 0x74, - 0x68, 0x2e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x28, 0x29, 0x3b, - 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x2f, 0x2f, 0x20, 0x73, 0x65, 0x65, 0x20, 0x68, - 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x6f, - 0x76, 0x65, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x31, 0x38, - 0x31, 0x31, 0x31, 0x31, 0x36, 0x2f, 0x69, 0x65, 0x2d, 0x73, 0x75, 0x70, - 0x70, 0x6f, 0x72, 0x74, 0x2d, 0x66, 0x6f, 0x72, 0x2d, 0x64, 0x6f, 0x6d, - 0x2d, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x6e, 0x6f, 0x64, 0x65, 0x0a, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x64, 0x6f, 0x63, 0x75, 0x6d, - 0x65, 0x6e, 0x74, 0x2e, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4e, 0x6f, - 0x64, 0x65, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x28, 0x6e, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x61, 0x6c, 0x6c, 0x43, - 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x29, 0x20, 0x7b, 0x0a, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x20, 0x20, 0x73, 0x77, 0x69, 0x74, - 0x63, 0x68, 0x20, 0x28, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x6e, 0x6f, 0x64, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x20, 0x20, 0x20, 0x20, 0x63, 0x61, 0x73, 0x65, - 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x4c, - 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x3a, 0x0a, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x65, 0x77, 0x4e, 0x6f, 0x64, 0x65, - 0x20, 0x3d, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x4e, 0x53, 0x28, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x6e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x55, 0x52, 0x49, 0x2c, 0x20, 0x6e, - 0x6f, 0x64, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, - 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x28, 0x6e, 0x6f, 0x64, 0x65, 0x2e, - 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x20, 0x26, - 0x26, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, - 0x20, 0x3e, 0x20, 0x30, 0x29, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x72, - 0x28, 0x76, 0x61, 0x72, 0x20, 0x69, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x20, - 0x69, 0x6c, 0x20, 0x3d, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x6e, - 0x67, 0x74, 0x68, 0x3b, 0x20, 0x69, 0x20, 0x3c, 0x20, 0x69, 0x6c, 0x3b, - 0x20, 0x69, 0x2b, 0x2b, 0x29, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6e, - 0x65, 0x77, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x6e, 0x6f, 0x64, 0x65, - 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5b, - 0x69, 0x5d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x2c, - 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x6e, 0x6f, 0x64, 0x65, 0x2e, - 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x5b, 0x69, - 0x5d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x29, 0x29, - 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x69, 0x66, 0x28, 0x61, 0x6c, 0x6c, 0x43, 0x68, 0x69, - 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x20, 0x26, 0x26, 0x20, 0x6e, 0x6f, 0x64, - 0x65, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, - 0x20, 0x26, 0x26, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x68, 0x69, - 0x6c, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, - 0x74, 0x68, 0x20, 0x3e, 0x20, 0x30, 0x29, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, - 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x69, 0x20, 0x3d, 0x20, 0x30, - 0x2c, 0x20, 0x69, 0x6c, 0x20, 0x3d, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x2e, - 0x63, 0x68, 0x69, 0x6c, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2e, 0x6c, - 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x20, 0x69, 0x20, 0x3c, 0x20, 0x69, - 0x6c, 0x3b, 0x20, 0x69, 0x2b, 0x2b, 0x29, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x6e, 0x65, 0x77, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x70, - 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x64, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, - 0x4e, 0x6f, 0x64, 0x65, 0x28, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x63, 0x68, - 0x69, 0x6c, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x5b, 0x69, 0x5d, 0x2c, - 0x20, 0x61, 0x6c, 0x6c, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, - 0x29, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, - 0x6e, 0x65, 0x77, 0x4e, 0x6f, 0x64, 0x65, 0x3b, 0x0a, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, - 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x20, 0x20, 0x20, 0x20, 0x63, 0x61, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x45, 0x58, 0x54, 0x5f, 0x4e, - 0x4f, 0x44, 0x45, 0x3a, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x20, 0x20, 0x20, 0x20, 0x63, 0x61, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x44, 0x41, 0x54, 0x41, 0x5f, - 0x53, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x44, 0x45, - 0x3a, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x20, 0x20, 0x20, - 0x20, 0x63, 0x61, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x2e, 0x43, 0x4f, 0x4d, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x4e, - 0x4f, 0x44, 0x45, 0x3a, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, - 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x78, 0x74, 0x4e, 0x6f, 0x64, 0x65, - 0x28, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, - 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x20, 0x20, 0x7d, - 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x7d, 0x0a, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x28, 0x29, 0x3b, - 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x7d, 0x0a, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x7d, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x40, 0x65, 0x6e, - 0x64, 0x20, 0x40, 0x2a, 0x2f, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x2f, 0x2a, - 0x20, 0x4d, 0x6f, 0x7a, 0x69, 0x6c, 0x6c, 0x61, 0x2c, 0x20, 0x43, 0x68, - 0x72, 0x6f, 0x6d, 0x65, 0x2c, 0x20, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x20, - 0x2a, 0x2f, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x28, 0x64, - 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, - 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x64, 0x6f, 0x63, - 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28, 0x27, - 0x44, 0x4f, 0x4d, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x6f, - 0x61, 0x64, 0x65, 0x64, 0x27, 0x2c, 0x20, 0x63, 0x61, 0x6c, 0x6c, 0x62, - 0x61, 0x63, 0x6b, 0x2c, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, - 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, - 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x7d, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x2f, 0x2a, 0x20, 0x53, 0x61, 0x66, 0x61, 0x72, 0x69, 0x2c, 0x20, 0x69, - 0x43, 0x61, 0x62, 0x2c, 0x20, 0x4b, 0x6f, 0x6e, 0x71, 0x75, 0x65, 0x72, - 0x6f, 0x72, 0x20, 0x2a, 0x2f, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x69, 0x66, - 0x20, 0x28, 0x2f, 0x4b, 0x48, 0x54, 0x4d, 0x4c, 0x7c, 0x57, 0x65, 0x62, - 0x4b, 0x69, 0x74, 0x7c, 0x69, 0x43, 0x61, 0x62, 0x2f, 0x69, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x28, 0x6e, 0x61, 0x76, 0x69, 0x67, 0x61, 0x74, 0x6f, - 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x29, - 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x76, 0x61, 0x72, - 0x20, 0x44, 0x4f, 0x4d, 0x4c, 0x6f, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, - 0x72, 0x20, 0x3d, 0x20, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, - 0x76, 0x61, 0x6c, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x20, 0x28, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x69, 0x66, 0x20, 0x28, 0x2f, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x7c, - 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x2f, 0x69, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x28, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, - 0x2e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x29, - 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x63, - 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x28, 0x29, 0x3b, 0x0a, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x49, - 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x28, 0x44, 0x4f, 0x4d, 0x4c, - 0x6f, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x29, 0x3b, 0x0a, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x7d, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x7d, 0x2c, 0x20, 0x31, 0x30, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x0a, 0x09, 0x09, 0x09, - 0x09, 0x7d, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x2f, 0x2a, 0x20, 0x4f, 0x74, - 0x68, 0x65, 0x72, 0x20, 0x77, 0x65, 0x62, 0x20, 0x62, 0x72, 0x6f, 0x77, - 0x73, 0x65, 0x72, 0x73, 0x20, 0x2a, 0x2f, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x6f, 0x6e, 0x6c, 0x6f, 0x61, - 0x64, 0x20, 0x3d, 0x20, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, - 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x7d, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x3c, - 0x2f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3e, 0x0a, 0x0a, 0x09, 0x09, - 0x3c, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x20, 0x74, 0x79, 0x70, 0x65, - 0x3d, 0x22, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x6a, 0x61, 0x76, 0x61, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x0a, - 0x09, 0x09, 0x09, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, - 0x43, 0x6f, 0x6d, 0x65, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x28, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x29, 0x20, 0x7b, 0x0a, - 0x09, 0x09, 0x09, 0x09, 0x2f, 0x2a, 0x2a, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x20, 0x2a, 0x20, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x66, - 0x6f, 0x72, 0x20, 0x74, 0x77, 0x6f, 0x2d, 0x63, 0x68, 0x61, 0x6e, 0x6e, - 0x65, 0x6c, 0x20, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, - 0x6f, 0x75, 0x73, 0x20, 0x68, 0x74, 0x74, 0x70, 0x20, 0x63, 0x6f, 0x6d, - 0x6d, 0x75, 0x6e, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x09, - 0x09, 0x09, 0x09, 0x20, 0x2a, 0x2f, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x66, - 0x6f, 0x72, 0x20, 0x28, 0x76, 0x61, 0x72, 0x20, 0x6b, 0x65, 0x79, 0x20, - 0x69, 0x6e, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x29, 0x20, - 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x68, 0x61, 0x73, 0x4f, - 0x77, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x28, 0x6b, - 0x65, 0x79, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x20, - 0x20, 0x20, 0x20, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x6b, 0x65, 0x79, 0x5d, - 0x20, 0x3d, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5b, 0x6b, - 0x65, 0x79, 0x5d, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x20, 0x20, 0x7d, - 0x0a, 0x09, 0x09, 0x09, 0x09, 0x7d, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x76, - 0x61, 0x72, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x20, 0x3d, 0x20, 0x74, 0x68, - 0x69, 0x73, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x09, 0x09, 0x09, - 0x09, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x78, 0x68, 0x72, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x3d, 0x20, 0x28, 0x77, 0x69, 0x6e, 0x64, 0x6f, - 0x77, 0x2e, 0x58, 0x4d, 0x4c, 0x48, 0x74, 0x74, 0x70, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x20, 0x3f, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x58, - 0x4d, 0x4c, 0x48, 0x74, 0x74, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x28, 0x29, 0x20, 0x3a, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x41, 0x63, - 0x74, 0x69, 0x76, 0x65, 0x58, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x28, - 0x22, 0x4d, 0x53, 0x58, 0x4d, 0x4c, 0x32, 0x2e, 0x58, 0x4d, 0x4c, 0x48, - 0x54, 0x54, 0x50, 0x2e, 0x33, 0x2e, 0x30, 0x22, 0x29, 0x29, 0x3b, 0x0a, - 0x09, 0x09, 0x09, 0x09, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, - 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x6c, 0x20, 0x3d, 0x20, 0x28, 0x77, 0x69, - 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x58, 0x4d, 0x4c, 0x48, 0x74, 0x74, 0x70, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x20, 0x3f, 0x20, 0x6e, 0x65, - 0x77, 0x20, 0x58, 0x4d, 0x4c, 0x48, 0x74, 0x74, 0x70, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x28, 0x29, 0x20, 0x3a, 0x20, 0x6e, 0x65, 0x77, - 0x20, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x58, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x28, 0x22, 0x4d, 0x53, 0x58, 0x4d, 0x4c, 0x32, 0x2e, 0x58, - 0x4d, 0x4c, 0x48, 0x54, 0x54, 0x50, 0x2e, 0x33, 0x2e, 0x30, 0x22, 0x29, - 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, - 0x55, 0x49, 0x44, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x28, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x2f, 0x2f, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, - 0x77, 0x2e, 0x69, 0x65, 0x74, 0x66, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x72, - 0x66, 0x63, 0x2f, 0x72, 0x66, 0x63, 0x34, 0x31, 0x32, 0x32, 0x2e, 0x74, - 0x78, 0x74, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x76, 0x61, 0x72, 0x20, - 0x73, 0x20, 0x3d, 0x20, 0x5b, 0x5d, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x76, 0x61, 0x72, 0x20, 0x68, 0x65, 0x78, 0x44, 0x69, 0x67, 0x69, - 0x74, 0x73, 0x20, 0x3d, 0x20, 0x22, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, - 0x36, 0x37, 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x22, 0x3b, - 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x66, 0x6f, 0x72, 0x20, 0x28, 0x76, - 0x61, 0x72, 0x20, 0x69, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x20, 0x69, 0x20, - 0x3c, 0x20, 0x33, 0x36, 0x3b, 0x20, 0x69, 0x2b, 0x2b, 0x29, 0x20, 0x7b, - 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, 0x5b, 0x69, 0x5d, 0x20, - 0x3d, 0x20, 0x68, 0x65, 0x78, 0x44, 0x69, 0x67, 0x69, 0x74, 0x73, 0x2e, - 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e, - 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x72, - 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x28, 0x29, 0x20, 0x2a, 0x20, 0x30, 0x78, - 0x31, 0x30, 0x29, 0x2c, 0x20, 0x31, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x7d, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, 0x5b, 0x31, - 0x34, 0x5d, 0x20, 0x3d, 0x20, 0x22, 0x34, 0x22, 0x3b, 0x20, 0x20, 0x2f, - 0x2f, 0x20, 0x62, 0x69, 0x74, 0x73, 0x20, 0x31, 0x32, 0x2d, 0x31, 0x35, - 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, - 0x5f, 0x68, 0x69, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x6f, - 0x20, 0x30, 0x30, 0x31, 0x30, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, - 0x5b, 0x31, 0x39, 0x5d, 0x20, 0x3d, 0x20, 0x68, 0x65, 0x78, 0x44, 0x69, - 0x67, 0x69, 0x74, 0x73, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x28, - 0x28, 0x73, 0x5b, 0x31, 0x39, 0x5d, 0x20, 0x26, 0x20, 0x30, 0x78, 0x33, - 0x29, 0x20, 0x7c, 0x20, 0x30, 0x78, 0x38, 0x2c, 0x20, 0x31, 0x29, 0x3b, - 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x62, 0x69, 0x74, 0x73, 0x20, 0x36, 0x2d, - 0x37, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x6f, - 0x63, 0x6b, 0x5f, 0x73, 0x65, 0x71, 0x5f, 0x68, 0x69, 0x5f, 0x61, 0x6e, - 0x64, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x74, - 0x6f, 0x20, 0x30, 0x31, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, 0x5b, - 0x38, 0x5d, 0x20, 0x3d, 0x20, 0x73, 0x5b, 0x31, 0x33, 0x5d, 0x20, 0x3d, - 0x20, 0x73, 0x5b, 0x31, 0x38, 0x5d, 0x20, 0x3d, 0x20, 0x73, 0x5b, 0x32, - 0x33, 0x5d, 0x20, 0x3d, 0x20, 0x22, 0x2d, 0x22, 0x3b, 0x0a, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x76, 0x61, 0x72, 0x20, 0x75, 0x75, 0x69, 0x64, 0x20, - 0x3d, 0x20, 0x73, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x22, 0x29, - 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, - 0x6e, 0x20, 0x75, 0x75, 0x69, 0x64, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x7d, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x74, - 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x6f, 0x6e, 0x67, 0x70, 0x6f, 0x6c, 0x6c, - 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, - 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, 0x65, 0x6c, - 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x6c, 0x2e, - 0x6f, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x28, 0x73, 0x65, 0x6c, 0x66, - 0x2e, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x6c, 0x2e, 0x72, - 0x65, 0x61, 0x64, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x20, 0x3d, 0x3d, - 0x3d, 0x20, 0x34, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x69, 0x66, 0x20, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x63, - 0x6f, 0x6d, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x20, 0x21, 0x3d, 0x3d, 0x20, 0x32, 0x30, 0x30, 0x29, - 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, - 0x65, 0x6c, 0x66, 0x2e, 0x6c, 0x6f, 0x6e, 0x67, 0x70, 0x6f, 0x6c, 0x6c, - 0x28, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x7d, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x6f, 0x6e, 0x52, 0x63, 0x76, 0x64, 0x28, - 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x50, 0x6f, - 0x6c, 0x6c, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x6c, 0x6f, 0x6e, 0x67, 0x70, 0x6f, 0x6c, - 0x6c, 0x28, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x7d, - 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x7d, 0x3b, 0x0a, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x2f, 0x2f, 0x20, 0x75, 0x73, 0x65, 0x20, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x20, 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x20, 0x77, 0x65, 0x20, - 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x78, 0x74, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, 0x65, 0x6c, 0x66, - 0x2e, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x6c, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x28, 0x22, 0x47, 0x45, 0x54, 0x22, 0x2c, 0x20, 0x73, - 0x65, 0x6c, 0x66, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x2b, - 0x20, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x20, 0x3f, 0x20, 0x22, 0x3f, 0x22, 0x20, 0x2b, 0x20, 0x73, 0x65, 0x6c, - 0x66, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x3a, 0x20, 0x22, 0x22, - 0x29, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, 0x65, 0x6c, - 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x6c, 0x2e, - 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x28, 0x27, 0x58, 0x2d, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x65, 0x64, 0x2d, 0x57, 0x69, 0x74, 0x68, 0x27, 0x2c, - 0x20, 0x27, 0x58, 0x4d, 0x4c, 0x48, 0x74, 0x74, 0x70, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x27, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x2f, 0x2f, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x63, 0x6f, 0x6d, - 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x28, - 0x22, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0x2c, 0x20, 0x22, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x22, 0x29, 0x3b, 0x0a, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x63, 0x6f, - 0x6d, 0x65, 0x74, 0x50, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x6e, 0x64, - 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x7d, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x28, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x78, 0x68, 0x72, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x28, 0x22, 0x50, 0x4f, 0x53, 0x54, 0x22, 0x2c, 0x20, 0x73, 0x65, - 0x6c, 0x66, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x2b, 0x20, - 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x20, - 0x3f, 0x20, 0x22, 0x3f, 0x22, 0x20, 0x2b, 0x20, 0x73, 0x65, 0x6c, 0x66, - 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x3a, 0x20, 0x22, 0x22, 0x29, - 0x2c, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x0a, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x78, 0x68, 0x72, 0x2e, - 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x28, 0x27, 0x58, 0x2d, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x65, 0x64, 0x2d, 0x57, 0x69, 0x74, 0x68, 0x27, 0x2c, - 0x20, 0x27, 0x58, 0x4d, 0x4c, 0x48, 0x74, 0x74, 0x70, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x27, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x78, 0x68, 0x72, 0x2e, 0x73, 0x65, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x28, 0x27, 0x58, 0x2d, 0x53, 0x43, 0x58, 0x4d, 0x4c, 0x2d, - 0x4e, 0x61, 0x6d, 0x65, 0x27, 0x2c, 0x20, 0x22, 0x64, 0x6f, 0x6e, 0x65, - 0x2e, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x22, 0x29, 0x3b, 0x0a, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x78, 0x68, 0x72, - 0x2e, 0x73, 0x65, 0x6e, 0x64, 0x28, 0x4e, 0x55, 0x4c, 0x4c, 0x29, 0x3b, - 0x0a, 0x09, 0x09, 0x09, 0x09, 0x7d, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x0a, 0x09, 0x09, 0x09, 0x09, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x6f, - 0x73, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x20, 0x64, 0x61, 0x74, 0x61, - 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, - 0x65, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, 0x65, - 0x6c, 0x66, 0x2e, 0x78, 0x68, 0x72, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x28, - 0x22, 0x50, 0x4f, 0x53, 0x54, 0x22, 0x2c, 0x20, 0x73, 0x65, 0x6c, 0x66, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x2b, 0x20, 0x28, 0x73, - 0x65, 0x6c, 0x66, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x3f, 0x20, - 0x22, 0x3f, 0x22, 0x20, 0x2b, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x20, 0x3a, 0x20, 0x22, 0x22, 0x29, 0x29, 0x3b, - 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x78, - 0x68, 0x72, 0x2e, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x28, 0x27, 0x58, 0x2d, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x2d, 0x57, 0x69, 0x74, - 0x68, 0x27, 0x2c, 0x20, 0x27, 0x58, 0x4d, 0x4c, 0x48, 0x74, 0x74, 0x70, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x27, 0x29, 0x3b, 0x0a, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x78, 0x68, 0x72, - 0x2e, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x28, 0x27, 0x58, 0x2d, 0x53, 0x43, 0x58, - 0x4d, 0x4c, 0x2d, 0x4e, 0x61, 0x6d, 0x65, 0x27, 0x2c, 0x20, 0x6e, 0x61, - 0x6d, 0x65, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x69, 0x66, - 0x20, 0x28, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, - 0x65, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, - 0x65, 0x6c, 0x66, 0x2e, 0x78, 0x68, 0x72, 0x2e, 0x73, 0x65, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x28, 0x27, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79, - 0x70, 0x65, 0x27, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x54, 0x79, 0x70, 0x65, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x7d, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, 0x65, 0x6c, 0x66, 0x2e, - 0x78, 0x68, 0x72, 0x2e, 0x73, 0x65, 0x6e, 0x64, 0x28, 0x64, 0x61, 0x74, - 0x61, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x7d, 0x0a, 0x09, 0x09, - 0x09, 0x09, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x2f, 0x2f, 0x20, 0x73, 0x65, - 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x20, 0x61, 0x6e, 0x20, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, - 0x73, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x74, 0x68, 0x69, - 0x73, 0x2e, 0x73, 0x65, 0x6e, 0x64, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x20, - 0x74, 0x68, 0x69, 0x6e, 0x67, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x76, 0x61, 0x72, 0x20, 0x64, 0x61, 0x74, 0x61, 0x3b, 0x0a, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x2f, 0x2f, 0x20, 0x73, 0x65, 0x65, 0x20, - 0x61, 0x6c, 0x73, 0x6f, 0x3a, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, - 0x2f, 0x2f, 0x72, 0x61, 0x77, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x6f, 0x75, 0x67, 0x6c, 0x61, 0x73, - 0x63, 0x72, 0x6f, 0x63, 0x6b, 0x66, 0x6f, 0x72, 0x64, 0x2f, 0x4a, 0x53, - 0x4f, 0x4e, 0x2d, 0x6a, 0x73, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, - 0x2f, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x6a, 0x73, 0x0a, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x2f, 0x2f, 0x20, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, - 0x63, 0x68, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x74, 0x68, 0x69, 0x6e, - 0x67, 0x79, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x68, 0x65, 0x72, 0x65, - 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x28, 0x74, 0x79, - 0x70, 0x65, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x3d, - 0x3d, 0x3d, 0x20, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x29, - 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x76, 0x61, 0x72, - 0x20, 0x73, 0x65, 0x65, 0x6e, 0x20, 0x3d, 0x20, 0x5b, 0x5d, 0x3b, 0x0a, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x2f, 0x2f, 0x20, 0x77, 0x69, 0x6c, - 0x6c, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x6f, - 0x6e, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x20, 0x61, 0x73, 0x20, 0x74, - 0x68, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x73, 0x20, 0x63, 0x68, 0x65, 0x63, - 0x6b, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x63, 0x79, 0x63, 0x6c, - 0x65, 0x73, 0x20, 0x66, 0x69, 0x72, 0x73, 0x74, 0x0a, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x64, 0x61, 0x74, 0x61, 0x20, 0x3d, 0x20, 0x4a, 0x53, - 0x4f, 0x4e, 0x2e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x69, 0x66, 0x79, - 0x28, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6b, 0x65, 0x79, 0x2c, 0x20, 0x76, 0x61, - 0x6c, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x69, 0x66, 0x20, 0x28, 0x69, 0x73, 0x4e, 0x6f, 0x64, 0x65, 0x28, 0x76, - 0x61, 0x6c, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x2f, 0x2f, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, - 0x20, 0x61, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x20, 0x6f, 0x66, 0x20, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x73, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x72, - 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x69, 0x64, 0x3a, 0x20, 0x76, 0x61, 0x6c, - 0x2e, 0x69, 0x64, 0x2c, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x74, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x76, - 0x61, 0x6c, 0x2e, 0x74, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x2c, 0x0a, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x6c, 0x6f, 0x63, - 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x76, 0x61, 0x6c, 0x2e, - 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x0a, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x7d, 0x3b, 0x0a, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x7d, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x69, 0x66, 0x20, 0x28, 0x69, 0x73, 0x57, 0x69, 0x6e, 0x64, 0x6f, - 0x77, 0x28, 0x76, 0x61, 0x6c, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, - 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x7d, 0x0a, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x28, 0x74, 0x79, - 0x70, 0x65, 0x6f, 0x66, 0x20, 0x76, 0x61, 0x6c, 0x20, 0x3d, 0x3d, 0x3d, - 0x20, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x29, 0x20, 0x7b, - 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x69, 0x66, 0x20, - 0x28, 0x73, 0x65, 0x65, 0x6e, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4f, - 0x66, 0x28, 0x76, 0x61, 0x6c, 0x29, 0x20, 0x3e, 0x3d, 0x20, 0x30, 0x29, - 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x72, 0x65, - 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x73, 0x65, 0x65, 0x6e, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, - 0x76, 0x61, 0x6c, 0x29, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x7d, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x72, 0x65, 0x74, - 0x75, 0x72, 0x6e, 0x20, 0x76, 0x61, 0x6c, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x7d, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x7d, - 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x64, 0x61, 0x74, 0x61, 0x20, 0x3d, 0x20, 0x74, 0x68, 0x69, - 0x6e, 0x67, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x7d, 0x0a, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x6f, 0x73, - 0x74, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x20, 0x64, 0x61, 0x74, 0x61, - 0x2c, 0x20, 0x22, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x22, 0x29, 0x3b, 0x0a, 0x09, - 0x09, 0x09, 0x09, 0x7d, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x09, 0x09, - 0x09, 0x09, 0x2f, 0x2f, 0x20, 0x68, 0x65, 0x6c, 0x70, 0x65, 0x72, 0x20, - 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, - 0x64, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x20, 0x77, 0x68, - 0x65, 0x74, 0x68, 0x65, 0x72, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x74, 0x68, - 0x69, 0x6e, 0x67, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x68, 0x74, 0x6d, - 0x6c, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x76, - 0x61, 0x72, 0x20, 0x69, 0x73, 0x4e, 0x6f, 0x64, 0x65, 0x20, 0x3d, 0x20, - 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6f, 0x29, 0x7b, - 0x0a, 0x09, 0x09, 0x09, 0x09, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, - 0x6e, 0x20, 0x28, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x20, 0x20, 0x20, 0x20, - 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x20, - 0x3d, 0x3d, 0x3d, 0x20, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, - 0x20, 0x3f, 0x20, 0x6f, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, - 0x65, 0x6f, 0x66, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x20, 0x3a, 0x20, 0x0a, - 0x09, 0x09, 0x09, 0x09, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x20, 0x26, 0x26, - 0x20, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6f, 0x20, 0x3d, 0x3d, - 0x3d, 0x20, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x20, 0x26, - 0x26, 0x20, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6f, 0x2e, 0x6e, - 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x3d, 0x3d, 0x20, - 0x22, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x20, 0x26, 0x26, 0x20, - 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6f, 0x2e, 0x6e, 0x6f, 0x64, - 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x3d, 0x3d, 0x3d, 0x22, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x22, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x20, 0x20, 0x29, - 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x7d, 0x0a, 0x0a, 0x09, 0x09, 0x09, - 0x09, 0x2f, 0x2f, 0x20, 0x68, 0x65, 0x6c, 0x70, 0x65, 0x72, 0x20, 0x66, - 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x64, - 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x20, 0x77, 0x68, 0x65, - 0x74, 0x68, 0x65, 0x72, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x69, - 0x6e, 0x67, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x77, 0x69, 0x6e, 0x64, - 0x6f, 0x77, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x76, 0x61, 0x72, 0x20, 0x69, - 0x73, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x3d, 0x20, 0x66, 0x75, - 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6f, 0x29, 0x7b, 0x0a, 0x09, - 0x09, 0x09, 0x09, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, - 0x28, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x20, 0x20, 0x20, 0x20, 0x74, 0x79, - 0x70, 0x65, 0x6f, 0x66, 0x20, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, - 0x3d, 0x3d, 0x3d, 0x20, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, - 0x20, 0x3f, 0x20, 0x6f, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, - 0x65, 0x6f, 0x66, 0x20, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x3a, - 0x20, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x20, - 0x26, 0x26, 0x20, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6f, 0x20, - 0x3d, 0x3d, 0x3d, 0x20, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, - 0x20, 0x26, 0x26, 0x20, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6f, - 0x2e, 0x6d, 0x65, 0x6e, 0x75, 0x62, 0x61, 0x72, 0x20, 0x3d, 0x3d, 0x3d, - 0x20, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x0a, 0x09, 0x09, - 0x09, 0x09, 0x20, 0x20, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x7d, - 0x0a, 0x09, 0x09, 0x09, 0x09, 0x0a, 0x09, 0x09, 0x09, 0x7d, 0x0a, 0x09, - 0x09, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x3e, 0x0a, 0x09, 0x09, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x74, 0x65, 0x78, - 0x74, 0x2f, 0x6a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x22, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x64, 0x6f, 0x6d, 0x4c, 0x6f, 0x61, - 0x64, 0x65, 0x64, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x20, 0x28, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x73, 0x63, - 0x78, 0x6d, 0x6c, 0x20, 0x3d, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x43, 0x6f, - 0x6d, 0x65, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x28, 0x7b, - 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x2f, 0x2f, 0x65, 0x6c, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x42, 0x79, 0x49, 0x64, 0x28, 0x22, 0x24, 0x7b, 0x73, 0x63, 0x78, 0x6d, - 0x6c, 0x2e, 0x69, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x49, 0x64, 0x7d, 0x22, - 0x29, 0x2c, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x3a, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, - 0x2e, 0x55, 0x52, 0x4c, 0x2c, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x6f, - 0x6e, 0x52, 0x63, 0x76, 0x64, 0x20, 0x3a, 0x20, 0x66, 0x75, 0x6e, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29, 0x20, 0x7b, - 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x28, 0x64, - 0x61, 0x74, 0x61, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x58, 0x4d, 0x4c, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x76, 0x61, 0x72, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, - 0x20, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x28, - 0x22, 0x58, 0x2d, 0x53, 0x43, 0x58, 0x4d, 0x4c, 0x2d, 0x54, 0x79, 0x70, - 0x65, 0x22, 0x29, 0x20, 0x7c, 0x7c, 0x20, 0x22, 0x72, 0x65, 0x70, 0x6c, - 0x61, 0x63, 0x65, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x22, - 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x76, 0x61, 0x72, - 0x20, 0x64, 0x6f, 0x6d, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x3d, - 0x20, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x28, - 0x22, 0x58, 0x2d, 0x53, 0x43, 0x58, 0x4d, 0x4c, 0x2d, 0x58, 0x50, 0x61, - 0x74, 0x68, 0x22, 0x29, 0x20, 0x7c, 0x7c, 0x20, 0x22, 0x2f, 0x68, 0x74, - 0x6d, 0x6c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x3b, 0x0a, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x76, 0x61, 0x72, 0x20, 0x64, 0x6f, 0x6d, - 0x41, 0x74, 0x74, 0x72, 0x20, 0x3d, 0x20, 0x64, 0x61, 0x74, 0x61, 0x2e, - 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x28, 0x22, 0x58, 0x2d, 0x53, 0x43, 0x58, - 0x4d, 0x4c, 0x2d, 0x41, 0x74, 0x74, 0x72, 0x22, 0x29, 0x3b, 0x0a, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x76, 0x61, 0x72, 0x20, 0x72, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x20, 0x3d, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, - 0x65, 0x6e, 0x74, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x65, - 0x28, 0x64, 0x6f, 0x6d, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2c, 0x20, - 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2c, 0x20, 0x6e, 0x75, - 0x6c, 0x6c, 0x2c, 0x20, 0x58, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x2e, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x45, 0x44, 0x5f, - 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x4e, 0x41, 0x50, 0x53, 0x48, 0x4f, - 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x2c, 0x20, 0x6e, 0x75, 0x6c, 0x6c, - 0x29, 0x3b, 0x0a, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x66, - 0x6f, 0x72, 0x20, 0x28, 0x76, 0x61, 0x72, 0x20, 0x69, 0x20, 0x3d, 0x20, - 0x30, 0x2c, 0x20, 0x6c, 0x20, 0x3d, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x2e, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4c, 0x65, - 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x20, 0x69, 0x20, 0x3c, 0x20, 0x6c, 0x3b, - 0x20, 0x69, 0x2b, 0x2b, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x76, 0x61, 0x72, 0x20, 0x69, 0x74, 0x65, 0x6d, - 0x20, 0x3d, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x73, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x28, 0x69, - 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x76, - 0x61, 0x72, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x20, 0x3d, 0x20, 0x64, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x69, 0x6d, 0x70, 0x6f, 0x72, - 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x28, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x58, 0x4d, 0x4c, 0x2e, 0x66, - 0x69, 0x72, 0x73, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x2c, 0x20, 0x74, - 0x72, 0x75, 0x65, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x20, 0x28, 0x74, 0x79, - 0x70, 0x65, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x63, 0x61, 0x73, 0x65, 0x20, 0x22, 0x66, 0x69, 0x72, - 0x73, 0x74, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x22, 0x3a, 0x0a, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x69, 0x74, 0x65, 0x6d, - 0x2e, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x42, 0x65, 0x66, 0x6f, 0x72, - 0x65, 0x28, 0x6e, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x69, 0x74, 0x65, 0x6d, - 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x29, - 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x62, - 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x63, 0x61, 0x73, 0x65, 0x20, 0x22, 0x6c, 0x61, 0x73, - 0x74, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x22, 0x3a, 0x0a, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x69, 0x74, 0x65, 0x6d, 0x2e, - 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, - 0x6e, 0x6f, 0x64, 0x65, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x63, 0x61, 0x73, 0x65, - 0x20, 0x22, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x73, 0x69, - 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x22, 0x3a, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x69, 0x6e, - 0x73, 0x65, 0x72, 0x74, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x28, 0x6e, - 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x29, 0x3b, 0x0a, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x62, 0x72, 0x65, - 0x61, 0x6b, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x63, 0x61, 0x73, 0x65, 0x20, 0x22, 0x6e, 0x65, 0x78, 0x74, 0x73, - 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x22, 0x3a, 0x0a, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x69, 0x74, 0x65, 0x6d, 0x2e, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x69, - 0x6e, 0x73, 0x65, 0x72, 0x74, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x28, - 0x6e, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x6e, - 0x65, 0x78, 0x74, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x29, 0x3b, - 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x62, 0x72, - 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x63, 0x61, 0x73, 0x65, 0x20, 0x22, 0x72, 0x65, 0x70, 0x6c, - 0x61, 0x63, 0x65, 0x22, 0x3a, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x70, 0x61, 0x72, - 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x72, 0x65, 0x70, 0x6c, - 0x61, 0x63, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x6e, 0x6f, 0x64, - 0x65, 0x2c, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x29, 0x3b, 0x0a, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x62, 0x72, 0x65, 0x61, 0x6b, - 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x63, - 0x61, 0x73, 0x65, 0x20, 0x22, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x22, - 0x3a, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, - 0x6f, 0x64, 0x65, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, - 0x69, 0x6c, 0x64, 0x28, 0x69, 0x74, 0x65, 0x6d, 0x29, 0x3b, 0x0a, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x62, 0x72, 0x65, 0x61, - 0x6b, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x63, 0x61, 0x73, 0x65, 0x20, 0x22, 0x61, 0x64, 0x64, 0x61, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, 0x3a, 0x0a, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x69, 0x74, 0x65, 0x6d, 0x2e, - 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, - 0x28, 0x64, 0x6f, 0x6d, 0x41, 0x74, 0x74, 0x72, 0x2c, 0x20, 0x6e, 0x6f, - 0x64, 0x65, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x0a, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x63, 0x61, 0x73, 0x65, 0x20, 0x22, - 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x63, 0x68, 0x69, 0x6c, 0x64, - 0x72, 0x65, 0x6e, 0x22, 0x3a, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x69, 0x74, - 0x65, 0x6d, 0x2e, 0x68, 0x61, 0x73, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x4e, - 0x6f, 0x64, 0x65, 0x73, 0x28, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x69, 0x74, 0x65, - 0x6d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x69, 0x6c, - 0x64, 0x28, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74, - 0x43, 0x68, 0x69, 0x6c, 0x64, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x7d, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x61, - 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x6e, - 0x6f, 0x64, 0x65, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x09, 0x09, 0x09, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x0a, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x62, 0x72, 0x65, - 0x61, 0x6b, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x7d, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x7d, 0x0a, 0x09, - 0x09, 0x09, 0x09, 0x09, 0x09, 0x7d, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, - 0x7d, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x7d, 0x29, 0x3b, 0x0a, 0x09, 0x09, - 0x09, 0x09, 0x73, 0x63, 0x78, 0x6d, 0x6c, 0x2e, 0x6c, 0x6f, 0x6e, 0x67, - 0x70, 0x6f, 0x6c, 0x6c, 0x28, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, - 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x3d, 0x20, 0x73, 0x63, - 0x78, 0x6d, 0x6c, 0x3b, 0x0a, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x77, 0x69, - 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x6f, 0x6e, 0x62, 0x65, 0x66, 0x6f, 0x72, - 0x65, 0x75, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x3d, 0x20, 0x66, 0x75, - 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x65, 0x29, 0x20, 0x7b, - 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x73, 0x63, 0x78, 0x6d, 0x6c, 0x2e, - 0x64, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x28, 0x29, - 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x2f, 0x2f, 0x20, 0x72, 0x65, - 0x74, 0x75, 0x72, 0x6e, 0x20, 0x27, 0x59, 0x6f, 0x75, 0x20, 0x68, 0x61, - 0x76, 0x65, 0x20, 0x75, 0x6e, 0x73, 0x61, 0x76, 0x65, 0x64, 0x20, 0x63, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x21, 0x27, 0x3b, 0x0a, 0x09, 0x09, - 0x09, 0x09, 0x7d, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x7d, 0x29, 0x3b, 0x0a, - 0x09, 0x09, 0x3c, 0x2f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3e, 0x0a, - 0x0a, 0x09, 0x3c, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0a, 0x09, 0x3c, - 0x62, 0x6f, 0x64, 0x79, 0x3e, 0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e, - 0x0a, 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0a -}; -unsigned int template_xhtml_invoker_html_len = 8253; diff --git a/src/uscxml/plugins/ioprocessor/CMakeLists.txt b/src/uscxml/plugins/ioprocessor/CMakeLists.txt index 3c882ed..1171d73 100644 --- a/src/uscxml/plugins/ioprocessor/CMakeLists.txt +++ b/src/uscxml/plugins/ioprocessor/CMakeLists.txt @@ -1,25 +1,3 @@ -# LIBEVENT basichttp ioprocessor - this one is already required above - -set(USCXML_IOPROCESSORS "basichttp ${USCXML_IOPROCESSORS}") -file(GLOB_RECURSE BASICHTTP_IOPROCESSOR - basichttp/*.cpp - basichttp/*.h -) -if (BUILD_AS_PLUGINS) - source_group("" FILES ${BASICHTTP_IOPROCESSOR}) - add_library( - ioprocessor_basichttp SHARED - ${BASICHTTP_IOPROCESSOR} - "../Plugins.cpp") - target_link_libraries(ioprocessor_basichttp uscxml) - set_target_properties(ioprocessor_basichttp PROPERTIES FOLDER "Plugin IOProcessor") - set_target_properties(ioprocessor_basichttp PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(ioprocessor_basichttp PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") -else() - list (APPEND USCXML_FILES ${BASICHTTP_IOPROCESSOR}) -endif() - - # scxml ioprocessor set(USCXML_IOPROCESSORS "scxml ${USCXML_IOPROCESSORS}") @@ -27,110 +5,16 @@ file(GLOB_RECURSE SCXML_IOPROCESSOR scxml/*.cpp scxml/*.h ) +list (APPEND USCXML_FILES ${SCXML_IOPROCESSOR}) + +set(USCXML_IOPROCESSORS "basichttp ${USCXML_IOPROCESSORS}") file(GLOB_RECURSE BASICHTTP_IOPROCESSOR basichttp/*.cpp basichttp/*.h ) -if (BUILD_AS_PLUGINS) - source_group("" FILES ${SCXML_IOPROCESSOR}) - add_library( - ioprocessor_scxml SHARED - ${SCXML_IOPROCESSOR} - ${BASICHTTP_IOPROCESSOR} - "../Plugins.cpp") - # scxml ioprocessor is a basichttp ioprocessor - target_link_libraries(ioprocessor_scxml uscxml) - set_target_properties(ioprocessor_scxml PROPERTIES FOLDER "Plugin IOProcessor") - set_target_properties(ioprocessor_scxml PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(ioprocessor_scxml PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") -else() - list (APPEND USCXML_FILES ${SCXML_IOPROCESSOR}) -endif() - - -if (NOT BUILD_MINIMAL) - - set(USCXML_IOPROCESSORS "sample ${USCXML_IOPROCESSORS}") - file(GLOB_RECURSE SAMPLE_IOPROCESSOR - sample/*.cpp - sample/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${SAMPLE_IOPROCESSOR}) - add_library( - ioprocessor_sample SHARED - ${SAMPLE_IOPROCESSOR} - "../Plugins.cpp") - target_link_libraries(ioprocessor_sample uscxml) - set_target_properties(ioprocessor_sample PROPERTIES FOLDER "Plugin IOProcessor") - set_target_properties(ioprocessor_sample PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(ioprocessor_sample PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${SAMPLE_IOPROCESSOR}) - endif() - - set(USCXML_IOPROCESSORS "comet ${USCXML_IOPROCESSORS}") - file(GLOB_RECURSE COMET_IOPROCESSOR - comet/*.cpp - comet/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${COMET_IOPROCESSOR}) - add_library( - ioprocessor_comet SHARED - ${COMET_IOPROCESSOR} - "../Plugins.cpp") - target_link_libraries(ioprocessor_comet uscxml) - set_target_properties(ioprocessor_comet PROPERTIES FOLDER "Plugin IOProcessor") - set_target_properties(ioprocessor_comet PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(ioprocessor_comet PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${COMET_IOPROCESSOR}) - endif() - - - # mmi ioprocessor - - if (PROTOBUF_FOUND AND OFF) - - if (NOT PROTOBUF_PROTOC_EXECUTABLE) - message(FATAL_ERROR "protoc binary required for serialization") - endif() - - set(USCXML_IOPROCESSORS "mmi ${USCXML_IOPROCESSORS}") - file(GLOB_RECURSE MMI_IOPROCESSOR - modality/*.cpp - modality/*.h - ) - - # process .proto files - file(GLOB_RECURSE PROTOBUF_INTERFACES ${PROJECT_SOURCE_DIR}/contrib/proto/*.proto) - list (APPEND USCXML_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}) - - PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${PROTOBUF_INTERFACES}) - # set_source_files_properties(${PROTO_SRCS} ${PROTO_HDRS} PROPERTIES GENERATED TRUE) - - # this needs to be here for dependencies on the generated proto files - add_library(mmi_proto STATIC ${PROTO_SRCS}) - set_target_properties(mmi_proto PROPERTIES FOLDER "Generated") - - if (BUILD_AS_PLUGINS) - source_group("" FILES ${MMI_IOPROCESSOR}) - add_library( - ioprocessor_mmi SHARED - ${MMI_IOPROCESSOR} - "../Plugins.cpp") - target_link_libraries(ioprocessor_mmi uscxml mmi_proto) - set_target_properties(ioprocessor_mmi PROPERTIES FOLDER "Plugin IOProcessor") - set_target_properties(ioprocessor_mmi PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(ioprocessor_mmi PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${MMI_IOPROCESSOR}) - list (APPEND USCXML_OPT_LIBS mmi_proto) - endif() - endif() +list (APPEND BASICHTTP_IOPROCESSOR "") -endif() # BUILD_MINIMAL +list (APPEND USCXML_FILES ${BASICHTTP_IOPROCESSOR}) set(USCXML_INCLUDE_DIRS ${USCXML_INCLUDE_DIRS} PARENT_SCOPE) set(USCXML_OPT_LIBS ${USCXML_OPT_LIBS} PARENT_SCOPE) diff --git a/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp index 1bced48..f81cf54 100644 --- a/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp +++ b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp @@ -20,9 +20,8 @@ #include "uscxml/Common.h" #include "uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h" -#include "uscxml/Message.h" -#include "uscxml/dom/DOMUtils.h" -#include "uscxml/dom/NameSpacingParser.h" +#include "uscxml/messages/Event.h" +#include "uscxml/util/DOM.h" #include <iostream> #include <event2/dns.h> @@ -31,8 +30,7 @@ #include <string.h> -#include <io/uri.hpp> -#include <glog/logging.h> +#include <easylogging++.h> #include <boost/algorithm/string.hpp> #ifdef _WIN32 @@ -65,6 +63,7 @@ bool pluginConnect(pluma::Host& host) { // see http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor BasicHTTPIOProcessor::BasicHTTPIOProcessor() { + HTTPServer::getInstance(); } BasicHTTPIOProcessor::~BasicHTTPIOProcessor() { @@ -73,8 +72,8 @@ BasicHTTPIOProcessor::~BasicHTTPIOProcessor() { } -boost::shared_ptr<IOProcessorImpl> BasicHTTPIOProcessor::create(InterpreterImpl* interpreter) { - boost::shared_ptr<BasicHTTPIOProcessor> io = boost::shared_ptr<BasicHTTPIOProcessor>(new BasicHTTPIOProcessor()); +std::shared_ptr<IOProcessorImpl> BasicHTTPIOProcessor::create(InterpreterImpl* interpreter) { + std::shared_ptr<BasicHTTPIOProcessor> io(new BasicHTTPIOProcessor()); io->_interpreter = interpreter; // register at http server @@ -104,19 +103,19 @@ Data BasicHTTPIOProcessor::getDataModelVariables() { data.compound["path"] = Data(url.path(), Data::VERBATIM); data.compound["scheme"] = Data(url.scheme(), Data::VERBATIM); - std::vector<std::string> pathComps = url.pathComponents(); - std::vector<std::string>::const_iterator pathCompIter = pathComps.begin(); + std::list<std::string> pathComps = url.pathComponents(); + std::list<std::string>::const_iterator pathCompIter = pathComps.begin(); while(pathCompIter != pathComps.end()) { - data.compound["pathComponens"].array.push_back(Data(*pathCompIter, Data::VERBATIM)); + data.compound["pathComponents"].array.push_back(Data(*pathCompIter, Data::VERBATIM)); pathCompIter++; } return data; } -bool BasicHTTPIOProcessor::httpRecvRequest(const HTTPServer::Request& req) { - Event reqEvent = req; - reqEvent.eventType = Event::EXTERNAL; +bool BasicHTTPIOProcessor::requestFromHTTP(const HTTPServer::Request& req) { + Event event = req; + event.eventType = Event::EXTERNAL; // std::cout << req.raw << std::endl; @@ -130,10 +129,10 @@ bool BasicHTTPIOProcessor::httpRecvRequest(const HTTPServer::Request& req) { // if we sent ourself an event it will end up here // this will call the const subscript operator if (req.data.at("content").hasKey("_scxmleventname")) { - reqEvent.name = req.data.at("content").at("_scxmleventname").atom; + event.name = req.data.at("content").at("_scxmleventname").atom; } if (req.data.at("content").hasKey("content")) { - reqEvent.content = req.data.at("content").at("content").atom; + event.data.atom = req.data.at("content").at("content").atom; } } @@ -143,9 +142,9 @@ bool BasicHTTPIOProcessor::httpRecvRequest(const HTTPServer::Request& req) { for(std::map<std::string, Data>::const_iterator compIter = data.compound.begin(); compIter!= data.compound.end(); compIter++) { if (compIter->first == "content") { - reqEvent.content = compIter->second.atom; + event.data.atom = compIter->second.atom; } else { - reqEvent.data[compIter->first] = compIter->second; + event.data[compIter->first] = compIter->second; } } } @@ -155,62 +154,60 @@ bool BasicHTTPIOProcessor::httpRecvRequest(const HTTPServer::Request& req) { for(std::map<std::string, Data>::const_iterator compIter = data.compound.begin(); compIter!= data.compound.end(); compIter++) { if (compIter->first == "_scxmleventname") { - reqEvent.name = compIter->second.atom; + event.name = compIter->second.atom; } } } - // check whether we can parse it as XML - if (reqEvent.content.length() > 0) { - NameSpacingParser parser = NameSpacingParser::fromXML(reqEvent.content); - if (!parser.errorsReported()) { - reqEvent.dom = parser.getDocument(); - } - } - - /// test532 - if (reqEvent.name.length() == 0) - reqEvent.name = "http." + req.data.compound.at("type").atom; + // test 532 + if (event.name.length() == 0) + event.name = "http." + req.data.compound.at("type").atom; - returnEvent(reqEvent); + eventToSCXML(event, USCXML_IOPROC_BASICHTTP_TYPE, _url); evhttp_send_reply(req.evhttpReq, 200, "OK", NULL); return true; } -void BasicHTTPIOProcessor::send(const SendRequest& req) { +bool BasicHTTPIOProcessor::isValidTarget(const std::string& target) { + try { + URL url(target); + if (url.scheme().compare("http") != 0) + return false; - if (req.target.length() == 0) { - _interpreter->receiveInternal(Event("error.communication", Event::PLATFORM)); - return; + return true; + } catch (ErrorEvent e) { } + return false; +} - bool isLocal = false; - std::string target; - if (!boost::equals(req.target, _url)) { - target = req.target; - } else { - isLocal = true; - target = _url; +void BasicHTTPIOProcessor::eventFromSCXML(const std::string& target, const Event& event) { + + // TODO: is this still needed with isValidTarget()? + if (target.length() == 0) { + _interpreter->enqueueInternal(Event("error.communication", Event::PLATFORM)); + return; } + + bool isLocal = target == _url; URL targetURL(target); std::stringstream kvps; std::string kvpSeperator; // event name - if (req.name.size() > 0) { + if (event.name.size() > 0) { char* eventNameCStr = evhttp_encode_uri("_scxmleventname"); - char* eventValueCStr = evhttp_encode_uri(req.name.c_str()); + char* eventValueCStr = evhttp_encode_uri(event.name.c_str()); kvps << kvpSeperator << eventNameCStr << "=" << eventValueCStr; kvpSeperator = "&"; free(eventNameCStr); free(eventValueCStr); -// targetURL.addOutHeader("_scxmleventname", evhttp_encode_uri(req.name.c_str())); + targetURL.addOutHeader("_scxmleventname", evhttp_encode_uri(event.name.c_str())); } // event namelist - if (req.namelist.size() > 0) { - std::map<std::string, Data>::const_iterator namelistIter = req.namelist.begin(); - while (namelistIter != req.namelist.end()) { + if (event.namelist.size() > 0) { + std::map<std::string, Data>::const_iterator namelistIter = event.namelist.begin(); + while (namelistIter != event.namelist.end()) { char* keyCStr = evhttp_encode_uri(namelistIter->first.c_str()); // this is simplified - Data might be more elaborate than a simple string atom char* valueCStr = evhttp_encode_uri(namelistIter->second.atom.c_str()); @@ -218,15 +215,15 @@ void BasicHTTPIOProcessor::send(const SendRequest& req) { free(keyCStr); free(valueCStr); kvpSeperator = "&"; -// targetURL.addOutHeader(namelistIter->first, namelistIter->second); + targetURL.addOutHeader(namelistIter->first, namelistIter->second); namelistIter++; } } // event params - if (req.params.size() > 0) { - std::multimap<std::string, Data>::const_iterator paramIter = req.params.begin(); - while (paramIter != req.params.end()) { + if (event.params.size() > 0) { + std::multimap<std::string, Data>::const_iterator paramIter = event.params.begin(); + while (paramIter != event.params.end()) { char* keyCStr = evhttp_encode_uri(paramIter->first.c_str()); // this is simplified - Data might be more elaborate than a simple string atom char* valueCStr = evhttp_encode_uri(paramIter->second.atom.c_str()); @@ -234,35 +231,23 @@ void BasicHTTPIOProcessor::send(const SendRequest& req) { free(keyCStr); free(valueCStr); kvpSeperator = "&"; -// targetURL.addOutHeader(paramIter->first, paramIter->second); + targetURL.addOutHeader(paramIter->first, paramIter->second); paramIter++; } } // try hard to find actual content char* keyCStr = evhttp_encode_uri("content"); - if (req.content.size() > 0) { - char* valueCStr = evhttp_encode_uri(req.content.c_str()); - kvps << kvpSeperator << keyCStr << "=" << valueCStr; - free(valueCStr); - kvpSeperator = "&"; - } else if (req.dom) { - std::stringstream xmlStream; - xmlStream << req.dom; - char* valueCStr = evhttp_encode_uri(xmlStream.str().c_str()); - kvps << kvpSeperator << keyCStr << "=" << valueCStr; - free(valueCStr); - kvpSeperator = "&"; - } else if (!req.data.empty()) { + if (!event.data.empty()) { char* valueCStr = NULL; - if (req.data.atom.length() || req.data.array.size() || req.data.compound.size()) { - valueCStr = evhttp_encode_uri(Data::toJSON(req.data).c_str()); - } else if(req.data.node) { + if (event.data.atom.length() || event.data.array.size() || event.data.compound.size()) { + valueCStr = evhttp_encode_uri(Data::toJSON(event.data).c_str()); + } else if(event.data.node) { std::stringstream xmlStream; - xmlStream << req.data.node; + xmlStream << event.data.node; valueCStr = evhttp_encode_uri(xmlStream.str().c_str()); - } else if(req.data.binary) { - valueCStr = evhttp_encode_uri(req.data.binary.base64().c_str()); + } else if(event.data.binary) { + valueCStr = evhttp_encode_uri(event.data.binary.base64().c_str()); } if (valueCStr != NULL) { kvps << kvpSeperator << keyCStr << "=" << valueCStr; @@ -273,13 +258,12 @@ void BasicHTTPIOProcessor::send(const SendRequest& req) { free(keyCStr); targetURL.setOutContent(kvps.str()); + targetURL.addOutHeader("Content-Type", "application/x-www-form-urlencoded"); -// targetURL.addOutHeader("Content-Type", "application/x-www-form-urlencoded"); - - targetURL.setRequestType("post"); + targetURL.setRequestType(URLRequestType::POST); targetURL.addMonitor(this); - _sendRequests[req.sendid] = std::make_pair(targetURL, req); + _sendRequests[event.sendid] = std::make_pair(targetURL, event); if (isLocal) { // test201 use a blocking request with local communication targetURL.download(true); @@ -291,7 +275,7 @@ void BasicHTTPIOProcessor::send(const SendRequest& req) { void BasicHTTPIOProcessor::downloadStarted(const URL& url) {} void BasicHTTPIOProcessor::downloadCompleted(const URL& url) { - std::map<std::string, std::pair<URL, SendRequest> >::iterator reqIter = _sendRequests.begin(); + std::map<std::string, std::pair<URL, Event> >::iterator reqIter = _sendRequests.begin(); while(reqIter != _sendRequests.end()) { if (reqIter->second.first == url) { // test513 @@ -302,7 +286,7 @@ void BasicHTTPIOProcessor::downloadCompleted(const URL& url) { Event event; event.data = url; event.name = "HTTP." + statusPrefix + "." + statusRest; -// returnEvent(event); + eventToSCXML(event, USCXML_IOPROC_BASICHTTP_TYPE, std::string(_url)); } _sendRequests.erase(reqIter); return; @@ -314,12 +298,12 @@ void BasicHTTPIOProcessor::downloadCompleted(const URL& url) { void BasicHTTPIOProcessor::downloadFailed(const URL& url, int errorCode) { - std::map<std::string, std::pair<URL, SendRequest> >::iterator reqIter = _sendRequests.begin(); + std::map<std::string, std::pair<URL, Event> >::iterator reqIter = _sendRequests.begin(); while(reqIter != _sendRequests.end()) { if (reqIter->second.first == url) { Event failEvent; failEvent.name = "error.communication"; - returnEvent(failEvent); + eventToSCXML(failEvent, USCXML_IOPROC_BASICHTTP_TYPE, std::string(_url)); _sendRequests.erase(reqIter); return; diff --git a/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h index 3a43e49..f7e9f10 100644 --- a/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h +++ b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h @@ -35,10 +35,9 @@ extern "C" { # define USCXML_PLUGIN_API #endif -#include "uscxml/concurrency/DelayedEventQueue.h" #include "uscxml/server/HTTPServer.h" #include "uscxml/Interpreter.h" -#include "uscxml/Factory.h" +#include "uscxml/plugins/Factory.h" #ifndef _WIN32 #include <sys/time.h> #endif @@ -47,27 +46,30 @@ extern "C" { #include "uscxml/plugins/Plugins.h" #endif +#define USCXML_IOPROC_BASICHTTP_TYPE "http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor" + namespace uscxml { class USCXML_PLUGIN_API BasicHTTPIOProcessor : public IOProcessorImpl, public HTTPServlet, public URLMonitor { public: BasicHTTPIOProcessor(); virtual ~BasicHTTPIOProcessor(); - virtual boost::shared_ptr<IOProcessorImpl> create(uscxml::InterpreterImpl* interpreter); + virtual std::shared_ptr<IOProcessorImpl> create(uscxml::InterpreterImpl* interpreter); virtual std::list<std::string> getNames() { std::list<std::string> names; names.push_back("basichttp"); - names.push_back("http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor"); + names.push_back(USCXML_IOPROC_BASICHTTP_TYPE); return names; } - virtual void send(const SendRequest& req); + virtual void eventFromSCXML(const std::string& target, const Event& event); + virtual bool isValidTarget(const std::string& target); Data getDataModelVariables(); /// HTTPServlet - bool httpRecvRequest(const HTTPServer::Request& req); + bool requestFromHTTP(const HTTPServer::Request& req); void setURL(const std::string& url) { _url = url; } @@ -83,7 +85,7 @@ public: protected: std::string _url; - std::map<std::string, std::pair<URL, SendRequest> > _sendRequests; + std::map<std::string, std::pair<URL, Event> > _sendRequests; }; // do not implement pluma plugins if we build an inherited plugin diff --git a/src/uscxml/plugins/ioprocessor/comet/CometIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/comet/CometIOProcessor.cpp deleted file mode 100644 index 9ec5c00..0000000 --- a/src/uscxml/plugins/ioprocessor/comet/CometIOProcessor.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include <uscxml/Common.h> -#include "uscxml/plugins/ioprocessor/comet/CometIOProcessor.h" -#include "uscxml/Message.h" -#include <iostream> - -#include <DOM/io/Stream.hpp> -#include <string.h> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new CometIOProcessorProvider() ); - return true; -} -#endif - -CometIOProcessor::CometIOProcessor() { -} - -CometIOProcessor::~CometIOProcessor() { - HTTPServer::unregisterServlet(this); -} - -boost::shared_ptr<IOProcessorImpl> CometIOProcessor::create(InterpreterImpl* interpreter) { - boost::shared_ptr<CometIOProcessor> io = boost::shared_ptr<CometIOProcessor>(new CometIOProcessor()); - io->_interpreter = interpreter; - - // register at http server - std::string path = interpreter->getName(); - int i = 2; - while (!HTTPServer::registerServlet(path + "/comet", io.get())) { - std::stringstream ss; - ss << interpreter->getName() << i++; - path = ss.str(); - } - - return io; -} - -Data CometIOProcessor::getDataModelVariables() { - Data data; - return data; -} - -void CometIOProcessor::send(const SendRequest& req) { - tthread::lock_guard<tthread::recursive_mutex> lock(_mutex); - if (!_longPollingReq) { - _outQueue.push_back(req); - return; - } - reply(req, _longPollingReq); -} - -void CometIOProcessor::reply(const SendRequest& req, const HTTPServer::Request& longPoll) { - HTTPServer::Reply reply(longPoll); - - if (req.dom) { - std::stringstream ss; - ss << req.dom; - reply.content = ss.str(); - reply.headers["Content-Type"] = "application/xml"; - } else if (!req.data.empty()) { - reply.content = Data::toJSON(req.data); - reply.headers["Content-Type"] = "application/json"; - } else if (req.content.length() > 0) { - reply.content = req.content; - reply.headers["Content-Type"] = "text/plain"; - } - - if (req.params.find("Content-Type") != req.params.end()) - reply.headers["Content-Type"] = req.params.find("Content-Type")->first; - - HTTPServer::reply(reply); -} - -bool CometIOProcessor::httpRecvRequest(const HTTPServer::Request& request) { - tthread::lock_guard<tthread::recursive_mutex> lock(_mutex); - - if (_longPollingReq) - // send 204 to last request and remember new one - evhttp_send_error(_longPollingReq.evhttpReq, 204, NULL); - _longPollingReq = request; - if (!_outQueue.empty()) { - send(_outQueue.front()); - _outQueue.pop_front(); - } - return true; -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/ioprocessor/comet/CometIOProcessor.h b/src/uscxml/plugins/ioprocessor/comet/CometIOProcessor.h deleted file mode 100644 index 0a57d70..0000000 --- a/src/uscxml/plugins/ioprocessor/comet/CometIOProcessor.h +++ /dev/null @@ -1,72 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef COMETIOPROCESSOR_H_2CUY93KU -#define COMETIOPROCESSOR_H_2CUY93KU - -#include "uscxml/concurrency/DelayedEventQueue.h" -#include "uscxml/server/HTTPServer.h" -#include "uscxml/Interpreter.h" -#include "uscxml/Factory.h" - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class CometIOProcessor : public IOProcessorImpl, public HTTPServlet { -public: - CometIOProcessor(); - virtual ~CometIOProcessor(); - virtual boost::shared_ptr<IOProcessorImpl> create(uscxml::InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("comet"); - names.push_back("http://www.w3.org/TR/scxml/#CometEventProcessor"); - return names; - } - - /// This method can be overridden for specific replies - virtual void reply(const SendRequest& req, const HTTPServer::Request& longPoll); - - virtual void send(const SendRequest& req); - Data getDataModelVariables(); - - virtual bool httpRecvRequest(const HTTPServer::Request& request); - virtual void setURL(const std::string& url) { - _url = url; - } - -protected: - tthread::recursive_mutex _mutex; - std::string _url; - std::deque<SendRequest> _outQueue; - HTTPServer::Request _longPollingReq; - -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(CometIOProcessor, IOProcessorImpl); -#endif - -} - -#endif /* end of include guard: COMETIOPROCESSOR_H_2CUY93KU */
\ No newline at end of file diff --git a/src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.cpp deleted file mode 100644 index 1a3417a..0000000 --- a/src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.cpp +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - diff --git a/src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.h b/src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.h deleted file mode 100644 index 1a3417a..0000000 --- a/src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.h +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - diff --git a/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.cpp deleted file mode 100644 index 15c05c0..0000000 --- a/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.cpp +++ /dev/null @@ -1,210 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.h" -#include "uscxml/Message.h" - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new MMIHTTPIOProcessorProvider() ); - return true; -} -#endif - -MMIHTTPIOProcessor::MMIHTTPIOProcessor() { -} - -MMIHTTPIOProcessor::~MMIHTTPIOProcessor() { -} - -boost::shared_ptr<IOProcessorImpl> MMIHTTPIOProcessor::create(InterpreterImpl* interpreter) { - boost::shared_ptr<MMIHTTPIOProcessor> io = boost::shared_ptr<MMIHTTPIOProcessor>(new MMIHTTPIOProcessor()); - io->_interpreter = interpreter; - - // register at http server - std::string path = interpreter->getName(); - int i = 2; - while (!HTTPServer::registerServlet(path + "/mmihttp", io.get())) { - std::stringstream ss; - ss << interpreter->getName() << i++; - path = ss.str(); - } - - return io; -} - -bool MMIHTTPIOProcessor::httpRecvRequest(const HTTPServer::Request& req) { - Event reqEvent = req; - reqEvent.eventType = Event::EXTERNAL; - bool scxmlStructFound = false; - - if (reqEvent.data.compound["header"].compound.find("Content-Type") != reqEvent.data.compound["header"].compound.end() && - boost::iequals(reqEvent.data.compound["header"].compound["Content-Type"].atom, "application/x-www-form-urlencoded")) { - std::stringstream ss(reqEvent.data.compound["content"].atom); - std::string term; - while(std::getline(ss, term, '&')) { - size_t split = term.find_first_of("="); - if (split != std::string::npos) { - std::string key = evhttp_decode_uri(term.substr(0, split).c_str()); - std::string value = evhttp_decode_uri(term.substr(split + 1).c_str()); - if (boost::iequals(key, "_scxmleventname")) { - reqEvent.name = value; - } else if (boost::iequals(key, "content")) { - reqEvent.initContent(value); - } else { - reqEvent.data.compound[key] = value; - reqEvent.params.insert(std::make_pair(key, value)); - } - } else { - // this is most likely wrong - reqEvent.content = evhttp_decode_uri(term.c_str()); - } - } - } else { - if (reqEvent.data.compound["header"].compound.find("_scxmleventstruct") != reqEvent.data.compound["header"].compound.end()) { - // TODO: this looses all other information - reqEvent = Event::fromXML(evhttp_decode_uri(reqEvent.data.compound["header"].compound["_scxmleventstruct"].atom.c_str())); - scxmlStructFound = true; - } - if (reqEvent.data.compound["header"].compound.find("_scxmleventname") != reqEvent.data.compound["header"].compound.end()) { - reqEvent.name = evhttp_decode_uri(reqEvent.data.compound["header"].compound["_scxmleventname"].atom.c_str()); - } - } - std::map<std::string, Data>::iterator headerIter = reqEvent.data.compound["header"].compound.begin(); - while(headerIter != reqEvent.data.compound["header"].compound.end()) { - reqEvent.data.compound[headerIter->first] = Data(evhttp_decode_uri(headerIter->second.atom.c_str()), Data::VERBATIM); - headerIter++; - } - -#if 0 - std::map<std::string, std::string>::const_iterator headerIter = req.headers.begin(); - while(headerIter != req.headers.end()) { - if (boost::iequals("_scxmleventstruct", headerIter->first)) { - reqEvent = Event::fromXML(evhttp_decode_uri(headerIter->second.c_str())); - scxmlStructFound = true; - break; - } else if (boost::iequals("_scxmleventname", headerIter->first)) { - reqEvent.name = evhttp_decode_uri(headerIter->second.c_str()); - } else { - reqEvent.data.compound[headerIter->first] = Data(evhttp_decode_uri(headerIter->second.c_str()), Data::VERBATIM); - } - headerIter++; - } -#endif - - /// test532 - if (reqEvent.name.length() == 0) - reqEvent.name = "http." + req.data.compound.at("type").atom; - - if (!scxmlStructFound) { - // get content into event - reqEvent.data.compound["content"] = Data(req.content, Data::VERBATIM); - } - - returnEvent(reqEvent); - evhttp_send_reply(req.curlReq, 200, "OK", NULL); - return true; -} - -void MMIHTTPIOProcessor::send(const SendRequest& req) { - - if (req.target.length() == 0) { - _interpreter->receiveInternal(Event("error.communication", Event::PLATFORM)); - return; - } - - bool isLocal = false; - std::string target; - if (!boost::equals(req.target, _url)) { - target = req.target; - } else { - isLocal = true; - target = _url; - } - URL targetURL(target); - std::stringstream kvps; - std::string kvpSeperator; - - // event name - if (req.name.size() > 0) { - kvps << kvpSeperator << evhttp_encode_uri("_scxmleventname") << "=" << evhttp_encode_uri(req.name.c_str()); - kvpSeperator = "&"; -// targetURL.addOutHeader("_scxmleventname", evhttp_encode_uri(req.name.c_str())); - } - - // event namelist - if (req.namelist.size() > 0) { - std::map<std::string, Data>::const_iterator namelistIter = req.namelist.begin(); - while (namelistIter != req.namelist.end()) { - // this is simplified - Data might be more elaborate than a simple string atom - kvps << kvpSeperator << evhttp_encode_uri(namelistIter->first.c_str()) << "=" << evhttp_encode_uri(namelistIter->second.atom.c_str()); - kvpSeperator = "&"; -// targetURL.addOutHeader(namelistIter->first, namelistIter->second); - namelistIter++; - } - } - - // event params - if (req.params.size() > 0) { - std::multimap<std::string, Data>::const_iterator paramIter = req.params.begin(); - while (paramIter != req.params.end()) { - // this is simplified - Data might be more elaborate than a simple string atom - kvps << kvpSeperator << evhttp_encode_uri(paramIter->first.c_str()) << "=" << evhttp_encode_uri(paramIter->second.atom.c_str()); - kvpSeperator = "&"; -// targetURL.addOutHeader(paramIter->first, paramIter->second); - paramIter++; - } - } - - // content - - if (req.content.size() > 0) { - kvps << kvpSeperator << evhttp_encode_uri("content") << "=" << evhttp_encode_uri(req.content.c_str()); - kvpSeperator = "&"; - } - if (req.dom) { - std::stringstream xmlStream; - xmlStream << req.dom; - kvps << kvpSeperator << evhttp_encode_uri("content") << "=" << evhttp_encode_uri(xmlStream.str().c_str()); - kvpSeperator = "&"; - } - targetURL.setOutContent(kvps.str()); - - targetURL.setRequestType("post"); - targetURL.addMonitor(this); - - _sendRequests[req.sendid] = std::make_pair(targetURL, req); - if (isLocal) { - // test201 use a blocking request with local communication - targetURL.download(true); - } else { - URLFetcher::fetchURL(targetURL); - } -} - - - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.h b/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.h deleted file mode 100644 index 00b47c7..0000000 --- a/src/uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.h +++ /dev/null @@ -1,72 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef MMIHTTPIOPROCESSOR_H_P1FN0YPL -#define MMIHTTPIOPROCESSOR_H_P1FN0YPL - -#include "uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h" -#include "uscxml/Interpreter.h" -#include "uscxml/Factory.h" -#ifndef _WIN32 -#include <sys/time.h> -#endif - -#include <event2/http.h> -#include <event2/http_struct.h> - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -namespace uscxml { - -class MMIHTTPIOProcessor : public BasicHTTPIOProcessor { -public: - MMIHTTPIOProcessor(); - virtual ~MMIHTTPIOProcessor(); - virtual boost::shared_ptr<IOProcessorImpl> create(uscxml::InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("mmihttp"); - names.push_back("http://www.w3.org/TR/mmi-arch/#HTTPTransport"); - return names; - } - - virtual void send(const SendRequest& req); - - /// HTTPServlet - bool httpRecvRequest(const HTTPServer::Request& req); - - bool canAdaptPath() { - return false; - } - -protected: - std::string _url; - std::map<std::string, std::pair<URL, SendRequest> > _sendRequests; -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(MMIHTTPIOProcessor, IOProcessorImpl); -#endif - -} - -#endif /* end of include guard: MMIHTTPIOPROCESSOR_H_P1FN0YPL */ diff --git a/src/uscxml/plugins/ioprocessor/modality/MMIProtoBridge.cpp b/src/uscxml/plugins/ioprocessor/modality/MMIProtoBridge.cpp deleted file mode 100644 index c649a17..0000000 --- a/src/uscxml/plugins/ioprocessor/modality/MMIProtoBridge.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "MMIProtoBridge.h" - -#define INIT_PROTO_LIFE_CYCLE_EVENT(type) \ -::LifeCycleEvent lifeCycleEvent; \ -lifeCycleEvent.set_type(type); \ -lifeCycleEvent.set_requestid(mmiEvent.requestId); \ -lifeCycleEvent.set_source(mmiEvent.source); \ -lifeCycleEvent.set_target(mmiEvent.target); - -namespace uscxml { - -::LifeCycleEvent MMIProtoBridge::toProto(const NewContextRequest& mmiEvent) { - INIT_PROTO_LIFE_CYCLE_EVENT(::LifeCycleEvent_LifeCycleEventType_NEW_CONTEXT_REQUEST); - return lifeCycleEvent; -} - -::LifeCycleEvent MMIProtoBridge::toProto(const NewContextResponse& mmiEvent) { - INIT_PROTO_LIFE_CYCLE_EVENT(::LifeCycleEvent_LifeCycleEventType_NEW_CONTEXT_RESPONSE); - return lifeCycleEvent; -} - -::LifeCycleEvent MMIProtoBridge::toProto(const PrepareRequest& mmiEvent) { - INIT_PROTO_LIFE_CYCLE_EVENT(::LifeCycleEvent_LifeCycleEventType_PREPARE_REQUEST); - return lifeCycleEvent; -} - -::LifeCycleEvent MMIProtoBridge::toProto(const PrepareResponse& mmiEvent) { - INIT_PROTO_LIFE_CYCLE_EVENT(::LifeCycleEvent_LifeCycleEventType_PREPARE_RESPONSE); - return lifeCycleEvent; -} - -::LifeCycleEvent MMIProtoBridge::toProto(const StartRequest& mmiEvent) { - INIT_PROTO_LIFE_CYCLE_EVENT(::LifeCycleEvent_LifeCycleEventType_START_REQUEST); - - ::LifeCycleRequest* lifeCycleRequest = lifeCycleEvent.MutableExtension(::LifeCycleRequest::Request); - lifeCycleRequest->set_context(mmiEvent.context); - - ::StartRequest* startRequest = lifeCycleRequest->MutableExtension(::StartRequest::Request); - startRequest->set_content(mmiEvent.content); - startRequest->set_contenturl(mmiEvent.contentURL.href); - - ::StartRequestData* startRequestData = startRequest->MutableExtension(::StartRequestData::Request); - startRequestData->set_data(mmiEvent.data); - - return lifeCycleEvent; -} - -::LifeCycleEvent MMIProtoBridge::toProto(const StartResponse& mmiEvent) { - INIT_PROTO_LIFE_CYCLE_EVENT(::LifeCycleEvent_LifeCycleEventType_START_RESPONSE); - return lifeCycleEvent; -} - -::LifeCycleEvent MMIProtoBridge::toProto(const DoneNotification& mmiEvent) { - INIT_PROTO_LIFE_CYCLE_EVENT(::LifeCycleEvent_LifeCycleEventType_DONE_NOTIFICATION); - return lifeCycleEvent; -} - -::LifeCycleEvent MMIProtoBridge::toProto(const CancelRequest& mmiEvent) { - INIT_PROTO_LIFE_CYCLE_EVENT(::LifeCycleEvent_LifeCycleEventType_CANCEL_REQUEST); - return lifeCycleEvent; -} - -::LifeCycleEvent MMIProtoBridge::toProto(const CancelResponse& mmiEvent) { - INIT_PROTO_LIFE_CYCLE_EVENT(::LifeCycleEvent_LifeCycleEventType_CANCEL_RESPONSE); - return lifeCycleEvent; -} - -::LifeCycleEvent MMIProtoBridge::toProto(const PauseRequest& mmiEvent) { - INIT_PROTO_LIFE_CYCLE_EVENT(::LifeCycleEvent_LifeCycleEventType_PAUSE_REQUEST); - return lifeCycleEvent; -} - -::LifeCycleEvent MMIProtoBridge::toProto(const PauseResponse& mmiEvent) { - INIT_PROTO_LIFE_CYCLE_EVENT(::LifeCycleEvent_LifeCycleEventType_PAUSE_RESPONSE); - return lifeCycleEvent; -} - -::LifeCycleEvent MMIProtoBridge::toProto(const ResumeRequest& mmiEvent) { - INIT_PROTO_LIFE_CYCLE_EVENT(::LifeCycleEvent_LifeCycleEventType_RESUME_REQUEST); - return lifeCycleEvent; -} - -::LifeCycleEvent MMIProtoBridge::toProto(const ResumeResponse& mmiEvent) { - INIT_PROTO_LIFE_CYCLE_EVENT(::LifeCycleEvent_LifeCycleEventType_RESUME_RESPONSE); - return lifeCycleEvent; -} - -::LifeCycleEvent MMIProtoBridge::toProto(const ExtensionNotification& mmiEvent) { - INIT_PROTO_LIFE_CYCLE_EVENT(::LifeCycleEvent_LifeCycleEventType_EXTENSION_NOTIFICATION); - return lifeCycleEvent; -} - -::LifeCycleEvent MMIProtoBridge::toProto(const ClearContextRequest& mmiEvent) { - INIT_PROTO_LIFE_CYCLE_EVENT(::LifeCycleEvent_LifeCycleEventType_CLEAR_CONTEXT_REQUEST); - return lifeCycleEvent; -} - -::LifeCycleEvent MMIProtoBridge::toProto(const ClearContextResponse& mmiEvent) { - INIT_PROTO_LIFE_CYCLE_EVENT(::LifeCycleEvent_LifeCycleEventType_CLEAR_CONTEXT_RESPONSE); - return lifeCycleEvent; -} - -::LifeCycleEvent MMIProtoBridge::toProto(const StatusRequest& mmiEvent) { - INIT_PROTO_LIFE_CYCLE_EVENT(::LifeCycleEvent_LifeCycleEventType_STATUS_REQUEST); - return lifeCycleEvent; -} - -::LifeCycleEvent MMIProtoBridge::toProto(const StatusResponse& mmiEvent) { - INIT_PROTO_LIFE_CYCLE_EVENT(::LifeCycleEvent_LifeCycleEventType_STATUS_RESPONSE); - return lifeCycleEvent; -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/ioprocessor/modality/MMIProtoBridge.h b/src/uscxml/plugins/ioprocessor/modality/MMIProtoBridge.h deleted file mode 100644 index 60ba824..0000000 --- a/src/uscxml/plugins/ioprocessor/modality/MMIProtoBridge.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef MMIPROTOBRIDGE_H_T6VXUX69 -#define MMIPROTOBRIDGE_H_T6VXUX69 - -#include "LifeCycleEvents.pb.h" -#include "StringDataExtension.pb.h" -#include "MMIMessages.h" - -namespace uscxml { - -class MMIProtoBridge { -public: - static ::LifeCycleEvent toProto(const NewContextRequest&); - static ::LifeCycleEvent toProto(const NewContextResponse&); - static ::LifeCycleEvent toProto(const PrepareRequest&); - static ::LifeCycleEvent toProto(const PrepareResponse&); - static ::LifeCycleEvent toProto(const StartRequest&); - static ::LifeCycleEvent toProto(const StartResponse&); - static ::LifeCycleEvent toProto(const DoneNotification&); - static ::LifeCycleEvent toProto(const CancelRequest&); - static ::LifeCycleEvent toProto(const CancelResponse&); - static ::LifeCycleEvent toProto(const PauseRequest&); - static ::LifeCycleEvent toProto(const PauseResponse&); - static ::LifeCycleEvent toProto(const ResumeRequest&); - static ::LifeCycleEvent toProto(const ResumeResponse&); - static ::LifeCycleEvent toProto(const ExtensionNotification&); - static ::LifeCycleEvent toProto(const ClearContextRequest&); - static ::LifeCycleEvent toProto(const ClearContextResponse&); - static ::LifeCycleEvent toProto(const StatusRequest&); - static ::LifeCycleEvent toProto(const StatusResponse&); -}; - -} - -#endif /* end of include guard: MMIPROTOBRIDGE_H_T6VXUX69 */ diff --git a/src/uscxml/plugins/ioprocessor/sample/SampleIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/sample/SampleIOProcessor.cpp deleted file mode 100644 index bca2344..0000000 --- a/src/uscxml/plugins/ioprocessor/sample/SampleIOProcessor.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#include "uscxml/plugins/ioprocessor/sample/SampleIOProcessor.h" -#include "uscxml/Message.h" -#include <iostream> - -#include <string.h> - -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - -namespace uscxml { - -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new SampleIOProcessorProvider() ); - return true; -} -#endif - -SampleIOProcessor::SampleIOProcessor() { -} - -SampleIOProcessor::~SampleIOProcessor() { -} - -boost::shared_ptr<IOProcessorImpl> SampleIOProcessor::create(InterpreterImpl* interpreter) { - boost::shared_ptr<SampleIOProcessor> io = boost::shared_ptr<SampleIOProcessor>(new SampleIOProcessor()); - return io; -} - -Data SampleIOProcessor::getDataModelVariables() { - Data data; - return data; -} - -void SampleIOProcessor::send(const SendRequest& req) { -} - -}
\ No newline at end of file diff --git a/src/uscxml/plugins/ioprocessor/sample/SampleIOProcessor.h b/src/uscxml/plugins/ioprocessor/sample/SampleIOProcessor.h deleted file mode 100644 index 05dd3ef..0000000 --- a/src/uscxml/plugins/ioprocessor/sample/SampleIOProcessor.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @file - * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) - * @copyright Simplified BSD - * - * @cond - * This program is free software: you can redistribute it and/or modify - * it under the terms of the FreeBSD license as published by the FreeBSD - * project. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received a copy of the FreeBSD license along with this - * program. If not, see <http://www.opensource.org/licenses/bsd-license>. - * @endcond - */ - -#ifndef SAMPLEIOPROCESSOR_H_2CUY93KU -#define SAMPLEIOPROCESSOR_H_2CUY93KU - -#include "uscxml/Factory.h" - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif - -#if defined(_WIN32) && !defined(USCXML_STATIC) -# if (defined ioprocessor_sample_EXPORTS || defined USCXML_EXPORT) -# define USCXML_PLUGIN_API __declspec(dllexport) -# else -# define USCXML_PLUGIN_API __declspec(dllimport) -# endif -#else -# define USCXML_PLUGIN_API -#endif - -namespace uscxml { - -class USCXML_PLUGIN_API SampleIOProcessor : public IOProcessorImpl { -public: - SampleIOProcessor(); - virtual ~SampleIOProcessor(); - virtual boost::shared_ptr<IOProcessorImpl> create(uscxml::InterpreterImpl* interpreter); - - virtual std::list<std::string> getNames() { - std::list<std::string> names; - names.push_back("sample"); - names.push_back("http://www.w3.org/TR/scxml/#SampleEventProcessor"); - return names; - } - - virtual void send(const SendRequest& req); - Data getDataModelVariables(); - -protected: -}; - -#ifdef BUILD_AS_PLUGINS -PLUMA_INHERIT_PROVIDER(SampleIOProcessor, IOProcessorImpl); -#endif - -} - -#endif /* end of include guard: SAMPLEIOPROCESSOR_H_2CUY93KU */
\ No newline at end of file diff --git a/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp index 6905e22..c53915b 100644 --- a/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp +++ b/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp @@ -17,88 +17,64 @@ * @endcond */ -#include <boost/algorithm/string.hpp> -#ifdef _WIN32 -#define NOMINMAX -#include <winsock2.h> -#include <windows.h> -#endif - -#include "uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.h" -#include "uscxml/Message.h" -#include <iostream> -#include <event2/dns.h> -#include <event2/buffer.h> -#include <event2/keyvalq_struct.h> +#include "SCXMLIOProcessor.h" +#include "uscxml/messages/Event.h" +#include "uscxml/interpreter/InterpreterImpl.h" #include <string.h> -#include <io/uri.hpp> -#include <glog/logging.h> #ifndef _WIN32 #include <netdb.h> #include <arpa/inet.h> #endif -#ifdef BUILD_AS_PLUGINS -#include <Pluma/Connector.hpp> -#endif - namespace uscxml { -#ifdef BUILD_AS_PLUGINS -PLUMA_CONNECTOR -bool pluginConnect(pluma::Host& host) { - host.add( new SCXMLIOProcessorProvider() ); - return true; -} -#endif - // see http://www.w3.org/TR/scxml/#SCXMLEventProcessor SCXMLIOProcessor::SCXMLIOProcessor() { } SCXMLIOProcessor::~SCXMLIOProcessor() { - HTTPServer::unregisterServlet(this); } -boost::shared_ptr<IOProcessorImpl> SCXMLIOProcessor::create(InterpreterImpl* interpreter) { - boost::shared_ptr<SCXMLIOProcessor> io = boost::shared_ptr<SCXMLIOProcessor>(new SCXMLIOProcessor()); +std::shared_ptr<IOProcessorImpl> SCXMLIOProcessor::create(InterpreterImpl* interpreter) { + std::shared_ptr<SCXMLIOProcessor> io(new SCXMLIOProcessor()); io->_interpreter = interpreter; - - // register at http server - std::string path = interpreter->getName(); - int i = 2; - while (!HTTPServer::registerServlet(path + "/scxml", io.get())) { - std::stringstream ss; - ss << interpreter->getName() << i++; - path = ss.str(); - } return io; } Data SCXMLIOProcessor::getDataModelVariables() { Data data; - if(_url.length() > 0) - data.compound["location"] = Data(_url, Data::VERBATIM); + + data.compound["location"] = Data("#_scxml_" + _interpreter->getSessionId(), Data::VERBATIM); + return data; } +bool SCXMLIOProcessor::isValidTarget(const std::string& target) { + if (target.size() > 0 && (target[0] != '#' || target[1] != '_')) { + ERROR_EXECUTION_THROW("Target '" + target + "' not supported in send"); + } + return true; +} + -void SCXMLIOProcessor::send(const SendRequest& req) { +void SCXMLIOProcessor::eventFromSCXML(const std::string& target, const Event& event) { // see http://www.w3.org/TR/scxml/#SendTargets + Event eventCopy(event); - SendRequest reqCopy(req); - // test 253 - reqCopy.origintype = "http://www.w3.org/TR/scxml/#SCXMLEventProcessor"; - reqCopy.origin = _url; + // test 253 / 198 / 336 + eventCopy.origintype = "http://www.w3.org/TR/scxml/#SCXMLEventProcessor"; + + // test 336 + eventCopy.origin = "#_scxml_" + _interpreter->getSessionId(); if (false) { - } else if(reqCopy.target.length() == 0) { + } else if(target.length() == 0) { /** * If neither the 'target' nor the 'targetexpr' attribute is specified, the * SCXML Processor must add the event will be added to the external event @@ -107,16 +83,31 @@ void SCXMLIOProcessor::send(const SendRequest& req) { // test333 vs test351 // reqCopy.sendid = ""; + // test 198 - _interpreter->receive(reqCopy); - } else if (iequals(reqCopy.target, "#_internal")) { + _interpreter->enqueueExternal(eventCopy); + + } else if (iequals(target, "#_internal")) { /** * #_internal: If the target is the special term '#_internal', the Processor * must add the event to the internal event queue of the sending session. */ - _interpreter->receiveInternal(reqCopy); + _interpreter->enqueueInternal(eventCopy); - } else if(boost::starts_with(reqCopy.target, "#_scxml_")) { + } else if (iequals(target, "#_parent")) { + /** + * #_parent: If the target is the special term '#_parent', the Processor must + * add the event to the external event queue of the SCXML session that invoked + * the sending session, if there is one. + */ + + if (_interpreter->_parentQueue) { + _interpreter->_parentQueue.enqueue(eventCopy); + } else { + ERROR_COMMUNICATION_THROW("Sending to parent invoker, but none is set"); + } + + } else if (target.length() > 8 && iequals(target.substr(0, 8), "#_scxml_")) { /** * #_scxml_sessionid: If the target is the special term '#_scxml_sessionid', * where sessionid is the id of an SCXML session that is accessible to the @@ -124,66 +115,46 @@ void SCXMLIOProcessor::send(const SendRequest& req) { * session. The set of SCXML sessions that are accessible to a given SCXML * Processor is platform-dependent. */ - std::string sessionId = reqCopy.target.substr(8, reqCopy.target.length() - 8); - std::map<std::string, boost::weak_ptr<InterpreterImpl> > instances = Interpreter::getInstances(); - if (instances.find(sessionId) != instances.end()) { - boost::shared_ptr<InterpreterImpl> other = instances[sessionId].lock(); - other->receive(reqCopy); - } else { - ERROR_COMMUNICATION(error, "Can not send to scxml session " + sessionId + " - not known"); - error.sendid = reqCopy.sendid; - _interpreter->receiveInternal(error); + std::string sessionId = target.substr(8); - } - } else if (iequals(reqCopy.target, "#_parent")) { - /** - * #_parent: If the target is the special term '#_parent', the Processor must - * add the event to the external event queue of the SCXML session that invoked - * the sending session, if there is one. - */ - if (_interpreter->_parentQueue != NULL) { - _interpreter->_parentQueue->push(reqCopy); + std::lock_guard<std::recursive_mutex> lock(_interpreter->_instanceMutex); + std::map<std::string, std::weak_ptr<InterpreterImpl> > instances = InterpreterImpl::getInstances(); + if (instances.find(sessionId) != instances.end()) { + std::shared_ptr<InterpreterImpl> otherSession = instances[sessionId].lock(); + if (otherSession) { + otherSession->enqueueExternal(eventCopy); + } else { + ERROR_COMMUNICATION_THROW("Can not send to scxml session " + sessionId + " - not known"); + } } else { - ERROR_COMMUNICATION(error, "Can not send to parent, we were not invoked or no parent queue is set"); - error.sendid = reqCopy.sendid; - _interpreter->receiveInternal(error); + ERROR_COMMUNICATION_THROW("Invalid target scxml session for send"); } - } else if (boost::starts_with(reqCopy.target, "#_")) { + + } else if (target.length() > 2 && iequals(target.substr(0, 2), "#_")) { /** * #_invokeid: If the target is the special term '#_invokeid', where invokeid * is the invokeid of an SCXML session that the sending session has created * by <invoke>, the Processor must add the event to the external queue of that * session. */ - std::string invokeId = reqCopy.target.substr(2, reqCopy.target.length() - 2); + std::string invokeId = target.substr(2); if (_interpreter->_invokers.find(invokeId) != _interpreter->_invokers.end()) { - tthread::lock_guard<tthread::recursive_mutex> lock(_interpreter->_mutex); + std::lock_guard<std::recursive_mutex> lock(_interpreter->_instanceMutex); try { - _interpreter->_invokers[invokeId].send(reqCopy); + _interpreter->_invokers[invokeId].eventFromSCXML(eventCopy); } catch(Event e) { // Is this the right thing to do? - _interpreter->receive(e); +// _interpreter->enqueueExternal(eventCopy); } catch (const std::exception &e) { - LOG(ERROR) << "Exception caught while sending event to invoker " << invokeId << ": " << e.what(); + ERROR_COMMUNICATION_THROW("Exception caught while sending event to invoker '" + invokeId + "': " + e.what()); } catch(...) { - LOG(ERROR) << "Exception caught while sending event to invoker " << invokeId; + ERROR_COMMUNICATION_THROW("Exception caught while sending event to invoker '" + invokeId + "'"); } } else { - ERROR_COMMUNICATION(error, "Can not send to invoked component '" + invokeId + "', no such invokeId"); - error.sendid = reqCopy.sendid; - _interpreter->receiveInternal(error); + ERROR_COMMUNICATION_THROW("Can not send to invoked component '" + invokeId + "', no such invokeId"); } } else { - URL target(reqCopy.target); - if (target.isAbsolute()) { - BasicHTTPIOProcessor::send(reqCopy); - } else { - ERROR_EXECUTION(error, "Not sure what to make of the target '" + reqCopy.target + "' - raising error"); - error.sendid = reqCopy.sendid; - // test 159 still fails -// _interpreter->receiveInternal(error); - throw error; - } + ERROR_COMMUNICATION_THROW("Not sure what to make of the target '" + target + "' - raising error"); } } diff --git a/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.h b/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.h index 3eca2db..3b08e30 100644 --- a/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.h +++ b/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.h @@ -20,19 +20,15 @@ #ifndef SCXMLIOProcessor_H_2CUY93KU #define SCXMLIOProcessor_H_2CUY93KU -#include "uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h" - -#ifdef BUILD_AS_PLUGINS -#include "uscxml/plugins/Plugins.h" -#endif +#include "uscxml/plugins/IOProcessor.h" namespace uscxml { -class SCXMLIOProcessor : public BasicHTTPIOProcessor { +class SCXMLIOProcessor : public IOProcessorImpl { public: SCXMLIOProcessor(); virtual ~SCXMLIOProcessor(); - virtual boost::shared_ptr<IOProcessorImpl> create(uscxml::InterpreterImpl* interpreter); + virtual std::shared_ptr<IOProcessorImpl> create(uscxml::InterpreterImpl* interpreter); virtual std::list<std::string> getNames() { std::list<std::string> names; @@ -41,9 +37,12 @@ public: return names; } - virtual void send(const SendRequest& req); + virtual void eventFromSCXML(const std::string& target, const Event& event); + virtual bool isValidTarget(const std::string& target); Data getDataModelVariables(); +protected: + InterpreterImpl* _interpreter; }; #ifdef BUILD_AS_PLUGINS |