Samchon Framework for CPP  1.0.0
main.cpp
1 #include <iostream>
2 
3 #include <samchon/library/XML.hpp>
4 #include <samchon/protocol/Invoke.hpp>
5 
6 using namespace std;
7 using namespace samchon;
8 using namespace samchon::library;
9 using namespace samchon::protocol;
10 
11 #ifdef _WIN64
12 # ifdef _DEBUG
13 # pragma comment(lib, "x64/Debug/SamchonFramework.lib")
14 # else
15 # pragma comment(lib, "x64/Release/SamchonFramework.lib")
16 # endif
17 #else
18 # ifdef _DEBUG
19 # pragma comment(lib, "Debug/SamchonFramework.lib")
20 # else
21 # pragma comment(lib, "Release/SamchonFramework.lib")
22 # endif
23 #endif
24 
25 void main()
26 {
27  string str = string("") +
28  "<memberList>\n" +
29  " <member id='jhnam88' pass='1231' />\n" +
30  " <member id='samchon' pass='1231'>Administrator</member>\n" +
31  " <group>3</group>\n" +
32  "</memberList>";
33 
34  shared_ptr<XML> xml(new XML(str));
35  shared_ptr<Invoke> invoke(new Invoke("login", "jhnam88", "1231", 4, xml));
36 
37  cout << "Invoke to XML: " << endl;
38  cout << invoke->toXML()->toString() << endl << endl;
39 
40  cout << "-------------------------------------------------------------" << endl;
41  cout << " Parameters" << endl;
42  cout << "-------------------------------------------------------------" << endl;
43  cout << "1st param: " << invoke->at(0)->getValue<string>() << endl;
44  cout << "2nd param: " << invoke->at(1)->getValue<string>() << endl;
45  cout << "3rd param: " << invoke->at(2)->getValue<string>() << endl;
46  cout << "4th param: " << endl << invoke->at(3)->getValue<shared_ptr<XML>>()->toString() << endl;
47 
48  system("pause");
49 }
Definition: RWMutex.hpp:4
Package of libraries.
Definition: library.hpp:84
Package of network protocol and libraries.
Definition: protocol.hpp:185
Standard message of network I/O.
Definition: Invoke.hpp:47
XML is a class representing xml object.
Definition: XML.hpp:72
Top level namespace of products built from samchon.
Definition: ByteArray.hpp:7