removed basic_ prefixes from SAX classes, removed typedefs

This commit is contained in:
jez 2007-09-05 12:57:07 +00:00
parent 7d46f6f4e2
commit a76b137b60
89 changed files with 819 additions and 975 deletions

View file

@ -27,7 +27,7 @@ int main(int argc, char* argv[])
for(int i = 1; i < argc; ++i)
{
std::string file(argv[i]);
Arabica::SAX::InputSource is;
Arabica::SAX::InputSource<std::string> is;
is.setSystemId(file);
if(file != "-")

View file

@ -7,9 +7,9 @@
//////////////////////////////////////////////
// EntityResolver
Arabica::SAX::InputSource SimpleHandler::resolveEntity(const std::string& publicId, const std::string& systemId)
Arabica::SAX::InputSource<std::string> SimpleHandler::resolveEntity(const std::string& publicId, const std::string& systemId)
{
return Arabica::SAX::InputSource();
return Arabica::SAX::InputSource<std::string>();
} // resolveEntity
//////////////////////////////////////////////
@ -57,7 +57,7 @@ void SimpleHandler::endPrefixMapping(const std::string& prefix)
} // startPrefixMapping
void SimpleHandler::startElement(const std::string& namespaceURI, const std::string& localName,
const std::string& qName, const Arabica::SAX::Attributes& atts)
const std::string& qName, const Arabica::SAX::Attributes<std::string>& atts)
{
if(localName.length())
std::cout << "Start Element: " << namespaceURI << ":" << localName << std::endl;
@ -93,17 +93,17 @@ void SimpleHandler::skippedEntity(const std::string& name)
/////////////////////////////////////////////////////
// ErrorHandler
void SimpleHandler::warning(const Arabica::SAX::SAXParseException& exception)
void SimpleHandler::warning(const Arabica::SAX::SAXParseException<std::string>& exception)
{
std::cerr << "WARNING: " << exception.what() << std::endl;
} // warning
void SimpleHandler::error(const Arabica::SAX::SAXParseException& exception)
void SimpleHandler::error(const Arabica::SAX::SAXParseException<std::string>& exception)
{
std::cerr << "ERROR : " << exception.what() << std::endl;
} // error
void SimpleHandler::fatalError(const Arabica::SAX::SAXParseException& exception)
void SimpleHandler::fatalError(const Arabica::SAX::SAXParseException<std::string>& exception)
{
std::cerr << "FATAL : " << exception.what() << std::endl;
} // fatalError

View file

@ -13,12 +13,12 @@
#include <SAX/ext/DeclHandler.hpp>
#include <SAX/SAXException.hpp>
class SimpleHandler : public Arabica::SAX::EntityResolver,
public Arabica::SAX::DTDHandler,
public Arabica::SAX::ContentHandler,
public Arabica::SAX::ErrorHandler,
public Arabica::SAX::LexicalHandler,
public Arabica::SAX::DeclHandler
class SimpleHandler : public Arabica::SAX::EntityResolver<std::string>,
public Arabica::SAX::DTDHandler<std::string>,
public Arabica::SAX::ContentHandler<std::string>,
public Arabica::SAX::ErrorHandler<std::string>,
public Arabica::SAX::LexicalHandler<std::string>,
public Arabica::SAX::DeclHandler<std::string>
{
public:
SimpleHandler() { }
@ -26,7 +26,7 @@ public:
//////////////////////////////////////////////
// EntityResolver
virtual Arabica::SAX::InputSource resolveEntity(const std::string& publicId, const std::string& systemId);
virtual Arabica::SAX::InputSource<std::string> resolveEntity(const std::string& publicId, const std::string& systemId);
//////////////////////////////////////////////
// DTDHandler
@ -56,9 +56,9 @@ public:
/////////////////////////////////////////////////////
// ErrorHandler
virtual void warning(const Arabica::SAX::SAXParseException&);
virtual void error(const Arabica::SAX::SAXParseException&);
virtual void fatalError(const Arabica::SAX::SAXParseException& exception);
virtual void warning(const Arabica::SAX::SAXParseException<std::string>&);
virtual void error(const Arabica::SAX::SAXParseException<std::string>&);
virtual void fatalError(const Arabica::SAX::SAXParseException<std::string>& exception);
///////////////////////////////////////////////////////
// LexicalHandler

View file

@ -19,18 +19,18 @@
#include <SAX/XMLReader.hpp>
#include <iostream>
class SAX2PYX : public Arabica::SAX::DefaultHandler
class SAX2PYX : public Arabica::SAX::DefaultHandler<std::string>
{
public:
virtual void startElement(const std::string& namespaceURI, const std::string& localName,
const std::string& qName, const Arabica::SAX::Attributes& atts);
const std::string& qName, const Arabica::SAX::Attributes<std::string>& atts);
virtual void endElement(const std::string& namespaceURI, const std::string& localName,
const std::string& qName);
virtual void characters(const std::string& ch);
virtual void processingInstruction(const std::string& target, const std::string& data);
virtual void warning(const Arabica::SAX::SAXParseException& e) { fatalError(e); }
virtual void error(const Arabica::SAX::SAXParseException& e) { fatalError(e); }
virtual void warning(const Arabica::SAX::SAXParseException<std::string>& e) { fatalError(e); }
virtual void error(const Arabica::SAX::SAXParseException<std::string>& e) { fatalError(e); }
private:
std::string escape(const std::string& str) const;
@ -55,7 +55,7 @@ int main(int argc, char* argv[])
myParser.setErrorHandler(handler);
myParser.setFeature("prohibit-dtd", false);
Arabica::SAX::InputSource is(argv[i]);
Arabica::SAX::InputSource<std::string> is(argv[i]);
myParser.parse(is);
} // try
catch(std::runtime_error& e)
@ -69,7 +69,7 @@ int main(int argc, char* argv[])
void SAX2PYX::startElement(const std::string&, const std::string& localName,
const std::string&, const Arabica::SAX::Attributes& atts)
const std::string&, const Arabica::SAX::Attributes<std::string>& atts)
{
std::cout << '(' << localName << std::endl;

View file

@ -49,12 +49,12 @@ int main(int argc, char* argv[])
if(file != "-")
{
Arabica::SAX::InputSource is(file);
Arabica::SAX::InputSource<std::string> is(file);
parser.parse(is);
}
else
{
Arabica::SAX::InputSource is;
Arabica::SAX::InputSource<std::string> is;
is.setSystemId("stdin");
is.setByteStream(std::cin);

View file

@ -21,7 +21,7 @@ int main(int argc, char* argv[])
{ // narrow
Arabica::SAX::FeatureNames<std::string> fNames;
Arabica::SAX::XMLReader<std::string> parser;
Arabica::SAX::Writer writer(std::cout, 4);
Arabica::SAX::Writer<std::string> writer(std::cout, 4);
Arabica::SAX::CatchErrorHandler<std::string> eh;
writer.setParent(parser);
@ -30,7 +30,7 @@ int main(int argc, char* argv[])
for(int i = 1; i < argc; ++i)
{
std::string file(argv[i]);
Arabica::SAX::InputSource is;
Arabica::SAX::InputSource<std::string> is;
is.setSystemId(file);
if(file != "-")

View file

@ -18,19 +18,19 @@
#include <SAX/helpers/XMLBaseSupport.hpp>
#include <iostream>
class hrefPrinter : public Arabica::SAX::DefaultHandler
class hrefPrinter : public Arabica::SAX::DefaultHandler<std::string>
{
public:
virtual void startElement(const std::string& namespaceURI, const std::string& localName,
const std::string& qName, const Arabica::SAX::Attributes& atts);
const std::string& qName, const Arabica::SAX::Attributes<std::string>& atts);
virtual void endElement(const std::string& namespaceURI, const std::string& localName,
const std::string& qName);
virtual void warning(const Arabica::SAX::SAXParseException& e) { fatalError(e); }
virtual void error(const Arabica::SAX::SAXParseException& e) { fatalError(e); }
virtual void warning(const Arabica::SAX::SAXParseException<std::string>& e) { fatalError(e); }
virtual void error(const Arabica::SAX::SAXParseException<std::string>& e) { fatalError(e); }
private:
Arabica::SAX::XMLBaseSupport xmlbaseTracker_;
Arabica::SAX::XMLBaseSupport<std::string> xmlbaseTracker_;
}; // class SimpleHandler
int main(int argc, char* argv[])
@ -51,7 +51,7 @@ int main(int argc, char* argv[])
myParser.setContentHandler(handler);
myParser.setErrorHandler(handler);
Arabica::SAX::InputSource is(argv[i]);
Arabica::SAX::InputSource<std::string> is(argv[i]);
myParser.parse(is);
} // try
catch(std::runtime_error& e)
@ -65,7 +65,7 @@ int main(int argc, char* argv[])
void hrefPrinter::startElement(const std::string&, const std::string& localName,
const std::string&, const Arabica::SAX::Attributes& atts)
const std::string&, const Arabica::SAX::Attributes<std::string>& atts)
{
xmlbaseTracker_.startElement(atts);

View file

@ -39,7 +39,7 @@ int main(int argc, char* argv[])
for(int i = 2; i < argc; ++i)
{
std::string file(argv[i]);
Arabica::SAX::InputSource is;
Arabica::SAX::InputSource<std::string> is;
is.setSystemId(file);
if(file != "-")

View file

@ -33,7 +33,7 @@ int main(int argc, const char* argv[])
std::ostringstream errors;
try
{
Arabica::SAX::InputSource source(argv[2]);
Arabica::SAX::InputSource<std::string> source(argv[2]);
std::auto_ptr<Arabica::XSLT::Stylesheet> stylesheet = compiler.compile(source);
if(stylesheet.get() == 0)
{
@ -64,7 +64,7 @@ int main(int argc, const char* argv[])
Arabica::DOM::Document<std::string> buildDOM(const std::string& filename)
{
Arabica::SAX::InputSource is(filename);
Arabica::SAX::InputSource<std::string> is(filename);
Arabica::SAX2DOM::Parser<std::string> parser;
parser.parse(is);

View file

@ -23,17 +23,17 @@ namespace SAX2DOM
template<class stringT,
class string_adaptorT = Arabica::default_string_adaptor<stringT>,
class SAX_parser = Arabica::SAX::XMLReader<stringT, string_adaptorT> >
class Parser : protected Arabica::SAX::basic_DefaultHandler<stringT>
class Parser : protected Arabica::SAX::DefaultHandler<stringT>
{
typedef Arabica::SAX::basic_EntityResolver<stringT> EntityResolverT;
typedef Arabica::SAX::basic_ErrorHandler<stringT> ErrorHandlerT;
typedef Arabica::SAX::basic_LexicalHandler<stringT> LexicalHandlerT;
typedef Arabica::SAX::basic_DeclHandler<stringT> DeclHandlerT;
typedef Arabica::SAX::basic_InputSource<stringT> InputSourceT;
typedef Arabica::SAX::EntityResolver<stringT> EntityResolverT;
typedef Arabica::SAX::ErrorHandler<stringT> ErrorHandlerT;
typedef Arabica::SAX::LexicalHandler<stringT> LexicalHandlerT;
typedef Arabica::SAX::DeclHandler<stringT> DeclHandlerT;
typedef Arabica::SAX::InputSource<stringT> InputSourceT;
typedef Arabica::SimpleDOM::EntityImpl<stringT, string_adaptorT> EntityT;
typedef Arabica::SimpleDOM::NotationImpl<stringT, string_adaptorT> NotationT;
typedef Arabica::SimpleDOM::ElementImpl<stringT, string_adaptorT> ElementT;
typedef typename Arabica::SAX::basic_ErrorHandler<stringT>::SAXParseExceptionT SAXParseExceptionT;
typedef typename Arabica::SAX::ErrorHandler<stringT>::SAXParseExceptionT SAXParseExceptionT;
public:
Parser() :
@ -187,7 +187,7 @@ class Parser : protected Arabica::SAX::basic_DefaultHandler<stringT>
} // endDocument
virtual void startElement(const stringT& namespaceURI, const stringT& localName,
const stringT& qName, const Arabica::SAX::basic_Attributes<stringT>& atts)
const stringT& qName, const Arabica::SAX::Attributes<stringT>& atts)
{
if(currentNode_ == 0)
return;

View file

@ -17,16 +17,16 @@ namespace SAX
* Interface for an element's attribute specifications.
*
* <p>This is the original SAX1 interface for reporting an element's
* attributes. Unlike the new {@link basic_Attributes Attributes}
* attributes. Unlike the new {@link Attributes Attributes}
* interface, it does not support Namespace-related information.</p>
*
* <p>When an attribute list is supplied as part of a
* {@link basic_DocumentHandler#startElement startElement}
* {@link DocumentHandler#startElement startElement}
* event, the list will return valid results only during the
* scope of the event; once the event handler returns control
* to the parser, the attribute list is invalid. To save a
* persistent copy of the attribute list, use the SAX1
* {@link basic_AttributeListImpl AttributeListImpl}
* {@link AttributeListImpl AttributeListImpl}
* helper class.</p>
*
* <p>An attribute list includes only attributes that have been
@ -65,22 +65,22 @@ namespace SAX
* </pre>
*
* @deprecated This interface has been replaced by the SAX2
* {@link basic_Attributes Attributes}
* {@link Attributes Attributes}
* interface, which includes Namespace support.
* @since SAX 1.0
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 2.0
* @see basic_DocumentHandler#startElement startElement
* @see basic_AttributeListImpl
* @see DocumentHandler#startElement startElement
* @see AttributeListImpl
*/
template<class string_type>
class basic_AttributeList
class AttributeList
{
public:
typedef string_type stringT;
virtual ~basic_AttributeList() { }
virtual ~AttributeList() { }
//
// Iteration methods.
@ -186,11 +186,6 @@ public:
}; // class AttributeList
typedef basic_AttributeList<std::string> AttributeList;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_AttributeList<std::wstring> wAttributeList;
#endif
} // namespace SAX
} // namespace Arabica

View file

@ -39,7 +39,7 @@ namespace SAX
* may not be available.</p>
*
* <p>This interface replaces the now-deprecated SAX1 {@link
* basic_AttributeList AttributeList} interface, which does not
* AttributeList AttributeList} interface, which does not
* contain Namespace support. In addition to Namespace support, it
* adds the <var>getIndex</var> methods (below).</p>
*
@ -50,15 +50,15 @@ namespace SAX
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 2.0
* @see basic_AttributesImpl
* @see AttributesImpl
*/
template<class string_type>
class basic_Attributes
class Attributes
{
public:
typedef string_type stringT;
virtual ~basic_Attributes() { }
virtual ~Attributes() { }
//
// indexed access
@ -227,11 +227,6 @@ public:
}; // class Attributes
typedef basic_Attributes<std::string> Attributes;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_Attributes<std::wstring> wAttributes;
#endif
} // namespace SAX
} // namespace Arabica

View file

@ -13,8 +13,8 @@ namespace Arabica
namespace SAX
{
template<class string_type> class basic_Locator;
template<class string_type> class basic_Attributes;
template<class string_type> class Locator;
template<class string_type> class Attributes;
/**
* Receive notification of the logical content of a document.
@ -22,7 +22,7 @@ template<class string_type> class basic_Attributes;
* <p>This is the main interface that most SAX applications
* implement: if the application needs to be informed of basic parsing
* events, it implements this interface and registers an instance with
* the SAX parser using the {@link basic_XMLReader#setContentHandler
* the SAX parser using the {@link XMLReader#setContentHandler
* setContentHandler} method. The parser uses the instance to report
* basic document-related events like the start and end of elements
* and character data.</p>
@ -42,19 +42,19 @@ template<class string_type> class basic_Attributes;
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 2.0
* @see basic_XMLReader
* @see basic_DTDHandler
* @see basic_ErrorHandler
* @see XMLReader
* @see DTDHandler
* @see ErrorHandler
*/
template<class string_type>
class basic_ContentHandler
class ContentHandler
{
public:
typedef string_type stringT;
typedef basic_Locator<stringT> LocatorT;
typedef basic_Attributes<stringT> AttributesT;
typedef Locator<stringT> LocatorT;
typedef Attributes<stringT> AttributesT;
virtual ~basic_ContentHandler() { }
virtual ~ContentHandler() { }
/**
* Receive an object for locating the origin of SAX document events.
@ -79,7 +79,7 @@ public:
*
* @param locator An object that can return the location of
* any SAX document event.
* @see basic_Locator
* @see Locator
*/
virtual void setDocumentLocator(const LocatorT& locator) = 0;
@ -87,7 +87,7 @@ public:
* Receive notification of the beginning of a document.
*
* <p>The SAX parser will invoke this method only once, before any
* other methods in this interface or in {@link basic_DTDHandler
* other methods in this interface or in {@link DTDHandler
* DTDHandler} (except for {@link #setDocumentLocator
* setDocumentLocator}).</p>
*
@ -219,7 +219,7 @@ public:
* @exception SAXException Any SAX exception, possibly
* wrapping another exception.
* @see #endElement
* @see basic_Attributes
* @see Attributes
*/
virtual void startElement(const stringT& namespaceURI, const stringT& localName,
const stringT& qName, const AttributesT& atts) = 0;
@ -267,7 +267,7 @@ public:
* @param ch The characters from the XML document.
* @exception SAXException Any SAX exception.
* @see #ignorableWhitespace
* @see basic_Locator
* @see Locator
*/
virtual void characters(const stringT& ch) = 0;
/**
@ -332,12 +332,7 @@ public:
* @exception SAXException Any SAX exception.
*/
virtual void skippedEntity(const stringT& name) = 0;
}; // class basic_ContentHandler
typedef basic_ContentHandler<std::string> ContentHandler;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_ContentHandler<std::wstring> wContentHandler;
#endif
}; // class ContentHandler
} // namespace SAX
} // namespace Arabica

View file

@ -32,7 +32,7 @@ namespace SAX
* declared; however, all DTD events must be reported after the
* document handler's startDocument event, and before the first
* startElement event.
* (If the {@link basic_LexicalHandler LexicalHandler} is
* (If the {@link LexicalHandler LexicalHandler} is
* used, these events must also be reported before the endDTD event.)
* </p>
*
@ -47,16 +47,16 @@ namespace SAX
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version $Id$
* @see basic_XMLReader#setDTDHandler
* @see XMLReader#setDTDHandler
*/
template<class string_type>
class basic_DTDHandler
class DTDHandler
{
public:
typedef string_type stringT;
virtual ~basic_DTDHandler() { }
virtual ~DTDHandler() { }
/**
@ -70,7 +70,7 @@ public:
* When a system identifier is present, applications are responsible
* for knowing if it is used as a URL, and absolutizing it against
* the appropriate URI when appropriate.
* That base URI is available from {@link basic_Locator#getSystemId} during
* That base URI is available from {@link Locator#getSystemId} during
* this callback, assuming the parser provides a Locator.</p>
*
* <p>At least one of publicId and systemId must be non-empty. </p>
@ -85,7 +85,7 @@ public:
* none was given.
* @exception SAXException Any SAX exception.
* @see #unparsedEntityDecl
* @see basic_Attributes
* @see Attributes
*/
virtual void notationDecl(const stringT& name,
const stringT& publicId,
@ -112,19 +112,14 @@ public:
* @param systemId The entity's system identifier.
* @param notationName The name of the associated notation.
* @see #notationDecl
* @see basic_Attributes
* @see Attributes
*/
virtual void unparsedEntityDecl(const stringT& name,
const stringT& publicId,
const stringT& systemId,
const stringT& notationName) = 0;
}; // class basic_DTDHandler
typedef basic_DTDHandler<std::string> DTDHandler;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_DTDHandler<std::wstring> wDTDHandler;
#endif
}; // class DTDHandler
} // namespace SAX
} // namespace Arabica

View file

@ -10,8 +10,8 @@ namespace Arabica
namespace SAX
{
template<class string_type> class basic_Locator;
template<class string_type> class basic_AttributeList;
template<class string_type> class Locator;
template<class string_type> class AttributeList;
/**
* Receive notification of general document events.
@ -38,19 +38,19 @@ template<class string_type> class basic_AttributeList;
*
* @author Jez Higgins, jez@jezuk.co.uk
* @version 0.1
* @see basic_Parser#setDocumentHandler
* @see basic_Locator
* @see basic_HandlerBase
* @see Parser#setDocumentHandler
* @see Locator
* @see HandlerBase
*/
template<class string_type>
class basic_DocumentHandler
class DocumentHandler
{
public:
typedef string_type stringT;
typedef basic_Locator<stringT> LocatorT;
typedef basic_AttributeList<stringT> AttributeListT;
typedef Locator<stringT> LocatorT;
typedef AttributeList<stringT> AttributeListT;
virtual ~basic_DocumentHandler() { }
virtual ~DocumentHandler() { }
virtual void setDocumentLocator(const LocatorT& locator) = 0;
@ -67,12 +67,7 @@ public:
virtual void processingInstruction(const stringT& target,
const stringT& data) = 0;
}; // class basic_DocumentHandler
typedef basic_DocumentHandler<std::string> DocumentHandler;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_DocumentHandler<std::wstring> wDocumentHandler;
#endif
}; // class DocumentHandler
} // namespace SAX
} // namespace Arabica

View file

@ -21,7 +21,7 @@ namespace SAX
* <p>If a SAX application needs to implement customized handling
* for external entities, it must implement this interface and
* register an instance with the SAX driver using the
* {@link basic_XMLReader#setEntityResolver setEntityResolver}
* {@link XMLReader#setEntityResolver setEntityResolver}
* method.</p>
*
* <p>The XML reader will then allow the application to intercept any
@ -66,17 +66,17 @@ namespace SAX
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 2.0
* @see basic_Parser#setEntityResolver
* @see basic_InputSource
* @see Parser#setEntityResolver
* @see InputSource
*/
template<class string_type>
class basic_EntityResolver
class EntityResolver
{
public:
typedef string_type stringT;
typedef basic_InputSource<stringT> InputSourceT;
typedef InputSource<stringT> InputSourceT;
virtual ~basic_EntityResolver() { };
virtual ~EntityResolver() { };
/**
* Allow the application to resolve external entities.
@ -106,16 +106,11 @@ public:
* or a default-constructed <code>InputSource</code> to request that
* the parser open a regular URI connection to the system identifier.
* @exception SAXException Any SAX exception.
* @see basic_InputSource
* @see InputSource
*/
virtual InputSourceT resolveEntity(const stringT& publicId, const stringT& systemId) = 0;
}; // class EntityResolver
typedef basic_EntityResolver<std::string> EntityResolver;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_EntityResolver<std::wstring> wEntityResolver;
#endif
} // namespace SAX
} // namespace Arabica

View file

@ -21,7 +21,7 @@ namespace SAX
* <p>If a SAX application needs to implement customized error
* handling, it must implement this interface and then register an
* instance with the XML reader using the
* {@link basic_XMLReader#setErrorHandler setErrorHandler}
* {@link XMLReader#setErrorHandler setErrorHandler}
* method. The parser will then report all errors and warnings
* through this interface.</p>
*
@ -41,17 +41,17 @@ namespace SAX
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 2.0
* @see basic_Parser#setErrorHandler
* @see basic_SAXParseException
* @see Parser#setErrorHandler
* @see SAXParseException
*/
template<class string_type>
class basic_ErrorHandler
class ErrorHandler
{
public:
typedef string_type stringT;
typedef basic_SAXParseException<stringT> SAXParseExceptionT;
typedef SAXParseException<stringT> SAXParseExceptionT;
virtual ~basic_ErrorHandler() { };
virtual ~ErrorHandler() { };
/**
* Receive notification of a warning.
@ -69,7 +69,7 @@ public:
*
* @param exception The warning information encapsulated in a
* SAX parse exception.
* @see basic_SAXParseException
* @see SAXParseException
*/
virtual void warning(const SAXParseExceptionT& exception) = 0;
/**
@ -93,7 +93,7 @@ public:
*
* @param exception The error information encapsulated in a
* SAX parse exception.
* @see basic_SAXParseException
* @see SAXParseException
*/
virtual void error(const SAXParseExceptionT& exception) = 0;
/**
@ -112,16 +112,11 @@ public:
*
* @param exception The error information encapsulated in a
* SAX parse exception.
* @see basic_SAXParseException
* @see SAXParseException
*/
virtual void fatalError(const SAXParseExceptionT& exception) = 0;
}; // class ErrorHandler
typedef basic_ErrorHandler<std::string> ErrorHandler;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_ErrorHandler<std::wstring> wErrorHandler;
#endif
} // namespace SAX
} // namespace Arabica

View file

@ -27,7 +27,7 @@ namespace SAX
* interfaces: EntityResolver, DTDHandler, DocumentHandler,
* and ErrorHandler. It is now obsolete, but is included in SAX2 to
* support legacy SAX1 applications. SAX2 applications should use
* the {@link basic_DefaultHandler DefaultHandler}
* the {@link DefaultHandler DefaultHandler}
* class instead.</p>
*
* <p>Application writers can extend this class when they need to
@ -38,32 +38,32 @@ namespace SAX
* <p>Note that the use of this class is optional.</p>
*
* @deprecated This class works with the deprecated
* {@link basic_DocumentHandler DocumentHandler}
* {@link DocumentHandler DocumentHandler}
* interface. It has been replaced by the SAX2
* {@link basic_DefaultHandler DefaultHandler}
* {@link DefaultHandler DefaultHandler}
* class.
* @since SAX 1.0
* @author Jez Higgins, <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 1.0
* @see basic_EntityResolver
* @see basic_DTDHandler
* @see basic_DocumentHandler
* @see basic_ErrorHandler
* @see EntityResolver
* @see DTDHandler
* @see DocumentHandler
* @see ErrorHandler
*/
template<class string_type>
class basic_HandlerBase : public basic_EntityResolver<string_type>,
public basic_DTDHandler<string_type>,
public basic_DocumentHandler<string_type>,
public basic_ErrorHandler<string_type>
class HandlerBase : public EntityResolver<string_type>,
public DTDHandler<string_type>,
public DocumentHandler<string_type>,
public ErrorHandler<string_type>
{
public:
typedef string_name stringT;
typedef basic_Locator<stringT> LocatorT;
typedef basic_AttributeList<stringT> AttributeListT;
typedef basic_InputSource<stringT> InputSourceT;
typedef basic_ErrorHandler<stringT>::SAXParseExceptionT SAXParseExceptionT;
typedef Locator<stringT> LocatorT;
typedef AttributeList<stringT> AttributeListT;
typedef InputSource<stringT> InputSourceT;
typedef ErrorHandler<stringT>::SAXParseExceptionT SAXParseExceptionT;
virtual ~basic_HandlerBase() { }
virtual ~HandlerBase() { }
//////////////////////////////////////////////////////////////////////
// Default implementation of the EntityResolver interface.
@ -83,7 +83,7 @@ public:
* document.
* @return The new input source, or an empty string to require the
* default behaviour.
* @see basic_EntityResolver#resolveEntity
* @see EntityResolver#resolveEntity
*/
virtual InputSourceT resolveEntity(const stringT& publicId,
const stringT& systemId)
@ -105,7 +105,7 @@ public:
* @param publicId The notation public identifier, or an empty string if not
* available.
* @param systemId The notation system identifier.
* @see basic_DTDHandler#notationDecl
* @see DTDHandler#notationDecl
*/
virtual void notationDecl(const stringT& name,
const stringT& publicId,
@ -123,7 +123,7 @@ public:
* available.
* @param systemId The entity system identifier.
* @param notationName The name of the associated notation.
* @see basic_DTDHandler#unparsedEntityDecl
* @see DTDHandler#unparsedEntityDecl
*/
virtual void unparsedEntityDecl(const stringT& name,
const stringT& publicId,
@ -141,8 +141,8 @@ public:
* with other document events.</p>
*
* @param locator A locator for all SAX document events.
* @see basic_DocumentHandler#setDocumentLocator
* @see basic_Locator
* @see DocumentHandler#setDocumentLocator
* @see Locator
*/
virtual void setDocumentLocator(const LocatorT& locator) { }
@ -154,7 +154,7 @@ public:
* of a document (such as allocating the root node of a tree or
* creating an output file).</p>
*
* @see basic_DocumentHandler#startDocument
* @see DocumentHandler#startDocument
*/
virtual void startDocument() { }
/**
@ -165,7 +165,7 @@ public:
* of a document (such as finalising a tree or closing an output
* file).</p>
*
* @see basic_DocumentHandler#endDocument
* @see DocumentHandler#endDocument
*/
virtual void endDocument() { }
@ -179,7 +179,7 @@ public:
*
* @param name The element type name.
* @param attributes The specified or defaulted attributes.
* @see basic_DocumentHandler#startElement
* @see DocumentHandler#startElement
*/
virtual void startElement(const stringT& name,
const AttributeListT& attributes) { }
@ -192,7 +192,7 @@ public:
* output to a file).</p>
*
* @param name The element type name.
* @see basic_DocumentHandler#endElement
* @see DocumentHandler#endElement
*/
virtual void endElement(const stringT& name) { }
@ -205,7 +205,7 @@ public:
* a file).</p>
*
* @param ch The characters.
* @see basic_DocumentHandler#characters
* @see DocumentHandler#characters
*/
virtual void characters(const stringT& ch) { }
/**
@ -217,7 +217,7 @@ public:
* it to a file).</p>
*
* @param ch The whitespace characters.
* @see basic_DocumentHandler#ignorableWhitespace
* @see DocumentHandler#ignorableWhitespace
*/
virtual void ignorableWhitespace(const stringT& ch) { }
@ -232,7 +232,7 @@ public:
* @param target The processing instruction target.
* @param data The processing instruction data, or an empty string if
* none is supplied.
* @see basic_DocumentHandler#processingInstruction
* @see DocumentHandler#processingInstruction
*/
virtual void processingInstruction(const stringT& target,
const stringT& data) { }
@ -249,8 +249,8 @@ public:
* printing it to the console.</p>
*
* @param e The warning information encoded as an exception.
* @see basic_ErrorHandler#warning
* @see basic_SAXParseException
* @see ErrorHandler#warning
* @see SAXParseException
*/
virtual void warning(const SAXParseExceptionT& e) { }
/**
@ -262,8 +262,8 @@ public:
* printing it to the console.</p>
*
* @param e The warning information encoded as an exception.
* @see basic_ErrorHandler#warning
* @see basic_SAXParseException
* @see ErrorHandler#warning
* @see SAXParseException
*/
virtual void error(const SAXParseExceptionT& e) { }
/**
@ -278,17 +278,12 @@ public:
* the parser may no longer report parsing events.</p>
*
* @param e The error information encoded as an exception.
* @see basic_ErrorHandler#fatalError
* @see basic_SAXParseException
* @see ErrorHandler#fatalError
* @see SAXParseException
*/
virtual void fatalError(const SAXParseExceptionT& e) { throw e; }
}; // class HandlerBase
typedef basic_HandlerBase<std::string> HandlerBase;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_HandlerBase<std::wstring> wHandlerBase;
#endif
} // namespace SAX
} // namespace Arabica

View file

@ -45,11 +45,11 @@ namespace SAX
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 2.0
* @see basic_Parser#parse
* @see basic_EntityResolver#resolveEntity
* @see Parser#parse
* @see EntityResolver#resolveEntity
*/
template<class string_type>
class basic_InputSource
class InputSource
{
public:
typedef string_type stringT;
@ -62,7 +62,7 @@ public:
* @see #setByteStream
* @see #setEncoding
*/
basic_InputSource() :
InputSource() :
byteStream_(),
publicId_(),
systemId_(),
@ -83,13 +83,13 @@ public:
* @see #setByteStream
* @see #setEncoding
*/
basic_InputSource(const stringT& systemId) :
InputSource(const stringT& systemId) :
byteStream_(),
publicId_(),
systemId_(systemId),
encoding_()
{ }
basic_InputSource(const basic_InputSource& rhs) :
InputSource(const InputSource& rhs) :
byteStream_(rhs.byteStream_),
publicId_(rhs.publicId_),
systemId_(rhs.systemId_),
@ -104,15 +104,15 @@ public:
* character encoding.</p>
*
* @param byteStream The raw byte stream containing the document. The
* basic_InputSource does not assume ownership of
* InputSource does not assume ownership of
* this byteStream.
* @see #basic_InputSource(std::auto_ptr<std::istream>)
* @see #InputSource(std::auto_ptr<std::istream>)
* @see #setPublicId
* @see #setSystemId
* @see #setEncoding
* @see #setByteStream
*/
basic_InputSource(std::istream& byteStream) :
InputSource(std::istream& byteStream) :
byteStream_(byteStream),
publicId_(),
systemId_(),
@ -129,22 +129,22 @@ public:
* character encoding.</p>
*
* @param byteStream The raw byte stream containing the document. The
* basic_InputSource assumes ownership of the byteStream
* InputSource assumes ownership of the byteStream
* and will delete it when no-longer required.
* @see basic_InputSource(std::istream&)
* @see InputSource(std::istream&)
* @see #setPublicId
* @see #setSystemId
* @see #setEncoding
* @see #setByteStream
*/
basic_InputSource(std::auto_ptr<std::istream> byteStream) :
InputSource(std::auto_ptr<std::istream> byteStream) :
byteStream_(byteStream),
publicId_(),
systemId_(),
encoding_()
{ }
basic_InputSource(std::auto_ptr<std::iostream> byteStream) :
InputSource(std::auto_ptr<std::iostream> byteStream) :
byteStream_(byteStream),
publicId_(),
systemId_(),
@ -152,9 +152,9 @@ public:
{ }
virtual ~basic_InputSource() { }
virtual ~InputSource() { }
basic_InputSource& operator=(const basic_InputSource& rhs)
InputSource& operator=(const InputSource& rhs)
{
byteStream_ = rhs.byteStream_;
publicId_ = rhs.publicId_;
@ -173,8 +173,8 @@ public:
*
* @param publicId The public identifier as a string.
* @see #getPublicId
* @see basic_Locator#getPublicId
* @see basic_SAXParseException#getPublicId
* @see Locator#getPublicId
* @see SAXParseException#getPublicId
*/
void setPublicId(const stringT& publicId) { publicId_ = publicId; }
/**
@ -204,8 +204,8 @@ public:
* @param systemId The system identifier as a string.
* @see #setEncoding
* @see #getSystemId
* @see basic_Locator#getSystemId
* @see basic_SAXParseException#getSystemId
* @see Locator#getSystemId
* @see SAXParseException#getSystemId
*/
void setSystemId(const stringT& systemId) { systemId_ = systemId; }
/**
@ -232,7 +232,7 @@ public:
* byte stream, it should set it with the setEncoding method.</p>
*
* @param byteStream A byte stream containing an XML document or
* other entity. The basic_InputSource does not assume
* other entity. The InputSource does not assume
* ownership of byteStream.
* @see #setByteStream(std::auto_ptr<std::istream>) To transfer ownership of
* an std::istream to an InputSource
@ -255,7 +255,7 @@ public:
* byte stream, it should set it with the setEncoding method.</p>
*
* @param byteStream A byte stream containing an XML document or
* other entity. The basic_InputSource assumes
* other entity. The InputSource assumes
* ownership of byteStream.
* @see #setByteStream(std::istream&)
* @see #setEncoding
@ -328,13 +328,8 @@ private:
stringT systemId_;
stringT encoding_;
bool operator==(const basic_InputSource&); // no implementation
}; // class basic_InputSource
typedef basic_InputSource<std::string> InputSource;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_InputSource<std::wstring> wInputSource;
#endif
bool operator==(const InputSource&); // no implementation
}; // class InputSource
} // namespace SAX
} // namespace Arabica

View file

@ -19,7 +19,7 @@ namespace SAX
* <p>If a SAX parser provides location information to the SAX
* application, it does so by implementing this interface and then
* passing an instance to the application using the content
* handler's {@link basic_ContentHandler#setDocumentLocator
* handler's {@link ContentHandler#setDocumentLocator
* setDocumentLocator} method. The application can use the
* object to obtain the location of any other content handler event
* in the XML source document.</p>
@ -33,7 +33,7 @@ namespace SAX
* very strongly encouraged to do so. If the parser supplies a
* locator, it must do so before reporting any other document events.
* If no locator has been set by the time the application receives
* the {@link basic_ContentHandler#startDocument startDocument}
* the {@link ContentHandler#startDocument startDocument}
* event, the application should assume that a locator is not
* available.</p>
*
@ -41,15 +41,15 @@ namespace SAX
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 2.0
* @see basic_ContentHandler#setDocumentLocator
* @see ContentHandler#setDocumentLocator
*/
template<class string_type>
class basic_Locator
class Locator
{
public:
typedef string_type stringT;
virtual ~basic_Locator() { }
virtual ~Locator() { }
/**
* Return the public identifier for the current document event.
@ -124,11 +124,6 @@ public:
virtual int getColumnNumber() const = 0;
}; // class Locator
typedef basic_Locator<std::string> Locator;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_Locator<std::wstring> wLocator;
#endif
} // namespace SAX
} // namespace Arabica

View file

@ -21,7 +21,7 @@ namespace SAX
* Basic interface for SAX (Simple API for XML) parsers.
*
* <p>This was the main event supplier interface for SAX1; it has
* been replaced in SAX2 by {@link basic_XMLReader XMLReader},
* been replaced in SAX2 by {@link XMLReader XMLReader},
* which includes Namespace support and sophisticated configurability
* and extensibility.</p>
*
@ -38,30 +38,30 @@ namespace SAX
* invoke the parse() methods recursively within a parse.</p>
*
* @deprecated This interface has been replaced by the SAX2
* {@link basic_XMLReader XMLReader}
* {@link XMLReader XMLReader}
* interface, which includes Namespace support.
* @since SAX 1.0
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 2.0
* @see basic_EntityResolver
* @see basic_DTDHandler
* @see basic_DocumentHandler
* @see basic_ErrorHandler
* @see basic_HandlerBase
* @see basic_InputSource
* @see EntityResolver
* @see DTDHandler
* @see DocumentHandler
* @see ErrorHandler
* @see HandlerBase
* @see InputSource
*/
template<class string_type>
class basic_Parser
class Parser
{
public:
typedef string_name stringT;
typedef basic_EntityResolver<stringT> EntityResolverT;
typedef basic_DTDHandler<stringT> DTDHandlerT;
typedef basic_DocumentHandler<stringT> DocumentHandlerT;
typedef basic_InputSource<stringT> InputSourceT;
typedef EntityResolver<stringT> EntityResolverT;
typedef DTDHandler<stringT> DTDHandlerT;
typedef DocumentHandler<stringT> DocumentHandlerT;
typedef InputSource<stringT> InputSourceT;
virtual ~basic_Parser() { }
virtual ~Parser() { }
// virtual void setLocale(Locale locale) throws SAXException = 0;
/**
@ -77,8 +77,8 @@ public:
* the new resolver immediately.</p>
*
* @param resolver The object for resolving entities.
* @see basic_EntityResolver
* @see basic_HandlerBase
* @see EntityResolver
* @see HandlerBase
*/
virtual void setEntityResolver(EntityResolverT& resolver) = 0;
/**
@ -94,8 +94,8 @@ public:
* begin using the new handler immediately.</p>
*
* @param handler The DTD handler.
* @see basic_DTDHandler
* @see basic_HandlerBase
* @see DTDHandler
* @see HandlerBase
*/
virtual void setDTDHandler(DTDHandlerT& handler) = 0;
/**
@ -111,8 +111,8 @@ public:
* handler immediately.</p>
*
* @param handler The document handler.
* @see basic_DocumentHandler
* @see basic_HandlerBase
* @see DocumentHandler
* @see HandlerBase
*/
virtual void setDocumentHandler(DocumentHandlerT& handler) = 0;
/**
@ -128,9 +128,9 @@ public:
* handler immediately.</p>
*
* @param handler The error handler.
* @see basic_ErrorHandler
* @see basic_SAXException
* @see basic_HandlerBase
* @see ErrorHandler
* @see SAXException
* @see HandlerBase
*/
virtual void setErrorHandler(ErrorHandler& handler) = 0;
@ -149,19 +149,14 @@ public:
*
* @param source The input source for the top-level of the
* XML document.
* @see basic_InputSource
* @see InputSource
* @see #setEntityResolver
* @see #setDTDHandler
* @see #setDocumentHandler
* @see #setErrorHandler
*/
virtual void parse(InputSourceT& source) = 0;
}; // class basic_Parser
typedef basic_Parser<std::string> Parser;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_Parser<std::wstring> wParser;
#endif
}; // class Parser
} // namespace SAX
} // namespace Arabica

View file

@ -24,13 +24,13 @@ namespace SAX
*
* <p>If the parser or application needs to include information about a
* specific location in an XML document, it should use the
* {@link basic_SAXParseException SAXParseException} subclass.</p>
* {@link SAXParseException SAXParseException} subclass.</p>
*
* @since SAX 1.0
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 2.0
* @see basic_SAXParseException
* @see SAXParseException
*/
class SAXException : public std::runtime_error
{

View file

@ -34,16 +34,16 @@ namespace SAX
* @version 2.0
* @see SAXException
* @see Locator
* @see basic_ErrorHandler
* @see ErrorHandler
*/
template<class string_type>
class basic_SAXParseException : public SAXException
class SAXParseException : public SAXException
{
public:
typedef string_type stringT;
typedef basic_Locator<stringT> LocatorT;
typedef Locator<stringT> LocatorT;
basic_SAXParseException(const std::string& message) :
SAXParseException(const std::string& message) :
SAXException(message),
publicId_(),
systemId_(),
@ -51,9 +51,9 @@ public:
columnNumber_(-1)
{
setMsg();
} // basic_SAXParseException
} // SAXParseException
basic_SAXParseException(const std::string& message,
SAXParseException(const std::string& message,
const LocatorT& locator) :
SAXException(message),
publicId_(locator.getPublicId()),
@ -62,9 +62,9 @@ public:
columnNumber_(locator.getColumnNumber())
{
setMsg();
} // basic_SAXParseException
} // SAXParseException
basic_SAXParseException(const std::string& message,
SAXParseException(const std::string& message,
const stringT& publicId,
const stringT& systemId,
int lineNumber,
@ -76,9 +76,9 @@ public:
columnNumber_(columnNumber)
{
setMsg();
} // basic_SAXParseException
} // SAXParseException
basic_SAXParseException(const basic_SAXParseException& rhs) :
SAXParseException(const SAXParseException& rhs) :
SAXException(rhs),
msg_(rhs.msg_),
publicId_(rhs.publicId_),
@ -86,9 +86,9 @@ public:
lineNumber_(rhs.lineNumber_),
columnNumber_(rhs.columnNumber_)
{
} // basic_SAXParseException
} // SAXParseException
basic_SAXParseException& operator=(const basic_SAXParseException& rhs)
SAXParseException& operator=(const SAXParseException& rhs)
{
SAXException::operator=(rhs);
@ -101,14 +101,14 @@ public:
return *this;
} // operator=
virtual ~basic_SAXParseException() throw() { }
virtual ~SAXParseException() throw() { }
/**
* Get the public identifier of the entity where the exception occurred.
*
* @return A string containing the public identifier, or an empty string
* if none is available.
* @see basic_Locator#getPublicId
* @see Locator#getPublicId
*/
const stringT& getPublicId() const { return publicId_; }
/**
@ -119,7 +119,7 @@ public:
*
* @return A string containing the system identifier, or an empty string
* if none is available.
* @see basic_Locator#getSystemId
* @see Locator#getSystemId
*/
const stringT& getSystemId() const { return systemId_; }
/**
@ -127,7 +127,7 @@ public:
*
* @return An integer representing the line number, or -1
* if none is available.
* @see basic_Locator#getLineNumber
* @see Locator#getLineNumber
*/
int getLineNumber() const { return lineNumber_; }
/**
@ -137,7 +137,7 @@ public:
*
* @return An integer representing the column number, or -1
* if none is available.
* @see basic_Locator#getColumnNumber
* @see Locator#getColumnNumber
*/
int getColumnNumber() const { return columnNumber_; }
@ -162,13 +162,8 @@ private:
int lineNumber_;
int columnNumber_;
basic_SAXParseException();
}; // class basic_SAXParseException
typedef basic_SAXParseException<std::string> SAXParseException;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_SAXParseException<std::wstring> wSAXParseException;
#endif
SAXParseException();
}; // class SAXParseException
} // namespace SAX
} // namespace Arabica

View file

@ -23,25 +23,25 @@ namespace SAX
* events as they pass on to the final application.</p>
*
* <p>The XMLFilterImpl helper class provides a convenient base
* for creating SAX2 filters, by passing on all {@link basic_EntityResolver
* EntityResolver}, {@link basic_DTDHandler DTDHandler},
* {@link basic_ContentHandler ContentHandler} and {@link ErrorHandler
* for creating SAX2 filters, by passing on all {@link EntityResolver
* EntityResolver}, {@link DTDHandler DTDHandler},
* {@link ContentHandler ContentHandler} and {@link ErrorHandler
* ErrorHandler} events automatically.</p>
*
* @since SAX 2.0
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 2.0
* @see basic_XMLFilterImpl
* @see XMLFilterImpl
*/
template<class string_type>
class basic_XMLFilter : public basic_XMLReader<string_type>
class XMLFilter : public XMLReaderInterface<string_type>
{
public:
typedef string_type stringT;
typedef basic_XMLReader<stringT> XMLReaderT;
typedef XMLReaderInterface<stringT> XMLReaderT;
virtual ~basic_XMLFilter() { }
virtual ~XMLFilter() { }
/**
* Set the parent reader.
@ -63,12 +63,7 @@ public:
* @return The parent filter, or 0 if none has been set.
*/
virtual XMLReaderT* getParent() const = 0;
}; // class basic_XMLFilter
typedef basic_XMLFilter<std::string> XMLFilter;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_XMLFilter<std::wstring> wXMLFilter;
#endif
}; // class XMLFilter
} // namespace SAX
} // namespace Arabica

View file

@ -38,7 +38,7 @@ namespace SAX
* to return before reporting the next event.</p>
*
* <p>This interface replaces the (now deprecated) SAX 1.0 {@link
* basic_Parser Parser} interface. The XMLReader interface
* Parser Parser} interface. The XMLReader interface
* contains two important enhancements over the old Parser
* interface:</p>
*
@ -56,24 +56,24 @@ namespace SAX
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 2.0
* @see basic_XMLFilter
* @see basic_helpers.ParserAdapter
* @see basic_helpers.XMLReaderAdapter
* @see XMLFilter
* @see helpers.ParserAdapter
* @see helpers.XMLReaderAdapter
*/
template<class string_type>
class basic_XMLReader
class XMLReaderInterface
{
public:
typedef string_type stringT;
typedef basic_EntityResolver<stringT> EntityResolverT;
typedef basic_DTDHandler<stringT> DTDHandlerT;
typedef basic_ContentHandler<stringT> ContentHandlerT;
typedef basic_InputSource<stringT> InputSourceT;
typedef basic_ErrorHandler<stringT> ErrorHandlerT;
typedef basic_DeclHandler<stringT> DeclHandlerT;
typedef basic_LexicalHandler<stringT> LexicalHandlerT;
typedef EntityResolver<stringT> EntityResolverT;
typedef DTDHandler<stringT> DTDHandlerT;
typedef ContentHandler<stringT> ContentHandlerT;
typedef InputSource<stringT> InputSourceT;
typedef ErrorHandler<stringT> ErrorHandlerT;
typedef DeclHandler<stringT> DeclHandlerT;
typedef LexicalHandler<stringT> LexicalHandlerT;
virtual ~basic_XMLReader() { }
virtual ~XMLReaderInterface() { }
/////////////////////////////////////////////////
// Configuration
@ -134,7 +134,7 @@ public:
* <p>The feature name is any fully-qualified URI. It is
* possible for an XMLReader to recognize a feature name but
* to be unable to set its value; this is especially true
* in the case of an adapter for a SAX1 {@link basic_Parser Parser},
* in the case of an adapter for a SAX1 {@link Parser Parser},
* which has no way of affecting whether the underlying parser is
* validating, for example.</p>
*
@ -293,7 +293,7 @@ public:
* by the application before it is passed to the parser.</p>
*
* @param systemId The system identifier (URI).
* @see #parse(basic_InputSource&)
* @see #parse(InputSource&)
*/
void parse(const stringT& systemId)
{
@ -323,7 +323,7 @@ public:
*
* @param input The input source for the top-level of the
* XML document.
* @see basic_InputSource
* @see InputSource
* @see #parse(const stringT&)
* @see #setEntityResolver
* @see #setDTDHandler
@ -363,7 +363,7 @@ public:
* <p>The property name is any fully-qualified URI. It is
* possible for an XMLReader to recognize a property name but
* to be unable to return its state; this is especially true
* in the case of an adapter for a SAX1 {@link basic_Parser
* in the case of an adapter for a SAX1 {@link Parser
* Parser}.</p>
*
* <p>XMLReaders are not required to recognize any specific
@ -403,7 +403,7 @@ public:
* <p>The property name is any fully-qualified URI. It is
* possible for an XMLReader to recognize a property name but
* to be unable to set its value; this is especially true
* in the case of an adapter for a SAX1 {@link basic_Parser
* in the case of an adapter for a SAX1 {@link Parser
* Parser}.</p>
*
* <p>XMLReaders are not required to recognize setting
@ -431,7 +431,7 @@ public:
Property<propertyTypeT&>* prop = new Property<propertyTypeT&>(value);
doSetProperty(name, std::auto_ptr<PropertyBase>(prop));
} // setProperty
}; // class basic_XMLReader
}; // class XMLReaderInterface
} // namespace SAX
} // namespace Arabica

View file

@ -25,16 +25,16 @@ namespace SAX
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 2.0
* @see basic_Attributes
* @see basic_Attributes2Impl
* @see Attributes
* @see Attributes2Impl
*/
template<class string_type>
class basic_Attributes2 : public basic_Attributes<string_type>
class Attributes2 : public Attributes<string_type>
{
public:
typedef string_type stringT;
virtual ~basic_Attributes2() { }
virtual ~Attributes2() { }
/**
* Returns true unless the attribute value was provided by DTD defaulting.
@ -70,12 +70,7 @@ public:
* does not identify an attribute
*/
virtual bool isSpecified(const stringT& uri, const stringT& localName) const = 0;
}; // class basic_Attributes2
typedef basic_Attributes2<std::string> Attributes2;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_Attributes2<std::wstring> wAttributes2;
#endif
}; // class Attributes2
} // namespace SAX
} // namespace Arabica

View file

@ -22,15 +22,15 @@ namespace SAX
*
* <p>Note that data-related DTD declarations (unparsed entities and
* notations) are already reported through the {@link
* basic_DTDHandler DTDHandler} interface.</p>
* DTDHandler DTDHandler} interface.</p>
*
* <p>If you are using the declaration handler together with a lexical
* handler, all of the events will occur between the
* {@link basic_LexicalHandler#startDTD startDTD} and the
* {@link basic_LexicalHandler#endDTD endDTD} events.</p>
* {@link LexicalHandler#startDTD startDTD} and the
* {@link LexicalHandler#endDTD endDTD} events.</p>
*
* <p>To set the DeclHandler for an XML reader, use the
* {@link basic_XMLReader#setProperty setProperty} method
* {@link XMLReader#setProperty setProperty} method
* with the propertyId "http://xml.org/sax/properties/declaration-handler".
* If the reader does not support declaration events, it will throw a
* {@link SAXNotRecognizedException SAXNotRecognizedException}
@ -42,14 +42,14 @@ namespace SAX
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 1.0
* @see basic_XMLReader
* @see XMLReader
*/
template<class string_type>
class basic_DeclHandler
class DeclHandler
{
public:
typedef string_type stringT;
virtual ~basic_DeclHandler() { }
virtual ~DeclHandler() { }
/**
* Report an element type declaration.
@ -106,7 +106,7 @@ public:
* entity, the name will begin with '%'.
* @param value The replacement text of the entity.
* @see #externalEntityDecl
* @see basic_DTDHandler#unparsedEntityDecl
* @see DTDHandler#unparsedEntityDecl
*/
virtual void internalEntityDecl(const stringT& name, const stringT& value) = 0;
/**
@ -121,17 +121,12 @@ public:
* an empty string if none was declared.
* @param systemId The declared system identifier of the entity.
* @see #internalEntityDecl
* @see basic_DTDHandler#unparsedEntityDecl
* @see DTDHandler#unparsedEntityDecl
*/
virtual void externalEntityDecl(const stringT& name,
const stringT& publicId,
const stringT& systemId) = 0;
}; // class basic_DeclHandler
typedef basic_DeclHandler<std::string> DeclHandler;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_DeclHandler<std::wstring> wDeclHandler;
#endif
}; // class DeclHandler
} // namespace SAX
} // namespace Arabica

View file

@ -20,45 +20,40 @@ namespace SAX
* Default base class for SAX2 event handlers.
*
* <p>This class extends the SAX2 base
* {@link basic_DefaultHandler} handler class to
* support the SAX2 {@link basic_LexicalHandler LexicalHandler}
* and {@link basic_DeclHandler DeclHandler} extensions.
* {@link DefaultHandler} handler class to
* support the SAX2 {@link LexicalHandler LexicalHandler}
* and {@link DeclHandler DeclHandler} extensions.
* The added handler methods just return; subclassers may
* override on a method-by-method basis.
*
* Note: this class might yet learn that the
* ContentHandler.setDocumentLocator() call might be
* passed a {@link basic_Locator2 Locator2} object, and
* passed a {@link Locator2 Locator2} object, and
* that the ContentHandler.startElement() call might be
* passed a {@link basic_Attributes2 Attributes2} object.
* passed a {@link Attributes2 Attributes2} object.
*
* @since SAX 2.0
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 2.0
* @see basic_DefaultHandler
* @see basic_LexicalHandler
* @see basic_DeclHandler
* @see DefaultHandler
* @see LexicalHandler
* @see DeclHandler
*/
template<class string_type>
class basic_DefaultHandler2 : public basic_DefaultHandler<string_type>
class DefaultHandler2 : public DefaultHandler<string_type>
{
public:
typedef string_type stringT;
basic_DefaultHandler2() { }
virtual ~basic_DefaultHandler2() { }
DefaultHandler2() { }
virtual ~DefaultHandler2() { }
private:
basic_DefaultHandler2(const basic_DefaultHandler2&);
basic_DefaultHandler2& operator=(const basic_DefaultHandler2&);
bool operator==(const basic_DefaultHandler2&);
}; // class basic_DefaultHandler
typedef basic_DefaultHandler2<std::string> DefaultHandler2;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_DefaultHandler2<std::wstring> wDefaultHandler2;
#endif
DefaultHandler2(const DefaultHandler2&);
DefaultHandler2& operator=(const DefaultHandler2&);
bool operator==(const DefaultHandler2&);
}; // class DefaultHandler
} // namespace SAX
} // namespace Arabica

View file

@ -27,7 +27,7 @@ namespace SAX
* endDocument events.</p>
*
* <p>To set the LexicalHandler for an XML reader, use the
* {@link basic_XMLReader#setProperty setProperty} method
* {@link XMLReader#setProperty setProperty} method
* with the propertyId "http://xml.org/sax/properties/lexical-handler".
* If the reader does not support lexical events, it will throw a
* {@link SAXNotRecognizedException SAXNotRecognizedException}
@ -39,17 +39,17 @@ namespace SAX
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 1.0
* @see basic_XMLReader#setProperty
* @see XMLReader#setProperty
* @see SAXNotRecognizedException
* @see SAXNotSupportedException
*/
template<class string_type>
class basic_LexicalHandler
class LexicalHandler
{
public:
typedef string_type stringT;
virtual ~basic_LexicalHandler() { }
virtual ~LexicalHandler() { }
/**
* Report the start of DTD declarations, if any.
@ -59,8 +59,8 @@ public:
* this method will not be invoked.</p>
*
* <p>All declarations reported through
* {@link basic_DTDHandler DTDHandler} or
* {@link basic_DeclHandler DeclHandler} events must appear
* {@link DTDHandler DTDHandler} or
* {@link DeclHandler DeclHandler} events must appear
* between the startDTD and {@link #endDTD endDTD} events.
* Declarations are assumed to belong to the internal DTD subset
* unless they appear between {@link #startEntity startEntity}
@ -74,7 +74,7 @@ public:
* <p>Note that the start/endDTD events will appear within
* the start/endDocument events from ContentHandler and
* before the first
* {@link basic_ContentHandler#startElement startElement}
* {@link ContentHandler#startElement startElement}
* event.</p>
*
* @param name The document type name.
@ -116,11 +116,11 @@ public:
* <p>When a SAX2 driver is providing these events, all other
* events must be properly nested within start/end entity
* events. There is no additional requirement that events from
* {@link basic_DeclHandler DeclHandler} or
* {@link basic_DTDHandler DTDHandler} be properly ordered.</p>
* {@link DeclHandler DeclHandler} or
* {@link DTDHandler DTDHandler} be properly ordered.</p>
*
* <p>Note that skipped entities will be reported through the
* {@link basic_ContentHandler#skippedEntity skippedEntity}
* {@link ContentHandler#skippedEntity skippedEntity}
* event, which is part of the ContentHandler interface.</p>
*
* <p>Because of the streaming event model that SAX uses, some
@ -144,8 +144,8 @@ public:
* entity, the name will begin with '%', and if it is the
* external DTD subset, it will be "[dtd]".
* @see #endEntity
* @see basic_DeclHandler#internalEntityDecl
* @see basic_DeclHandler#externalEntityDecl
* @see DeclHandler#internalEntityDecl
* @see DeclHandler#externalEntityDecl
*/
virtual void startEntity(const stringT& name) = 0;
/**
@ -160,7 +160,7 @@ public:
* Report the start of a CDATA section.
*
* <p>The contents of the CDATA section will be reported through
* the regular {@link basic_ContentHandler#characters
* the regular {@link ContentHandler#characters
* characters} event; this event is intended only to report
* the boundary.</p>
*
@ -186,12 +186,7 @@ public:
* @param text A string holding the comment.
*/
virtual void comment(const stringT& text) = 0;
}; // class basic_LexicalHandler
typedef basic_LexicalHandler<std::string> LexicalHandler;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_LexicalHandler<std::wstring> wLexicalHandler;
#endif
}; // class LexicalHandler
} // namespace SAX
} // namespace Arabica

View file

@ -26,12 +26,12 @@ namespace SAX
* @version 2.0
*/
template<class string_type>
class basic_Locator2 : public basic_Locator<string_type>
class Locator2 : public Locator<string_type>
{
public:
typedef string_type stringT;
virtual ~basic_Locator2() { }
virtual ~Locator2() { }
/**
* Returns the version of XML used for the entity. This will normally
@ -65,12 +65,7 @@ public:
* @return Name of the character encoding being used to interpret the entity's text.
*/
virtual stringT getEncoding() const = 0;
}; // class basic_Locator2
typedef basic_Locator2<std::string> Locator2;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_Locator2<std::wstring> wLocator2;
#endif
}; // class Locator2
} // namespace SAX
} // namespace Arabica

View file

@ -40,10 +40,10 @@ namespace SAX
}; // XMLPScanToken
template<class string_type>
class basic_ProgressiveParser : public basic_XMLReader<string_type>
class ProgressiveParser : public XMLReaderInterface<string_type>
{
public:
typedef typename basic_XMLReader<string_type>::InputSourceT InputSourceT;
typedef typename XMLReaderInterface<string_type>::InputSourceT InputSourceT;
/** @name Progressive Parsing Methods */
//@{
@ -153,12 +153,8 @@ namespace SAX
*/
virtual void parseReset(XMLPScanToken& token) = 0;
//@}
}; // basic_ProgressiveParser
}; // ProgressiveParser
typedef basic_ProgressiveParser<std::string> ProgressiveParser;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_ProgressiveParser<std::wstring> wProgressiveParser;
#endif
} // namespace SAX
} // namespace Arabica

View file

@ -13,23 +13,23 @@ namespace SAX
{
template<class string_type, class string_adaptor = Arabica::default_string_adaptor<string_type> >
class NamespaceTracker : public basic_XMLFilterImpl<string_type>
class NamespaceTracker : public XMLFilterImpl<string_type>
{
typedef basic_NamespaceSupport<string_type, string_adaptor> NamespaceSupportT;
typedef NamespaceSupport<string_type, string_adaptor> NamespaceSupportT;
typedef typename NamespaceSupportT::stringListT stringListT;
typedef basic_XMLFilterImpl<string_type> XMLFilterT;
typedef XMLFilterImpl<string_type> XMLFilterT;
public:
typedef basic_XMLReader<string_type> XMLReaderT;
typedef basic_Attributes<string_type> AttributesT;
typedef XMLReaderInterface<string_type> XMLReaderT;
typedef Attributes<string_type> AttributesT;
NamespaceTracker() :
basic_XMLFilterImpl<string_type>()
XMLFilterImpl<string_type>()
{
} // NamespaceTracker
NamespaceTracker(XMLReaderT& parent) :
basic_XMLFilterImpl<string_type>(parent)
XMLFilterImpl<string_type>(parent)
{
} // NamespaceTracker

View file

@ -12,7 +12,7 @@ namespace SAX
{
template<class string_type>
class PYXWriter : public basic_XMLFilterImpl<string_type>
class PYXWriter : public XMLFilterImpl<string_type>
{
public:
typedef string_type stringT;
@ -20,9 +20,9 @@ class PYXWriter : public basic_XMLFilterImpl<string_type>
typedef typename string_type::value_type charT;
typedef typename string_type::traits_type traitsT;
typedef std::basic_ostream<charT, traitsT> ostreamT;
typedef basic_XMLReader<stringT> XMLReaderT;
typedef basic_XMLFilterImpl<stringT> XMLFilterT;
typedef typename basic_XMLFilterImpl<stringT>::AttributesT AttributesT;
typedef XMLReaderInterface<stringT> XMLReaderT;
typedef XMLFilterImpl<stringT> XMLFilterT;
typedef typename XMLFilterImpl<stringT>::AttributesT AttributesT;
typedef Arabica::Unicode<charT> UnicodeT;
private:
using XMLFilterT::getParent;

View file

@ -17,23 +17,23 @@ namespace SAX
This filter buffers up multiple calls to characters(...) and reports text in a single lump.
*/
template<class string_type, class string_adaptor = Arabica::default_string_adaptor<string_type> >
class TextCoalescer : public basic_XMLFilterImpl<string_type>
class TextCoalescer : public XMLFilterImpl<string_type>
{
typedef basic_XMLFilterImpl<string_type> XMLFilterT;
typedef XMLFilterImpl<string_type> XMLFilterT;
public:
typedef basic_XMLReader<string_type> XMLReaderT;
typedef basic_Attributes<string_type> AttributesT;
typedef XMLReaderInterface<string_type> XMLReaderT;
typedef Attributes<string_type> AttributesT;
TextCoalescer() :
XMLFilterT()
{
} // basic_TextCoalescer
} // TextCoalescer
TextCoalescer(XMLReaderT& parent) :
XMLFilterT(parent)
{
} // basic_TextCoalescer
} // TextCoalescer
virtual void startElement(const string_type& namespaceURI, const string_type& localName,
const string_type& qName, const AttributesT& atts)
@ -93,7 +93,7 @@ private:
buffer_ = string_adaptor::empty_string();
} // flush
string_type buffer_;
}; // class basic_TextCoalescer
}; // class TextCoalescer
} // namespace SAX
} // namespace Arabica

View file

@ -14,12 +14,12 @@ namespace SAX
Strips out everything except startDocument, endDocument and text
*/
template<class string_type, class string_adaptor = Arabica::default_string_adaptor<string_type> >
class TextOnly : public basic_XMLFilterImpl<string_type>
class TextOnly : public XMLFilterImpl<string_type>
{
typedef basic_XMLFilterImpl<string_type> XMLFilterT;
typedef XMLFilterImpl<string_type> XMLFilterT;
public:
typedef basic_XMLReader<string_type> XMLReaderT;
typedef XMLReaderInterface<string_type> XMLReaderT;
TextOnly() :
XMLFilterT(0)

View file

@ -11,12 +11,12 @@ namespace SAX
{
template<class string_type, class string_adaptor = Arabica::default_string_adaptor<string_type> >
class WhitespaceStripper : public SAX::basic_XMLFilterImpl<string_type>
class WhitespaceStripper : public SAX::XMLFilterImpl<string_type>
{
public:
typedef string_type stringT;
typedef SAX::basic_XMLFilterImpl<stringT> baseT;
typedef SAX::basic_XMLReader<stringT> XMLReaderT;
typedef SAX::XMLFilterImpl<stringT> baseT;
typedef SAX::XMLReader<stringT> XMLReaderT;
WhitespaceStripper() :
baseT()

View file

@ -18,29 +18,29 @@ namespace SAX
{
template<class string_type>
class basic_Writer : public basic_XMLFilterImpl<string_type>
class Writer : public XMLFilterImpl<string_type>
{
public:
typedef string_type stringT;
typedef basic_Writer<stringT> WriterT;
typedef Writer<stringT> WriterT;
typedef typename string_type::value_type charT;
typedef typename string_type::traits_type traitsT;
typedef std::basic_ostream<charT, traitsT> ostreamT;
typedef basic_XMLReader<stringT> XMLReaderT;
typedef basic_XMLFilterImpl<stringT> XMLFilterT;
typedef typename basic_XMLFilterImpl<stringT>::AttributesT AttributesT;
typedef XMLReaderInterface<stringT> XMLReaderT;
typedef XMLFilterImpl<stringT> XMLFilterT;
typedef typename XMLFilterImpl<stringT>::AttributesT AttributesT;
typedef Arabica::Unicode<charT> UnicodeT;
typedef Arabica::XML::text_escaper<charT, traitsT> text_escaperT;
typedef Arabica::XML::attribute_escaper<charT, traitsT> attribute_escaperT;
private:
typedef basic_LexicalHandler<stringT> LexicalHandlerT;
typedef basic_DeclHandler<stringT> DeclHandlerT;
typedef LexicalHandler<stringT> LexicalHandlerT;
typedef DeclHandler<stringT> DeclHandlerT;
typedef typename XMLReaderT::InputSourceT InputSourceT;
typedef typename XMLReaderT::PropertyBase PropertyBaseT;
using XMLFilterT::getParent;
public:
basic_Writer(ostreamT& stream, unsigned int indent = 2) :
Writer(ostreamT& stream, unsigned int indent = 2) :
inCDATA_(false),
inDTD_(false),
internalSubset_(true),
@ -50,9 +50,9 @@ class basic_Writer : public basic_XMLFilterImpl<string_type>
encoding_(),
lastTag_(startTag)
{
} // basic_Writer
} // Writer
basic_Writer(ostreamT& stream, XMLReaderT& parent, unsigned int indent = 2) :
Writer(ostreamT& stream, XMLReaderT& parent, unsigned int indent = 2) :
XMLFilterT(parent),
inCDATA_(false),
inDTD_(false),
@ -63,9 +63,9 @@ class basic_Writer : public basic_XMLFilterImpl<string_type>
encoding_(),
lastTag_(startTag)
{
} // basic_Writer
} // Writer
basic_Writer(ostreamT& stream, const stringT& encoding, unsigned int indent = 2) :
Writer(ostreamT& stream, const stringT& encoding, unsigned int indent = 2) :
inCDATA_(false),
inDTD_(false),
internalSubset_(true),
@ -75,9 +75,9 @@ class basic_Writer : public basic_XMLFilterImpl<string_type>
encoding_(encoding),
lastTag_(startTag)
{
} // basic_Writer
} // Writer
basic_Writer(ostreamT& stream, XMLReaderT& parent, const stringT& encoding, unsigned int indent = 2) :
Writer(ostreamT& stream, XMLReaderT& parent, const stringT& encoding, unsigned int indent = 2) :
XMLFilterT(parent),
inCDATA_(false),
inDTD_(false),
@ -88,7 +88,7 @@ class basic_Writer : public basic_XMLFilterImpl<string_type>
encoding_(encoding),
lastTag_(startTag)
{
} // basic_Writer
} // Writer
// setEncoding
// Sets the encoding included in the XML declaration. If not set, then the encoding
@ -149,10 +149,10 @@ class basic_Writer : public basic_XMLFilterImpl<string_type>
enum { startTag, endTag, docTag } lastTag_;
const SAX::PropertyNames<stringT> properties_;
}; // class basic_Writer
}; // class Writer
template<class string_type>
void basic_Writer<string_type>::startDocument()
void Writer<string_type>::startDocument()
{
*stream_ << UnicodeT::LESS_THAN_SIGN
<< UnicodeT::QUESTION_MARK
@ -202,14 +202,14 @@ void basic_Writer<string_type>::startDocument()
} // startDocument
template<class string_type>
void basic_Writer<string_type>::endDocument()
void Writer<string_type>::endDocument()
{
XMLFilterT::endDocument();
lastTag_ = endTag;
} // endDocument
template<class string_type>
void basic_Writer<string_type>::startElement(
void Writer<string_type>::startElement(
const stringT& namespaceURI, const stringT& localName,
const stringT& qName, const AttributesT& atts)
{
@ -237,7 +237,7 @@ void basic_Writer<string_type>::startElement(
} // startElement
template<class string_type>
void basic_Writer<string_type>::endElement(
void Writer<string_type>::endElement(
const stringT& namespaceURI, const stringT& localName,
const stringT& qName)
{
@ -256,7 +256,7 @@ void basic_Writer<string_type>::endElement(
} // endElement
template<class string_type>
void basic_Writer<string_type>::characters(const stringT& ch)
void Writer<string_type>::characters(const stringT& ch)
{
if(!inCDATA_)
std::for_each(ch.begin(), ch.end(), text_escaperT(*stream_));
@ -267,7 +267,7 @@ void basic_Writer<string_type>::characters(const stringT& ch)
} // characters
template<class string_type>
void basic_Writer<string_type>::ignorableWhitespace(const stringT& ch)
void Writer<string_type>::ignorableWhitespace(const stringT& ch)
{
*stream_ << ch;
@ -275,7 +275,7 @@ void basic_Writer<string_type>::ignorableWhitespace(const stringT& ch)
} // ignorableWhitespace
template<class string_type>
void basic_Writer<string_type>::processingInstruction(const stringT& target, const stringT& data)
void Writer<string_type>::processingInstruction(const stringT& target, const stringT& data)
{
if((!inDTD_) || (inDTD_ && internalSubset_))
{
@ -294,7 +294,7 @@ void basic_Writer<string_type>::processingInstruction(const stringT& target, con
} // processingInstruction
template<class string_type>
void basic_Writer<string_type>::skippedEntity(const stringT& name)
void Writer<string_type>::skippedEntity(const stringT& name)
{
if(!isDtd(name))
*stream_ << UnicodeT::AMPERSAND << name << UnicodeT::SEMI_COLON;
@ -303,14 +303,14 @@ void basic_Writer<string_type>::skippedEntity(const stringT& name)
} // skippedEntity
template<class string_type>
void basic_Writer<string_type>::doIndent()
void Writer<string_type>::doIndent()
{
for(int i = 0; i < depth_; ++i)
*stream_ << UnicodeT::SPACE;
} // doIndent
template<class string_type>
bool basic_Writer<string_type>::isDtd(const string_type& name)
bool Writer<string_type>::isDtd(const string_type& name)
{
return (name.length() == 5 &&
name[0] == UnicodeT::LEFT_SQUARE_BRACKET &&
@ -321,7 +321,7 @@ bool basic_Writer<string_type>::isDtd(const string_type& name)
} // isDtd
template<class string_type>
void basic_Writer<string_type>::startDTD(const stringT& name, const stringT& publicId, const stringT& systemId)
void Writer<string_type>::startDTD(const stringT& name, const stringT& publicId, const stringT& systemId)
{
inDTD_ = true;
depth_ += indent_;
@ -348,7 +348,7 @@ void basic_Writer<string_type>::startDTD(const stringT& name, const stringT& pub
} // startDTD
template<class string_type>
void basic_Writer<string_type>::endDTD()
void Writer<string_type>::endDTD()
{
*stream_ << UnicodeT::RIGHT_SQUARE_BRACKET
<< UnicodeT::GREATER_THAN_SIGN
@ -361,7 +361,7 @@ void basic_Writer<string_type>::endDTD()
} // endDTD
template<class string_type>
void basic_Writer<string_type>::startEntity(const stringT& name)
void Writer<string_type>::startEntity(const stringT& name)
{
if(isDtd(name))
internalSubset_ = false;
@ -370,7 +370,7 @@ void basic_Writer<string_type>::startEntity(const stringT& name)
} // startEntity
template<class string_type>
void basic_Writer<string_type>::endEntity(const stringT& name)
void Writer<string_type>::endEntity(const stringT& name)
{
if(isDtd(name))
internalSubset_ = true;
@ -379,7 +379,7 @@ void basic_Writer<string_type>::endEntity(const stringT& name)
} // endEntity
template<class string_type>
void basic_Writer<string_type>::startCDATA()
void Writer<string_type>::startCDATA()
{
inCDATA_ = true;
@ -397,7 +397,7 @@ void basic_Writer<string_type>::startCDATA()
} // startCDATA
template<class string_type>
void basic_Writer<string_type>::endCDATA()
void Writer<string_type>::endCDATA()
{
*stream_ << UnicodeT::RIGHT_SQUARE_BRACKET
<< UnicodeT::RIGHT_SQUARE_BRACKET
@ -409,7 +409,7 @@ void basic_Writer<string_type>::endCDATA()
} // endCDATA
template<class string_type>
void basic_Writer<string_type>::comment(const stringT& text)
void Writer<string_type>::comment(const stringT& text)
{
if((!inDTD_) || (inDTD_ && internalSubset_))
*stream_ << UnicodeT::LESS_THAN_SIGN
@ -425,7 +425,7 @@ void basic_Writer<string_type>::comment(const stringT& text)
} // comment
template<class string_type>
void basic_Writer<string_type>::notationDecl(const stringT& name, const stringT& publicId, const stringT& systemId)
void Writer<string_type>::notationDecl(const stringT& name, const stringT& publicId, const stringT& systemId)
{
if(inDTD_ && internalSubset_)
{
@ -454,7 +454,7 @@ void basic_Writer<string_type>::notationDecl(const stringT& name, const stringT&
} // notationDecl
template<class string_type>
void basic_Writer<string_type>::unparsedEntityDecl(const stringT& name, const stringT& publicId, const stringT& systemId, const stringT& notationName)
void Writer<string_type>::unparsedEntityDecl(const stringT& name, const stringT& publicId, const stringT& systemId, const stringT& notationName)
{
if(inDTD_ && internalSubset_)
{
@ -479,7 +479,7 @@ void basic_Writer<string_type>::unparsedEntityDecl(const stringT& name, const st
} // unparsedEntityDecl
template<class string_type>
void basic_Writer<string_type>::elementDecl(const stringT& name, const stringT& model)
void Writer<string_type>::elementDecl(const stringT& name, const stringT& model)
{
if(inDTD_ && internalSubset_)
{
@ -507,7 +507,7 @@ void basic_Writer<string_type>::elementDecl(const stringT& name, const stringT&
} // elementDecl
template<class string_type>
void basic_Writer<string_type>::attributeDecl(const stringT& elementName, const stringT& attributeName,
void Writer<string_type>::attributeDecl(const stringT& elementName, const stringT& attributeName,
const stringT& type, const stringT& valueDefault, const stringT& value)
{
if(inDTD_ && internalSubset_)
@ -548,7 +548,7 @@ void basic_Writer<string_type>::attributeDecl(const stringT& elementName, const
} // attributeDecl
template<class string_type>
void basic_Writer<string_type>::internalEntityDecl(const stringT& name, const stringT& value)
void Writer<string_type>::internalEntityDecl(const stringT& name, const stringT& value)
{
if(inDTD_ && internalSubset_)
{
@ -566,7 +566,7 @@ void basic_Writer<string_type>::internalEntityDecl(const stringT& name, const st
} // internalEntityDecl
template<class string_type>
void basic_Writer<string_type>::externalEntityDecl(const stringT& name, const stringT& publicId, const stringT& systemId)
void Writer<string_type>::externalEntityDecl(const stringT& name, const stringT& publicId, const stringT& systemId)
{
if(inDTD_ && internalSubset_)
{
@ -581,7 +581,7 @@ void basic_Writer<string_type>::externalEntityDecl(const stringT& name, const st
} // externalEntityDecl
template<class string_type>
void basic_Writer<string_type>::startEntityDecl(const stringT& name)
void Writer<string_type>::startEntityDecl(const stringT& name)
{
*stream_ << UnicodeT::LESS_THAN_SIGN
<< UnicodeT::EXCLAMATION_MARK
@ -596,7 +596,7 @@ void basic_Writer<string_type>::startEntityDecl(const stringT& name)
} // startEntityDecl
template<class string_type>
void basic_Writer<string_type>::publicAndSystem(const stringT& publicId, const stringT& systemId)
void Writer<string_type>::publicAndSystem(const stringT& publicId, const stringT& systemId)
{
*stream_ << UnicodeT::SPACE;
@ -628,11 +628,6 @@ void basic_Writer<string_type>::publicAndSystem(const stringT& publicId, const s
} // if ...
} // publicAndSystem
typedef basic_Writer<std::string> Writer;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_Writer<std::wstring> wWriter;
#endif
} // namespace SAX
} // namespace Arabica

View file

@ -12,25 +12,25 @@ namespace SAX
{
template<class string_type, class string_adaptor = Arabica::default_string_adaptor<string_type> >
class XMLBaseTracker : public basic_XMLFilterImpl<string_type>
class XMLBaseTracker : public XMLFilterImpl<string_type>
{
typedef basic_XMLBaseSupport<string_type, string_adaptor> XMLBaseSupportT;
typedef basic_XMLFilterImpl<string_type> XMLFilterT;
typedef XMLBaseSupport<string_type, string_adaptor> XMLBaseSupportT;
typedef XMLFilterImpl<string_type> XMLFilterT;
public:
typedef basic_XMLReader<string_type> XMLReaderT;
typedef basic_Locator<string_type> LocatorT;
typedef basic_Attributes<string_type> AttributesT;
typedef XMLReaderInterface<string_type> XMLReaderT;
typedef Locator<string_type> LocatorT;
typedef Attributes<string_type> AttributesT;
XMLBaseTracker() :
basic_XMLFilterImpl<string_type>(),
XMLFilterImpl<string_type>(),
locator_(0),
base_set_(false)
{
} // XMLBaseTracker
XMLBaseTracker(XMLReaderT& parent) :
basic_XMLFilterImpl<string_type>(parent),
XMLFilterImpl<string_type>(parent),
locator_(0),
base_set_(false)
{

View file

@ -37,12 +37,12 @@ const std::string const types[] = { empty_, "CDATA", "ID", "IDREF", "IDREFS", "N
* Default implementation for AttributeList.
*
* <p>AttributeList implements the deprecated SAX1 {@link
* basic_AttributeList AttributeList} interface, and has been
* replaced by the new SAX2 {@link basic_AttributesImpl
* AttributeList AttributeList} interface, and has been
* replaced by the new SAX2 {@link AttributesImpl
* AttributesImpl} interface.</p>
*
* <p>This class provides a convenience implementation of the SAX
* {@link basic_AttributeList AttributeList} interface. This
* {@link AttributeList AttributeList} interface. This
* implementation is useful both for SAX parser writers, who can use
* it to provide attributes to the application, and for SAX application
* writers, who can use it to create a persistent copy of an element's
@ -67,38 +67,38 @@ const std::string const types[] = { empty_, "CDATA", "ID", "IDREF", "IDREFS", "N
* implementations.</p>
*
* @deprecated This class implements a deprecated interface,
* {@link basic_AttributeList AttributeList};
* {@link AttributeList AttributeList};
* that interface has been replaced by
* {@link basic_Attributes Attributes},
* {@link Attributes Attributes},
* which is implemented in the
* {@link basic_AttributesImpl
* {@link AttributesImpl
* AttributesImpl} helper class.
* @since SAX 1.0
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 2.0
* @see basic_AttributeList
* @see basic_DocumentHandler#startElement
* @see AttributeList
* @see DocumentHandler#startElement
*/
template<class stringT>
class basic_AttributeListImpl : public basic_AttributeList<stringT>
class AttributeListImpl : public AttributeList<stringT>
{
public:
basic_AttributeListImpl() : atts_() { }
basic_AttributeListImpl(const basic_AttributeList& atts)
AttributeListImpl() : atts_() { }
AttributeListImpl(const AttributeList& atts)
: atts_(atts.getLength())
{
setAttributeList(atts);
} // AttributeListImpl
basic_AttributeListImpl& operator=(const basic_AttributeList& atts)
AttributeListImpl& operator=(const AttributeList& atts)
{
setAttributeList(atts);
return *this;
} // operator=
virtual ~basic_AttributeListImpl() { clear(); }
virtual ~AttributeListImpl() { clear(); }
//////////////////////////////////////////////////////////////////////
// Methods specific to this class.
@ -132,7 +132,7 @@ public:
* @param type The attribute type ("NMTOKEN" for an enumeration).
* @param value The attribute value.
* @see #removeAttribute
* @see basic_DocumentHandler#startElement
* @see DocumentHandler#startElement
*/
void addAttribute(const stringT& name, const stringT& type, const stringT& value)
{
@ -170,7 +170,7 @@ public:
* it will make sense to reuse the same AttributeListImpl object
* rather than allocating a new one each time.</p>
*
* @see basic_DocumentHandler#startElement
* @see DocumentHandler#startElement
*/
void clear()
{
@ -188,7 +188,7 @@ public:
* Return the number of attributes in the list.
*
* @return The number of attributes in the list.
* @see basic_AttributeList#getLength
* @see AttributeList#getLength
*/
virtual int getLength() const
{
@ -201,7 +201,7 @@ public:
* @param i The position of the attribute in the list.
* @return The attribute name as a string, or an empty string if there
* is no attribute at that position.
* @see basic_AttributeList#getName(int)
* @see AttributeList#getName(int)
*/
virtual const stringT& getName(int i) const
{
@ -218,7 +218,7 @@ public:
* enumeration, and "CDATA" if no declaration was
* read), or an empty string if there is no attribute at
* that position.
* @see basic_AttributeList#getType(int)
* @see AttributeList#getType(int)
*/
virtual const stringT& getType(int i) const
{
@ -233,7 +233,7 @@ public:
* @param i The position of the attribute in the list.
* @return The attribute value as a string, or an empty string if
* there is no attribute at that position.
* @see basic_AttributeList#getValue(int)
* @see AttributeList#getValue(int)
*/
virtual const stringT& getValue(int i) const
{
@ -249,7 +249,7 @@ public:
* @return The attribute type as a string ("NMTOKEN" for an
* enumeration, and "CDATA" if no declaration was
* read).
* @see basic_AttributeList#getType(java.lang.String)
* @see AttributeList#getType(java.lang.String)
*/
virtual const stringT& getType(const stringT& name) const
{
@ -261,7 +261,7 @@ public:
* Get the value of an attribute (by name).
*
* @param name The attribute name.
* @see basic_AttributeList#getValue(java.lang.String)
* @see AttributeList#getValue(java.lang.String)
*/
virtual const stringT& getValue(const stringT& name) const
{
@ -287,14 +287,9 @@ private:
return res;
} // index
bool operator==(const basic_AttributeList&) const; // not implemented
bool operator==(const AttributeList&) const; // not implemented
}; // class AttributeListImpl
typedef basic_AttributeListImpl<std::string> AttributeListImpl;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_AttributeListImpl<std::wstring> wAttributeListImpl;
#endif
} // namespace SAX
} // namespace Arabica

View file

@ -17,7 +17,7 @@ namespace SAX
* Default implementation of the Attributes interface.
*
* <p>This class provides a default implementation of the SAX2
* {@link basic_Attributes Attributes} interface, with the
* {@link Attributes Attributes} interface, with the
* addition of manipulators so that the list can be modified or
* reused.</p>
*
@ -25,12 +25,12 @@ namespace SAX
*
* <ol>
* <li>to take a persistent snapshot of an Attributes object
* in a {@link basic_ContentHandler#startElement startElement} event; or</li>
* in a {@link ContentHandler#startElement startElement} event; or</li>
* <li>to construct or modify an Attributes object in a SAX2 driver or filter.</li>
* </ol>
*
* <p>This class replaces the now-deprecated SAX1 {@link
* basic_AttributeListImpl AttributeListImpl}
* AttributeListImpl AttributeListImpl}
* class.</p>
*
* @since SAX 2.0
@ -39,19 +39,19 @@ namespace SAX
* @version 2.0
*/
template<class string_type>
class basic_AttributesImpl : public basic_Attributes<string_type>
class AttributesImpl : public Attributes<string_type>
{
public:
typedef string_type stringT;
typedef basic_Attributes<stringT> AttributesT;
typedef Attributes<stringT> AttributesT;
////////////////////////////////////////////////////////////////////
// Constructors.
basic_AttributesImpl() { }
basic_AttributesImpl(const AttributesT& atts)
AttributesImpl() { }
AttributesImpl(const AttributesT& atts)
{
setAttributes(atts);
} // basic_AttributesImpl
} // AttributesImpl
////////////////////////////////////////////////////////////////////
// Implementation of SAX::Attributes.
@ -59,7 +59,7 @@ public:
* Return the number of attributes in the list.
*
* @return The number of attributes in the list.
* @see basic_Attributes#getLength
* @see Attributes#getLength
*/
virtual int getLength() const
{
@ -72,7 +72,7 @@ public:
* @param index The attribute's index (zero-based).
* @return The Namespace URI, the empty string if none is
* available, or if the index is out of range.
* @see basic_Attributes#getURI
* @see Attributes#getURI
*/
virtual stringT getURI(unsigned int index) const
{
@ -87,7 +87,7 @@ public:
* @param index The attribute's index (zero-based).
* @return The attribute's local name, the empty string if
* none is available, or if the index if out of range.
* @see basic_Attributes#getLocalName
* @see Attributes#getLocalName
*/
virtual stringT getLocalName(unsigned int index) const
{
@ -103,7 +103,7 @@ public:
* @param index The attribute's index (zero-based).
* @return The attribute's qualified name, the empty string if
* none is available, or if the index is out of bounds.
* @see basic_Attributes#getQName
* @see Attributes#getQName
*/
virtual stringT getQName(unsigned int index) const
{
@ -119,7 +119,7 @@ public:
* @param index The attribute's index (zero-based).
* @return The attribute's type, "CDATA" if the type is unknown, or an empty
* string if the index is out of bounds.
* @see basic_Attributes#getType(int)
* @see Attributes#getType(int)
*/
virtual stringT getType(unsigned int index) const
{
@ -134,7 +134,7 @@ public:
*
* @param index The attribute's index (zero-based).
* @return The attribute's value or an empty string if the index is out of bounds.
* @see basic_Attributes#getValue(int)
* @see Attributes#getValue(int)
*/
virtual stringT getValue(unsigned int index) const
{
@ -155,7 +155,7 @@ public:
* string if none is available.
* @param localName The attribute's local name.
* @return The attribute's index, or -1 if none matches.
* @see basic_Attributes#getIndex(const stringT&,const stringT&)
* @see Attributes#getIndex(const stringT&,const stringT&)
*/
virtual int getIndex(const stringT& uri, const stringT& localName) const
{
@ -170,7 +170,7 @@ public:
*
* @param qName The qualified name.
* @return The attribute's index, or -1 if none matches.
* @see basic_Attributes#getIndex(const stringT&)
* @see Attributes#getIndex(const stringT&)
*/
virtual int getIndex(const stringT& qName) const
{
@ -191,7 +191,7 @@ public:
* @param localName The local name.
* @return The attribute's type, or an empty string if there is no
* matching attribute.
* @see basic_Attributes#getType(const stringT&,const stringT&)
* @see Attributes#getType(const stringT&,const stringT&)
*/
virtual stringT getType(const stringT& uri, const stringT& localName) const
{
@ -207,7 +207,7 @@ public:
* @param qName The qualified name.
* @return The attribute's type, or an empty string if there is no
* matching attribute.
* @see basic_Attributes#getType(const stringT&)
* @see Attributes#getType(const stringT&)
*/
virtual stringT getType(const stringT& qName) const
{
@ -228,7 +228,7 @@ public:
* @param localName The local name.
* @return The attribute's value, or an empty string if there is no
* matching attribute.
* @see basic_Attributes#getValue(const stringT&,const stringT&)
* @see Attributes#getValue(const stringT&,const stringT&)
*/
virtual stringT getValue(const stringT& uri, const stringT& localName) const
{
@ -244,7 +244,7 @@ public:
* @param qName The qualified name.
* @return The attribute's value, or an empty string if there is no
* matching attribute.
* @see basic_Attributes#getValue(const stringT&)
* @see Attributes#getValue(const stringT&)
*/
virtual stringT getValue(const stringT& qName) const
{
@ -556,11 +556,6 @@ private:
stringT emptyString_;
}; // class AttributesImpl
typedef basic_AttributesImpl<std::string> AttributesImpl;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_AttributesImpl<std::wstring> wAttributesImpl;
#endif
} // namespace SAX
} // namespace Arabica

View file

@ -12,10 +12,10 @@ namespace Arabica
namespace SAX
{
template<class string_type>
class CatchErrorHandler : public SAX::basic_ErrorHandler<string_type>
class CatchErrorHandler : public SAX::ErrorHandler<string_type>
{
public:
typedef SAX::basic_SAXParseException<string_type> SAXParseExceptionT;
typedef SAX::SAXParseException<string_type> SAXParseExceptionT;
CatchErrorHandler() : errors_() { }
virtual ~CatchErrorHandler() { }

View file

@ -29,9 +29,9 @@ namespace SAX
* callbacks in the four core SAX2 handler classes:</p>
*
* <ul>
* <li>{@link basic_EntityResolver EntityResolver}</li>
* <li>{@link basic_DTDHandler DTDHandler}</li>
* <li>{@link basic_ContentHandler ContentHandler}</li>
* <li>{@link EntityResolver EntityResolver}</li>
* <li>{@link DTDHandler DTDHandler}</li>
* <li>{@link ContentHandler ContentHandler}</li>
* <li>{@link ErrorHandler ErrorHandler}</li>
* </ul>
*
@ -41,34 +41,34 @@ namespace SAX
* application has not supplied its own.</p>
*
* <p>This class replaces the deprecated SAX1
* {@link basic_HandlerBase HandlerBase} class.</p>
* {@link HandlerBase HandlerBase} class.</p>
*
* @since SAX 2.0
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 2.0
* @see basic_EntityResolver
* @see basic_DTDHandler
* @see basic_ContentHandler
* @see basic_ErrorHandler
* @see EntityResolver
* @see DTDHandler
* @see ContentHandler
* @see ErrorHandler
*/
template<class string_type>
class basic_DefaultHandler : public basic_EntityResolver<string_type>,
public basic_DTDHandler<string_type>,
public basic_ContentHandler<string_type>,
public basic_ErrorHandler<string_type>,
public basic_LexicalHandler<string_type>,
public basic_DeclHandler<string_type>
class DefaultHandler : public EntityResolver<string_type>,
public DTDHandler<string_type>,
public ContentHandler<string_type>,
public ErrorHandler<string_type>,
public LexicalHandler<string_type>,
public DeclHandler<string_type>
{
public:
typedef string_type stringT;
typedef basic_InputSource<stringT> InputSourceT;
typedef basic_Locator<stringT> LocatorT;
typedef basic_Attributes<stringT> AttributesT;
typedef basic_SAXParseException<stringT> SAXParseExceptionT;
typedef InputSource<stringT> InputSourceT;
typedef Locator<stringT> LocatorT;
typedef Attributes<stringT> AttributesT;
typedef SAXParseException<stringT> SAXParseExceptionT;
basic_DefaultHandler() { }
virtual ~basic_DefaultHandler() { }
DefaultHandler() { }
virtual ~DefaultHandler() { }
//////////////////////////////////////////////
// EntityResolver
@ -88,7 +88,7 @@ public:
* @return The new input source, (empty to require the
* default behaviour).
* @exception SAXException Any SAX exception.
* @see basic_EntityResolver#resolveEntity
* @see EntityResolver#resolveEntity
*/
virtual InputSourceT resolveEntity(const stringT& /* publicId */, const stringT& /* systemId */)
{
@ -110,7 +110,7 @@ public:
* @param systemId The notation system identifier.
* @exception SAXException Any SAX exception, possibly
* wrapping another exception.
* @see basic_DTDHandler#notationDecl
* @see DTDHandler#notationDecl
*/
virtual void notationDecl(const stringT& /* name */,
const stringT& /* publicId */,
@ -132,7 +132,7 @@ public:
* @param notationName The name of the associated notation.
* @exception SAXException Any SAX exception, possibly
* wrapping another exception.
* @see basic_DTDHandler#unparsedEntityDecl
* @see DTDHandler#unparsedEntityDecl
*/
virtual void unparsedEntityDecl(const stringT& /* name */,
const stringT& /* publicId */,
@ -151,8 +151,8 @@ public:
* with other document events.</p>
*
* @param locator A locator for all SAX document events.
* @see basic_ContentHandler#setDocumentLocator
* @see basic_Locator
* @see ContentHandler#setDocumentLocator
* @see Locator
*/
virtual void setDocumentLocator(const LocatorT& /* locator */) { }
@ -166,7 +166,7 @@ public:
*
* @exception SAXException Any SAX exception, possibly
* wrapping another exception.
* @see basic_ContentHandler#startDocument
* @see ContentHandler#startDocument
*/
virtual void startDocument() { }
/**
@ -179,7 +179,7 @@ public:
*
* @exception SAXException Any SAX exception, possibly
* wrapping another exception.
* @see basic_ContentHandler#endDocument
* @see ContentHandler#endDocument
*/
virtual void endDocument() { }
@ -194,7 +194,7 @@ public:
* @param uri The Namespace URI mapped to the prefix.
* @exception SAXException Any SAX exception, possibly
* wrapping another exception.
* @see basic_ContentHandler#startPrefixMapping
* @see ContentHandler#startPrefixMapping
*/
virtual void startPrefixMapping(const stringT& /* prefix */, const stringT& /* uri */) { }
/**
@ -207,7 +207,7 @@ public:
* @param prefix The Namespace prefix being declared.
* @exception SAXException Any SAX exception, possibly
* wrapping another exception.
* @see basic_ContentHandler#endPrefixMapping
* @see ContentHandler#endPrefixMapping
*/
virtual void endPrefixMapping(const stringT& /* prefix */) { }
@ -230,7 +230,7 @@ public:
* attributes, it shall be an empty Attributes object.
* @exception SAXException Any SAX exception, possibly
* wrapping another exception.
* @see basic_ContentHandler#startElement
* @see ContentHandler#startElement
*/
virtual void startElement(const stringT& /* namespaceURI */, const stringT& /* localName */,
const stringT& /* qName */, const AttributesT& /* atts */) { }
@ -251,7 +251,7 @@ public:
* qualified names are not available.
* @exception SAXException Any SAX exception, possibly
* wrapping another exception.
* @see basic_ContentHandler#endElement
* @see ContentHandler#endElement
*/
virtual void endElement(const stringT& /* namespaceURI */, const stringT& /* localName */,
const stringT& /* qName */) { }
@ -267,7 +267,7 @@ public:
* @param ch The characters.
* @exception SAXException Any SAX exception, possibly
* wrapping another exception.
* @see basic_ContentHandler#characters
* @see ContentHandler#characters
*/
virtual void characters(const stringT& /* ch */) { }
/**
@ -281,7 +281,7 @@ public:
* @param ch The whitespace characters.
* @exception SAXException Any SAX exception, possibly
* wrapping another exception.
* @see basic_ContentHandler#ignorableWhitespace
* @see ContentHandler#ignorableWhitespace
*/
virtual void ignorableWhitespace(const stringT& /* ch */) { }
@ -298,7 +298,7 @@ public:
* none is supplied.
* @exception SAXException Any SAX exception, possibly
* wrapping another exception.
* @see basic_ContentHandler#processingInstruction
* @see ContentHandler#processingInstruction
*/
virtual void processingInstruction(const stringT& /* target */, const stringT& /* data */) { }
@ -313,7 +313,7 @@ public:
* @param name The name of the skipped entity.
* @exception SAXException Any SAX exception, possibly
* wrapping another exception.
* @see basic_ContentHandler#processingInstruction
* @see ContentHandler#processingInstruction
*/
virtual void skippedEntity(const stringT& /* name */) { }
@ -330,7 +330,7 @@ public:
* @param e The warning information encoded as an exception.
* @exception SAXException Any SAX exception, possibly
* wrapping another exception.
* @see basic_ErrorHandler#warning
* @see ErrorHandler#warning
* @see SAXParseException
*/
virtual void warning(const SAXParseExceptionT& /* e */) { }
@ -345,7 +345,7 @@ public:
* @param e The warning information encoded as an exception.
* @exception SAXException Any SAX exception, possibly
* wrapping another exception.
* @see basic_ErrorHandler#error
* @see ErrorHandler#error
* @see SAXParseException
*/
virtual void error(const SAXParseExceptionT& /* e */) { }
@ -363,7 +363,7 @@ public:
* @param e The error information encoded as an exception.
* @exception SAXException Any SAX exception, possibly
* wrapping another exception.
* @see basic_ErrorHandler#fatalError
* @see ErrorHandler#fatalError
* @see SAXParseException
*/
virtual void fatalError(const SAXParseExceptionT& e)
@ -384,8 +384,8 @@ public:
* this method will not be invoked.</p>
*
* <p>All declarations reported through
* {@link basic_DTDHandler DTDHandler} or
* {@link basic_DeclHandler DeclHandler} events must appear
* {@link DTDHandler DTDHandler} or
* {@link DeclHandler DeclHandler} events must appear
* between the startDTD and {@link #endDTD endDTD} events.
* Declarations are assumed to belong to the internal DTD subset
* unless they appear between {@link #startEntity startEntity}
@ -399,7 +399,7 @@ public:
* <p>Note that the start/endDTD events will appear within
* the start/endDocument events from ContentHandler and
* before the first
* {@link basic_ContentHandler#startElement startElement}
* {@link ContentHandler#startElement startElement}
* event.</p>
*
* @param name The document type name.
@ -442,11 +442,11 @@ public:
* <p>When a SAX2 driver is providing these events, all other
* events must be properly nested within start/end entity
* events. There is no additional requirement that events from
* {@link basic_DeclHandler DeclHandler} or
* {@link basic_DTDHandler DTDHandler} be properly ordered.</p>
* {@link DeclHandler DeclHandler} or
* {@link DTDHandler DTDHandler} be properly ordered.</p>
*
* <p>Note that skipped entities will be reported through the
* {@link basic_ContentHandler#skippedEntity skippedEntity}
* {@link ContentHandler#skippedEntity skippedEntity}
* event, which is part of the ContentHandler interface.</p>
*
* <p>Because of the streaming event model that SAX uses, some
@ -470,8 +470,8 @@ public:
* entity, the name will begin with '%', and if it is the
* external DTD subset, it will be "[dtd]".
* @see #endEntity
* @see basic_DeclHandler#internalEntityDecl
* @see basic_DeclHandler#externalEntityDecl
* @see DeclHandler#internalEntityDecl
* @see DeclHandler#externalEntityDecl
*/
virtual void startEntity(const stringT& name) { }
/**
@ -486,7 +486,7 @@ public:
* Report the start of a CDATA section.
*
* <p>The contents of the CDATA section will be reported through
* the regular {@link basic_ContentHandler#characters
* the regular {@link ContentHandler#characters
* characters} event; this event is intended only to report
* the boundary.</p>
*
@ -570,7 +570,7 @@ public:
* entity, the name will begin with '%'.
* @param value The replacement text of the entity.
* @see #externalEntityDecl
* @see basic_DTDHandler#unparsedEntityDecl
* @see DTDHandler#unparsedEntityDecl
*/
virtual void internalEntityDecl(const stringT& name, const stringT& value) { }
/**
@ -585,21 +585,16 @@ public:
* an empty string if none was declared.
* @param systemId The declared system identifier of the entity.
* @see #internalEntityDecl
* @see basic_DTDHandler#unparsedEntityDecl
* @see DTDHandler#unparsedEntityDecl
*/
virtual void externalEntityDecl(const stringT& name,
const stringT& publicId,
const stringT& systemId) { }
private:
basic_DefaultHandler(const basic_DefaultHandler&);
basic_DefaultHandler& operator=(const basic_DefaultHandler&);
bool operator==(const basic_DefaultHandler&);
}; // class basic_DefaultHandler
typedef basic_DefaultHandler<std::string> DefaultHandler;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_DefaultHandler<std::wstring> wDefaultHandler;
#endif
DefaultHandler(const DefaultHandler&);
DefaultHandler& operator=(const DefaultHandler&);
bool operator==(const DefaultHandler&);
}; // class DefaultHandler
} // namespace SAX
} // namespace Arabica

View file

@ -14,10 +14,10 @@ namespace SAX
class InputSourceResolver
{
public:
InputSourceResolver(const SAX::InputSource& inputSource);
InputSourceResolver(const SAX::InputSource<std::string>& inputSource);
template<class stringT, class stringAdaptorT>
InputSourceResolver(const SAX::basic_InputSource<stringT>& inputSource,
InputSourceResolver(const SAX::InputSource<stringT>& inputSource,
const stringAdaptorT& SA) :
deleteStream_(false),
byteStream_(0)

View file

@ -46,34 +46,34 @@ namespace SAX
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 2.0
* @see basic_Locator Locator
* @see Locator Locator
*/
template<class string_type>
class basic_LocatorImpl : public basic_Locator<string_type>
class LocatorImpl : public Locator<string_type>
{
public:
typedef string_type stringT;
typedef basic_Locator<stringT> LocatorT;
typedef Locator<stringT> LocatorT;
basic_LocatorImpl() :
LocatorImpl() :
publicId_(),
systemId_(),
lineNumber_(-1),
columnNumber_(-1)
{
} // basic_LocatorImpl
} // LocatorImpl
basic_LocatorImpl(const LocatorT& rhs) :
LocatorImpl(const LocatorT& rhs) :
publicId_(rhs.getPublicId()),
systemId_(rhs.getSystemId()),
lineNumber_(rhs.getLineNumber()),
columnNumber_(rhs.getColumnNumber())
{
} // basic_LocatorImpl
} // LocatorImpl
virtual ~basic_LocatorImpl() { }
virtual ~LocatorImpl() { }
basic_LocatorImpl& operator=(const LocatorT& rhs)
LocatorImpl& operator=(const LocatorT& rhs)
{
publicId_ = rhs.getPublicId();
systemId_ = rhs.getSystemId();
@ -88,7 +88,7 @@ public:
*
* @return The public identifier as a string, or an empty string if none
* is available.
* @see basic_Locator#getPublicId
* @see Locator#getPublicId
* @see #setPublicId
*/
virtual stringT getPublicId() const { return publicId_; }
@ -97,7 +97,7 @@ public:
*
* @return The system identifier as a string, or an empty string if none
* is available.
* @see basic_Locator#getSystemId
* @see Locator#getSystemId
* @see #setSystemId
*/
virtual stringT getSystemId() const { return systemId_; }
@ -105,7 +105,7 @@ public:
* Return the saved line number (1-based).
*
* @return The line number as an integer, or -1 if none is available.
* @see basic_Locator#getLineNumber
* @see Locator#getLineNumber
* @see #setLineNumber
*/
virtual int getLineNumber() const { return lineNumber_; }
@ -113,7 +113,7 @@ public:
* Return the saved column number (1-based).
*
* @return The column number as an integer, or -1 if none is available.
* @see basic_Locator#getColumnNumber
* @see Locator#getColumnNumber
* @see #setColumnNumber
*/
virtual int getColumnNumber() const { return columnNumber_; }
@ -162,11 +162,6 @@ private:
bool operator==(const LocatorT& rhs) const;
}; // class LocatorImpl
typedef basic_LocatorImpl<std::string> LocatorImpl;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_LocatorImpl<std::wstring> wLocatorImpl;
#endif
} // namespace SAX
} // namespace Arabica

View file

@ -84,7 +84,7 @@ struct NamespaceConstants
* @version 2.0
*/
template<class stringT, class string_adaptorT>
class basic_NamespaceSupport
class NamespaceSupport
{
public:
typedef std::vector<stringT> stringListT;
@ -98,10 +98,10 @@ class basic_NamespaceSupport
}; // struct Parts
// functions
basic_NamespaceSupport()
NamespaceSupport()
{
reset();
} // basic_NamespaceSupport
} // NamespaceSupport
/**
* Reset this Namespace support object for reuse.
@ -394,10 +394,10 @@ class basic_NamespaceSupport
const NamespaceConstants<stringT, string_adaptorT> nsc_;
// no impl
basic_NamespaceSupport(const basic_NamespaceSupport&);
basic_NamespaceSupport& operator=(const basic_NamespaceSupport&);
bool operator==(const basic_NamespaceSupport&) const;
}; // class basic_NamespaceSupport
NamespaceSupport(const NamespaceSupport&);
NamespaceSupport& operator=(const NamespaceSupport&);
bool operator==(const NamespaceSupport&) const;
}; // class NamespaceSupport
} // namespace SAX
} // namespace Arabica

View file

@ -25,10 +25,10 @@ namespace SAX
/**
* Adapt a SAX1 Parser as a SAX2 XMLReader.
*
* <p>This class wraps a SAX1 {@link basic_Parser Parser}
* and makes it act as a SAX2 {@link basic_XMLReader XMLReader},
* <p>This class wraps a SAX1 {@link Parser Parser}
* and makes it act as a SAX2 {@link XMLReader XMLReader},
* with feature, property, and Namespace support. Note
* that it is not possible to report {@link basic_ContentHandler#skippedEntity
* that it is not possible to report {@link ContentHandler#skippedEntity
* skippedEntity} events, since SAX1 does not make that information available.</p>
*
* <p>This adapter does not test for duplicate Namespace-qualified
@ -38,27 +38,27 @@ namespace SAX
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 2.0
* @see basic_XMLReader
* @see basic_Parser
* @see XMLReader
* @see Parser
*/
template<class string_type, class string_adaptor_type>
class basic_ParserAdaptor : public basic_XMLReader<string_type>,
public basic_DocumentHandler<string_type>
class ParserAdaptor : public XMLReaderInterface<string_type>,
public DocumentHandler<string_type>
{
public:
typedef string_type stringT;
typedef string_adaptor_type string_adaptorT;
typedef basic_Parser<stringT> ParserT;
typedef basic_EntityResolver<stringT> EntityResolverT;
typedef basic_DTDHandler<stringT> DTDHandlerT;
typedef basic_DocumentHandler<stringT> DocumentHandlerT;
typedef basic_ContentHandler<stringT> ContentHandlerT;
typedef basic_InputSource<stringT> InputSourceT;
typedef basic_Locator<stringT> LocatorT;
typedef basic_SAXParseException<stringT> SAXParseExceptionT;
typedef basic_AttributeList<stringT> AttributeListT;
typedef Parser<stringT> ParserT;
typedef EntityResolver<stringT> EntityResolverT;
typedef DTDHandler<stringT> DTDHandlerT;
typedef DocumentHandler<stringT> DocumentHandlerT;
typedef ContentHandler<stringT> ContentHandlerT;
typedef InputSource<stringT> InputSourceT;
typedef Locator<stringT> LocatorT;
typedef SAXParseException<stringT> SAXParseExceptionT;
typedef AttributeList<stringT> AttributeListT;
basic_ParserAdaptor(ParserT& parser) :
ParserAdaptor(ParserT& parser) :
parser_(parser),
parsing_(false),
locator_(0),
@ -85,7 +85,7 @@ public:
* name is not known.
* @exception SAXNotSupportedException If the feature
* state is not supported.
* @see basic_XMLReader#setFeature
* @see XMLReader#setFeature
*/
virtual void setFeature(const stringT& name, bool value)
{
@ -127,7 +127,7 @@ public:
* name is not known.
* @exception SAXNotSupportedException If querying the
* feature state is not supported.
* @see basic_XMLReader#setFeature
* @see XMLReader#setFeature
*/
virtual bool getFeature(const stringT& name) const
{
@ -167,14 +167,14 @@ public:
* Set the entity resolver.
*
* @param resolver The new entity resolver.
* @see basic_XMLReader#setEntityResolver
* @see XMLReader#setEntityResolver
*/
virtual void setEntityResolver(EntityResolverT& resolver) { entityResolver_ = &resolver; }
/**
* Return the current entity resolver.
*
* @return The current entity resolver, or null if none was supplied.
* @see basic_XMLReader#getEntityResolver
* @see XMLReader#getEntityResolver
*/
virtual EntityResolverT* getEntityResolver() const { return entityResolver_; }
@ -182,14 +182,14 @@ public:
* Set the DTD handler.
*
* @param handler The new DTD handler.
* @see basic_XMLReader#setEntityResolver
* @see XMLReader#setEntityResolver
*/
virtual void setDTDHandler(DTDHandlerT& handler) { dtdHandler_ = &handler; }
/**
* Return the current DTD handler.
*
* @return The current DTD handler, or null if none was supplied.
* @see basic_XMLReader#getEntityResolver
* @see XMLReader#getEntityResolver
*/
virtual DTDHandlerT* getDTDHandler() const { return dtdHandler_; }
@ -197,14 +197,14 @@ public:
* Set the content handler.
*
* @param handler The new content handler.
* @see basic_XMLReader#setEntityResolver
* @see XMLReader#setEntityResolver
*/
virtual void setContentHandler(ContentHandlerT& handler) { contentHandler_ = &handler; }
/**
* Return the current content handler.
*
* @return The current content handler, or null if none was supplied.
* @see basic_XMLReader#getEntityResolver
* @see XMLReader#getEntityResolver
*/
virtual ContentHandlerT* getContentHandler() const { return contentHandler_; }
@ -212,14 +212,14 @@ public:
* Set the error handler.
*
* @param handler The new error handler.
* @see basic_XMLReader#setEntityResolver
* @see XMLReader#setEntityResolver
*/
virtual void setErrorHandler(ErrorHandler& handler) { errorHandler_ = &handler; }
/**
* Return the current error handler.
*
* @return The current error handler, or null if none was supplied.
* @see basic_XMLReader#getEntityResolver
* @see XMLReader#getEntityResolver
*/
virtual ErrorHandler* getErrorHandler() const { return errorHandler_; }
@ -227,7 +227,7 @@ public:
* Parse an XML document.
*
* @param input An input source for the document.
* @see basic_Parser#parse(InputSource&)
* @see Parser#parse(InputSource&)
*/
virtual void parse(InputSourceT& input)
{
@ -253,7 +253,7 @@ public:
* Adapt a SAX1 document locator event.
*
* @param locator A document locator.
* @see basic_ContentHandler#setDocumentLocator
* @see ContentHandler#setDocumentLocator
*/
virtual void setDocumentLocator(const LocatorT& locator)
{
@ -265,7 +265,7 @@ public:
/**
* Adapt a SAX1 start document event.
*
* @see basic_DocumentHandler#startDocument
* @see DocumentHandler#startDocument
*/
virtual void startDocument()
{
@ -276,7 +276,7 @@ public:
/**
* Adapt a SAX1 end document event.
*
* @see basic_DocumentHandler#endDocument
* @see DocumentHandler#endDocument
*/
virtual void endDocument()
{
@ -369,7 +369,7 @@ public:
* Adapt a SAX1 end element event.
*
* @param qName The qualified (prefixed) name.
* @see basic_DocumentHandler#endElement
* @see DocumentHandler#endElement
*/
void endElement(const stringT& qName)
{
@ -395,7 +395,7 @@ public:
* Adapt a SAX1 characters event.
*
* @param ch The characters.
* @see basic_DocumentHandler#characters
* @see DocumentHandler#characters
*/
virtual void characters(const stringT& ch)
{
@ -407,7 +407,7 @@ public:
* Adapt a SAX1 ignorable whitespace event.
*
* @param ch Thecharacters.
* @see basic_DocumentHandler#ignorableWhitespace
* @see DocumentHandler#ignorableWhitespace
*/
virtual void ignorableWhitespace(const stringT& ch)
{
@ -420,7 +420,7 @@ public:
*
* @param target The processing instruction target.
* @param data The remainder of the processing instruction
* @see basic_DocumentHandler#processingInstruction
* @see DocumentHandler#processingInstruction
*/
virtual void processingInstruction(const stringT& target, const stringT& data)
{
@ -429,8 +429,8 @@ public:
} // processingInstruction
private:
typedef basic_NamespaceSupport<stringT, string_adaptorT> NamespaceSupportT;
typedef basic_AttributesImpl<stringT> AttributesImplT;
typedef NamespaceSupport<stringT, string_adaptorT> NamespaceSupportT;
typedef AttributesImpl<stringT> AttributesImplT;
void setupParser()
{
@ -477,11 +477,11 @@ private:
} // makeString
// This wrapper is used only when Namespace support is disabled.
class AttributesListAdaptor : public basic_Attributes<stringT>
class AttributesListAdaptor : public Attributes<stringT>
{
public:
typedef typename basic_ParserAdaptor<stringT, string_adaptorT> ParserAdaptorT;
typedef typename basic_AttributeList<stringT> AttributeListT;
typedef typename ParserAdaptor<stringT, string_adaptorT> ParserAdaptorT;
typedef typename AttributeList<stringT> AttributeListT;
void setAttributeList(const AttributeListT& attList)
{
@ -538,17 +538,12 @@ public:
const stringT NULL_STRING;
private:
basic_ParserAdaptor();
basic_ParserAdaptor(const basic_ParserAdaptor&);
basic_ParserAdaptor& operator=(const basic_ParserAdaptor&);
bool operator==(const basic_ParserAdaptor&);
ParserAdaptor();
ParserAdaptor(const ParserAdaptor&);
ParserAdaptor& operator=(const ParserAdaptor&);
bool operator==(const ParserAdaptor&);
}; // ParserAdaptor
typedef basic_ParserAdaptor<std::string, char> ParserAdaptor;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_ParserAdaptor<std::wstring, wchar_t> wParserAdaptor;
#endif
} // namespace SAX
} // namespace Arabica

View file

@ -48,15 +48,15 @@ struct XMLBaseConstants
}; // struct XMLBaseConstants
template<class string_type, class string_adaptor_type = Arabica::default_string_adaptor<string_type> >
class basic_XMLBaseSupport
class XMLBaseSupport
{
public:
typedef string_type stringT;
typedef string_adaptor_type string_adaptorT;
typedef typename string_adaptor_type::value_type valueT;
typedef basic_Attributes<stringT> AttributesT;
typedef Attributes<stringT> AttributesT;
basic_XMLBaseSupport() :
XMLBaseSupport() :
depth_(0) { }
void setDocumentLocation(const stringT& loc)
@ -118,15 +118,10 @@ private:
const XMLBaseConstants<stringT, string_adaptorT> xbc_;
// no impl
basic_XMLBaseSupport(const basic_XMLBaseSupport&);
basic_XMLBaseSupport& operator=(const basic_XMLBaseSupport&);
bool operator==(const basic_XMLBaseSupport&);
}; // class basic_XMLBaseSupport
typedef basic_XMLBaseSupport<std::string> XMLBaseSupport;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_XMLBaseSupport<std::wstring> wXMLBaseSupport;
#endif
XMLBaseSupport(const XMLBaseSupport&);
XMLBaseSupport& operator=(const XMLBaseSupport&);
bool operator==(const XMLBaseSupport&);
}; // class XMLBaseSupport
} // namespace SAX
} // namespace Arabica

View file

@ -18,7 +18,7 @@ namespace SAX
/**
* Base class for deriving an XML filter.
*
* <p>This class is designed to sit between an {@link basic_XMLReader
* <p>This class is designed to sit between an {@link XMLReader
* XMLReader} and the client application's event handlers. By default, it
* does nothing but pass requests up to the reader and events
* on to the handlers unmodified, but subclasses can override
@ -29,56 +29,56 @@ namespace SAX
* @author Jez Higgins,
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version 2.0
* @see basic_XMLFilter
* @see basic_XMLReader
* @see basic_EntityResolver
* @see basic_DTDHandler
* @see basic_ContentHandler
* @see basic_ErrorHandler
* @see XMLFilter
* @see XMLReader
* @see EntityResolver
* @see DTDHandler
* @see ContentHandler
* @see ErrorHandler
*/
template<class string_type, class string_adaptor_type = Arabica::default_string_adaptor<string_type> >
class basic_XMLFilterImpl : public basic_XMLFilter<string_type>,
public basic_EntityResolver<string_type>,
public basic_DTDHandler<string_type>,
public basic_ContentHandler<string_type>,
public basic_ErrorHandler<string_type>,
public basic_DeclHandler<string_type>,
public basic_LexicalHandler<string_type>
class XMLFilterImpl : public XMLFilter<string_type>,
public EntityResolver<string_type>,
public DTDHandler<string_type>,
public ContentHandler<string_type>,
public ErrorHandler<string_type>,
public DeclHandler<string_type>,
public LexicalHandler<string_type>
{
public:
typedef string_type stringT;
typedef string_adaptor_type string_adaptorT;
typedef basic_XMLReader<stringT> XMLReaderT;
typedef basic_EntityResolver<stringT> EntityResolverT;
typedef basic_DTDHandler<stringT> DTDHandlerT;
typedef basic_ContentHandler<stringT> ContentHandlerT;
typedef basic_InputSource<stringT> InputSourceT;
typedef basic_Locator<stringT> LocatorT;
typedef basic_ErrorHandler<stringT> ErrorHandlerT;
typedef basic_DeclHandler<stringT> DeclHandlerT;
typedef basic_LexicalHandler<stringT> LexicalHandlerT;
typedef typename basic_ErrorHandler<stringT>::SAXParseExceptionT SAXParseExceptionT;
typedef XMLReaderInterface<stringT> XMLReaderT;
typedef EntityResolver<stringT> EntityResolverT;
typedef DTDHandler<stringT> DTDHandlerT;
typedef ContentHandler<stringT> ContentHandlerT;
typedef InputSource<stringT> InputSourceT;
typedef Locator<stringT> LocatorT;
typedef ErrorHandler<stringT> ErrorHandlerT;
typedef DeclHandler<stringT> DeclHandlerT;
typedef LexicalHandler<stringT> LexicalHandlerT;
typedef typename ErrorHandler<stringT>::SAXParseExceptionT SAXParseExceptionT;
basic_XMLFilterImpl() :
XMLFilterImpl() :
parent_(0)
{
setDefaults();
} // basic_XMLFilterImpl
basic_XMLFilterImpl(XMLReaderT& parent) :
} // XMLFilterImpl
XMLFilterImpl(XMLReaderT& parent) :
parent_(&parent)
{
setDefaults();
} // basic_XMLFilterImpl
} // XMLFilterImpl
virtual ~basic_XMLFilterImpl() { }
virtual ~XMLFilterImpl() { }
/////////////////////////////////////////////////
// XMLFilter implementation
/**
* Set the parent reader.
*
* <p>This is the {@link basic_XMLReader XMLReader} from which
* <p>This is the {@link XMLReader XMLReader} from which
* this filter will obtain its events and to which it will pass its
* configuration requests. The parent may itself be another filter.</p>
*
@ -111,7 +111,7 @@ public:
* @exception SAXNotSupportedException When the
* XMLReader recognizes the feature name but
* cannot set the requested value.
* @see basic_XMLReader#setFeature
* @see XMLReader#setFeature
*/
virtual void setFeature(const stringT& name, bool value)
{
@ -136,7 +136,7 @@ public:
* @exception SAXNotSupportedException When the
* XMLReader recognizes the feature name but
* cannot determine its state at this time.
* @see basic_XMLReader#getFeature
* @see XMLReader#getFeature
*/
virtual bool getFeature(const stringT& name) const
{
@ -154,56 +154,56 @@ public:
* Set the entity resolver.
*
* @param resolver The new entity resolver.
* @see basic_XMLReader#setEntityResolver
* @see XMLReader#setEntityResolver
*/
virtual void setEntityResolver(EntityResolverT& resolver) { entityResolver_ = &resolver; }
/**
* Get the current entity resolver.
*
* @return The current entity resolver, or null if none was set.
* @see basic_XMLReader#getEntityResolver
* @see XMLReader#getEntityResolver
*/
virtual EntityResolverT* getEntityResolver() const { return entityResolver_ ; }
/**
* Set the DTD event handler.
*
* @param handler The new DTD handler.
* @see basic_XMLReader#setDTDHandler
* @see XMLReader#setDTDHandler
*/
virtual void setDTDHandler(DTDHandlerT& handler) { dtdHandler_ = &handler; }
/**
* Get the current DTD event handler.
*
* @return The current DTD handler, or null if none was set.
* @see basic_XMLReader#getDTDHandler
* @see XMLReader#getDTDHandler
*/
virtual DTDHandlerT* getDTDHandler() const { return dtdHandler_; }
/**
* Set the content event handler.
*
* @param handler The new content handler.
* @see basic_XMLReader#setContentHandler
* @see XMLReader#setContentHandler
*/
virtual void setContentHandler(ContentHandlerT& handler) { contentHandler_ = &handler; }
/**
* Get the content event handler.
*
* @return The current content handler, or null if none was set.
* @see basic_XMLReader#getContentHandler
* @see XMLReader#getContentHandler
*/
virtual ContentHandlerT* getContentHandler() const { return contentHandler_; }
/**
* Set the error event handler.
*
* @param handler The new error handler.
* @see basic_XMLReader#setErrorHandler
* @see XMLReader#setErrorHandler
*/
virtual void setErrorHandler(ErrorHandlerT& handler) { errorHandler_ = &handler; }
/**
* Get the current error event handler.
*
* @return The current error handler, or null if none was set.
* @see basic_XMLReader#getErrorHandler
* @see XMLReader#getErrorHandler
*/
virtual ErrorHandlerT* getErrorHandler() const { return errorHandler_; }
@ -216,7 +216,7 @@ public:
* Parse a document.
*
* @param input The input source for the document entity.
* @see basic_XMLReader#parse(basic_InputSource)
* @see XMLReader#parse(InputSource)
*/
virtual void parse(InputSourceT& input)
{
@ -257,7 +257,7 @@ public:
* @param systemId The entity's system identifier.
* @return A new InputSource or a default-constructed
* <code>InputSourceT</code> for the default.
* @see basic_EntityResolver#resolveEntity
* @see EntityResolver#resolveEntity
*/
virtual InputSourceT resolveEntity(const stringT& publicId, const stringT& systemId)
{
@ -274,7 +274,7 @@ public:
* @param name The notation name.
* @param publicId The notation's public identifier, or an empty string.
* @param systemId The notation's system identifier, or an empty string.
* @see basic_DTDHandler#notationDecl
* @see DTDHandler#notationDecl
*/
virtual void notationDecl(const stringT& name,
const stringT& publicId,
@ -290,7 +290,7 @@ public:
* @param publicId The entity's public identifier, or an empty string.
* @param systemId The entity's system identifier, or an empty string.
* @param notationName The name of the associated notation.
* @see basic_DTDHandler#unparsedEntityDecl
* @see DTDHandler#unparsedEntityDecl
*/
virtual void unparsedEntityDecl(const stringT& name,
const stringT& publicId,
@ -306,7 +306,7 @@ public:
* Filter a new document locator event.
*
* @param locator The document locator.
* @see basic_ContentHandler#setDocumentLocator
* @see ContentHandler#setDocumentLocator
*/
virtual void setDocumentLocator(const LocatorT& locator)
{
@ -316,7 +316,7 @@ public:
/**
* Filter a start document event.
*
* @see basic_ContentHandler#startDocument
* @see ContentHandler#startDocument
*/
virtual void startDocument()
{
@ -326,7 +326,7 @@ public:
/**
* Filter an end document event.
*
* @see basic_ContentHandler#endDocument
* @see ContentHandler#endDocument
*/
virtual void endDocument()
{
@ -338,7 +338,7 @@ public:
*
* @param prefix The Namespace prefix.
* @param uri The Namespace URI.
* @see basic_ContentHandler#startPrefixMapping
* @see ContentHandler#startPrefixMapping
*/
virtual void startPrefixMapping(const stringT& prefix, const stringT& uri)
{
@ -349,7 +349,7 @@ public:
* Filter an end Namespace prefix mapping event.
*
* @param prefix The Namespace prefix.
* @see basic_ContentHandler#endPrefixMapping
* @see ContentHandler#endPrefixMapping
*/
virtual void endPrefixMapping(const stringT& prefix)
{
@ -364,7 +364,7 @@ public:
* @param qName The element's qualified (prefixed) name, or the empty
* string.
* @param atts The element's attributes.
* @see basic_ContentHandler#startElement
* @see ContentHandler#startElement
*/
virtual void startElement(const stringT& namespaceURI, const stringT& localName,
const stringT& qName, const typename ContentHandlerT::AttributesT& atts)
@ -379,7 +379,7 @@ public:
* @param localName The element's local name, or the empty string.
* @param qName The element's qualified (prefixed) name, or the empty
* string.
* @see basic_ContentHandler#endElement
* @see ContentHandler#endElement
*/
virtual void endElement(const stringT& namespaceURI, const stringT& localName,
const stringT& qName)
@ -391,7 +391,7 @@ public:
* Filter a character data event.
*
* @param ch The characters.
* @see basic_ContentHandler#characters
* @see ContentHandler#characters
*/
virtual void characters(const stringT& ch)
{
@ -402,7 +402,7 @@ public:
* Filter an ignorable whitespace event.
*
* @param ch The whitespace
* @see basic_ContentHandler#ignorableWhitespace
* @see ContentHandler#ignorableWhitespace
*/
virtual void ignorableWhitespace(const stringT& ch)
{
@ -414,7 +414,7 @@ public:
*
* @param target The processing instruction target.
* @param data The text following the target.
* @see basic_ContentHandler#processingInstruction
* @see ContentHandler#processingInstruction
*/
virtual void processingInstruction(const stringT& target, const stringT& data)
{
@ -425,7 +425,7 @@ public:
* Filter a skipped entity event.
*
* @param name The name of the skipped entity.
* @see basic_ContentHandler#skippedEntity
* @see ContentHandler#skippedEntity
*/
virtual void skippedEntity(const stringT& name)
{
@ -438,7 +438,7 @@ public:
* Filter a warning event.
*
* @param exception The warning as an exception.
* @see basic_ErrorHandler#warning
* @see ErrorHandler#warning
*/
virtual void warning(const SAXParseExceptionT& exception)
{
@ -449,7 +449,7 @@ public:
* Filter an error event.
*
* @param exception The error as an exception.
* @see basic_ErrorHandler#error
* @see ErrorHandler#error
*/
virtual void error(const SAXParseExceptionT& exception)
{
@ -460,7 +460,7 @@ public:
* Filter a fatal error event.
*
* @param exception The error as an exception.
* @see basic_ErrorHandler#fatalError
* @see ErrorHandler#fatalError
*/
virtual void fatalError(const SAXParseExceptionT& exception)
{
@ -588,9 +588,9 @@ private:
parent_->setLexicalHandler(*this);
} // setupParse
basic_XMLFilterImpl(const basic_XMLFilterImpl&);
basic_XMLFilterImpl& operator=(const basic_XMLFilterImpl&); // no impl
bool operator==(const basic_XMLFilterImpl&); // no impl
XMLFilterImpl(const XMLFilterImpl&);
XMLFilterImpl& operator=(const XMLFilterImpl&); // no impl
bool operator==(const XMLFilterImpl&); // no impl
XMLReaderT* parent_;
EntityResolverT* entityResolver_;
@ -599,13 +599,8 @@ private:
ErrorHandlerT* errorHandler_;
DeclHandlerT* declHandler_;
LexicalHandlerT* lexicalHandler_;
basic_DefaultHandler<stringT> defaultHandler_;
}; // class basic_XMLFilter
typedef basic_XMLFilterImpl<std::string> XMLFilterImpl;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_XMLFilterImpl<std::wstring> wXMLFilterImpl;
#endif
DefaultHandler<stringT> defaultHandler_;
}; // class XMLFilter
} // namespace SAX
} // namespace Arabica

View file

@ -24,7 +24,7 @@ namespace SAX
template<class string_type,
class T0 = Arabica::nil_t,
class T1 = Arabica::nil_t>
class Garden : public basic_XMLReader<string_type>
class Garden : public XMLReaderInterface<string_type>
{
public:
typedef string_type stringT;
@ -32,15 +32,15 @@ public:
Arabica::default_string_adaptor<string_type>,
T0,
T1>::type string_adaptor_type;
typedef basic_EntityResolver<stringT> EntityResolverT;
typedef basic_DTDHandler<stringT> DTDHandlerT;
typedef basic_ContentHandler<stringT> ContentHandlerT;
typedef basic_InputSource<stringT> InputSourceT;
typedef basic_AttributesImpl<stringT> AttributesImplT;
typedef basic_ErrorHandler<stringT> ErrorHandlerT;
typedef basic_DeclHandler<stringT> declHandlerT;
typedef basic_LexicalHandler<stringT> lexicalHandlerT;
typedef typename basic_XMLReader<stringT>::PropertyBase PropertyBase;
typedef EntityResolver<stringT> EntityResolverT;
typedef DTDHandler<stringT> DTDHandlerT;
typedef ContentHandler<stringT> ContentHandlerT;
typedef InputSource<stringT> InputSourceT;
typedef AttributesImpl<stringT> AttributesImplT;
typedef ErrorHandler<stringT> ErrorHandlerT;
typedef DeclHandler<stringT> declHandlerT;
typedef LexicalHandler<stringT> lexicalHandlerT;
typedef typename XMLReaderInterface<stringT>::PropertyBase PropertyBase;
Garden();
@ -254,7 +254,7 @@ std::auto_ptr<typename Garden<string_type, T0, T1>::PropertyBase> Garden<string_
} // doGetProperty
template<class string_type, class T0, class T1>
void Garden<string_type, T0, T1>::doSetProperty(const stringT& name, std::auto_ptr<typename basic_XMLReader<string_type>::PropertyBase> value)
void Garden<string_type, T0, T1>::doSetProperty(const stringT& name, std::auto_ptr<typename XMLReaderInterface<string_type>::PropertyBase> value)
{
throw SAXNotRecognizedException(string_adaptor_type::asStdString(name));
} // doSetProperty
@ -451,7 +451,7 @@ void Garden<string_type, T0, T1>::reportError(const std::string& message, bool f
if(!errorHandler_)
return;
SAX::basic_SAXParseException<stringT> e(message);
SAX::SAXParseException<stringT> e(message);
if(fatal)
errorHandler_->fatalError(e);

View file

@ -73,37 +73,15 @@ namespace Arabica
namespace SAX
{
template<class string_type> class basic_AttributeList;
template<class string_type> class basic_DocumentHandler;
template<class string_type> class basic_DTDHandler;
template<class string_type> class basic_EntityResolver;
template<class string_type> class basic_InputSource;
template<class string_type> class basic_Locator;
template<class string_type> class basic_Parser;
template<class string_type> class basic_SAXParseException;
template<class string_type> class basic_ErrorHandler;
typedef basic_AttributeList<std::string> AttributeList;
typedef basic_DocumentHandler<std::string> DocumentHandler;
typedef basic_DTDHandler<std::string> DTDHandler;
typedef basic_EntityResolver<std::string> EntityResolver;
typedef basic_InputSource<std::string> InputSource;
typedef basic_Locator<std::string> Locator;
typedef basic_Parser<std::string> Parser;
typedef basic_SAXParseException<std::string> SAXParseException;
typedef basic_ErrorHandler<std::string> ErrorHandler;
#ifndef ARABICA_NO_WCHAR_T
typedef basic_AttributeList<std::wstring> wAttributeList;
typedef basic_DocumentHandler<std::wstring> wDocumentHandler;
typedef basic_DTDHandler<std::wstring> wDTDHandler;
typedef basic_EntityResolver<std::wstring> wEntityResolver;
typedef basic_InputSource<std::wstring> wInputSource;
typedef basic_Locator<std::wstring> wLocator;
typedef basic_Parser<std::wstring> wParser;
typedef basic_SAXParseException<std::wstring> wSAXParseException;
typedef basic_ErrorHandler<std::wstring> wErrorHandler;
#endif
template<class string_type> class AttributeList;
template<class string_type> class DocumentHandler;
template<class string_type> class DTDHandler;
template<class string_type> class EntityResolver;
template<class string_type> class InputSource;
template<class string_type> class Locator;
template<class string_type> class Parser;
template<class string_type> class SAXParseException;
template<class string_type> class ErrorHandler;
} // namespace SAX
} // namespace Arabica

View file

@ -150,7 +150,7 @@ private:
// so the SAX wrapper maps more or less directly to it.
/**
* expat_wrapper puts an {@link basic_XMLReader XMLReader} interface
* expat_wrapper puts an {@link XMLReader XMLReader} interface
* around <a href='http://www.libexpat.org/'>Expat</a>.
* <p>
* For general usage:<br>
@ -195,13 +195,13 @@ private:
* @author Jez Higgins
* <a href="mailto:jez@jezuk.co.uk">jez@jezuk.co.uk</a>
* @version $Id$
* @see SAX::basic_XMLReader
* @see SAX::XMLReader
*/
template<class string_type,
class T0 = Arabica::nil_t,
class T1 = Arabica::nil_t>
class expat_wrapper : public SAX::basic_XMLReader<string_type>,
public SAX::basic_Locator<string_type>,
class expat_wrapper : public SAX::XMLReaderInterface<string_type>,
public SAX::Locator<string_type>,
public expat_wrapper_impl_mumbojumbo::expat2base
{
public:
@ -212,17 +212,17 @@ class expat_wrapper : public SAX::basic_XMLReader<string_type>,
T1>::type string_adaptor_type;
typedef string_adaptor_type string_adaptorT;
typedef string_adaptor_type SA;
typedef SAX::basic_EntityResolver<stringT> entityResolverT;
typedef SAX::basic_DTDHandler<stringT> dtdHandlerT;
typedef SAX::basic_ContentHandler<stringT> contentHandlerT;
typedef SAX::basic_DeclHandler<stringT> declHandlerT;
typedef SAX::basic_LexicalHandler<stringT> lexicalHandlerT;
typedef SAX::basic_InputSource<stringT> inputSourceT;
typedef SAX::basic_Locator<stringT> locatorT;
typedef SAX::basic_NamespaceSupport<stringT, string_adaptorT> namespaceSupportT;
typedef SAX::basic_ErrorHandler<stringT> errorHandlerT;
typedef SAX::basic_SAXParseException<stringT> SAXParseExceptionT;
typedef SAX::basic_XMLReader<stringT> XMLReaderT;
typedef SAX::EntityResolver<stringT> entityResolverT;
typedef SAX::DTDHandler<stringT> dtdHandlerT;
typedef SAX::ContentHandler<stringT> contentHandlerT;
typedef SAX::DeclHandler<stringT> declHandlerT;
typedef SAX::LexicalHandler<stringT> lexicalHandlerT;
typedef SAX::InputSource<stringT> inputSourceT;
typedef SAX::Locator<stringT> locatorT;
typedef SAX::NamespaceSupport<stringT, string_adaptorT> namespaceSupportT;
typedef SAX::ErrorHandler<stringT> errorHandlerT;
typedef SAX::SAXParseException<stringT> SAXParseExceptionT;
typedef SAX::XMLReaderInterface<stringT> XMLReaderT;
typedef typename XMLReaderT::PropertyBase PropertyBaseT;
typedef typename XMLReaderT::template Property<lexicalHandlerT*> getLexicalHandlerT;
typedef typename XMLReaderT::template Property<lexicalHandlerT&> setLexicalHandlerT;
@ -589,7 +589,7 @@ int expat_wrapper<stringT, T0, T1>::getColumnNumber() const
} // getColumnNumber
template<class stringT, class T0, class T1>
typename SAX::basic_NamespaceSupport<stringT, typename expat_wrapper<stringT, T0, T1>::string_adaptorT>::Parts expat_wrapper<stringT, T0, T1>::processName(const stringT& qName, bool isAttribute)
typename SAX::NamespaceSupport<stringT, typename expat_wrapper<stringT, T0, T1>::string_adaptorT>::Parts expat_wrapper<stringT, T0, T1>::processName(const stringT& qName, bool isAttribute)
{
typename namespaceSupportT::Parts p = nsSupport_.processName(qName, isAttribute);
if(SA::empty(p.URI) && !SA::empty(p.prefix))
@ -647,7 +647,7 @@ void expat_wrapper<stringT, T0, T1>::startElement(const char* qName, const char*
// OK we're doing Namespaces
nsSupport_.pushContext();
SAX::basic_AttributesImpl<stringT> attributes;
SAX::AttributesImpl<stringT> attributes;
// take a first pass and copy all the attributes, noting any declarations
if(atts && *atts != 0)
@ -699,7 +699,7 @@ void expat_wrapper<stringT, T0, T1>::startElement(const char* qName, const char*
template<class stringT, class T0, class T1>
void expat_wrapper<stringT, T0, T1>::startElementNoNS(const char* qName, const char** atts)
{
SAX::basic_AttributesImpl<stringT> attributes;
SAX::AttributesImpl<stringT> attributes;
if(atts && *atts != 0)
{

View file

@ -115,8 +115,8 @@ xmlSAXHandler* lwit_SaxHandler();
template<class string_type,
class T0 = Arabica::nil_t,
class T1 = Arabica::nil_t>
class libxml2_wrapper : public basic_XMLReader<string_type>,
public basic_Locator<string_type>,
class libxml2_wrapper : public XMLReaderInterface<string_type>,
public Locator<string_type>,
protected libxml2_wrapper_impl_tiddle::libxml2_base
{
public:
@ -126,17 +126,17 @@ class libxml2_wrapper : public basic_XMLReader<string_type>,
T0,
T1>::type string_adaptor_type;
typedef string_adaptor_type string_adaptorT;
typedef SAX::basic_EntityResolver<stringT> entityResolverT;
typedef SAX::basic_DTDHandler<stringT> dtdHandlerT;
typedef SAX::basic_ContentHandler<stringT> contentHandlerT;
typedef SAX::basic_DeclHandler<stringT> declHandlerT;
typedef SAX::basic_LexicalHandler<stringT> lexicalHandlerT;
typedef SAX::basic_InputSource<stringT> inputSourceT;
typedef SAX::basic_Locator<stringT> locatorT;
typedef SAX::basic_NamespaceSupport<stringT, string_adaptorT> namespaceSupportT;
typedef SAX::basic_ErrorHandler<stringT> errorHandlerT;
typedef SAX::basic_SAXParseException<stringT> SAXParseExceptionT;
typedef SAX::basic_XMLReader<stringT> XMLReaderT;
typedef SAX::EntityResolver<stringT> entityResolverT;
typedef SAX::DTDHandler<stringT> dtdHandlerT;
typedef SAX::ContentHandler<stringT> contentHandlerT;
typedef SAX::DeclHandler<stringT> declHandlerT;
typedef SAX::LexicalHandler<stringT> lexicalHandlerT;
typedef SAX::InputSource<stringT> inputSourceT;
typedef SAX::Locator<stringT> locatorT;
typedef SAX::NamespaceSupport<stringT, string_adaptorT> namespaceSupportT;
typedef SAX::ErrorHandler<stringT> errorHandlerT;
typedef SAX::SAXParseException<stringT> SAXParseExceptionT;
typedef SAX::XMLReaderInterface<stringT> XMLReaderT;
typedef typename XMLReaderT::PropertyBase PropertyBaseT;
typedef typename XMLReaderT::template Property<lexicalHandlerT*> getLexicalHandlerT;
typedef typename XMLReaderT::template Property<lexicalHandlerT&> setLexicalHandlerT;
@ -152,12 +152,12 @@ class libxml2_wrapper : public basic_XMLReader<string_type>,
////////////////////////////////////////////////
// Event Handlers
virtual void setEntityResolver(basic_EntityResolver<stringT>& resolver) { entityResolver_ = &resolver; }
virtual basic_EntityResolver<stringT>* getEntityResolver() const { return entityResolver_; }
virtual void setDTDHandler(basic_DTDHandler<stringT>& handler) { dtdHandler_ = &handler; }
virtual basic_DTDHandler<stringT>* getDTDHandler() const { return dtdHandler_; }
virtual void setContentHandler(basic_ContentHandler<stringT>& handler) { contentHandler_ = &handler; }
virtual basic_ContentHandler<stringT>* getContentHandler() const { return contentHandler_; }
virtual void setEntityResolver(EntityResolver<stringT>& resolver) { entityResolver_ = &resolver; }
virtual EntityResolver<stringT>* getEntityResolver() const { return entityResolver_; }
virtual void setDTDHandler(DTDHandler<stringT>& handler) { dtdHandler_ = &handler; }
virtual DTDHandler<stringT>* getDTDHandler() const { return dtdHandler_; }
virtual void setContentHandler(ContentHandler<stringT>& handler) { contentHandler_ = &handler; }
virtual ContentHandler<stringT>* getContentHandler() const { return contentHandler_; }
virtual void setErrorHandler(errorHandlerT& handler) { errorHandler_ = &handler; }
virtual errorHandlerT* getErrorHandler() const { return errorHandler_; }
virtual void setDeclHandler(declHandlerT& handler) { declHandler_ = &handler; }
@ -167,7 +167,7 @@ class libxml2_wrapper : public basic_XMLReader<string_type>,
////////////////////////////////////////////////
// parsing
virtual void parse(basic_InputSource<stringT>& source);
virtual void parse(InputSource<stringT>& source);
protected:
////////////////////////////////////////////////
@ -205,7 +205,7 @@ class libxml2_wrapper : public basic_XMLReader<string_type>,
virtual void SAXentityDecl(const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content);
virtual xmlParserInputPtr SAXresolveEntity(const xmlChar* publicId, const xmlChar* systemId);
typename basic_NamespaceSupport<stringT, string_adaptorT>::Parts processName(const stringT& qName, bool isAttribute);
typename NamespaceSupport<stringT, string_adaptorT>::Parts processName(const stringT& qName, bool isAttribute);
void reportError(const std::string& message, bool fatal = false);
void checkNotParsing(const stringT& type, const stringT& name) const;
@ -380,9 +380,9 @@ void libxml2_wrapper<stringT, T0, T1>::doSetProperty(const stringT& name, std::a
} // doSetProperty
template<class stringT, class T0, class T1>
typename SAX::basic_NamespaceSupport<stringT, typename libxml2_wrapper<stringT, T0, T1>::string_adaptorT>::Parts libxml2_wrapper<stringT, T0, T1>::processName(const stringT& qName, bool isAttribute)
typename SAX::NamespaceSupport<stringT, typename libxml2_wrapper<stringT, T0, T1>::string_adaptorT>::Parts libxml2_wrapper<stringT, T0, T1>::processName(const stringT& qName, bool isAttribute)
{
typename basic_NamespaceSupport<stringT, string_adaptorT>::Parts p =
typename NamespaceSupport<stringT, string_adaptorT>::Parts p =
nsSupport_.processName(qName, isAttribute);
if(string_adaptorT::empty(p.URI) && !string_adaptorT::empty(p.prefix))
reportError(std::string("Undeclared prefix ") + string_adaptorT::asStdString(qName));
@ -395,7 +395,7 @@ void libxml2_wrapper<stringT, T0, T1>::reportError(const std::string& message, b
if(!errorHandler_)
return;
basic_SAXParseException<stringT> e(message, *this);
SAXParseException<stringT> e(message, *this);
if(fatal)
errorHandler_->fatalError(e);
else
@ -446,7 +446,7 @@ int libxml2_wrapper<stringT, T0, T1>::getColumnNumber() const
} // getColumnNumber
template<class stringT, class T0, class T1>
void libxml2_wrapper<stringT, T0, T1>::parse(basic_InputSource<stringT>& source)
void libxml2_wrapper<stringT, T0, T1>::parse(InputSource<stringT>& source)
{
if(contentHandler_)
contentHandler_->setDocumentLocator(*this);
@ -501,21 +501,21 @@ template<class stringT, class T0, class T1>
void libxml2_wrapper<stringT, T0, T1>::SAXwarning(const std::string& warning)
{
if(errorHandler_)
errorHandler_->warning(basic_SAXParseException<stringT>(warning, *this));
errorHandler_->warning(SAXParseException<stringT>(warning, *this));
} // warning
template<class stringT, class T0, class T1>
void libxml2_wrapper<stringT, T0, T1>::SAXerror(const std::string& error)
{
if(errorHandler_)
errorHandler_->error(basic_SAXParseException<stringT>(error, *this));
errorHandler_->error(SAXParseException<stringT>(error, *this));
} // error
template<class stringT, class T0, class T1>
void libxml2_wrapper<stringT, T0, T1>::SAXfatalError(const std::string& fatal)
{
if(errorHandler_)
errorHandler_->fatalError(basic_SAXParseException<stringT>(fatal, *this));
errorHandler_->fatalError(SAXParseException<stringT>(fatal, *this));
} // fatal
template<class stringT, class T0, class T1>
@ -547,7 +547,7 @@ void libxml2_wrapper<stringT, T0, T1>::SAXstartElement(const xmlChar* qName, con
// OK we're doing Namespaces
nsSupport_.pushContext();
SAX::basic_AttributesImpl<stringT> attributes;
SAX::AttributesImpl<stringT> attributes;
// take a first pass and copy all the attributes, noting any declarations
if(atts && *atts != 0)
@ -585,21 +585,21 @@ void libxml2_wrapper<stringT, T0, T1>::SAXstartElement(const xmlChar* qName, con
// declaration?
if(string_adaptorT::find(attQName, nsc_.xmlns) != 0)
{
typename basic_NamespaceSupport<stringT, string_adaptorT>::Parts attName = processName(attQName, true);
typename NamespaceSupport<stringT, string_adaptorT>::Parts attName = processName(attQName, true);
attributes.addAttribute(attName.URI, attName.localName, attName.rawName, emptyString_, value);
}
} // while ...
} // if ...
// at last! report the event
typename basic_NamespaceSupport<stringT, string_adaptorT>::Parts name = processName(string_adaptorT::construct_from_utf8(reinterpret_cast<const char*>(qName)), false);
typename NamespaceSupport<stringT, string_adaptorT>::Parts name = processName(string_adaptorT::construct_from_utf8(reinterpret_cast<const char*>(qName)), false);
contentHandler_->startElement(name.URI, name.localName, name.rawName, attributes);
} // SAXstartElement
template<class stringT, class T0, class T1>
void libxml2_wrapper<stringT, T0, T1>::SAXstartElementNoNS(const xmlChar* qName, const xmlChar** atts)
{
SAX::basic_AttributesImpl<stringT> attributes;
SAX::AttributesImpl<stringT> attributes;
if(atts && *atts != 0)
{
@ -627,9 +627,9 @@ void libxml2_wrapper<stringT, T0, T1>::SAXendElement(const xmlChar* qName)
return;
} // if(!namespaces_)
typename basic_NamespaceSupport<stringT, string_adaptorT>::Parts name = processName(string_adaptorT::construct_from_utf8(reinterpret_cast<const char*>(qName)), false);
typename NamespaceSupport<stringT, string_adaptorT>::Parts name = processName(string_adaptorT::construct_from_utf8(reinterpret_cast<const char*>(qName)), false);
contentHandler_->endElement(name.URI, name.localName, name.rawName);
typename basic_NamespaceSupport<stringT, string_adaptorT>::stringListT prefixes = nsSupport_.getDeclaredPrefixes();
typename NamespaceSupport<stringT, string_adaptorT>::stringListT prefixes = nsSupport_.getDeclaredPrefixes();
for(size_t i = 0, end = prefixes.size(); i < end; ++i)
contentHandler_->endPrefixMapping(prefixes[i]);
nsSupport_.popContext();

View file

@ -60,7 +60,7 @@ class COMMultiThreadInitializer : public COMInitializer_tag
template<class string_type,
class T0 = Arabica::nil_t,
class T1 = Arabica::nil_t>
class msxml2_wrapper : public SAX::basic_XMLReader<string_type>
class msxml2_wrapper : public SAX::XMLReaderInterface<string_type>
{
typedef typename Arabica::get_param<Arabica::string_adaptor_tag,
Arabica::default_string_adaptor<string_type>,
@ -72,14 +72,14 @@ class msxml2_wrapper : public SAX::basic_XMLReader<string_type>
T0>::type COMInitializer_type;
public:
typedef SAX::basic_EntityResolver<string_type> entityResolverT;
typedef SAX::basic_DTDHandler<string_type> dtdHandlerT;
typedef SAX::basic_ContentHandler<string_type> contentHandlerT;
typedef SAX::basic_DeclHandler<string_type> declHandlerT;
typedef SAX::basic_LexicalHandler<string_type> lexicalHandlerT;
typedef SAX::basic_InputSource<string_type> inputSourceT;
typedef SAX::basic_Locator<string_type> locatorT;
typedef SAX::basic_ErrorHandler<string_type> errorHandlerT;
typedef SAX::EntityResolver<string_type> entityResolverT;
typedef SAX::DTDHandler<string_type> dtdHandlerT;
typedef SAX::ContentHandler<string_type> contentHandlerT;
typedef SAX::DeclHandler<string_type> declHandlerT;
typedef SAX::LexicalHandler<string_type> lexicalHandlerT;
typedef SAX::InputSource<string_type> inputSourceT;
typedef SAX::Locator<string_type> locatorT;
typedef SAX::ErrorHandler<string_type> errorHandlerT;
msxml2_wrapper();
virtual ~msxml2_wrapper();
@ -92,14 +92,14 @@ class msxml2_wrapper : public SAX::basic_XMLReader<string_type>
/////////////////////////////////////////////////
// Event Handlers
/* MSXML does not use EntityResolver currently */
virtual void setEntityResolver(SAX::basic_EntityResolver<string_type>& resolver) { }
virtual SAX::basic_EntityResolver<string_type>* getEntityResolver() const { return 0; }
virtual void setDTDHandler(SAX::basic_DTDHandler<string_type>& handler) { dtdHandler_.setDTDHandler(handler); }
virtual SAX::basic_DTDHandler<string_type>* getDTDHandler() const { return dtdHandler_.getDTDHandler(); }
virtual void setContentHandler(SAX::basic_ContentHandler<string_type>& handler) { contentHandler_.setContentHandler(handler); }
virtual SAX::basic_ContentHandler<string_type>* getContentHandler() const { return contentHandler_.getContentHandler(); }
virtual void setErrorHandler(SAX::basic_ErrorHandler<string_type>& handler);
virtual SAX::basic_ErrorHandler<string_type>* getErrorHandler() const;
virtual void setEntityResolver(SAX::EntityResolver<string_type>& resolver) { }
virtual SAX::EntityResolver<string_type>* getEntityResolver() const { return 0; }
virtual void setDTDHandler(SAX::DTDHandler<string_type>& handler) { dtdHandler_.setDTDHandler(handler); }
virtual SAX::DTDHandler<string_type>* getDTDHandler() const { return dtdHandler_.getDTDHandler(); }
virtual void setContentHandler(SAX::ContentHandler<string_type>& handler) { contentHandler_.setContentHandler(handler); }
virtual SAX::ContentHandler<string_type>* getContentHandler() const { return contentHandler_.getContentHandler(); }
virtual void setErrorHandler(SAX::ErrorHandler<string_type>& handler);
virtual SAX::ErrorHandler<string_type>* getErrorHandler() const;
virtual void setDeclHandler(declHandlerT& handler) { declHandler_.setDeclHandler(handler); }
virtual declHandlerT* getDeclHandler() const { return declHandler_.getDeclHandler(); }
virtual void setLexicalHandler(lexicalHandlerT& handler) { lexicalHandler_.setLexicalHandler(handler); }
@ -107,29 +107,29 @@ class msxml2_wrapper : public SAX::basic_XMLReader<string_type>
//////////////////////////////////////////////////
// Parsing
virtual void parse(SAX::basic_InputSource<string_type>& input);
virtual void parse(SAX::InputSource<string_type>& input);
protected:
virtual std::auto_ptr<typename SAX::basic_XMLReader<string_type>::PropertyBase> doGetProperty(const string_type& name)
virtual std::auto_ptr<typename SAX::XMLReaderInterface<string_type>::PropertyBase> doGetProperty(const string_type& name)
{
if(name == properties_.lexicalHandler)
{
Property<SAX::basic_LexicalHandler<string_type>*>* prop = new Property<SAX::basic_LexicalHandler<string_type>*>(lexicalHandler_.getLexicalHandler());
return std::auto_ptr<SAX::basic_XMLReader<string_type>::PropertyBase>(prop);
Property<SAX::LexicalHandler<string_type>*>* prop = new Property<SAX::LexicalHandler<string_type>*>(lexicalHandler_.getLexicalHandler());
return std::auto_ptr<SAX::XMLReaderInterface<string_type>::PropertyBase>(prop);
}
if(name == properties_.declHandler)
{
Property<SAX::basic_DeclHandler<string_type>*>* prop = new Property<SAX::basic_DeclHandler<string_type>*>(declHandler_.getDeclHandler());
return std::auto_ptr<SAX::basic_XMLReader<string_type>::PropertyBase>(prop);
Property<SAX::DeclHandler<string_type>*>* prop = new Property<SAX::DeclHandler<string_type>*>(declHandler_.getDeclHandler());
return std::auto_ptr<SAX::XMLReaderInterface<string_type>::PropertyBase>(prop);
}
throw SAX::SAXNotRecognizedException("Property not recognized ");
} // doGetProperty
virtual void doSetProperty(const string_type& name, std::auto_ptr<typename SAX::basic_XMLReader<string_type>::PropertyBase> value)
virtual void doSetProperty(const string_type& name, std::auto_ptr<typename SAX::XMLReaderInterface<string_type>::PropertyBase> value)
{
if(name == properties_.lexicalHandler)
{
Property<SAX::basic_LexicalHandler<string_type>&>* prop = dynamic_cast<Property<SAX::basic_LexicalHandler<string_type>&>*>(value.get());
Property<SAX::LexicalHandler<string_type>&>* prop = dynamic_cast<Property<SAX::LexicalHandler<string_type>&>*>(value.get());
if(!prop)
throw std::runtime_error("bad_cast: Property LexicalHandler is wrong type, should be SAX::LexicalHandler&");
@ -139,7 +139,7 @@ class msxml2_wrapper : public SAX::basic_XMLReader<string_type>
} // if ...
if(name == properties_.declHandler)
{
Property<SAX::basic_DeclHandler<string_type>&>* prop = dynamic_cast<Property<SAX::basic_DeclHandler<string_type>&>*>(value.get());
Property<SAX::DeclHandler<string_type>&>* prop = dynamic_cast<Property<SAX::DeclHandler<string_type>&>*>(value.get());
if(!prop)
throw std::runtime_error("bad_cast: Property DeclHandler is wrong type, should be SAX::DeclHandler&");
@ -153,7 +153,7 @@ class msxml2_wrapper : public SAX::basic_XMLReader<string_type>
private:
//////////////////////////////////////////////////////
// COM interface -> C++ interface adaptors
class LocatorAdaptor : public SAX::basic_Locator<string_type>
class LocatorAdaptor : public SAX::Locator<string_type>
{
public:
LocatorAdaptor() : locator_(0) { }
@ -219,8 +219,8 @@ class msxml2_wrapper : public SAX::basic_XMLReader<string_type>
DTDHandlerAdaptor() : dtdHandler_(0) { }
~DTDHandlerAdaptor() { }
void setDTDHandler(SAX::basic_DTDHandler<string_type>& handler) { dtdHandler_ = &handler; }
SAX::basic_DTDHandler<string_type>* getDTDHandler() const { return dtdHandler_; }
void setDTDHandler(SAX::DTDHandler<string_type>& handler) { dtdHandler_ = &handler; }
SAX::DTDHandler<string_type>* getDTDHandler() const { return dtdHandler_; }
virtual HRESULT STDMETHODCALLTYPE notationDecl(
/* [in] */ const wchar_t *pwchName,
@ -261,7 +261,7 @@ class msxml2_wrapper : public SAX::basic_XMLReader<string_type>
unsigned long __stdcall Release() { return 0; }
private:
SAX::basic_DTDHandler<string_type>* dtdHandler_;
SAX::DTDHandler<string_type>* dtdHandler_;
}; // class DTDHandlerAdaptor
class ContentHandlerAdaptor : public ISAXContentHandler
@ -270,8 +270,8 @@ class msxml2_wrapper : public SAX::basic_XMLReader<string_type>
ContentHandlerAdaptor() : contentHandler_(0) { }
~ContentHandlerAdaptor() { }
void setContentHandler(SAX::basic_ContentHandler<string_type>& handler) { contentHandler_ = &handler; }
SAX::basic_ContentHandler<string_type>* getContentHandler() const { return contentHandler_; }
void setContentHandler(SAX::ContentHandler<string_type>& handler) { contentHandler_ = &handler; }
SAX::ContentHandler<string_type>* getContentHandler() const { return contentHandler_; }
virtual HRESULT STDMETHODCALLTYPE putDocumentLocator(
@ -396,12 +396,12 @@ class msxml2_wrapper : public SAX::basic_XMLReader<string_type>
private:
////////////////////////////////////////////////
// member varaibles
SAX::basic_ContentHandler<string_type>* contentHandler_;
SAX::ContentHandler<string_type>* contentHandler_;
LocatorAdaptor locator_;
//////////////////////////////////////////////////////
// COM interface -> C++ interface adaptors
class AttributesAdaptor : public SAX::basic_Attributes<string_type>
class AttributesAdaptor : public SAX::Attributes<string_type>
{
public:
AttributesAdaptor(ISAXAttributes __RPC_FAR *pAttributes) : attributes_(pAttributes) { }
@ -564,8 +564,8 @@ class msxml2_wrapper : public SAX::basic_XMLReader<string_type>
{ }
virtual ~ErrorHandlerAdaptor() { }
void setErrorHandler(SAX::basic_ErrorHandler<string_type>& handler) { errorHandler_ = &handler; }
SAX::basic_ErrorHandler<string_type>* getErrorHandler() const { return errorHandler_; }
void setErrorHandler(SAX::ErrorHandler<string_type>& handler) { errorHandler_ = &handler; }
SAX::ErrorHandler<string_type>* getErrorHandler() const { return errorHandler_; }
virtual HRESULT STDMETHODCALLTYPE error(
/* [in] */ ISAXLocator *pLocator,
@ -625,7 +625,7 @@ class msxml2_wrapper : public SAX::basic_XMLReader<string_type>
unsigned long __stdcall Release() { return 0; }
private:
typedef SAX::basic_SAXParseException<string_type> SAXParseExceptionT;
typedef SAX::SAXParseException<string_type> SAXParseExceptionT;
bool bWarning_;
bool bError_;
bool bFatal_;
@ -633,7 +633,7 @@ class msxml2_wrapper : public SAX::basic_XMLReader<string_type>
SAXParseExceptionT eError_;
SAXParseExceptionT eFatal_;
SAX::basic_ErrorHandler<string_type>* errorHandler_;
SAX::ErrorHandler<string_type>* errorHandler_;
}; // class ErrorHandlerAdaptor
class LexicalHandlerAdaptor : public ISAXLexicalHandler
@ -642,8 +642,8 @@ class msxml2_wrapper : public SAX::basic_XMLReader<string_type>
LexicalHandlerAdaptor() : lexicalHandler_(0) { }
virtual ~LexicalHandlerAdaptor() { }
void setLexicalHandler(SAX::basic_LexicalHandler<string_type>& handler) { lexicalHandler_ = &handler; }
SAX::basic_LexicalHandler<string_type>* getLexicalHandler() const { return lexicalHandler_; }
void setLexicalHandler(SAX::LexicalHandler<string_type>& handler) { lexicalHandler_ = &handler; }
SAX::LexicalHandler<string_type>* getLexicalHandler() const { return lexicalHandler_; }
virtual HRESULT STDMETHODCALLTYPE startDTD(
/* [in] */ const wchar_t *pwchName,
@ -721,7 +721,7 @@ class msxml2_wrapper : public SAX::basic_XMLReader<string_type>
unsigned long __stdcall Release() { return 0; }
private:
SAX::basic_LexicalHandler<string_type>* lexicalHandler_;
SAX::LexicalHandler<string_type>* lexicalHandler_;
}; // class LexicalHandlerAdaptor
class DeclHandlerAdaptor : public ISAXDeclHandler
@ -730,8 +730,8 @@ class msxml2_wrapper : public SAX::basic_XMLReader<string_type>
DeclHandlerAdaptor() : declHandler_(0) { }
virtual ~DeclHandlerAdaptor() { }
void setDeclHandler(SAX::basic_DeclHandler<string_type>& handler) { declHandler_ = &handler; }
SAX::basic_DeclHandler<string_type>* getDeclHandler() const { return declHandler_; }
void setDeclHandler(SAX::DeclHandler<string_type>& handler) { declHandler_ = &handler; }
SAX::DeclHandler<string_type>* getDeclHandler() const { return declHandler_; }
virtual HRESULT STDMETHODCALLTYPE elementDecl(
/* [in] */ const wchar_t *pwchName,
@ -807,13 +807,13 @@ class msxml2_wrapper : public SAX::basic_XMLReader<string_type>
unsigned long __stdcall Release() { return 0; }
private:
SAX::basic_DeclHandler<string_type>* declHandler_;
SAX::DeclHandler<string_type>* declHandler_;
}; // class DeclHandlerAdaptor
class StreamAdaptor : public ISequentialStream
{
public:
StreamAdaptor(SAX::basic_InputSource<string_type>& source) :
StreamAdaptor(SAX::InputSource<string_type>& source) :
source_(source)
{
} // StreamAdaptor
@ -847,7 +847,7 @@ class msxml2_wrapper : public SAX::basic_XMLReader<string_type>
unsigned long __stdcall Release() { return 1; }
private:
SAX::basic_InputSource<string_type>& source_;
SAX::InputSource<string_type>& source_;
}; // StreamAdaptor
@ -916,19 +916,19 @@ void msxml2_wrapper<string_type, T0, T1>::setFeature(const string_type& name, bo
} // setFeature
template<class string_type, class T0, class T1>
void msxml2_wrapper<string_type, T0, T1>::setErrorHandler(SAX::basic_ErrorHandler<string_type>& handler)
void msxml2_wrapper<string_type, T0, T1>::setErrorHandler(SAX::ErrorHandler<string_type>& handler)
{
errorHandler_.setErrorHandler(handler);
} // setErrorHandler
template<class string_type, class T0, class T1>
SAX::basic_ErrorHandler<string_type>* msxml2_wrapper<string_type, T0, T1>::getErrorHandler() const
SAX::ErrorHandler<string_type>* msxml2_wrapper<string_type, T0, T1>::getErrorHandler() const
{
return errorHandler_.getErrorHandler();
} // getErrorHandler
template<class string_type, class T0, class T1>
void msxml2_wrapper<string_type, T0, T1>::parse(SAX::basic_InputSource<string_type>& source)
void msxml2_wrapper<string_type, T0, T1>::parse(SAX::InputSource<string_type>& source)
{
if(source.getByteStream() == 0)
{

View file

@ -122,7 +122,7 @@ namespace XercesImpl
template<class string_type,
class T0 = Arabica::nil_t,
class T1 = Arabica::nil_t>
class xerces_wrapper : public SAX::basic_ProgressiveParser<string_type>
class xerces_wrapper : public SAX::ProgressiveParser<string_type>
{
private:
typedef typename Arabica::get_param<Arabica::string_adaptor_tag,
@ -132,18 +132,18 @@ class xerces_wrapper : public SAX::basic_ProgressiveParser<string_type>
typedef string_adaptor_type string_adaptorT;
protected:
typedef SAX::basic_XMLReader<string_type> base;
typedef SAX::XMLReaderInterface<string_type> base;
public:
typedef typename base::EntityResolverT EntityResolverT;
typedef typename base::DTDHandlerT DTDHandlerT;
typedef typename base::ContentHandlerT ContentHandlerT;
typedef typename base::InputSourceT InputSourceT;
typedef SAX::basic_LexicalHandler<string_type> LexicalHandlerT;
typedef SAX::basic_Locator<string_type> LocatorT;
typedef SAX::basic_Attributes<string_type> AttributesT;
typedef SAX::basic_DeclHandler<string_type> DeclHandlerT;
typedef SAX::basic_ErrorHandler<string_type> ErrorHandlerT;
typedef SAX::LexicalHandler<string_type> LexicalHandlerT;
typedef SAX::Locator<string_type> LocatorT;
typedef SAX::Attributes<string_type> AttributesT;
typedef SAX::DeclHandler<string_type> DeclHandlerT;
typedef SAX::ErrorHandler<string_type> ErrorHandlerT;
typedef typename ErrorHandlerT::SAXParseExceptionT SAXParseExceptionT;
typedef SAX::XercesFeatureNames<string_type, string_adaptorT> featuresT;
@ -939,14 +939,14 @@ void xerces_wrapper<string_type, T0, T1>::setFeature(const string_type& name, bo
template<class string_type, class T0, class T1>
#ifndef ARABICA_VS6_WORKAROUND
std::auto_ptr<typename SAX::basic_XMLReader<string_type>::PropertyBase> xerces_wrapper<string_type, T0, T1>::doGetProperty(const string_type& name)
std::auto_ptr<typename SAX::XMLReaderInterface<string_type>::PropertyBase> xerces_wrapper<string_type, T0, T1>::doGetProperty(const string_type& name)
#else
std::auto_ptr<SAX::basic_XMLReader<string_type>::PropertyBase> xerces_wrapper<string_type, T0, T1>::doGetProperty(const string_type& name)
std::auto_ptr<SAX::XMLReaderInterface<string_type>::PropertyBase> xerces_wrapper<string_type, T0, T1>::doGetProperty(const string_type& name)
#endif
{
if(name == properties_.lexicalHandler)
{
typedef typename SAX::basic_XMLReader<string_type>::template Property<LexicalHandlerT *> Prop;
typedef typename SAX::XMLReaderInterface<string_type>::template Property<LexicalHandlerT *> Prop;
Prop *prop = new Prop(lexicalHandlerAdaptor_.getLexicalHandler());
#ifndef ARABICA_VS6_WORKAROUND
return std::auto_ptr<typename base::PropertyBase>(prop);
@ -956,7 +956,7 @@ std::auto_ptr<SAX::basic_XMLReader<string_type>::PropertyBase> xerces_wrapper<st
}
if(name == properties_.declHandler)
{
typedef typename SAX::basic_XMLReader<string_type>::template Property<DeclHandlerT*> Prop;
typedef typename SAX::XMLReaderInterface<string_type>::template Property<DeclHandlerT*> Prop;
Prop* prop = new Prop(declHandlerAdaptor_.getDeclHandler());
#ifndef ARABICA_VS6_WORKAROUND
return std::auto_ptr<typename base::PropertyBase>(prop);
@ -966,7 +966,7 @@ std::auto_ptr<SAX::basic_XMLReader<string_type>::PropertyBase> xerces_wrapper<st
}
if (name == properties_.externalSchemaLocation)
{
typedef typename SAX::basic_XMLReader<string_type>::template Property<string_type&> StringPropertyType;
typedef typename SAX::XMLReaderInterface<string_type>::template Property<string_type&> StringPropertyType;
XMLCh* xercesExternalSchemaLocation =
static_cast<XMLCh*>(xerces_->getProperty(
@ -989,7 +989,7 @@ std::auto_ptr<SAX::basic_XMLReader<string_type>::PropertyBase> xerces_wrapper<st
}
if (name == properties_.externalNoNamespaceSchemaLocation)
{
typedef typename SAX::basic_XMLReader<string_type>::template Property<string_type&> StringPropertyType;
typedef typename SAX::XMLReaderInterface<string_type>::template Property<string_type&> StringPropertyType;
XMLCh* xercesExternalNoNamespaceSchemaLocation =
static_cast<XMLCh*>(xerces_->getProperty(
@ -1014,7 +1014,7 @@ void xerces_wrapper<string_type, T0, T1>::doSetProperty(const string_type& name,
{
if(name == properties_.lexicalHandler)
{
typedef typename SAX::basic_XMLReader<string_type>::template Property<LexicalHandlerT&> Prop;
typedef typename SAX::XMLReaderInterface<string_type>::template Property<LexicalHandlerT&> Prop;
Prop* prop = dynamic_cast<Prop*>(value.get());
if(!prop)
@ -1026,7 +1026,7 @@ void xerces_wrapper<string_type, T0, T1>::doSetProperty(const string_type& name,
if(name == properties_.declHandler)
{
typedef typename SAX::basic_XMLReader<string_type>::template Property<DeclHandlerT&> Prop;
typedef typename SAX::XMLReaderInterface<string_type>::template Property<DeclHandlerT&> Prop;
Prop* prop = dynamic_cast<Prop*>(value.get());
if(!prop)

View file

@ -8,7 +8,7 @@ namespace Arabica
namespace XSLT
{
class ApplyImportsHandler : public SAX::DefaultHandler
class ApplyImportsHandler : public SAX::DefaultHandler<std::string>
{
public:
ApplyImportsHandler(CompilationContext& context):
@ -24,7 +24,7 @@ public:
virtual void startElement(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
if(applyImports_ == 0)
{

View file

@ -10,7 +10,7 @@ namespace Arabica
namespace XSLT
{
class ApplyTemplatesHandler : public SAX::DefaultHandler
class ApplyTemplatesHandler : public SAX::DefaultHandler<std::string>
{
public:
ApplyTemplatesHandler(CompilationContext& context) :
@ -22,7 +22,7 @@ public:
virtual void startElement(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
if(applyTemplates_ == 0)
{

View file

@ -21,7 +21,7 @@ protected:
virtual Attribute* createContainer(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
static const ValueRule rules[] = { { "name", true, 0 },
{ "namespace", false, 0 },

View file

@ -9,7 +9,7 @@ namespace Arabica
namespace XSLT
{
class CallTemplateHandler : public SAX::DefaultHandler
class CallTemplateHandler : public SAX::DefaultHandler<std::string>
{
public:
CallTemplateHandler(CompilationContext& context) :
@ -21,7 +21,7 @@ public:
virtual void startElement(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
if(callTemplate_ == 0)
{

View file

@ -21,7 +21,7 @@ public:
virtual When* createContainer(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
static const ValueRule rules[] = { { "test", true, 0 },
{ 0, false, 0} };
@ -53,7 +53,7 @@ public:
virtual Otherwise* createContainer(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
if(atts.getLength())
throw SAX::SAXException("xsl:otherwise may not have any attributes");
@ -73,7 +73,7 @@ private:
Choose* choose_;
}; // class OtherwiseHandler
class ChooseHandler : public SAX::DefaultHandler
class ChooseHandler : public SAX::DefaultHandler<std::string>
{
public:
ChooseHandler(CompilationContext& context) :
@ -86,7 +86,7 @@ public:
virtual void startElement(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
if(!choose_)
{

View file

@ -20,7 +20,7 @@ public:
virtual Comment* createContainer(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
if(atts.getLength() != 0)
throw SAX::SAXException("xsl:comment can not have attributes");

View file

@ -19,7 +19,7 @@ public:
virtual Copy* createContainer(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
static const ValueRule rules[] = { { "use-attribute-sets", false, 0 },
{ 0, false, 0} };
@ -29,7 +29,7 @@ public:
} // createContainer
}; // class WhenHandler
class CopyOfHandler : public SAX::DefaultHandler
class CopyOfHandler : public SAX::DefaultHandler<std::string>
{
public:
CopyOfHandler(CompilationContext& context) :
@ -41,7 +41,7 @@ public:
virtual void startElement(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
if(copyOf_ == 0)
{

View file

@ -15,12 +15,12 @@ namespace XSLT
{
template<class Handler>
SAX::DefaultHandler* CreateHandler(CompilationContext& context)
SAX::DefaultHandler<std::string>* CreateHandler(CompilationContext& context)
{
return new Handler(context);
} // create
class NotImplementedYetHandler : public SAX::DefaultHandler
class NotImplementedYetHandler : public SAX::DefaultHandler<std::string>
{
public:
NotImplementedYetHandler(CompilationContext& context) { }
@ -28,13 +28,13 @@ public:
virtual void startElement(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
throw SAX::SAXException("Haven't implemented " + qName + " yet");
} // startElement
}; // NotImplementedYetHandler
typedef SAX::DefaultHandler* (*CreateHandlerPtr)(CompilationContext&);
typedef SAX::DefaultHandler<std::string>* (*CreateHandlerPtr)(CompilationContext&);
struct ChildElement
{

View file

@ -21,7 +21,7 @@ protected:
virtual Element* createContainer(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
static const ValueRule rules[] = { { "name", true, 0 },
{ "namespace", false, 0 },

View file

@ -23,7 +23,7 @@ protected:
virtual ForEach* createContainer(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
static const ValueRule rules[] = { { "select", true, 0 },
{ 0, false, 0} };
@ -35,7 +35,7 @@ protected:
virtual bool createChild(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
if((namespaceURI == StylesheetConstant::NamespaceURI()) &&
(localName == "sort"))

View file

@ -20,7 +20,7 @@ public:
virtual If* createContainer(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
static const ValueRule rules[] = { { "test", true, 0 },
{ 0, false, 0} };

View file

@ -10,7 +10,7 @@ namespace Arabica
namespace XSLT
{
class IncludeHandler : public SAX::DefaultHandler
class IncludeHandler : public SAX::DefaultHandler<std::string>
{
public:
IncludeHandler() :
@ -21,7 +21,7 @@ public:
{
} // IncludeHandler
void context(CompilationContext& context, SAX::DefaultHandler* compiler)
void context(CompilationContext& context, SAX::DefaultHandler<std::string>* compiler)
{
context_ = &context;
compiler_ = compiler;
@ -30,7 +30,7 @@ public:
void start_include(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
context_->parser().setContentHandler(*this);
startElement(namespaceURI, localName, qName, atts);
@ -39,7 +39,7 @@ public:
virtual void startElement(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
if(no_content_)
throw SAX::SAXException("xsl:include must be empty");
@ -77,10 +77,10 @@ public:
}
} // startElement
virtual void startPrefixMapping(const stringT& prefix, const stringT& uri)
{
context_->parentHandler().startPrefixMapping(prefix, uri);
} // startPrefixMapping
virtual void startPrefixMapping(const stringT& prefix, const stringT& uri)
{
context_->parentHandler().startPrefixMapping(prefix, uri);
} // startPrefixMapping
virtual void endElement(const std::string& namespaceURI,
@ -130,7 +130,7 @@ public:
} // unwind_imports
private:
std::string validate_href(const std::string& qName, const SAX::Attributes& atts)
std::string validate_href(const std::string& qName, const SAX::Attributes<std::string>& atts)
{
static const ValueRule rules[] = { { "href", true, 0 },
{ 0, false, 0 } };
@ -157,7 +157,7 @@ private:
std::string prev = context_->setBase(href);
SAX::InputSource source(href);
SAX::InputSource<std::string> source(href);
SAX::XMLReader<std::string> include_parser;
SAX::CatchErrorHandler<std::string> errorHandler;
@ -173,7 +173,7 @@ private:
current_includes_.pop_back();
} // include_stylesheet
SAX::DefaultHandler* compiler_;
SAX::DefaultHandler<std::string>* compiler_;
CompilationContext* context_;
unsigned int pass_through_;
bool no_content_;

View file

@ -21,7 +21,7 @@ protected:
virtual InlineElement* createContainer(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
std::vector<InlineAttribute> inlineAtts;
for(unsigned int i = 0; i != atts.getLength(); ++i)

View file

@ -11,10 +11,10 @@ namespace XSLT
{
const ChildElement* AllowedChildren();
SAX::DefaultHandler* createInlineElementHandler(CompilationContext& context);
SAX::DefaultHandler<std::string>* createInlineElementHandler(CompilationContext& context);
template<class container_type>
class ItemContainerHandler : public SAX::DefaultHandler
class ItemContainerHandler : public SAX::DefaultHandler<std::string>
{
protected:
ItemContainerHandler(CompilationContext& context) :
@ -26,7 +26,7 @@ protected:
virtual container_type* createContainer(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts) = 0;
const SAX::Attributes<std::string>& atts) = 0;
CompilationContext& context() const { return context_; }
container_type* container() const { return container_; }
@ -35,7 +35,7 @@ public:
virtual void startElement(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
if(container_ == 0)
{
@ -71,7 +71,7 @@ protected:
virtual bool createChild(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
if(namespaceURI == StylesheetConstant::NamespaceURI())
{
@ -156,7 +156,7 @@ const ChildElement* AllowedChildren()
return allowedChildren;
} // AllowedChildren
SAX::DefaultHandler* createInlineElementHandler(CompilationContext& context)
SAX::DefaultHandler<std::string>* createInlineElementHandler(CompilationContext& context)
{
return new InlineElementHandler(context);
} // InlineElementHandler

View file

@ -21,7 +21,7 @@ protected:
virtual Message* createContainer(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
static const ValueRule rules[] = { { "terminate", false, No, AllowedYesNo },
{ 0, false, 0} };

View file

@ -8,7 +8,7 @@ namespace Arabica
namespace XSLT
{
class NamespaceAliasHandler : public SAX::DefaultHandler
class NamespaceAliasHandler : public SAX::DefaultHandler<std::string>
{
public:
NamespaceAliasHandler(CompilationContext& context) :
@ -20,7 +20,7 @@ public:
virtual void startElement(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
if(!done_)
{

View file

@ -8,7 +8,7 @@ namespace Arabica
namespace XSLT
{
class OutputHandler : public SAX::DefaultHandler
class OutputHandler : public SAX::DefaultHandler<std::string>
{
public:
OutputHandler(CompilationContext& context) :
@ -19,7 +19,7 @@ public:
virtual void startElement(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
if(settings_.empty())
{

View file

@ -20,7 +20,7 @@ public:
virtual ProcessingInstruction* createContainer(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
static const ValueRule rules[] = { { "name", true, 0 },
{ 0, false, 0} };

View file

@ -8,7 +8,7 @@ namespace Arabica
namespace XSLT
{
class SortHandler : public SAX::DefaultHandler
class SortHandler : public SAX::DefaultHandler<std::string>
{
public:
SortHandler(CompilationContext& context,
@ -22,7 +22,7 @@ public:
virtual void startElement(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
if(sort_ == 0)
{

View file

@ -22,7 +22,7 @@ protected:
virtual Template* createContainer(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
const std::string& match = atts.getValue("match");
if((match == "") && (atts.getValue("name") == ""))
@ -45,7 +45,7 @@ protected:
virtual bool createChild(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
if((namespaceURI == StylesheetConstant::NamespaceURI()) &&
(localName == "param"))

View file

@ -8,7 +8,7 @@ namespace Arabica
namespace XSLT
{
class TextHandler : public SAX::DefaultHandler
class TextHandler : public SAX::DefaultHandler<std::string>
{
public:
TextHandler(CompilationContext& context) :
@ -20,7 +20,7 @@ public:
virtual void startElement(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
if(text_ == 0)
{

View file

@ -9,7 +9,7 @@ namespace Arabica
namespace XSLT
{
class ValueOfHandler : public SAX::DefaultHandler
class ValueOfHandler : public SAX::DefaultHandler<std::string>
{
public:
ValueOfHandler(CompilationContext& context) :
@ -21,7 +21,7 @@ public:
virtual void startElement(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
if(valueOf_ == 0)
{

View file

@ -49,7 +49,7 @@ void validateAttribute(const std::string& parentElement,
} // validateAttribute
std::map<std::string, std::string> gatherAttributes(const std::string& parentElement,
const SAX::Attributes& atts,
const SAX::Attributes<std::string>& atts,
const ValueRule* rules)
{
std::map<std::string, std::string> results;

View file

@ -23,7 +23,7 @@ protected:
virtual VType* createContainer(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
static const ValueRule rules[] = { { "name", true, 0 },
{ "select", false, 0 },

View file

@ -39,7 +39,7 @@ public:
} // while ...
} // ~CompilationContext
void root(SAX::DefaultHandler& root)
void root(SAX::DefaultHandler<std::string>& root)
{
handlerStack_.push(&root);
} // root
@ -64,11 +64,11 @@ public:
} // setBase
void push(ItemContainer* parent,
SAX::DefaultHandler* newHandler,
SAX::DefaultHandler<std::string>* newHandler,
const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
parentStack_.push(parent);
handlerStack_.push(newHandler);
@ -89,7 +89,7 @@ public:
return *parentStack_.top();
} // parentContainer
SAX::ContentHandler& parentHandler() const
SAX::ContentHandler<std::string>& parentHandler() const
{
parser_.setContentHandler(*handlerStack_.top());
return parser_.contentHandler();
@ -131,7 +131,7 @@ private:
StylesheetParser& parser_;
const Arabica::XPath::XPath<std::string>& xpath_;
Stylesheet& stylesheet_;
std::stack<SAX::DefaultHandler*> handlerStack_;
std::stack<SAX::DefaultHandler<std::string>*> handlerStack_;
std::stack<ItemContainer*> parentStack_;
std::map<std::string, Namespace> namespaceRemap_;

View file

@ -62,7 +62,7 @@ private:
Arabica::io::URI absolute(Arabica::io::URI(baseURI_), location);
SAX::InputSource is(absolute.as_string());
SAX::InputSource<std::string> is(absolute.as_string());
domParser.parse(is);
if(!eh.errorsReported())

View file

@ -221,7 +221,7 @@ public:
protected:
virtual void do_start_document(const Settings& settings) = 0;
virtual void do_end_document() = 0;
virtual void do_start_element(const std::string& qName, const std::string& namespaceURI, const SAX::Attributes& atts) = 0;
virtual void do_start_element(const std::string& qName, const std::string& namespaceURI, const SAX::Attributes<std::string>& atts) = 0;
virtual void do_end_element(const std::string& qName, const std::string& namespaceURI) = 0;
virtual void do_characters(const std::string& ch) = 0;
virtual void do_comment(const std::string& ch) = 0;
@ -305,7 +305,7 @@ private:
int pending_attribute_;
std::string name_;
std::string namespaceURI_;
SAX::AttributesImpl atts_;
SAX::AttributesImpl<std::string> atts_;
std::stringstream buffer_;
bool text_mode_;
NamespaceStack namespaceStack_;
@ -419,7 +419,7 @@ protected:
void do_start_element(const std::string& qName,
const std::string& namespaceURI,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
if(!seen_root_)
do_decl(qName);
@ -650,7 +650,7 @@ protected:
void do_start_element(const std::string& qName,
const std::string& namespaceURI,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
indent();
DOM::Element<std::string> elem = document().createElementNS(namespaceURI, qName);

View file

@ -19,7 +19,7 @@ namespace Arabica
namespace XSLT
{
class StylesheetHandler : public SAX::DefaultHandler
class StylesheetHandler : public SAX::DefaultHandler<std::string>
{
public:
StylesheetHandler(CompilationContext& context) :
@ -34,7 +34,7 @@ public:
virtual void startElement(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
if(top_)
{
@ -105,13 +105,13 @@ private:
void include_stylesheet(const std::string& namespaceURI,
const std::string& localName,
const std::string& qName,
const SAX::Attributes& atts)
const SAX::Attributes<std::string>& atts)
{
includer_.start_include(namespaceURI, localName, qName, atts);
} // include_stylesheet
CompilationContext& context_;
SAX::DefaultHandler* child_;
SAX::DefaultHandler<std::string>* child_;
IncludeHandler includer_;
bool top_;
unsigned int foreign_;
@ -149,7 +149,7 @@ public:
{
} // ~StylesheetCompiler
std::auto_ptr<Stylesheet> compile(SAX::InputSource& source)
std::auto_ptr<Stylesheet> compile(SAX::InputSource<std::string>& source)
{
error_ = "";

View file

@ -16,17 +16,17 @@ class StylesheetParser
public:
StylesheetParser() { }
void setContentHandler(SAX::ContentHandler& handler)
void setContentHandler(SAX::ContentHandler<std::string>& handler)
{
namespace_tracker_.setContentHandler(handler);
} // setContentHandler
SAX::ContentHandler& contentHandler()
SAX::ContentHandler<std::string>& contentHandler()
{
return text_coalescer_;
} // contentHandler
void parse(SAX::InputSource& source)
void parse(SAX::InputSource<std::string>& source)
{
SAX::XMLReader<std::string> base_parser;
text_coalescer_.setParent(base_parser);

View file

@ -15,7 +15,7 @@
using namespace Arabica::SAX;
InputSourceResolver::InputSourceResolver(const Arabica::SAX::InputSource& inputSource) :
InputSourceResolver::InputSourceResolver(const Arabica::SAX::InputSource<std::string>& inputSource) :
deleteStream_(false),
byteStream_(0)
{

View file

@ -28,7 +28,7 @@ class SAX2DOMTest : public TestCase
std::stringstream ss;
ss << SA::asStdString(str);
Arabica::SAX::basic_InputSource<string_type> is(ss);
Arabica::SAX::InputSource<string_type> is(ss);
Arabica::SAX::CatchErrorHandler<string_type> eh;
Arabica::SAX2DOM::Parser<string_type, string_adaptor> parser;
parser.setErrorHandler(eh);

View file

@ -28,7 +28,7 @@ class TreeWalkerTest : public TestCase
std::stringstream ss;
ss << SA::asStdString(str);
Arabica::SAX::basic_InputSource<string_type> is(ss);
Arabica::SAX::InputSource<string_type> is(ss);
Arabica::SAX::CatchErrorHandler<string_type> eh;
Arabica::SAX2DOM::Parser<string_type, string_adaptor> parser;
parser.setErrorHandler(eh);

View file

@ -125,11 +125,11 @@ class WhitespaceStripperTest : public TestCase
} // testStrip
private:
std::auto_ptr<Arabica::SAX::InputSource> source(const std::string& str)
std::auto_ptr<Arabica::SAX::InputSource<std::string> > source(const std::string& str)
{
std::auto_ptr<std::iostream> ss(new std::stringstream());
(*ss) << str;
return std::auto_ptr<Arabica::SAX::InputSource>(new Arabica::SAX::InputSource(ss));
return std::auto_ptr<Arabica::SAX::InputSource<std::string> >(new Arabica::SAX::InputSource<std::string>(ss));
} // source
}; // WhitespaceStripperTest

View file

@ -404,7 +404,7 @@ public:
std::stringstream ss;
ss << match;
Arabica::SAX::basic_InputSource<string_type> is(ss);
Arabica::SAX::InputSource<string_type> is(ss);
Arabica::SAX::CatchErrorHandler<string_type> eh;
Arabica::SAX2DOM::Parser<string_type, string_adaptor> parser;
parser.setErrorHandler(eh);

View file

@ -18,7 +18,7 @@ const std::string SEPERATOR = "/";
Arabica::DOM::Document<std::string> buildDOM(const std::string& filename)
{
Arabica::SAX::InputSource is(filename);
Arabica::SAX::InputSource<std::string> is(filename);
Arabica::SAX2DOM::Parser<std::string> parser;
parser.parse(is);
@ -85,7 +85,7 @@ protected:
{
Arabica::XSLT::StylesheetCompiler compiler;
Arabica::SAX::InputSource source(input_xslt_);
Arabica::SAX::InputSource<std::string> source(input_xslt_);
std::auto_ptr<Arabica::XSLT::Stylesheet> stylesheet = compiler.compile(source);
if(stylesheet.get() != 0)
assertImplementation(false, "Expected " + input_xslt_ + " not to compile. But it did :o");
@ -113,7 +113,7 @@ protected:
{
Arabica::XSLT::StylesheetCompiler compiler;
Arabica::SAX::InputSource source(input_xslt_);
Arabica::SAX::InputSource<std::string> source(input_xslt_);
std::auto_ptr<Arabica::XSLT::Stylesheet> stylesheet = compiler.compile(source);
if(stylesheet.get() == 0)
assertImplementation(false, "Failed to compile " + input_xslt_ + " : " + compiler.error());
@ -158,7 +158,7 @@ protected:
{
Arabica::XSLT::StylesheetCompiler compiler;
Arabica::SAX::InputSource source(input_xslt_);
Arabica::SAX::InputSource<std::string> source(input_xslt_);
std::auto_ptr<Arabica::XSLT::Stylesheet> stylesheet = compiler.compile(source);
if(stylesheet.get() == 0)
assertImplementation(false, "Failed to compile " + input_xslt_ + " : " + compiler.error());