2024-08-13 17:07:34 +08:00
|
|
|
#ifndef THREADPOOLDEMO_CCJSONOBJECT_H
|
|
|
|
|
#define THREADPOOLDEMO_CCJSONOBJECT_H
|
|
|
|
|
#include "nlohmann/json.hpp"
|
2024-11-01 16:09:31 +08:00
|
|
|
#include "CC.h"
|
2024-08-13 17:07:34 +08:00
|
|
|
using JSON = nlohmann::json;
|
|
|
|
|
|
|
|
|
|
class CCJSONObject: public JSON
|
|
|
|
|
{
|
|
|
|
|
public:
|
2024-11-01 16:09:31 +08:00
|
|
|
using nlohmann::json::json;
|
2024-08-13 17:07:34 +08:00
|
|
|
CCJSONObject() = default;
|
|
|
|
|
CCJSONObject(JSON && j);
|
2024-11-01 16:09:31 +08:00
|
|
|
void put(const char* key,nlohmann::json value);
|
|
|
|
|
JSON get(const char* key);
|
|
|
|
|
std::string to_String();
|
|
|
|
|
static CCJSONObject parse(const String& str);
|
2024-08-13 17:07:34 +08:00
|
|
|
private:
|
2024-11-01 16:09:31 +08:00
|
|
|
JSON J;
|
2024-08-13 17:07:34 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2024-11-01 16:09:31 +08:00
|
|
|
#endif
|