redundancy reduced

This commit is contained in:
MihailRis
2024-04-30 14:49:55 +03:00
parent 8c86bcae54
commit 9b843817f8
10 changed files with 136 additions and 146 deletions
+12 -12
View File
@@ -31,20 +31,20 @@ namespace files {
/// @param file target file
/// @param data data bytes array
/// @param size size of data bytes array
extern bool write_bytes(fs::path file, const ubyte* data, size_t size);
bool write_bytes(fs::path file, const ubyte* data, size_t size);
/// @brief Append bytes array to the file without any extra data
/// @param file target file
/// @param data data bytes array
/// @param size size of data bytes array
extern uint append_bytes(fs::path file, const ubyte* data, size_t size);
uint append_bytes(fs::path file, const ubyte* data, size_t size);
/// @brief Write string to the file
extern bool write_string(fs::path filename, const std::string content);
bool write_string(fs::path filename, const std::string content);
/// @brief Write dynamic data to the JSON file
/// @param nice if true, human readable format will be used, otherwise minimal
extern bool write_json(
bool write_json(
fs::path filename,
const dynamic::Map* obj,
bool nice=true);
@@ -52,21 +52,21 @@ namespace files {
/// @brief 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(
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 ubyte* read_bytes(fs::path, size_t& length);
extern std::string read_string(fs::path filename);
bool read(fs::path, char* data, size_t size);
std::unique_ptr<ubyte[]> read_bytes(fs::path, size_t& length);
std::string read_string(fs::path filename);
/// @brief Read JSON or BJSON file
/// @param file *.json or *.bjson 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);
std::unique_ptr<dynamic::Map> read_json(fs::path file);
std::unique_ptr<dynamic::Map> read_binary_json(fs::path file);
std::vector<std::string> read_list(fs::path file);
}
#endif /* FILES_FILES_H_ */
#endif /* FILES_FILES_H_ */