#ifndef _OTHER_PUBLICFUNCEXPORT_HEADER_ #define _OTHER_PUBLICFUNCEXPORT_HEADER_ #pragma once #include "cJSON.h" #include #include #include #include "publicExport.h" using namespace std; #define STR_TRUE "True" #define STR_FALSE "False" #define STR_NULL "Null" PUBLIC_API std::pair generateJsonStr(std::map &objectArr); PUBLIC_API std::vector parseJsonStr(const std::string jsonStr, const std::vector& keys); PUBLIC_API bool checkHttpActive(const char* httpUrl); PUBLIC_API int str2int(const string str); PUBLIC_API string int2str(const int num); class PUBLIC_API RVCJson{ public: cJSON* pJson; public: RVCJson(); RVCJson(bool notNewArray); ~RVCJson(); void SetJson(const char*jsonStr); void SetJson(RVCJson* cmbJson); void AddNullToObject(const char*key); void AddBoolToObject(const char*key, bool value); void AddNumberToObject(const char*key, double value); void AddStringToObject(const char*key, char*value); void AddItemToObject(const char*key, RVCJson* rvcJson); void AddItemToArray(RVCJson* rvcJson); RVCJson* Get(); char*GetJsonStr(); bool GetBoolValue(const char*key); double GetNumberValue(const char*key); int GetNumberIntValue(const char*key); char*GetStringValue(const char*key); RVCJson* GetJsonValue(const char*key); int GetArraySize(); RVCJson* GetArrayValue(int index); void Destory(); }; #endif //_OTHER_PUBLICFUNCEXPORT_HEADER_