diff options
Diffstat (limited to 'src/uscxml/plugins/datamodel')
191 files changed, 30017 insertions, 32622 deletions
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 */ |