1 #include <samchon/protocol/InvokeParameter.hpp> 3 #include <samchon/ByteArray.hpp> 4 #include <samchon/library/XML.hpp> 5 #include <samchon/library/Base64.hpp> 6 #include <samchon/library/StringUtil.hpp> 16 InvokeParameter::InvokeParameter(
const string &name,
const char *pChar)
35 this->type =
"string";
37 this->str = move(str);
43 this->type =
"ByteArray";
45 this->byteArray = move(byteArray);
58 if(xml->hasProperty(
"name") ==
true)
59 this->
name = xml->getProperty(
"name");
63 this->
type = xml->getProperty(
"type");
66 this->xml = xml->begin()->second->at(0);
67 else if (
type ==
"ByteArray")
69 size_t size = xml->getValue<
size_t>();
74 this->
str = xml->getValue();
77 auto InvokeParameter::reservedByteArraySize()
const ->
size_t 79 return (
size_t)stoull(StringUtil::between(this->
str,
"size: #"));
120 if(
name.empty() ==
false)
121 xml->setProperty(
"name",
name);
122 xml->setProperty(
"type",
type);
126 xml->push_back(this->xml);
128 else if (
type ==
"ByteArray")
145 value = move(
xml->toString());
149 std::string &sql = StringUtil::substituteSQL(
"({1}, {2}, {3})",
name,
type, value);
An entity, a standard data class.
std::string str
A string value if the type is "string" or "number".
virtual auto toXML() const -> std::shared_ptr< library::XML >
Get an XML object represents the Entity.
virtual auto TAG() const -> std::string override
A tag name when represented by XML.
std::string name
A name can represent the parameter.
ByteArray byteArray
A binary value if the type is "ByteArray".
virtual void construct(std::shared_ptr< library::XML >) override
Construct data of the Entity from an XML object.
auto getValueAsXML() const -> std::shared_ptr< library::XML >
Get value as XML object.
InvokeParameter()
Default Constructor.
virtual auto toXML() const -> std::shared_ptr< library::XML > override
Get an XML object represents the Entity.
std::shared_ptr< library::XML > xml
An XML object if the type is "XML".
Package of network protocol and libraries.
auto toSQL() const -> std::string
Get a string of sql statement used to archive history log.
auto getType() const -> std::string
Get type.
auto getName() const -> std::string
Get name.
XML is a class representing xml object.
std::string type
Type of the parameter.
virtual auto key() const -> std::string override
Get a key that can identify the Entity uniquely.
A parameter of an Invoke.
Top level namespace of products built from samchon.