1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #ifndef __PALYERLOGOUT_H_
- #define __PALYERLOGOUT_H_
- #include <iostream>
- #include <rapidjson/document.h>
- #include <rapidjson/rapidjson.h>
- #include <rapidjson/stringbuffer.h>
- #include <rapidjson/writer.h>
- using namespace std;
- class PlayerLogout
- {
- private:
- std::string URL = "/manager.do";
- public:
- std::string cid;
- std::string ctype;
- std::string cname;
- public:
- PlayerLogout();
- ~PlayerLogout();
- void setURL(std::string url){
- this->URL = url;
- }
- std::string getUrl(){
- return this->URL;
- }
- void objectToJson(std::string& str){
- rapidjson::StringBuffer strBuf;
- rapidjson::Writer<rapidjson::StringBuffer> writer(strBuf);
- this->objectToJson(writer);
- str = strBuf.GetString();
- }
- void objectToJson(rapidjson::Writer<rapidjson::StringBuffer>& writer){
- writer.StartObject();
- writer.Key("cid");
- writer.String(cid.c_str());
- writer.Key("ctype");
- writer.String(ctype.c_str());
- writer.Key("cname");
- writer.String(cname.c_str());
- writer.EndObject();
- }
- };
- #endif
|