forked from libxmljs/libxmljs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxml_element.h
More file actions
65 lines (52 loc) · 1.84 KB
/
xml_element.h
File metadata and controls
65 lines (52 loc) · 1.84 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
// 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_