mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-07-21 00:07:12 +02:00
Update libraries and make it build on windows.
Still gets some warnings because compilers have changed. But should work.
This commit is contained in:
@@ -37,6 +37,7 @@ public:
|
||||
Node* firstChild() const;
|
||||
Node* lastChild() const;
|
||||
Node* insertBefore(Node* newChild, Node* refChild);
|
||||
Node* insertAfterNP(Node* newChild, Node* refChild);
|
||||
Node* replaceChild(Node* newChild, Node* oldChild);
|
||||
Node* removeChild(Node* oldChild);
|
||||
Node* appendChild(Node* newChild);
|
||||
|
@@ -52,6 +52,7 @@ public:
|
||||
NamedNodeMap* attributes() const;
|
||||
Document* ownerDocument() const;
|
||||
Node* insertBefore(Node* newChild, Node* refChild);
|
||||
Node* insertAfterNP(Node* newChild, Node* refChild);
|
||||
Node* replaceChild(Node* newChild, Node* oldChild);
|
||||
Node* removeChild(Node* oldChild);
|
||||
Node* appendChild(Node* newChild);
|
||||
|
@@ -46,9 +46,14 @@ class XML_API DOMBuilder: protected DTDHandler, protected ContentHandler, protec
|
||||
/// must be supplied to the DOMBuilder.
|
||||
{
|
||||
public:
|
||||
DOMBuilder(XMLReader& xmlReader, NamePool* pNamePool = 0);
|
||||
DOMBuilder(XMLReader& xmlReader, NamePool* pNamePool = 0, std::size_t maxDepth = 0);
|
||||
/// Creates a DOMBuilder using the given XMLReader.
|
||||
/// If a NamePool is given, it becomes the Document's NamePool.
|
||||
///
|
||||
/// The maxDepth parameter can be used to limit the maximum element depth of the
|
||||
/// document. This can be used to prevent excessive element depth, which
|
||||
/// could lead to a stack overflow when destroying the document.
|
||||
/// A maxDepth of 0 does not limit the depth.
|
||||
|
||||
virtual ~DOMBuilder();
|
||||
/// Destroys the DOMBuilder.
|
||||
@@ -98,11 +103,13 @@ private:
|
||||
|
||||
XMLReader& _xmlReader;
|
||||
NamePool* _pNamePool;
|
||||
std::size_t _maxDepth;
|
||||
Document* _pDocument;
|
||||
AbstractContainerNode* _pParent;
|
||||
AbstractNode* _pPrevious;
|
||||
bool _inCDATA;
|
||||
bool _namespaces;
|
||||
std::size_t _depth;
|
||||
};
|
||||
|
||||
|
||||
|
20
vendor/POCO/XML/include/Poco/DOM/DOMParser.h
vendored
20
vendor/POCO/XML/include/Poco/DOM/DOMParser.h
vendored
@@ -99,12 +99,30 @@ public:
|
||||
void setEntityResolver(EntityResolver* pEntityResolver);
|
||||
/// Sets the entity resolver on the underlying SAXParser.
|
||||
|
||||
void setMaxElementDepth(std::size_t limit);
|
||||
/// Limits the maximum element depth of the XML document to be loaded.
|
||||
/// Setting the limit to zero disables the limit.
|
||||
///
|
||||
/// This can be used to prevent excessive element depth, which
|
||||
/// could lead to a stack overflow when destroying the document.
|
||||
///
|
||||
/// The default limit is 256.
|
||||
|
||||
std::size_t getMaxElementDepth() const;
|
||||
/// Returns the maximum element depth.
|
||||
|
||||
static const XMLString FEATURE_FILTER_WHITESPACE;
|
||||
|
||||
enum
|
||||
{
|
||||
DEFAULT_MAX_ELEMENT_DEPTH = 256
|
||||
};
|
||||
|
||||
private:
|
||||
SAXParser _saxParser;
|
||||
NamePool* _pNamePool;
|
||||
bool _filterWhitespace;
|
||||
bool _filterWhitespace = false;
|
||||
std::size_t _maxElementDepth = DEFAULT_MAX_ELEMENT_DEPTH;
|
||||
};
|
||||
|
||||
|
||||
|
8
vendor/POCO/XML/include/Poco/DOM/Node.h
vendored
8
vendor/POCO/XML/include/Poco/DOM/Node.h
vendored
@@ -133,6 +133,14 @@ public:
|
||||
/// If newChild is a DocumentFragment object, all of its children are
|
||||
/// inserted in the same order, before refChild. If the newChild is already
|
||||
/// in the tree, it is first removed.
|
||||
|
||||
virtual Node* insertAfterNP(Node* newChild, Node* refChild) = 0;
|
||||
/// Inserts the node newChild after the existing child node refChild.
|
||||
///
|
||||
/// If refChild is null, insert newChild at the beginning of the list of children.
|
||||
/// If newChild is a DocumentFragment object, all of its children are
|
||||
/// inserted in the same order, after refChild. If the newChild is already
|
||||
/// in the tree, it is first removed.
|
||||
|
||||
virtual Node* replaceChild(Node* newChild, Node* oldChild) = 0;
|
||||
/// Replaces the child node oldChild with newChild in the list of children,
|
||||
|
7
vendor/POCO/XML/include/Poco/SAX/SAXParser.h
vendored
7
vendor/POCO/XML/include/Poco/SAX/SAXParser.h
vendored
@@ -20,13 +20,16 @@
|
||||
|
||||
#include "Poco/XML/XML.h"
|
||||
#include "Poco/SAX/XMLReader.h"
|
||||
#include "Poco/XML/ParserEngine.h"
|
||||
#include "Poco/TextEncoding.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace XML {
|
||||
|
||||
|
||||
class ParserEngine;
|
||||
|
||||
|
||||
class XML_API SAXParser: public XMLReader
|
||||
/// This class provides a SAX2 (Simple API for XML) interface to expat,
|
||||
/// the XML parser toolkit.
|
||||
@@ -101,7 +104,7 @@ protected:
|
||||
void setupParse();
|
||||
|
||||
private:
|
||||
ParserEngine _engine;
|
||||
ParserEngine* _engine;
|
||||
bool _namespaces;
|
||||
bool _namespacePrefixes;
|
||||
};
|
||||
|
384
vendor/POCO/XML/include/Poco/XML/ParserEngine.h
vendored
384
vendor/POCO/XML/include/Poco/XML/ParserEngine.h
vendored
@@ -1,384 +0,0 @@
|
||||
//
|
||||
// ParserEngine.h
|
||||
//
|
||||
// Library: XML
|
||||
// Package: XML
|
||||
// Module: ParserEngine
|
||||
//
|
||||
// Definition of the ParseEngine class.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
|
||||
|
||||
#ifndef XML_ParserEngine_INCLUDED
|
||||
#define XML_ParserEngine_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/XML/XML.h"
|
||||
#if defined(POCO_UNBUNDLED)
|
||||
#include <expat.h>
|
||||
#else
|
||||
#include "Poco/XML/expat.h"
|
||||
#endif
|
||||
#include "Poco/XML/XMLString.h"
|
||||
#include "Poco/XML/XMLStream.h"
|
||||
#include "Poco/SAX/Locator.h"
|
||||
#include "Poco/TextEncoding.h"
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace XML {
|
||||
|
||||
|
||||
class InputSource;
|
||||
class EntityResolver;
|
||||
class DTDHandler;
|
||||
class DeclHandler;
|
||||
class ContentHandler;
|
||||
class LexicalHandler;
|
||||
class ErrorHandler;
|
||||
class NamespaceStrategy;
|
||||
class ContextLocator;
|
||||
|
||||
|
||||
class XML_API ParserEngine: public Locator
|
||||
/// This class provides an object-oriented, stream-based,
|
||||
/// low-level interface to the XML Parser Toolkit (expat).
|
||||
/// It is strongly recommended, that you use the
|
||||
/// SAX parser classes (which are based on this
|
||||
/// class) instead of this class, since they provide
|
||||
/// a standardized, higher-level interface to the parser.
|
||||
{
|
||||
public:
|
||||
ParserEngine();
|
||||
/// Creates the parser engine.
|
||||
|
||||
ParserEngine(const XMLString& encoding);
|
||||
/// Creates the parser engine and passes the encoding
|
||||
/// to the underlying parser.
|
||||
|
||||
~ParserEngine();
|
||||
/// Destroys the parser.
|
||||
|
||||
void setEncoding(const XMLString& encoding);
|
||||
/// Sets the encoding used by expat. The encoding must be
|
||||
/// set before parsing begins, otherwise it will be ignored.
|
||||
|
||||
const XMLString& getEncoding() const;
|
||||
/// Returns the encoding used by expat.
|
||||
|
||||
void addEncoding(const XMLString& name, Poco::TextEncoding* pEncoding);
|
||||
/// Adds an encoding to the parser.
|
||||
|
||||
void setNamespaceStrategy(NamespaceStrategy* pStrategy);
|
||||
/// Sets the NamespaceStrategy used by the parser.
|
||||
/// The parser takes ownership of the strategy object
|
||||
/// and deletes it when it's no longer needed.
|
||||
/// The default is NoNamespacesStrategy.
|
||||
|
||||
NamespaceStrategy* getNamespaceStrategy() const;
|
||||
/// Returns the NamespaceStrategy currently in use.
|
||||
|
||||
void setExpandInternalEntities(bool flag = true);
|
||||
/// Enables/disables expansion of internal entities (enabled by
|
||||
/// default). If entity expansion is disabled, internal entities
|
||||
/// are reported via the default handler.
|
||||
/// Must be set before parsing begins, otherwise it will be
|
||||
/// ignored.
|
||||
|
||||
bool getExpandInternalEntities() const;
|
||||
/// Returns true if internal entities will be expanded automatically,
|
||||
/// which is the default.
|
||||
|
||||
void setExternalGeneralEntities(bool flag = true);
|
||||
/// Enable or disable processing of external general entities.
|
||||
|
||||
bool getExternalGeneralEntities() const;
|
||||
/// Returns true if external general entities will be processed; false otherwise.
|
||||
|
||||
void setExternalParameterEntities(bool flag = true);
|
||||
/// Enable or disable processing of external parameter entities.
|
||||
|
||||
bool getExternalParameterEntities() const;
|
||||
/// Returns true if external parameter entities will be processed; false otherwise.
|
||||
|
||||
void setEntityResolver(EntityResolver* pResolver);
|
||||
/// Allow an application to register an entity resolver.
|
||||
|
||||
EntityResolver* getEntityResolver() const;
|
||||
/// Return the current entity resolver.
|
||||
|
||||
void setDTDHandler(DTDHandler* pDTDHandler);
|
||||
/// Allow an application to register a DTD event handler.
|
||||
|
||||
DTDHandler* getDTDHandler() const;
|
||||
/// Return the current DTD handler.
|
||||
|
||||
void setDeclHandler(DeclHandler* pDeclHandler);
|
||||
/// Allow an application to register a DTD declarations event handler.
|
||||
|
||||
DeclHandler* getDeclHandler() const;
|
||||
/// Return the current DTD declarations handler.
|
||||
|
||||
void setContentHandler(ContentHandler* pContentHandler);
|
||||
/// Allow an application to register a content event handler.
|
||||
|
||||
ContentHandler* getContentHandler() const;
|
||||
/// Return the current content handler.
|
||||
|
||||
void setLexicalHandler(LexicalHandler* pLexicalHandler);
|
||||
/// Allow an application to register a lexical event handler.
|
||||
|
||||
LexicalHandler* getLexicalHandler() const;
|
||||
/// Return the current lexical handler.
|
||||
|
||||
void setErrorHandler(ErrorHandler* pErrorHandler);
|
||||
/// Allow an application to register an error event handler.
|
||||
|
||||
ErrorHandler* getErrorHandler() const;
|
||||
/// Return the current error handler.
|
||||
|
||||
void setEnablePartialReads(bool flag = true);
|
||||
/// Enable or disable partial reads from the input source.
|
||||
///
|
||||
/// This is useful for parsing XML from a socket stream for
|
||||
/// a protocol like XMPP, where basically single elements
|
||||
/// are read one at a time from the input source's stream, and
|
||||
/// following elements depend upon responses sent back to
|
||||
/// the peer.
|
||||
///
|
||||
/// Normally, the parser always reads blocks of PARSE_BUFFER_SIZE
|
||||
/// at a time, and blocks until a complete block has been read (or
|
||||
/// the end of the stream has been reached).
|
||||
/// This allows for efficient parsing of "complete" XML documents,
|
||||
/// but fails in a case such as XMPP, where only XML fragments
|
||||
/// are sent at a time.
|
||||
|
||||
bool getEnablePartialReads() const;
|
||||
/// Returns true if partial reads are enabled (see
|
||||
/// setEnablePartialReads()), false otherwise.
|
||||
|
||||
void setBillionLaughsAttackProtectionMaximumAmplification(float maximumAmplificationFactor);
|
||||
/// Sets the maximum tolerated amplification factor
|
||||
/// for protection against Billion Laughs Attacks.
|
||||
///
|
||||
/// The amplification factor is calculated as:
|
||||
/// amplification := (direct + indirect) / direct
|
||||
/// while parsing, whereas:
|
||||
/// - direct is the number of bytes read from the primary document in parsing and
|
||||
/// - indirect is the number of bytes added by expanding entities and reading of
|
||||
/// external DTD files, combined.
|
||||
///
|
||||
/// maximumAmplificationFactor must be non-NaN and greater than or equal to 1.0.
|
||||
///
|
||||
/// Requires an underlying Expat version >= 2.4.0.
|
||||
|
||||
void setBillionLaughsAttackProtectionActivationThreshold(Poco::UInt64 activationThresholdBytes);
|
||||
/// Sets number of output bytes (including amplification from entity expansion and reading DTD files)
|
||||
/// needed to activate protection against Billion Laughs Attacks.
|
||||
///
|
||||
/// Defaults to 8 MiB.
|
||||
///
|
||||
/// Requires an underlying Expat version >= 2.4.0.
|
||||
|
||||
void parse(InputSource* pInputSource);
|
||||
/// Parse an XML document from the given InputSource.
|
||||
|
||||
void parse(const char* pBuffer, std::size_t size);
|
||||
/// Parses an XML document from the given buffer.
|
||||
|
||||
// Locator
|
||||
XMLString getPublicId() const;
|
||||
/// Return the public identifier for the current document event.
|
||||
|
||||
XMLString getSystemId() const;
|
||||
/// Return the system identifier for the current document event.
|
||||
|
||||
int getLineNumber() const;
|
||||
/// Return the line number where the current document event ends.
|
||||
|
||||
int getColumnNumber() const;
|
||||
/// Return the column number where the current document event ends.
|
||||
|
||||
protected:
|
||||
void init();
|
||||
/// initializes expat
|
||||
|
||||
void parseByteInputStream(XMLByteInputStream& istr);
|
||||
/// Parses an entity from the given stream.
|
||||
|
||||
void parseCharInputStream(XMLCharInputStream& istr);
|
||||
/// Parses an entity from the given stream.
|
||||
|
||||
std::streamsize readBytes(XMLByteInputStream& istr, char* pBuffer, std::streamsize bufferSize);
|
||||
/// Reads at most bufferSize bytes from the given stream into the given buffer.
|
||||
|
||||
std::streamsize readChars(XMLCharInputStream& istr, XMLChar* pBuffer, std::streamsize bufferSize);
|
||||
/// Reads at most bufferSize chars from the given stream into the given buffer.
|
||||
|
||||
void handleError(int errorNo);
|
||||
/// Throws an XMLException with a message corresponding
|
||||
/// to the given Expat error code.
|
||||
|
||||
void parseExternal(XML_Parser extParser, InputSource* pInputSource);
|
||||
/// Parse an XML document from the given InputSource.
|
||||
|
||||
void parseExternalByteInputStream(XML_Parser extParser, XMLByteInputStream& istr);
|
||||
/// Parses an external entity from the given stream, with a separate parser.
|
||||
|
||||
void parseExternalCharInputStream(XML_Parser extParser, XMLCharInputStream& istr);
|
||||
/// Parses an external entity from the given stream, with a separate parser.
|
||||
|
||||
void pushContext(XML_Parser parser, InputSource* pInputSource);
|
||||
/// Pushes a new entry to the context stack.
|
||||
|
||||
void popContext();
|
||||
/// Pops the top-most entry from the context stack.
|
||||
|
||||
void resetContext();
|
||||
/// Resets and clears the context stack.
|
||||
|
||||
const Locator& locator() const;
|
||||
/// Returns a locator denoting the current parse location.
|
||||
|
||||
// expat handler procedures
|
||||
static void handleStartElement(void* userData, const XML_Char* name, const XML_Char** atts);
|
||||
static void handleEndElement(void* userData, const XML_Char* name);
|
||||
static void handleCharacterData(void* userData, const XML_Char* s, int len);
|
||||
static void handleProcessingInstruction(void* userData, const XML_Char* target, const XML_Char* data);
|
||||
static void handleDefault(void* userData, const XML_Char* s, int len);
|
||||
static void handleUnparsedEntityDecl(void* userData, const XML_Char* entityName, const XML_Char* base, const XML_Char* systemId, const XML_Char* publicId, const XML_Char* notationName);
|
||||
static void handleNotationDecl(void* userData, const XML_Char* notationName, const XML_Char* base, const XML_Char* systemId, const XML_Char* publicId);
|
||||
static int handleExternalEntityRef(XML_Parser parser, const XML_Char* openEntityNames, const XML_Char* base, const XML_Char* systemId, const XML_Char* publicId);
|
||||
static int handleUnknownEncoding(void* encodingHandlerData, const XML_Char* name, XML_Encoding* info);
|
||||
static void handleComment(void* userData, const XML_Char* data);
|
||||
static void handleStartCdataSection(void* userData);
|
||||
static void handleEndCdataSection(void* userData);
|
||||
static void handleStartNamespaceDecl(void* userData, const XML_Char* prefix, const XML_Char* uri);
|
||||
static void handleEndNamespaceDecl(void* userData, const XML_Char* prefix);
|
||||
static void handleStartDoctypeDecl(void* userData, const XML_Char* doctypeName, const XML_Char *systemId, const XML_Char* publicId, int hasInternalSubset);
|
||||
static void handleEndDoctypeDecl(void* userData);
|
||||
static void handleEntityDecl(void *userData, const XML_Char *entityName, int isParamEntity, const XML_Char *value, int valueLength,
|
||||
const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName);
|
||||
static void handleExternalParsedEntityDecl(void* userData, const XML_Char* entityName, const XML_Char* base, const XML_Char* systemId, const XML_Char* publicId);
|
||||
static void handleInternalParsedEntityDecl(void* userData, const XML_Char* entityName, const XML_Char* replacementText, int replacementTextLength);
|
||||
static void handleSkippedEntity(void* userData, const XML_Char* entityName, int isParameterEntity);
|
||||
|
||||
// encoding support
|
||||
static int convert(void *data, const char *s);
|
||||
|
||||
private:
|
||||
typedef std::map<XMLString, Poco::TextEncoding*> EncodingMap;
|
||||
typedef std::vector<ContextLocator*> ContextStack;
|
||||
|
||||
XML_Parser _parser;
|
||||
char* _pBuffer;
|
||||
bool _encodingSpecified;
|
||||
XMLString _encoding;
|
||||
bool _expandInternalEntities;
|
||||
bool _externalGeneralEntities;
|
||||
bool _externalParameterEntities;
|
||||
bool _enablePartialReads;
|
||||
NamespaceStrategy* _pNamespaceStrategy;
|
||||
EncodingMap _encodings;
|
||||
ContextStack _context;
|
||||
|
||||
EntityResolver* _pEntityResolver;
|
||||
DTDHandler* _pDTDHandler;
|
||||
DeclHandler* _pDeclHandler;
|
||||
ContentHandler* _pContentHandler;
|
||||
LexicalHandler* _pLexicalHandler;
|
||||
ErrorHandler* _pErrorHandler;
|
||||
|
||||
float _maximumAmplificationFactor;
|
||||
Poco::UInt64 _activationThresholdBytes;
|
||||
|
||||
static const int PARSE_BUFFER_SIZE;
|
||||
static const XMLString EMPTY_STRING;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline const XMLString& ParserEngine::getEncoding() const
|
||||
{
|
||||
return _encoding;
|
||||
}
|
||||
|
||||
|
||||
inline NamespaceStrategy* ParserEngine::getNamespaceStrategy() const
|
||||
{
|
||||
return _pNamespaceStrategy;
|
||||
}
|
||||
|
||||
|
||||
inline bool ParserEngine::getExpandInternalEntities() const
|
||||
{
|
||||
return _expandInternalEntities;
|
||||
}
|
||||
|
||||
|
||||
inline bool ParserEngine::getExternalGeneralEntities() const
|
||||
{
|
||||
return _externalGeneralEntities;
|
||||
}
|
||||
|
||||
|
||||
inline bool ParserEngine::getExternalParameterEntities() const
|
||||
{
|
||||
return _externalParameterEntities;
|
||||
}
|
||||
|
||||
|
||||
inline EntityResolver* ParserEngine::getEntityResolver() const
|
||||
{
|
||||
return _pEntityResolver;
|
||||
}
|
||||
|
||||
|
||||
inline DTDHandler* ParserEngine::getDTDHandler() const
|
||||
{
|
||||
return _pDTDHandler;
|
||||
}
|
||||
|
||||
|
||||
inline DeclHandler* ParserEngine::getDeclHandler() const
|
||||
{
|
||||
return _pDeclHandler;
|
||||
}
|
||||
|
||||
|
||||
inline ContentHandler* ParserEngine::getContentHandler() const
|
||||
{
|
||||
return _pContentHandler;
|
||||
}
|
||||
|
||||
|
||||
inline LexicalHandler* ParserEngine::getLexicalHandler() const
|
||||
{
|
||||
return _pLexicalHandler;
|
||||
}
|
||||
|
||||
|
||||
inline ErrorHandler* ParserEngine::getErrorHandler() const
|
||||
{
|
||||
return _pErrorHandler;
|
||||
}
|
||||
|
||||
|
||||
inline bool ParserEngine::getEnablePartialReads() const
|
||||
{
|
||||
return _enablePartialReads;
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::XML
|
||||
|
||||
|
||||
#endif // XML_ParserEngine_INCLUDED
|
@@ -30,11 +30,7 @@
|
||||
#include "Poco/XML/QName.h"
|
||||
#include "Poco/XML/ValueTraits.h"
|
||||
#include "Poco/XML/Content.h"
|
||||
#if defined(POCO_UNBUNDLED)
|
||||
#include <expat.h>
|
||||
#else
|
||||
#include "Poco/XML/expat.h"
|
||||
#endif
|
||||
#include "Poco/XML/XMLString.h"
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
@@ -42,6 +38,9 @@
|
||||
#include <cstddef>
|
||||
|
||||
|
||||
struct XML_ParserStruct;
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace XML {
|
||||
|
||||
@@ -269,17 +268,18 @@ private:
|
||||
XMLStreamParser(const XMLStreamParser&);
|
||||
XMLStreamParser& operator = (const XMLStreamParser&);
|
||||
|
||||
static void XMLCALL handleStartElement(void*, const XML_Char*, const XML_Char**);
|
||||
static void XMLCALL handleEndElement(void*, const XML_Char*);
|
||||
static void XMLCALL handleCharacters(void*, const XML_Char*, int);
|
||||
static void XMLCALL handleStartNamespaceDecl(void*, const XML_Char*, const XML_Char*);
|
||||
static void XMLCALL handleEndNamespaceDecl(void*, const XML_Char*);
|
||||
static void handleStartElement(void*, const XMLChar*, const XMLChar**);
|
||||
static void handleEndElement(void*, const XMLChar*);
|
||||
static void handleCharacters(void*, const XMLChar*, int);
|
||||
static void handleStartNamespaceDecl(void*, const XMLChar*, const XMLChar*);
|
||||
static void handleEndNamespaceDecl(void*, const XMLChar*);
|
||||
|
||||
void init();
|
||||
EventType nextImpl(bool peek);
|
||||
EventType nextBody();
|
||||
void handleError();
|
||||
|
||||
#ifndef POCO_DOC
|
||||
// If _size is 0, then data is std::istream. Otherwise, it is a buffer.
|
||||
union
|
||||
{
|
||||
@@ -287,14 +287,21 @@ private:
|
||||
const void* buf;
|
||||
}
|
||||
_data;
|
||||
#endif
|
||||
|
||||
enum ParserState
|
||||
{
|
||||
state_next,
|
||||
state_peek
|
||||
};
|
||||
|
||||
std::size_t _size;
|
||||
const std::string _inputName;
|
||||
FeatureType _feature;
|
||||
XML_Parser _parser;
|
||||
XML_ParserStruct* _parser;
|
||||
std::size_t _depth;
|
||||
bool _accumulateContent; // Whether we are accumulating character content.
|
||||
enum { state_next, state_peek } _parserState;
|
||||
ParserState _parserState;
|
||||
EventType _currentEvent;
|
||||
EventType _queue;
|
||||
QName _qname;
|
||||
|
@@ -33,13 +33,13 @@ class XML_API XMLStreamParserException: public Poco::XML::XMLException
|
||||
public:
|
||||
XMLStreamParserException(const std::string& name, Poco::UInt64 line, Poco::UInt64 column, const std::string& description);
|
||||
XMLStreamParserException(const XMLStreamParser&, const std::string& description);
|
||||
virtual ~XMLStreamParserException() throw ();
|
||||
virtual ~XMLStreamParserException() noexcept;
|
||||
|
||||
const char* name() const noexcept;
|
||||
Poco::UInt64 line() const;
|
||||
Poco::UInt64 column() const;
|
||||
const std::string& description() const;
|
||||
virtual const char* what() const throw ();
|
||||
virtual const char* what() const noexcept;
|
||||
|
||||
private:
|
||||
void init();
|
||||
|
1064
vendor/POCO/XML/include/Poco/XML/expat.h
vendored
1064
vendor/POCO/XML/include/Poco/XML/expat.h
vendored
File diff suppressed because it is too large
Load Diff
165
vendor/POCO/XML/include/Poco/XML/expat_external.h
vendored
165
vendor/POCO/XML/include/Poco/XML/expat_external.h
vendored
@@ -1,165 +0,0 @@
|
||||
/*
|
||||
__ __ _
|
||||
___\ \/ /_ __ __ _| |_
|
||||
/ _ \\ /| '_ \ / _` | __|
|
||||
| __// \| |_) | (_| | |_
|
||||
\___/_/\_\ .__/ \__,_|\__|
|
||||
|_| XML parser
|
||||
|
||||
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
|
||||
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
Copyright (c) 2000-2004 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2001-2002 Greg Stein <gstein@users.sourceforge.net>
|
||||
Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2016 Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Copyright (c) 2016-2019 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
|
||||
Copyright (c) 2018 Yury Gribov <tetra2005@gmail.com>
|
||||
Licensed under the MIT license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the
|
||||
following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef Expat_External_INCLUDED
|
||||
#define Expat_External_INCLUDED 1
|
||||
|
||||
/* External API definitions */
|
||||
|
||||
/* Expat tries very hard to make the API boundary very specifically
|
||||
defined. There are two macros defined to control this boundary;
|
||||
each of these can be defined before including this header to
|
||||
achieve some different behavior, but doing so it not recommended or
|
||||
tested frequently.
|
||||
|
||||
XMLCALL - The calling convention to use for all calls across the
|
||||
"library boundary." This will default to cdecl, and
|
||||
try really hard to tell the compiler that's what we
|
||||
want.
|
||||
|
||||
XMLIMPORT - Whatever magic is needed to note that a function is
|
||||
to be imported from a dynamically loaded library
|
||||
(.dll, .so, or .sl, depending on your platform).
|
||||
|
||||
The XMLCALL macro was added in Expat 1.95.7. The only one which is
|
||||
expected to be directly useful in client code is XMLCALL.
|
||||
|
||||
Note that on at least some Unix versions, the Expat library must be
|
||||
compiled with the cdecl calling convention as the default since
|
||||
system headers may assume the cdecl convention.
|
||||
*/
|
||||
#ifndef XMLCALL
|
||||
# if defined(_MSC_VER)
|
||||
# define XMLCALL __cdecl
|
||||
# elif defined(__GNUC__) && defined(__i386) && ! defined(__INTEL_COMPILER)
|
||||
# define XMLCALL __attribute__((cdecl))
|
||||
# else
|
||||
/* For any platform which uses this definition and supports more than
|
||||
one calling convention, we need to extend this definition to
|
||||
declare the convention used on that platform, if it's possible to
|
||||
do so.
|
||||
|
||||
If this is the case for your platform, please file a bug report
|
||||
with information on how to identify your platform via the C
|
||||
pre-processor and how to specify the same calling convention as the
|
||||
platform's malloc() implementation.
|
||||
*/
|
||||
# define XMLCALL
|
||||
# endif
|
||||
#endif /* not defined XMLCALL */
|
||||
|
||||
#if ! defined(XML_STATIC) && ! defined(XMLIMPORT)
|
||||
# ifndef XML_BUILDING_EXPAT
|
||||
/* using Expat from an application */
|
||||
|
||||
# if defined(_MSC_EXTENSIONS) && ! defined(__BEOS__) && ! defined(__CYGWIN__)
|
||||
# define XMLIMPORT __declspec(dllimport)
|
||||
# endif
|
||||
|
||||
# endif
|
||||
#endif /* not defined XML_STATIC */
|
||||
|
||||
#ifndef XML_ENABLE_VISIBILITY
|
||||
# define XML_ENABLE_VISIBILITY 0
|
||||
#endif
|
||||
|
||||
#if ! defined(XMLIMPORT) && XML_ENABLE_VISIBILITY
|
||||
# define XMLIMPORT __attribute__((visibility("default")))
|
||||
#endif
|
||||
|
||||
/* If we didn't define it above, define it away: */
|
||||
#ifndef XMLIMPORT
|
||||
# define XMLIMPORT
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) \
|
||||
&& (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96))
|
||||
# define XML_ATTR_MALLOC __attribute__((__malloc__))
|
||||
#else
|
||||
# define XML_ATTR_MALLOC
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) \
|
||||
&& ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
|
||||
# define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
|
||||
#else
|
||||
# define XML_ATTR_ALLOC_SIZE(x)
|
||||
#endif
|
||||
|
||||
#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef XML_UNICODE_WCHAR_T
|
||||
# ifndef XML_UNICODE
|
||||
# define XML_UNICODE
|
||||
# endif
|
||||
# if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2)
|
||||
# error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef XML_UNICODE /* Information is UTF-16 encoded. */
|
||||
# ifdef XML_UNICODE_WCHAR_T
|
||||
typedef wchar_t XML_Char;
|
||||
typedef wchar_t XML_LChar;
|
||||
# else
|
||||
typedef unsigned short XML_Char;
|
||||
typedef char XML_LChar;
|
||||
# endif /* XML_UNICODE_WCHAR_T */
|
||||
#else /* Information is UTF-8 encoded. */
|
||||
typedef char XML_Char;
|
||||
typedef char XML_LChar;
|
||||
#endif /* XML_UNICODE */
|
||||
|
||||
#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
|
||||
typedef long long XML_Index;
|
||||
typedef unsigned long long XML_Size;
|
||||
#else
|
||||
typedef long XML_Index;
|
||||
typedef unsigned long XML_Size;
|
||||
#endif /* XML_LARGE_SIZE */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* not Expat_External_INCLUDED */
|
Reference in New Issue
Block a user