mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2026-08-15 12:17:11 +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);
|
||||
|
||||
+8
-1
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
+19
-1
@@ -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
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user