/
Node.cpp
48 lines (39 loc) · 1.43 KB
/
Node.cpp
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
/**********************************************************\
Original Author: Richard Bateman (taxilian)
Created: Dec 9, 2009
License: Dual license model; choose one of two:
New BSD License
http://www.opensource.org/licenses/bsd-license.php
- or -
GNU Lesser General Public License, version 2.1
http://www.gnu.org/licenses/lgpl-2.1.html
Copyright 2009 PacketPass, Inc and the Firebreath development team
\**********************************************************/
#include "JSObject.h"
#include "Node.h"
FB::DOM::NodePtr FB::DOM::Node::getNode(const std::wstring& name) const
{
return getNode(FB::wstring_to_utf8(name));
}
FB::DOM::NodePtr FB::DOM::Node::getNode(const std::string& name) const
{
FB::JSObjectPtr api = getProperty<FB::JSObjectPtr>(name);
return Node::create(api);
}
FB::DOM::NodePtr FB::DOM::Node::getNode(const int idx) const
{
FB::JSObjectPtr api = getProperty<JSObjectPtr>(idx);
return Node::create(api);
}
void FB::DOM::Node::setProperty(const std::wstring& name, const FB::variant& val) const
{
setProperty(FB::wstring_to_utf8(name), val);
}
void FB::DOM::Node::setProperty(const std::string& name, const FB::variant& val) const
{
m_element->SetProperty(name, val);
}
void FB::DOM::Node::setProperty(const int idx, const FB::variant& val) const
{
m_element->SetProperty(idx, val);
}