-
Notifications
You must be signed in to change notification settings - Fork 254
/
xml_element.h
60 lines (47 loc) · 2.19 KB
/
xml_element.h
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
// 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 v8::Persistent<v8::FunctionTemplate> constructor_template;
// create new xml element to wrap the node
static v8::Handle<v8::Object> New(xmlNode* node);
protected:
static v8::Handle<v8::Value> New(const v8::Arguments& args);
static v8::Handle<v8::Value> Name(const v8::Arguments& args);
static v8::Handle<v8::Value> Attr(const v8::Arguments& args);
static v8::Handle<v8::Value> Attrs(const v8::Arguments& args);
static v8::Handle<v8::Value> Find(const v8::Arguments& args);
static v8::Handle<v8::Value> Text(const v8::Arguments& args);
static v8::Handle<v8::Value> Path(const v8::Arguments& args);
static v8::Handle<v8::Value> Child(const v8::Arguments& args);
static v8::Handle<v8::Value> ChildNodes(const v8::Arguments& args);
static v8::Handle<v8::Value> AddChild(const v8::Arguments& args);
static v8::Handle<v8::Value> NextElement(const v8::Arguments& args);
static v8::Handle<v8::Value> PrevElement(const v8::Arguments& args);
static v8::Handle<v8::Value> AddPrevSibling(const v8::Arguments& args);
static v8::Handle<v8::Value> AddNextSibling(const v8::Arguments& args);
void set_name(const char* name);
v8::Handle<v8::Value> get_name();
v8::Handle<v8::Value> get_child(int32_t idx);
v8::Handle<v8::Value> get_child_nodes();
v8::Handle<v8::Value> get_path();
v8::Handle<v8::Value> get_attr(const char* name);
v8::Handle<v8::Value> get_attrs();
void set_attr(const char* name, const char* value);
void add_child(XmlElement* child);
void set_content(const char* content);
v8::Handle<v8::Value> get_content();
v8::Handle<v8::Value> get_next_element();
v8::Handle<v8::Value> get_prev_element();
void add_prev_sibling(XmlElement* element);
void add_next_sibling(XmlElement* element);
XmlElement *import_element(XmlElement* element);
};
} // namespace libxmljs
#endif // SRC_XML_ELEMENT_H_