Samchon Framework for CPP  1.0.0
FTInstance.cpp
1 #include <samchon/library/FTInstance.hpp>
2 
3 #include <samchon/library/XML.hpp>
4 
5 using namespace std;
6 
7 using namespace samchon;
8 using namespace samchon::library;
9 using namespace samchon::protocol;
10 
11 auto FTInstance::TAG() const -> string { return "file"; }
12 
13 FTInstance::FTInstance(FTFolder *parent)
14  : super()
15 {
16  this->parent = parent;
17 }
18 void FTInstance::construct(shared_ptr<XML> xml)
19 {
20  uid = xml->getProperty<int>("uid");
21  name = xml->getProperty("name");
22  comment = xml->getProperty("comment");
23 }
24 
25 auto FTInstance::key() const -> string
26 {
27  return to_string(uid);
28 }
29 auto FTInstance::getUID() const -> int
30 {
31  return uid;
32 }
34 {
35  return parent;
36 }
37 auto FTInstance::getName() const -> string
38 {
39  return name;
40 }
41 auto FTInstance::getComment() const -> string
42 {
43  return comment;
44 }
45 
46 auto FTInstance::toXML() const -> shared_ptr<XML>
47 {
48  shared_ptr<XML> &xml = super::toXML();
49  xml->setProperty("uid", uid);
50  xml->setProperty("name", name);
51  xml->setProperty("comment", comment);
52 
53  return xml;
54 }
auto getComment() const -> std::string
Get comment.
Definition: FTInstance.cpp:41
An entity, a standard data class.
Definition: Entity.hpp:48
auto getUID() const -> int
Get uid.
Definition: FTInstance.cpp:29
virtual auto toXML() const -> std::shared_ptr< library::XML >
Get an XML object represents the Entity.
Definition: Entity.cpp:30
Definition: RWMutex.hpp:4
Package of libraries.
Definition: library.hpp:84
std::string name
Name of the file.
Definition: FTInstance.hpp:44
auto getParent() const -> FTFolder *
Get parent folder.
Definition: FTInstance.cpp:33
Package of network protocol and libraries.
Definition: protocol.hpp:185
int uid
Key, an unique id of file.
Definition: FTInstance.hpp:39
virtual auto toXML() const -> std::shared_ptr< library::XML >
Get an XML object represents the Entity.
Definition: FTInstance.cpp:46
auto getName() const -> std::string
Get name.
Definition: FTInstance.cpp:37
XML is a class representing xml object.
Definition: XML.hpp:72
std::string comment
Comment of the file.
Definition: FTInstance.hpp:49
Top level namespace of products built from samchon.
Definition: ByteArray.hpp:7
virtual auto key() const -> std::string
Get a key that can identify the Entity uniquely.
Definition: FTInstance.cpp:25
FTFolder * parent
Parent folder containing the instance.
Definition: FTInstance.hpp:34