-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathxmlattribute.cpp
More file actions
48 lines (39 loc) · 1.08 KB
/
Copy pathxmlattribute.cpp
File metadata and controls
48 lines (39 loc) · 1.08 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
#include "common/xmlattribute.h"
#include "pugixml.hpp"
#include "common/private/xmlattribute_p.h"
shelllet::common::XmlAttribute::XmlAttribute(XmlAttributePrivate& d, Object* parent /*= nullptr*/)
: Object(d, parent)
{
}
shelllet::common::XmlAttribute shelllet::common::XmlAttribute::from(const pugi::xml_attribute* attr)
{
XmlAttribute temp;
temp.d_func()->attr.reset(new xml_attribute(*attr));
return temp;
}
shelllet::common::XmlAttribute& shelllet::common::XmlAttribute::operator=(const String& rhs)
{
Q_D(XmlAttribute);
*d->attr = rhs.toUtf8();
return *this;
}
shelllet::common::XmlAttribute& shelllet::common::XmlAttribute::operator=(int32_t rhs)
{
Q_D(XmlAttribute);
*d->attr = rhs;
return *this;
}
shelllet::common::String shelllet::common::XmlAttribute::value() const
{
Q_D(const XmlAttribute);
return d->attr->value();
}
void shelllet::common::XmlAttribute::setValue(const String& rhs)
{
Q_D(XmlAttribute);
d->attr->set_value(rhs.toUtf8());
}
shelllet::common::XmlAttribute::XmlAttribute(Object* parent /*= nullptr*/)
: XmlAttribute(*new XmlAttributePrivate, parent)
{
}