65 std::ofstream out_file(filename, std::ios::binary);
66 if(!out_file.is_open())
67 throw std::runtime_error(
"Failed to open file for writing: " + filename);
69 out_file.write(
reinterpret_cast<const rune*
>(&data),
sizeof(T));
93 std::ifstream in_file(filename, std::ios::binary);
94 if(!in_file.is_open())
95 throw std::runtime_error(
"Failed to open file for reading: " + filename);
98 in_file.read(
reinterpret_cast<rune*
>(&data),
sizeof(T));
void ldvc_write_file(const string &filename, const T &data)
Writes data to a file.
T ldvc_read_file(const string &filename)
Reads data from a file.
bool ldvc_delete_file(string file_path)
Deletes a file specified by its path.
bool ldvc_file_exists(const string &folder_path)
Checks if a file exists.
bool ldvc_create_folder(const string &folder_path, u16 mode)
Creates a folder with the specified permissions.
bool ldvc_delete_folder(string folder_path)
Deletes a folder specified by its path.
Defines common types used throughout the library.
char rune
Alias for a Unicode character.