Initial commit

This commit is contained in:
pasketti
2026-04-05 16:14:49 -04:00
commit ebee3a5534
14059 changed files with 2588797 additions and 0 deletions

19
node_modules/libxmljs/src/html_document.h generated vendored Normal file
View File

@@ -0,0 +1,19 @@
// Copyright 2009, Squish Tech, LLC.
#ifndef SRC_HTML_DOCUMENT_H_
#define SRC_HTML_DOCUMENT_H_
#include "libxmljs.h"
#include "xml_document.h"
namespace libxmljs {
class HtmlDocument : public XmlDocument {
public:
explicit HtmlDocument(xmlDoc* doc) : XmlDocument(doc) {}
static void Initialize(v8::Handle<v8::Object> target);
};
} // namespace libxmljs
#endif // SRC_HTML_DOCUMENT_H_

34
node_modules/libxmljs/src/libxmljs.h generated vendored Normal file
View File

@@ -0,0 +1,34 @@
// Copyright 2009, Squish Tech, LLC.
#ifndef SRC_LIBXMLJS_H_
#define SRC_LIBXMLJS_H_
#include <v8.h>
#include <node.h>
#include "nan.h"
#define LIBXMLJS_ARGUMENT_TYPE_CHECK(arg, type, err) \
if (!arg->type()) { \
return Nan::ThrowTypeError(err); \
}
namespace libxmljs {
#ifdef LIBXML_DEBUG_ENABLED
static const bool debugging = true;
#else
static const bool debugging = false;
#endif
// Ensure that libxml is properly initialised and destructed at shutdown
class LibXMLJS {
public:
LibXMLJS();
virtual ~LibXMLJS();
private:
static LibXMLJS instance;
};
} // namespace libxmljs
#endif // SRC_LIBXMLJS_H_

42
node_modules/libxmljs/src/xml_attribute.h generated vendored Normal file
View File

@@ -0,0 +1,42 @@
// Copyright 2009, Squish Tech, LLC.
#ifndef SRC_XML_ATTRIBUTE_H_
#define SRC_XML_ATTRIBUTE_H_
#include "libxmljs.h"
#include "xml_element.h"
#include "xml_namespace.h"
namespace libxmljs {
class XmlAttribute : public XmlNode {
public:
explicit XmlAttribute(xmlAttr* node) :
XmlNode(reinterpret_cast<xmlNode*>(node)) {}
static void Initialize(v8::Handle<v8::Object> target);
static Nan::Persistent<v8::FunctionTemplate> constructor_template;
static v8::Local<v8::Object> New(xmlNode* xml_obj,
const xmlChar* name, const xmlChar* value);
static v8::Local<v8::Object> New(xmlAttr* attr);
protected:
static NAN_METHOD(New);
static NAN_METHOD(Name);
static NAN_METHOD(Value);
static NAN_METHOD(Node);
static NAN_METHOD(Namespace);
v8::Local<v8::Value> get_name();
v8::Local<v8::Value> get_value();
void set_value(const char* value);
v8::Local<v8::Value> get_element();
v8::Local<v8::Value> get_namespace();
};
} // namespace libxmljs
#endif // SRC_XML_ATTRIBUTE_H_

32
node_modules/libxmljs/src/xml_comment.h generated vendored Normal file
View File

@@ -0,0 +1,32 @@
#ifndef SRC_XML_COMMENT_H_
#define SRC_XML_COMMENT_H_
#include "libxmljs.h"
#include "xml_node.h"
namespace libxmljs {
class XmlComment : public XmlNode {
public:
explicit XmlComment(xmlNode* node);
static void Initialize(v8::Handle<v8::Object> target);
static Nan::Persistent<v8::FunctionTemplate> constructor_template;
// create new xml comment to wrap the node
static v8::Local<v8::Object> New(xmlNode* node);
protected:
static NAN_METHOD(New);
static NAN_METHOD(Text);
void set_content(const char* content);
v8::Local<v8::Value> get_content();
};
} // namespace libxmljs
#endif // SRC_XML_COMMENT_H_

67
node_modules/libxmljs/src/xml_document.h generated vendored Normal file
View File

@@ -0,0 +1,67 @@
// Copyright 2009, Squish Tech, LLC.
#ifndef SRC_XML_DOCUMENT_H_
#define SRC_XML_DOCUMENT_H_
#include <libxml/tree.h>
#include "libxmljs.h"
namespace libxmljs {
class XmlDocument : public Nan::ObjectWrap {
// used to create new instanced of a document handle
static Nan::Persistent<v8::FunctionTemplate> constructor_template;
public:
// TODO make private with accessor
xmlDoc* xml_obj;
virtual ~XmlDocument();
// setup the document handle bindings and internal constructor
static void Initialize(v8::Handle<v8::Object> target);
// create a new document handle initialized with the
// given xmlDoc object, intended for use in c++ space
static v8::Local<v8::Object> New(xmlDoc* doc);
// publicly expose ref functions
using Nan::ObjectWrap::Ref;
using Nan::ObjectWrap::Unref;
// expose ObjectWrap::refs_ (for testing)
int refs() {
return refs_;
}
protected:
// initialize a new document
explicit XmlDocument(xmlDoc* doc);
static NAN_METHOD(New);
static NAN_METHOD(FromHtml);
static NAN_METHOD(FromXml);
static NAN_METHOD(SetDtd);
// document handle methods
static NAN_METHOD(Root);
static NAN_METHOD(GetDtd);
static NAN_METHOD(Encoding);
static NAN_METHOD(Version);
static NAN_METHOD(Doc);
static NAN_METHOD(Errors);
static NAN_METHOD(ToString);
static NAN_METHOD(Validate);
static NAN_METHOD(RngValidate);
// Static member variables
static const int DEFAULT_PARSING_OPTS;
static const int EXCLUDE_IMPLIED_ELEMENTS;
};
} // namespace libxmljs
#endif // SRC_XML_DOCUMENT_H_

65
node_modules/libxmljs/src/xml_element.h generated vendored Normal file
View File

@@ -0,0 +1,65 @@
// Copyright 2009, Squish Tech, LLC.
#ifndef SRC_XML_ELEMENT_H_
#define SRC_XML_ELEMENT_H_
#include "libxmljs.h"
#include "xml_node.h"
namespace libxmljs {
class XmlElement : public XmlNode {
public:
explicit XmlElement(xmlNode* node);
static void Initialize(v8::Handle<v8::Object> target);
static Nan::Persistent<v8::FunctionTemplate> constructor_template;
// create new xml element to wrap the node
static v8::Local<v8::Object> New(xmlNode* node);
protected:
static NAN_METHOD(New);
static NAN_METHOD(Name);
static NAN_METHOD(Attr);
static NAN_METHOD(Attrs);
static NAN_METHOD(Find);
static NAN_METHOD(Text);
static NAN_METHOD(Path);
static NAN_METHOD(Child);
static NAN_METHOD(ChildNodes);
static NAN_METHOD(AddChild);
static NAN_METHOD(AddCData);
static NAN_METHOD(NextElement);
static NAN_METHOD(PrevElement);
static NAN_METHOD(AddPrevSibling);
static NAN_METHOD(AddNextSibling);
static NAN_METHOD(Replace);
void set_name(const char* name);
v8::Local<v8::Value> get_name();
v8::Local<v8::Value> get_child(int32_t idx);
v8::Local<v8::Value> get_child_nodes();
v8::Local<v8::Value> get_path();
v8::Local<v8::Value> get_attr(const char* name);
v8::Local<v8::Value> get_attrs();
void set_attr(const char* name, const char* value);
void add_cdata(xmlNode* cdata);
void unlink_children();
void set_content(const char* content);
v8::Local<v8::Value> get_content();
v8::Local<v8::Value> get_next_element();
v8::Local<v8::Value> get_prev_element();
void replace_element(xmlNode* element);
void replace_text(const char* content);
bool child_will_merge(xmlNode* child);
bool prev_sibling_will_merge(xmlNode* node);
bool next_sibling_will_merge(xmlNode* node);
};
} // namespace libxmljs
#endif // SRC_XML_ELEMENT_H_

41
node_modules/libxmljs/src/xml_namespace.h generated vendored Normal file
View File

@@ -0,0 +1,41 @@
// Copyright 2009, Squish Tech, LLC.
#ifndef SRC_XML_NAMESPACE_H_
#define SRC_XML_NAMESPACE_H_
#include <node.h>
#include <libxml/tree.h>
#include "nan.h"
namespace libxmljs {
class XmlNamespace : public Nan::ObjectWrap {
public:
xmlNs* xml_obj;
xmlDoc* context; // reference-managed context
static void Initialize(v8::Handle<v8::Object> target);
static Nan::Persistent<v8::FunctionTemplate> constructor_template;
explicit XmlNamespace(xmlNs* ns);
XmlNamespace(xmlNs* node, const char* prefix, const char* href);
~XmlNamespace();
static v8::Local<v8::Object> New(xmlNs* ns);
protected:
static NAN_METHOD(New);
static NAN_METHOD(Href);
static NAN_METHOD(Prefix);
v8::Local<v8::Value> get_href();
v8::Local<v8::Value> get_prefix();
friend class Node;
};
} // namespace libxmljs
#endif // SRC_XML_NAMESPACE_H_

77
node_modules/libxmljs/src/xml_node.h generated vendored Normal file
View File

@@ -0,0 +1,77 @@
// Copyright 2009, Squish Tech, LLC.
#ifndef SRC_XML_NODE_H_
#define SRC_XML_NODE_H_
#include <libxml/tree.h>
#include "nan.h"
namespace libxmljs {
class XmlNode : public Nan::ObjectWrap {
public:
xmlNode* xml_obj;
// reference to a parent XmlNode or XmlElement
xmlNode* ancestor;
// referencing functions
void ref_wrapped_ancestor();
void unref_wrapped_ancestor();
xmlNode* get_wrapped_ancestor();
int refs() {
return refs_;
};
// the doc ref'd by this proxy
xmlDoc* doc;
explicit XmlNode(xmlNode* node);
virtual ~XmlNode();
static void Initialize(v8::Handle<v8::Object> target);
static Nan::Persistent<v8::FunctionTemplate> constructor_template;
// create new XmlElement, XmlAttribute, etc. to wrap a libxml xmlNode
static v8::Local<v8::Value> New(xmlNode* node);
protected:
static NAN_METHOD(Doc);
static NAN_METHOD(Namespace);
static NAN_METHOD(Namespaces);
static NAN_METHOD(Parent);
static NAN_METHOD(NextSibling);
static NAN_METHOD(PrevSibling);
static NAN_METHOD(LineNumber);
static NAN_METHOD(Type);
static NAN_METHOD(ToString);
static NAN_METHOD(Remove);
static NAN_METHOD(Clone);
v8::Local<v8::Value> get_doc();
v8::Local<v8::Value> remove_namespace();
v8::Local<v8::Value> get_namespace();
void set_namespace(xmlNs* ns);
xmlNs * find_namespace(const char * search_str);
v8::Local<v8::Value> get_all_namespaces();
v8::Local<v8::Value> get_local_namespaces();
v8::Local<v8::Value> get_parent();
v8::Local<v8::Value> get_prev_sibling();
v8::Local<v8::Value> get_next_sibling();
v8::Local<v8::Value> get_line_number();
v8::Local<v8::Value> clone(bool recurse);
v8::Local<v8::Value> get_type();
v8::Local<v8::Value> to_string(int options = 0);
void remove();
void add_child(xmlNode* child);
void add_prev_sibling(xmlNode* element);
void add_next_sibling(xmlNode* element);
void replace_element(xmlNode* element);
void replace_text(const char* content);
xmlNode *import_node(xmlNode* node);
};
} // namespace libxmljs
#endif // SRC_XML_NODE_H_

104
node_modules/libxmljs/src/xml_sax_parser.h generated vendored Normal file
View File

@@ -0,0 +1,104 @@
// Copyright 2009, Squish Tech, LLC.
#ifndef SRC_XML_SAX_PARSER_H_
#define SRC_XML_SAX_PARSER_H_
#include <node.h>
namespace libxmljs {
class XmlSaxParser : public Nan::ObjectWrap {
public:
XmlSaxParser();
virtual ~XmlSaxParser();
static void
Initialize(v8::Handle<v8::Object> target);
static NAN_METHOD(NewParser);
static NAN_METHOD(NewPushParser);
static NAN_METHOD(ParseString);
static NAN_METHOD(Push);
void
Callback(const char* what,
int argc = 0,
v8::Local<v8::Value> argv[] = NULL);
void
parse_string(const char* str,
unsigned int size);
void
initialize_push_parser();
void
push(const char* str,
unsigned int size,
bool terminate);
/// callbacks
static void
start_document(void* context);
static void
end_document(void* context);
static void
start_element(void* context,
const xmlChar* name,
const xmlChar** p);
static void
end_element(void* context, const xmlChar* name);
static void
start_element_ns(void* context,
const xmlChar* localname,
const xmlChar* prefix,
const xmlChar* uri,
int nb_namespaces,
const xmlChar** namespaces,
int nb_attributes,
int nb_defaulted,
const xmlChar** attributes);
static void
end_element_ns(void* context,
const xmlChar* localname,
const xmlChar* prefix,
const xmlChar* uri);
static void
characters(void* context,
const xmlChar* ch,
int len);
static void
comment(void* context, const xmlChar* value);
static void
cdata_block(void* context, const xmlChar* value, int len);
static void
warning(void* context, const char* msg, ...);
static void
error(void* context, const char* msg, ...);
protected:
void initializeContext();
void releaseContext();
xmlParserCtxt* context_;
xmlSAXHandler sax_handler_;
};
} // namespace libxmljs
#endif // SRC_XML_SAX_PARSER_H_

25
node_modules/libxmljs/src/xml_syntax_error.h generated vendored Normal file
View File

@@ -0,0 +1,25 @@
// Copyright 2009, Squish Tech, LLC.
#ifndef SRC_XML_SYNTAX_ERROR_H_
#define SRC_XML_SYNTAX_ERROR_H_
#include <libxml/xmlerror.h>
#include "libxmljs.h"
namespace libxmljs {
// basically being used like a namespace
class XmlSyntaxError {
public:
// push xmlError onto v8::Array
// helper method for xml library
static void PushToArray(void* errs, xmlError* error);
// create a v8 object for the syntax eror
// TODO make it a v8 Erorr object
static v8::Local<v8::Value> BuildSyntaxError(xmlError* error);
};
} // namespace libxmljs
#endif // SRC_XML_SYNTAX_ERROR_H_

48
node_modules/libxmljs/src/xml_text.h generated vendored Normal file
View File

@@ -0,0 +1,48 @@
#ifndef SRC_XML_TEXT_H_
#define SRC_XML_TEXT_H_
#include "libxmljs.h"
#include "xml_node.h"
namespace libxmljs {
class XmlText : public XmlNode {
public:
explicit XmlText(xmlNode* node);
static void Initialize(v8::Handle<v8::Object> target);
static Nan::Persistent<v8::FunctionTemplate> constructor_template;
// create new xml element to wrap the node
static v8::Local<v8::Object> New(xmlNode* node);
protected:
static NAN_METHOD(New);
static NAN_METHOD(Text);
static NAN_METHOD(Replace);
static NAN_METHOD(NextElement);
static NAN_METHOD(PrevElement);
static NAN_METHOD(AddPrevSibling);
static NAN_METHOD(AddNextSibling);
v8::Local<v8::Value> get_next_element();
v8::Local<v8::Value> get_prev_element();
v8::Local<v8::Value> get_content();
void set_content(const char* content);
void replace_text(const char* content);
void replace_element(xmlNode* element);
void add_prev_sibling(xmlNode* element);
void add_next_sibling(xmlNode* element);
bool prev_sibling_will_merge(xmlNode* node);
bool next_sibling_will_merge(xmlNode* node);
};
} // namespace libxmljs
#endif // SRC_XML_TEXT_H_

24
node_modules/libxmljs/src/xml_xpath_context.h generated vendored Normal file
View File

@@ -0,0 +1,24 @@
// Copyright 2009, Squish Tech, LLC.
#ifndef SRC_XML_XPATH_CONTEXT_H_
#define SRC_XML_XPATH_CONTEXT_H_
#include <libxml/xpath.h>
#include "libxmljs.h"
namespace libxmljs {
class XmlXpathContext {
public:
explicit XmlXpathContext(xmlNode* node);
~XmlXpathContext();
void register_ns(const xmlChar* prefix, const xmlChar* uri);
v8::Local<v8::Value> evaluate(const xmlChar* xpath);
xmlXPathContext *ctxt;
};
} // namespace libxmljs
#endif // SRC_XML_XPATH_CONTEXT_H_