Author: borisk
Date: Fri Jun 27 09:05:01 2008
New Revision: 672311
URL: http://svn.apache.org/viewvc?rev=672311&view=rev
Log:
Cleanup int/long usage in SAX2 interfaces.
Modified:
xerces/c/trunk/samples/src/SAX2Print/SAX2FilterHandlers.cpp
xerces/c/trunk/src/xercesc/internal/VecAttributesImpl.cpp
xerces/c/trunk/src/xercesc/internal/VecAttributesImpl.hpp
xerces/c/trunk/src/xercesc/parsers/SAX2XMLFilterImpl.cpp
xerces/c/trunk/src/xercesc/parsers/SAX2XMLFilterImpl.hpp
xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.cpp
xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.hpp
xerces/c/trunk/src/xercesc/sax2/Attributes.hpp
xerces/c/trunk/src/xercesc/sax2/SAX2XMLReader.hpp
Modified: xerces/c/trunk/samples/src/SAX2Print/SAX2FilterHandlers.cpp
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/samples/src/SAX2Print/SAX2FilterHandlers.cpp?rev=672311&r1=672310&r2=672311&view=diff
==============================================================================
--- xerces/c/trunk/samples/src/SAX2Print/SAX2FilterHandlers.cpp (original)
+++ xerces/c/trunk/samples/src/SAX2Print/SAX2FilterHandlers.cpp Fri Jun 27
09:05:01 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -38,75 +38,94 @@
class AttrList : public Attributes, public RefVectorOf<Attr>
{
public:
- AttrList(unsigned count) : RefVectorOf<Attr>(count) {}
+ AttrList(XMLSize_t count) : RefVectorOf<Attr>(count) {}
- virtual unsigned int getLength() const
+ virtual XMLSize_t getLength() const
{
return size();
}
- virtual const XMLCh* getURI(const unsigned int index) const
+ virtual const XMLCh* getURI(const XMLSize_t index) const
{
return elementAt(index)->uri;
}
- virtual const XMLCh* getLocalName(const unsigned int index) const
+ virtual const XMLCh* getLocalName(const XMLSize_t index) const
{
return elementAt(index)->localPart;
}
- virtual const XMLCh* getQName(const unsigned int index) const
+ virtual const XMLCh* getQName(const XMLSize_t index) const
{
return elementAt(index)->qName;
}
- virtual const XMLCh* getType(const unsigned int index) const
+ virtual const XMLCh* getType(const XMLSize_t index) const
{
return elementAt(index)->attrType;
}
- virtual const XMLCh* getValue(const unsigned int index) const
+ virtual const XMLCh* getValue(const XMLSize_t index) const
{
return elementAt(index)->value;
}
- virtual int getIndex(const XMLCh* const uri, const XMLCh* const
localPart ) const
+ virtual bool getIndex(const XMLCh* const uri,
+ const XMLCh* const localPart,
+ XMLSize_t& i) const
{
- for(unsigned int i=0;i<size();i++)
+ for(i=0;i<size();i++)
if(XMLString::equals(elementAt(i)->uri,uri) &&
XMLString::equals(elementAt(i)->localPart,localPart))
- return i;
+ return true;
+ return false;
+ }
+
+ virtual int getIndex(const XMLCh* const uri, const XMLCh* const localPart
) const
+ {
+ for(XMLSize_t i=0;i<size();i++)
+ if(XMLString::equals(elementAt(i)->uri,uri) &&
XMLString::equals(elementAt(i)->localPart,localPart))
+ return (int)i;
return -1;
}
- virtual int getIndex(const XMLCh* const qName ) const
+
+ virtual bool getIndex(const XMLCh* const qName, XMLSize_t& i) const
+ {
+ for(i=0;i<size();i++)
+ if(XMLString::equals(elementAt(i)->qName,qName))
+ return true;
+ return false;
+ }
+
+ virtual int getIndex(const XMLCh* const qName ) const
{
- for(unsigned int i=0;i<size();i++)
+ for(XMLSize_t i=0;i<size();i++)
if(XMLString::equals(elementAt(i)->qName,qName))
- return i;
+ return (int)i;
return -1;
}
- virtual const XMLCh* getType(const XMLCh* const uri, const XMLCh* const
localPart ) const
+ virtual const XMLCh* getType(const XMLCh* const uri, const XMLCh* const
localPart ) const
{
- for(unsigned int i=0;i<size();i++)
+ for(XMLSize_t i=0;i<size();i++)
if(XMLString::equals(elementAt(i)->uri,uri) &&
XMLString::equals(elementAt(i)->localPart,localPart))
return elementAt(i)->attrType;
return NULL;
}
virtual const XMLCh* getType(const XMLCh* const qName) const
{
- for(unsigned int i=0;i<size();i++)
+ for(XMLSize_t i=0;i<size();i++)
if(XMLString::equals(elementAt(i)->qName,qName))
return elementAt(i)->attrType;
return NULL;
}
- virtual const XMLCh* getValue(const XMLCh* const uri, const XMLCh*
const localPart ) const
+ virtual const XMLCh* getValue(const XMLCh* const uri, const XMLCh* const
localPart ) const
{
- for(unsigned int i=0;i<size();i++)
+ for(XMLSize_t i=0;i<size();i++)
if(XMLString::equals(elementAt(i)->uri,uri) &&
XMLString::equals(elementAt(i)->localPart,localPart))
return elementAt(i)->value;
return NULL;
}
virtual const XMLCh* getValue(const XMLCh* const qName) const
{
- for(unsigned int i=0;i<size();i++)
+ for(XMLSize_t i=0;i<size();i++)
if(XMLString::equals(elementAt(i)->qName,qName))
return elementAt(i)->value;
return NULL;
@@ -130,14 +149,14 @@
// SAX2SortAttributesFilter: Overrides of the SAX2XMLFilter interface
// ---------------------------------------------------------------------------
void SAX2SortAttributesFilter::startElement(const XMLCh* const uri,
- const
XMLCh* const localname,
- const
XMLCh* const qname,
- const Attributes&
attributes)
+ const XMLCh* const localname,
+ const XMLCh* const qname,
+ const Attributes&
attributes)
{
AttrList sortedList(attributes.getLength());
- for(unsigned int i=0;i<attributes.getLength();i++)
+ for(XMLSize_t i=0;i<attributes.getLength();i++)
{
- unsigned int j;
+ XMLSize_t j;
for(j=0;j<sortedList.getLength();j++)
{
if(XMLString::compareString(sortedList.elementAt(j)->qName,attributes.getQName(i))>=0)
Modified: xerces/c/trunk/src/xercesc/internal/VecAttributesImpl.cpp
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/internal/VecAttributesImpl.cpp?rev=672311&r1=672310&r2=672311&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/internal/VecAttributesImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/internal/VecAttributesImpl.cpp Fri Jun 27
09:05:01 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -54,12 +54,12 @@
// ---------------------------------------------------------------------------
// Implementation of the attribute list interface
// ---------------------------------------------------------------------------
-unsigned int VecAttributesImpl::getLength() const
+XMLSize_t VecAttributesImpl::getLength() const
{
return fCount;
}
-const XMLCh* VecAttributesImpl::getURI(const unsigned int index) const
+const XMLCh* VecAttributesImpl::getURI(const XMLSize_t index) const
{
// since this func really needs to be const, like the rest, not sure how we
// make it const and re-use the fURIBuffer member variable. we're
currently
@@ -77,7 +77,7 @@
return fScanner->getURIText(fVector->elementAt(index)->getURIId());
}
-const XMLCh* VecAttributesImpl::getLocalName(const unsigned int index) const
+const XMLCh* VecAttributesImpl::getLocalName(const XMLSize_t index) const
{
if (index >= fCount) {
return 0;
@@ -85,7 +85,7 @@
return fVector->elementAt(index)->getName();
}
-const XMLCh* VecAttributesImpl::getQName(const unsigned int index) const
+const XMLCh* VecAttributesImpl::getQName(const XMLSize_t index) const
{
if (index >= fCount) {
return 0;
@@ -93,7 +93,7 @@
return fVector->elementAt(index)->getQName();
}
-const XMLCh* VecAttributesImpl::getType(const unsigned int index) const
+const XMLCh* VecAttributesImpl::getType(const XMLSize_t index) const
{
if (index >= fCount) {
return 0;
@@ -101,7 +101,7 @@
return XMLAttDef::getAttTypeString(fVector->elementAt(index)->getType(),
fVector->getMemoryManager());
}
-const XMLCh* VecAttributesImpl::getValue(const unsigned int index) const
+const XMLCh* VecAttributesImpl::getValue(const XMLSize_t index) const
{
if (index >= fCount) {
return 0;
@@ -109,6 +109,28 @@
return fVector->elementAt(index)->getValue();
}
+bool VecAttributesImpl::getIndex(const XMLCh* const uri,
+ const XMLCh* const localPart,
+ XMLSize_t& index) const
+{
+ //
+ // Search the vector for the attribute with the given name and return
+ // its type.
+ //
+ XMLBuffer uriBuffer(1023, fVector->getMemoryManager()) ;
+ for (index = 0; index < fCount; index++)
+ {
+ const XMLAttr* curElem = fVector->elementAt(index);
+
+ fScanner->getURIText(curElem->getURIId(), uriBuffer) ;
+
+ if ( (XMLString::equals(curElem->getName(), localPart)) &&
+ (XMLString::equals(uriBuffer.getRawBuffer(), uri)) )
+ return true;
+ }
+ return false;
+}
+
int VecAttributesImpl::getIndex(const XMLCh* const uri, const XMLCh* const
localPart ) const
{
//
@@ -116,7 +138,7 @@
// its type.
//
XMLBuffer uriBuffer(1023, fVector->getMemoryManager()) ;
- for (unsigned int index = 0; index < fCount; index++)
+ for (XMLSize_t index = 0; index < fCount; index++)
{
const XMLAttr* curElem = fVector->elementAt(index);
@@ -124,56 +146,89 @@
if ( (XMLString::equals(curElem->getName(), localPart)) &&
(XMLString::equals(uriBuffer.getRawBuffer(), uri)) )
- return index ;
+ return (int)index ;
}
return -1;
}
+bool VecAttributesImpl::getIndex(const XMLCh* const qName,
+ XMLSize_t& index) const
+{
+ //
+ // Search the vector for the attribute with the given name and return
+ // its type.
+ //
+ for (index = 0; index < fCount; index++)
+ {
+ const XMLAttr* curElem = fVector->elementAt(index);
+
+ if (XMLString::equals(curElem->getQName(), qName))
+ return true;
+ }
+ return false;
+}
+
int VecAttributesImpl::getIndex(const XMLCh* const qName ) const
{
//
// Search the vector for the attribute with the given name and return
// its type.
//
- for (unsigned int index = 0; index < fCount; index++)
+ for (XMLSize_t index = 0; index < fCount; index++)
{
const XMLAttr* curElem = fVector->elementAt(index);
if (XMLString::equals(curElem->getQName(), qName))
- return index ;
+ return (int)index ;
}
return -1;
}
const XMLCh* VecAttributesImpl::getType(const XMLCh* const uri, const XMLCh*
const localPart ) const
{
- int retVal = getIndex(uri, localPart);
- return ((retVal < 0) ? 0 : getType(retVal));
+ XMLSize_t i;
+
+ if (getIndex(uri, localPart, i))
+ return getType(i);
+ else
+ return 0;
}
const XMLCh* VecAttributesImpl::getType(const XMLCh* const qName) const
{
- int retVal = getIndex(qName);
- return ((retVal < 0) ? 0 : getType(retVal));
+ XMLSize_t i;
+
+ if (getIndex(qName, i))
+ return getType(i);
+ else
+ return 0;
}
const XMLCh* VecAttributesImpl::getValue(const XMLCh* const uri, const XMLCh*
const localPart ) const
{
- int retVal = getIndex(uri, localPart);
- return ((retVal < 0) ? 0 : getValue(retVal));
+ XMLSize_t i;
+
+ if (getIndex(uri, localPart, i))
+ return getValue(i);
+ else
+ return 0;
}
const XMLCh* VecAttributesImpl::getValue(const XMLCh* const qName) const
{
- int retVal = getIndex(qName);
- return ((retVal < 0) ? 0 : getValue(retVal));
+ XMLSize_t i;
+
+ if (getIndex(qName, i))
+ return getValue(i);
+ else
+ return 0;
}
// ---------------------------------------------------------------------------
// Setter methods
// ---------------------------------------------------------------------------
void VecAttributesImpl::setVector(const RefVectorOf<XMLAttr>* const srcVec
- , const unsigned int count
+ , const XMLSize_t count
, const XMLScanner * const scanner
, const bool adopt)
{
Modified: xerces/c/trunk/src/xercesc/internal/VecAttributesImpl.hpp
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/internal/VecAttributesImpl.hpp?rev=672311&r1=672310&r2=672311&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/internal/VecAttributesImpl.hpp (original)
+++ xerces/c/trunk/src/xercesc/internal/VecAttributesImpl.hpp Fri Jun 27
09:05:01 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -43,22 +43,24 @@
// -----------------------------------------------------------------------
// Implementation of the attributes interface
// -----------------------------------------------------------------------
- virtual unsigned int getLength() const ;
+ virtual XMLSize_t getLength() const ;
- virtual const XMLCh* getURI(const unsigned int index) const;
- virtual const XMLCh* getLocalName(const unsigned int index) const ;
- virtual const XMLCh* getQName(const unsigned int index) const ;
- virtual const XMLCh* getType(const unsigned int index) const ;
- virtual const XMLCh* getValue(const unsigned int index) const ;
+ virtual const XMLCh* getURI(const XMLSize_t index) const;
+ virtual const XMLCh* getLocalName(const XMLSize_t index) const ;
+ virtual const XMLCh* getQName(const XMLSize_t index) const ;
+ virtual const XMLCh* getType(const XMLSize_t index) const ;
+ virtual const XMLCh* getValue(const XMLSize_t index) const ;
+
+ virtual bool getIndex(const XMLCh* const uri, const XMLCh* const
localPart, XMLSize_t& index) const;
+ virtual int getIndex(const XMLCh* const uri, const XMLCh* const localPart
) const ;
+ virtual bool getIndex(const XMLCh* const qName, XMLSize_t& index) const;
+ virtual int getIndex(const XMLCh* const qName ) const ;
- virtual int getIndex(const XMLCh* const uri, const XMLCh* const
localPart ) const ;
- virtual int getIndex(const XMLCh* const qName ) const ;
-
- virtual const XMLCh* getType(const XMLCh* const uri, const XMLCh* const
localPart ) const ;
+ virtual const XMLCh* getType(const XMLCh* const uri, const XMLCh* const
localPart ) const ;
virtual const XMLCh* getType(const XMLCh* const qName) const ;
virtual const XMLCh* getValue(const XMLCh* const qName) const;
- virtual const XMLCh* getValue(const XMLCh* const uri, const XMLCh*
const localPart ) const ;
+ virtual const XMLCh* getValue(const XMLCh* const uri, const XMLCh* const
localPart ) const ;
// -----------------------------------------------------------------------
@@ -66,9 +68,9 @@
// -----------------------------------------------------------------------
void setVector
(
- const RefVectorOf<XMLAttr>* const srcVec
- , const unsigned int count
- , const XMLScanner * const scanner
+ const RefVectorOf<XMLAttr>* const srcVec
+ , const XMLSize_t count
+ , const XMLScanner * const scanner
, const bool adopt = false
);
@@ -96,19 +98,18 @@
//
// fVector
// The vector that provides the backing for the list.
- //
- // fScanner
- // This is a pointer to the in use Scanner, so that we can
resolve
- // namespace URIs from UriIds
- //
- // fURIBuffer
- // A temporary buffer which is re-used when getting
namespace URI's
+ //
+ // fScanner
+ // This is a pointer to the in use Scanner, so that we can resolve
+ // namespace URIs from UriIds
+ //
+ // fURIBuffer
+ // A temporary buffer which is re-used when getting namespace URI's
// -----------------------------------------------------------------------
bool fAdopt;
- unsigned int fCount;
+ XMLSize_t fCount;
const RefVectorOf<XMLAttr>* fVector;
- const XMLScanner * fScanner ;
- //XMLBuffer fURIBuffer ;
+ const XMLScanner * fScanner ;
};
XERCES_CPP_NAMESPACE_END
Modified: xerces/c/trunk/src/xercesc/parsers/SAX2XMLFilterImpl.cpp
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/parsers/SAX2XMLFilterImpl.cpp?rev=672311&r1=672310&r2=672311&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/parsers/SAX2XMLFilterImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/parsers/SAX2XMLFilterImpl.cpp Fri Jun 27
09:05:01 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -113,7 +113,7 @@
// ---------------------------------------------------------------------------
// SAX2XMLReader Interface
// ---------------------------------------------------------------------------
-int SAX2XMLFilterImpl::getErrorCount() const
+XMLSize_t SAX2XMLFilterImpl::getErrorCount() const
{
if(fParentReader)
return fParentReader->getErrorCount();
@@ -224,7 +224,7 @@
// SAX2XMLFilterImpl: Grammar preparsing
// ---------------------------------------------------------------------------
Grammar* SAX2XMLFilterImpl::loadGrammar(const char* const systemId,
- const short grammarType,
+ const Grammar::GrammarType grammarType,
const bool toCache)
{
if(fParentReader)
@@ -233,7 +233,7 @@
}
Grammar* SAX2XMLFilterImpl::loadGrammar(const XMLCh* const systemId,
- const short grammarType,
+ const Grammar::GrammarType grammarType,
const bool toCache)
{
if(fParentReader)
@@ -242,7 +242,7 @@
}
Grammar* SAX2XMLFilterImpl::loadGrammar(const InputSource& source,
- const short grammarType,
+ const Grammar::GrammarType grammarType,
const bool toCache)
{
if(fParentReader)
@@ -414,4 +414,3 @@
}
XERCES_CPP_NAMESPACE_END
-
Modified: xerces/c/trunk/src/xercesc/parsers/SAX2XMLFilterImpl.hpp
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/parsers/SAX2XMLFilterImpl.hpp?rev=672311&r1=672310&r2=672311&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/parsers/SAX2XMLFilterImpl.hpp (original)
+++ xerces/c/trunk/src/xercesc/parsers/SAX2XMLFilterImpl.hpp Fri Jun 27
09:05:01 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -37,7 +37,7 @@
*
*/
-class PARSERS_EXPORT SAX2XMLFilterImpl :
+class PARSERS_EXPORT SAX2XMLFilterImpl :
public SAX2XMLFilter
, public EntityResolver
, public DTDHandler
@@ -53,7 +53,7 @@
/** The default constructor */
SAX2XMLFilterImpl(SAX2XMLReader* parent);
- /** The destructor */
+ /** The destructor */
~SAX2XMLFilterImpl() ;
//@}
@@ -176,7 +176,7 @@
* @see DefaultHandler#DefaultHandler
*/
virtual void setEntityResolver(EntityResolver* const resolver) ;
-
+
/**
* Allow an application to register an error event handler.
*
@@ -209,9 +209,9 @@
* <br>http://apache.org/xml/features/validation/schema (default: true)
* <br>http://apache.org/xml/features/validation/schema-full-checking
(default: false)
* <br>http://apache.org/xml/features/validating/load-schema (default: true)
- * <br>http://apache.org/xml/features/nonvalidating/load-external-dtd
(default: true)
+ * <br>http://apache.org/xml/features/nonvalidating/load-external-dtd
(default: true)
* <br>http://apache.org/xml/features/continue-after-fatal-error (default:
false)
- * <br>http://apache.org/xml/features/validation-error-as-fatal (default:
false)
+ * <br>http://apache.org/xml/features/validation-error-as-fatal (default:
false)
*
* @param name The unique identifier (URI) of the feature.
* @param value The requested state of the feature (true or false).
@@ -323,7 +323,7 @@
(
const char* const systemId
) ;
-
+
//@}
// -----------------------------------------------------------------------
@@ -410,7 +410,7 @@
* @return number of errors encountered during the latest
* parse operation.
*/
- virtual int getErrorCount() const ;
+ virtual XMLSize_t getErrorCount() const ;
/**
* This method returns the state of the parser's
@@ -735,7 +735,7 @@
* @see InputSource#InputSource
*/
virtual Grammar* loadGrammar(const InputSource& source,
- const short grammarType,
+ const Grammar::GrammarType grammarType,
const bool toCache = false);
/**
@@ -764,7 +764,7 @@
* @exception DOMException A DOM exception as per DOM spec.
*/
virtual Grammar* loadGrammar(const XMLCh* const systemId,
- const short grammarType,
+ const Grammar::GrammarType grammarType,
const bool toCache = false);
/**
@@ -792,7 +792,7 @@
* @exception DOMException A DOM exception as per DOM spec.
*/
virtual Grammar* loadGrammar(const char* const systemId,
- const short grammarType,
+ const Grammar::GrammarType grammarType,
const bool toCache = false);
/**
Modified: xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.cpp
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.cpp?rev=672311&r1=672310&r2=672311&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.cpp Fri Jun 27
09:05:01 2008
@@ -275,7 +275,7 @@
// ---------------------------------------------------------------------------
// SAX2XMLReader Interface
// ---------------------------------------------------------------------------
-int SAX2XMLReaderImpl::getErrorCount() const
+XMLSize_t SAX2XMLReaderImpl::getErrorCount() const
{
return fScanner->getErrorCount();
}
@@ -1515,7 +1515,7 @@
// SAX2XMLReaderImpl: Grammar preparsing
// ---------------------------------------------------------------------------
Grammar* SAX2XMLReaderImpl::loadGrammar(const char* const systemId,
- const short grammarType,
+ const Grammar::GrammarType grammarType,
const bool toCache)
{
// Avoid multiple entrance
@@ -1541,7 +1541,7 @@
}
Grammar* SAX2XMLReaderImpl::loadGrammar(const XMLCh* const systemId,
- const short grammarType,
+ const Grammar::GrammarType grammarType,
const bool toCache)
{
// Avoid multiple entrance
@@ -1567,7 +1567,7 @@
}
Grammar* SAX2XMLReaderImpl::loadGrammar(const InputSource& source,
- const short grammarType,
+ const Grammar::GrammarType grammarType,
const bool toCache)
{
// Avoid multiple entrance
Modified: xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.hpp
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.hpp?rev=672311&r1=672310&r2=672311&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.hpp (original)
+++ xerces/c/trunk/src/xercesc/parsers/SAX2XMLReaderImpl.hpp Fri Jun 27
09:05:01 2008
@@ -481,7 +481,7 @@
* @return number of errors encountered during the latest
* parse operation.
*/
- virtual int getErrorCount() const ;
+ virtual XMLSize_t getErrorCount() const ;
/**
* This method returns the state of the parser's
@@ -804,7 +804,7 @@
* @see InputSource#InputSource
*/
virtual Grammar* loadGrammar(const InputSource& source,
- const short grammarType,
+ const Grammar::GrammarType grammarType,
const bool toCache = false);
/**
@@ -831,7 +831,7 @@
* @exception DOMException A DOM exception as per DOM spec.
*/
virtual Grammar* loadGrammar(const XMLCh* const systemId,
- const short grammarType,
+ const Grammar::GrammarType grammarType,
const bool toCache = false);
/**
@@ -857,7 +857,7 @@
* @exception DOMException A DOM exception as per DOM spec.
*/
virtual Grammar* loadGrammar(const char* const systemId,
- const short grammarType,
+ const Grammar::GrammarType grammarType,
const bool toCache = false);
/**
Modified: xerces/c/trunk/src/xercesc/sax2/Attributes.hpp
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/sax2/Attributes.hpp?rev=672311&r1=672310&r2=672311&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/sax2/Attributes.hpp (original)
+++ xerces/c/trunk/src/xercesc/sax2/Attributes.hpp Fri Jun 27 09:05:01 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -47,7 +47,7 @@
*
* <code>
* public void startElement (String uri, String localpart, String qName,
Attributes atts) {<br>
- * for (int i = 0; i < atts.getLength(); i++) {<br>
+ * for (XMLSize_t i = 0; i < atts.getLength(); i++) {<br>
* String Qname = atts.getQName(i);<br>
* String URI = atts.getURI(i)<br>
* String local = atts.GetLocalName(i)<br>
@@ -110,7 +110,7 @@
*
* @return The number of attributes in the list.
*/
- virtual unsigned int getLength() const = 0;
+ virtual XMLSize_t getLength() const = 0;
/**
* Return the namespace URI of an attribute in this list (by position).
@@ -125,7 +125,7 @@
* if the index is out of range.
* @see #getLength
*/
- virtual const XMLCh* getURI(const unsigned int index) const = 0;
+ virtual const XMLCh* getURI(const XMLSize_t index) const = 0;
/**
* Return the local name of an attribute in this list (by position).
@@ -140,7 +140,7 @@
* if the index is out of range.
* @see #getLength
*/
- virtual const XMLCh* getLocalName(const unsigned int index) const = 0;
+ virtual const XMLCh* getLocalName(const XMLSize_t index) const = 0;
/**
* Return the qName of an attribute in this list (by position).
@@ -155,7 +155,7 @@
* if the index is out of range.
* @see #getLength
*/
- virtual const XMLCh* getQName(const unsigned int index) const = 0;
+ virtual const XMLCh* getQName(const XMLSize_t index) const = 0;
/**
* Return the type of an attribute in the list (by position).
@@ -178,7 +178,7 @@
* @see #getLength
* @see #getType
*/
- virtual const XMLCh* getType(const unsigned int index) const = 0;
+ virtual const XMLCh* getType(const XMLSize_t index) const = 0;
/**
* Return the value of an attribute in the list (by position).
@@ -193,13 +193,27 @@
* @see #getLength
* @see #getValue
*/
- virtual const XMLCh* getValue(const unsigned int index) const = 0;
+ virtual const XMLCh* getValue(const XMLSize_t index) const = 0;
////////////////////////////////////////////////////////////////////
// Name-based query.
////////////////////////////////////////////////////////////////////
/**
+ * Look up the index of an attribute by Namespace name. Non-standard
+ * extension.
+ *
+ * @param uri The Namespace URI, or the empty string if
+ * the name has no Namespace URI.
+ * @param localPart The attribute's local name.
+ * @param index Reference to the variable where the index will be stored.
+ * @return true if the attribute is found and false otherwise.
+ */
+ virtual bool getIndex(const XMLCh* const uri,
+ const XMLCh* const localPart,
+ XMLSize_t& index) const = 0 ;
+
+ /**
* Look up the index of an attribute by Namespace name.
*
* @param uri The Namespace URI, or the empty string if
@@ -208,7 +222,19 @@
* @return The index of the attribute, or -1 if it does not
* appear in the list.
*/
- virtual int getIndex(const XMLCh* const uri, const XMLCh* const
localPart ) const = 0 ;
+ virtual int getIndex(const XMLCh* const uri,
+ const XMLCh* const localPart ) const = 0 ;
+
+ /**
+ * Look up the index of an attribute by XML 1.0 qualified name.
+ * Non-standard extension.
+ *
+ * @param qName The qualified (prefixed) name.
+ * @param index Reference to the variable where the index will be stored.
+ * @return true if the attribute is found and false otherwise.
+ */
+ virtual bool getIndex(const XMLCh* const qName,
+ XMLSize_t& index) const = 0 ;
/**
* Look up the index of an attribute by XML 1.0 qualified name.
@@ -217,7 +243,7 @@
* @return The index of the attribute, or -1 if it does not
* appear in the list.
*/
- virtual int getIndex(const XMLCh* const qName ) const = 0 ;
+ virtual int getIndex(const XMLCh* const qName ) const = 0 ;
/**
* Look up an attribute's type by Namespace name.
@@ -231,7 +257,8 @@
* attribute is not in the list or if Namespace
* processing is not being performed.
*/
- virtual const XMLCh* getType(const XMLCh* const uri, const XMLCh* const
localPart ) const = 0 ;
+ virtual const XMLCh* getType(const XMLCh* const uri,
+ const XMLCh* const localPart ) const = 0 ;
/**
* Look up an attribute's type by XML 1.0 qualified name.
@@ -256,7 +283,7 @@
* @return The attribute value as a string, or null if the
* attribute is not in the list.
*/
- virtual const XMLCh* getValue(const XMLCh* const uri, const XMLCh*
const localPart ) const = 0 ;
+ virtual const XMLCh* getValue(const XMLCh* const uri, const XMLCh* const
localPart ) const = 0 ;
/**
* Look up an attribute's value by XML 1.0 qualified name.
Modified: xerces/c/trunk/src/xercesc/sax2/SAX2XMLReader.hpp
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/sax2/SAX2XMLReader.hpp?rev=672311&r1=672310&r2=672311&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/sax2/SAX2XMLReader.hpp (original)
+++ xerces/c/trunk/src/xercesc/sax2/SAX2XMLReader.hpp Fri Jun 27 09:05:01 2008
@@ -5,9 +5,9 @@
* The ASF licenses this file to You 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.
@@ -26,6 +26,7 @@
#include <xercesc/util/XMLUniDefs.hpp>
#include <xercesc/framework/XMLValidator.hpp>
#include <xercesc/framework/XMLPScanToken.hpp>
+#include <xercesc/validators/common/Grammar.hpp>
XERCES_CPP_NAMESPACE_BEGIN
@@ -37,7 +38,6 @@
class LexicalHandler;
class DeclHandler;
class XMLDocumentHandler;
-class Grammar;
class SAX2_EXPORT SAX2XMLReader
{
@@ -125,16 +125,16 @@
*/
virtual ErrorHandler* getErrorHandler() const = 0 ;
- /**
- * Query the current state of any feature in a SAX2 XMLReader.
- *
- * @param name The unique identifier (URI) of the feature being set.
- * @return The current state of the feature.
- * @exception SAXNotRecognizedException If the requested feature is not
known.
- */
- virtual bool getFeature(const XMLCh* const name) const = 0;
+ /**
+ * Query the current state of any feature in a SAX2 XMLReader.
+ *
+ * @param name The unique identifier (URI) of the feature being set.
+ * @return The current state of the feature.
+ * @exception SAXNotRecognizedException If the requested feature is not
known.
+ */
+ virtual bool getFeature(const XMLCh* const name) const = 0;
- /**
+ /**
* Query the current value of a property in a SAX2 XMLReader.
*
* The parser owns the returned pointer. The memory allocated for
@@ -240,9 +240,9 @@
* <br>http://apache.org/xml/features/validation/schema (default: true)
* <br>http://apache.org/xml/features/validation/schema-full-checking
(default: false)
* <br>http://apache.org/xml/features/validating/load-schema (default: true)
- * <br>http://apache.org/xml/features/nonvalidating/load-external-dtd
(default: true)
+ * <br>http://apache.org/xml/features/nonvalidating/load-external-dtd
(default: true)
* <br>http://apache.org/xml/features/continue-after-fatal-error (default:
false)
- * <br>http://apache.org/xml/features/validation-error-as-fatal (default:
false)
+ * <br>http://apache.org/xml/features/validation-error-as-fatal (default:
false)
*
* @param name The unique identifier (URI) of the feature.
* @param value The requested state of the feature (true or false).
@@ -354,7 +354,7 @@
(
const char* const systemId
) = 0;
-
+
//@}
// -----------------------------------------------------------------------
@@ -441,7 +441,7 @@
* @return number of errors encountered during the latest
* parse operation.
*/
- virtual int getErrorCount() const = 0 ;
+ virtual XMLSize_t getErrorCount() const = 0 ;
/**
* This method returns the state of the parser's
@@ -513,15 +513,15 @@
/** @name Setter Methods (Xerces-C specific) */
//@{
/**
- * This method is used to set a validator.
- *
- * <b>SAX2XMLReader assumes responsibility for the validator. It will
be
- * deleted when the XMLReader is destroyed.</b>
- *
- * @param valueToAdopt A pointer to the validator that the reader
should use.
- *
- */
- virtual void setValidator(XMLValidator* valueToAdopt) = 0;
+ * This method is used to set a validator.
+ *
+ * <b>SAX2XMLReader assumes responsibility for the validator. It will be
+ * deleted when the XMLReader is destroyed.</b>
+ *
+ * @param valueToAdopt A pointer to the validator that the reader should
use.
+ *
+ */
+ virtual void setValidator(XMLValidator* valueToAdopt) = 0;
/**
* This method allows users to set the parser's behaviour when it
@@ -766,7 +766,7 @@
* @see InputSource#InputSource
*/
virtual Grammar* loadGrammar(const InputSource& source,
- const short grammarType,
+ const Grammar::GrammarType grammarType,
const bool toCache = false) = 0;
/**
@@ -795,7 +795,7 @@
* @exception DOMException A DOM exception as per DOM spec.
*/
virtual Grammar* loadGrammar(const XMLCh* const systemId,
- const short grammarType,
+ const Grammar::GrammarType grammarType,
const bool toCache = false) = 0;
/**
@@ -823,7 +823,7 @@
* @exception DOMException A DOM exception as per DOM spec.
*/
virtual Grammar* loadGrammar(const char* const systemId,
- const short grammarType,
+ const Grammar::GrammarType grammarType,
const bool toCache = false) = 0;
/**
@@ -888,7 +888,7 @@
};
-inline void SAX2XMLReader::setInputBufferSize(const size_t /*bufferSize*/)
+inline void SAX2XMLReader::setInputBufferSize(const size_t /*bufferSize*/)
{
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]