the big refactor + extracted data classes from coders/json to data/dynamic

This commit is contained in:
MihailRis
2024-01-17 16:32:53 +03:00
parent 34d4500e24
commit 377c8e5029
36 changed files with 908 additions and 875 deletions
+7 -6
View File
@@ -3,14 +3,15 @@
#include <string>
#include <vector>
#include <memory>
#include <fstream>
#include <filesystem>
#include "../typedefs.h"
namespace fs = std::filesystem;
namespace json {
class JObject;
namespace dynamic {
class Map;
}
namespace files {
@@ -30,14 +31,14 @@ namespace files {
extern bool write_bytes(fs::path, const char* data, size_t size);
extern uint append_bytes(fs::path, const char* data, size_t size);
extern bool write_string(fs::path filename, const std::string content);
extern bool write_json(fs::path filename, const json::JObject* obj, bool nice=true);
extern bool write_binary_json(fs::path filename, const json::JObject* obj);
extern bool write_json(fs::path filename, const dynamic::Map* obj, bool nice=true);
extern bool write_binary_json(fs::path filename, const dynamic::Map* obj);
extern bool read(fs::path, char* data, size_t size);
extern char* read_bytes(fs::path, size_t& length);
extern std::string read_string(fs::path filename);
extern json::JObject* read_json(fs::path file);
extern json::JObject* read_binary_json(fs::path file);
extern std::unique_ptr<dynamic::Map> read_json(fs::path file);
extern std::unique_ptr<dynamic::Map> read_binary_json(fs::path file);
extern std::vector<std::string> read_list(fs::path file);
}