src/files update + write_binary_json compression argument
This commit is contained in:
+23
-5
@@ -27,15 +27,33 @@ namespace files {
|
||||
size_t length() const;
|
||||
};
|
||||
|
||||
/* Write bytes array to the file without any extra data */
|
||||
extern bool write_bytes(fs::path, const ubyte* data, size_t size);
|
||||
|
||||
extern bool write_bytes(fs::path, const char* data, size_t size);
|
||||
extern uint append_bytes(fs::path, const char* data, size_t size);
|
||||
/* Append bytes array to the file without any extra data */
|
||||
extern uint append_bytes(fs::path, const ubyte* data, size_t size);
|
||||
|
||||
/* Write string to the file */
|
||||
extern bool write_string(fs::path filename, const std::string content);
|
||||
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);
|
||||
|
||||
/* Write dynamic data to the JSON file
|
||||
@param nice if true,
|
||||
human readable format will be used, otherwise minimal */
|
||||
extern bool write_json(
|
||||
fs::path filename,
|
||||
const dynamic::Map* obj,
|
||||
bool nice=true);
|
||||
|
||||
/* Write dynamic data to the binary JSON file
|
||||
(see src/coders/binary_json_spec.md)
|
||||
@param compressed use gzip compression */
|
||||
extern bool write_binary_json(
|
||||
fs::path filename,
|
||||
const dynamic::Map* obj,
|
||||
bool compressed=false);
|
||||
|
||||
extern bool read(fs::path, char* data, size_t size);
|
||||
extern char* read_bytes(fs::path, size_t& length);
|
||||
extern ubyte* read_bytes(fs::path, size_t& length);
|
||||
extern std::string read_string(fs::path filename);
|
||||
extern std::unique_ptr<dynamic::Map> read_json(fs::path file);
|
||||
extern std::unique_ptr<dynamic::Map> read_binary_json(fs::path file);
|
||||
|
||||
Reference in New Issue
Block a user