Modified: xerces/c/trunk/swig/interfaces/typemaps-general.i URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/typemaps-general.i?view=diff&rev=463845&r1=463844&r2=463845 ============================================================================== --- xerces/c/trunk/swig/interfaces/typemaps-general.i (original) +++ xerces/c/trunk/swig/interfaces/typemaps-general.i Fri Oct 13 14:34:15 2006 @@ -24,43 +24,12 @@ %typemap(default,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; - } -} -} - -/* * 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. + * type to the scripting language 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. */ /* @@ -88,3 +57,26 @@ return NULL; } %} + +%typemap(out) XERCES_CPP_NAMESPACE::XMLGrammarDescription * = SWIGTYPE *DYNAMIC; + +DYNAMIC_CAST(SWIGTYPE_p_XERCES_CPP_NAMESPACE__XMLGrammarDescription, XMLGrammarDescription_dynamic_cast); + +%{ +static swig_type_info * +XMLGrammarDescription_dynamic_cast(void **ptr) { + XMLGrammarDescription **nptr = (XMLGrammarDescription **) ptr; + if (*nptr == NULL) { + return NULL; + } + short int type = (*nptr)->getGrammarType(); + if (type == Grammar::DTDGrammarType) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__XMLDTDDescription; + } + if (type == Grammar::SchemaGrammarType) { + return SWIGTYPE_p_XERCES_CPP_NAMESPACE__XMLSchemaDescription; + } + return NULL; +} +%} +
Modified: xerces/c/trunk/swig/interfaces/util.i URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/interfaces/util.i?view=diff&rev=463845&r1=463844&r2=463845 ============================================================================== --- xerces/c/trunk/swig/interfaces/util.i (original) +++ xerces/c/trunk/swig/interfaces/util.i Fri Oct 13 14:34:15 2006 @@ -1,8 +1,10 @@ // we remove this macro for PlatformUtils and XMLURL #define MakeXMLException(theType, expKeyword) -%include "xercesc/util/PlatformUtils.hpp" +%include "util/PlatformUtils.i" + %import "xercesc/util/XMemory.hpp" + %include "xercesc/util/XMLURL.hpp" #define DECL_XSERIALIZABLE(XMLUri) @@ -13,8 +15,6 @@ %include "xercesc/util/XMLExceptMsgs.hpp" %include "xercesc/util/XMLException.hpp" -// Unicode string constants for XML Formatter -%include "xercesc/util/XMLUni.hpp" - %include "xercesc/util/QName.hpp" +%include "xercesc/util/SecurityManager.hpp" --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
