forked from libxmljs/libxmljs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxml_document.h
More file actions
67 lines (48 loc) · 1.6 KB
/
xml_document.h
File metadata and controls
67 lines (48 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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_