7#include "rats_export.h"
37bool copy_file(
const char* src_path,
const char* dest_path);
38bool move_file(
const char* src_path,
const char* dest_path);
47bool write_file_chunk(
const char* path, uint64_t offset,
const void* data,
size_t size);
48bool read_file_chunk(
const char* path, uint64_t offset,
void* buffer,
size_t size);
65std::string
combine_paths(
const std::string& base,
const std::string& relative);
77inline bool create_file(
const std::string& path,
const std::string& content) {
83 if (!content)
return "";
84 std::string result(content, size);
94inline bool write_file_chunk(
const std::string& path, uint64_t offset,
const void* data,
size_t size) {
97inline bool read_file_chunk(
const std::string& path, uint64_t offset,
void* buffer,
size_t size) {
101inline bool rename_file(
const std::string& old_path,
const std::string& new_path) {
102 return rename_file(old_path.c_str(), new_path.c_str());
104inline bool validate_path(
const std::string& path,
bool check_write_access =
false) {
bool create_directory(const char *path)
std::string get_file_extension(const char *path)
bool append_to_file(const char *path, const char *content)
void free_file_buffer(void *buffer)
std::string combine_paths(const std::string &base, const std::string &relative)
bool file_exists(const char *path)
bool set_current_directory(const char *path)
bool file_or_directory_exists(const char *path)
bool create_file(const char *path, const char *content)
bool create_file_with_size(const char *path, uint64_t size)
bool delete_file(const char *path)
bool create_directories(const char *path)
bool delete_directory(const char *path)
bool rename_file(const char *old_path, const char *new_path)
bool is_directory(const char *path)
uint64_t get_file_modified_time(const char *path)
std::string read_file_text_cpp(const std::string &path)
bool move_file(const char *src_path, const char *dest_path)
bool is_file(const char *path)
bool read_file_chunk(const char *path, uint64_t offset, void *buffer, size_t size)
bool create_file_binary(const char *path, const void *data, size_t size)
bool copy_file(const char *src_path, const char *dest_path)
bool list_directory(const char *path, std::vector< DirectoryEntry > &entries)
bool get_current_directory(char *buffer, size_t buffer_size)
void * read_file_binary(const char *path, size_t *size_out)
int64_t get_file_size(const char *path)
std::string get_parent_directory(const char *path)
std::string get_filename_from_path(const char *path)
bool directory_exists(const char *path)
char * read_file_text(const char *path, size_t *size_out=nullptr)
bool validate_path(const char *path, bool check_write_access=false)
bool write_file_chunk(const char *path, uint64_t offset, const void *data, size_t size)