#pragma once #include"json.h" #define JSON_BUSINESS_ERROR_SIZE 10 class Json::Value; class CJsonBusiness :public Json::Value { public: CJsonBusiness(); ~CJsonBusiness(); CJsonBusiness(WORD x, WORD y) :m_wMainCmd(x), m_wSubCmd(y), m_str(""), m_reader(m_ft) {} private: std::string m_str;//字符串 UTF-8编码格式 WORD m_wMainCmd;//主命令 WORD m_wSubCmd;//子命令 Json::Value m_root; Json::FastWriter m_fw; Json::Features m_ft; Json::Reader m_reader; public: /*校验参数*/ bool IsVaildPara(VOID* pData){ return (NULL == pData); } /*设置主-子命令*/ void SetCmdType(WORD x, WORD y) { this->m_wMainCmd = x; this->m_wSubCmd = y; } /*获取Json字符串UTF-8*/ std::string GetUTF_8JsonStr() { return this->m_str; } /*传空值*/ std::string GetNullJson(VOID* pData); void Clear(); std::string JsonWriteUTF_8(Json::Value & root); void Log(std::string str); void Log(std::string str, const TCHAR* nStr); // 检验是否包含特殊字符 bool checkNumber(std::string str); //闲聊分享战绩 std::string GetInfoJson(const DWORD GameID, const TCHAR WanFInfo[68], const std::string strTime, const std::string strMd5, DBR_GR_ClubRecordXianLiao FenXiangRecord); //请求订单应答 //获取已支付订单列表 std::string GetInfoJson(TCHAR* ptr, DWORD size); };