2023-03-06 12:40:07 -08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include <filesystem>
|
|
|
|
|
2023-11-10 13:52:20 -08:00
|
|
|
namespace utilities::io
|
2023-03-06 12:40:07 -08:00
|
|
|
{
|
|
|
|
bool remove_file(const std::string& file);
|
|
|
|
bool move_file(const std::string& src, const std::string& target);
|
|
|
|
bool file_exists(const std::string& file);
|
|
|
|
bool write_file(const std::string& file, const std::string& data, bool append = false);
|
|
|
|
bool read_file(const std::string& file, std::string* data);
|
|
|
|
std::string read_file(const std::string& file);
|
2023-05-11 13:50:11 -07:00
|
|
|
std::string file_name(const std::string& path);
|
2023-11-10 13:52:20 -08:00
|
|
|
std::string file_stem(const std::string& path);
|
|
|
|
std::string file_extension(const std::string& path);
|
2023-03-06 12:40:07 -08:00
|
|
|
size_t file_size(const std::string& file);
|
2023-05-11 13:50:11 -07:00
|
|
|
time_t file_timestamp(const std::string& file);
|
2023-03-06 12:40:07 -08:00
|
|
|
bool create_directory(const std::string& directory);
|
|
|
|
bool directory_exists(const std::string& directory);
|
|
|
|
bool directory_is_empty(const std::string& directory);
|
|
|
|
std::vector<std::string> list_files(const std::string& directory);
|
|
|
|
void copy_folder(const std::filesystem::path& src, const std::filesystem::path& target);
|
|
|
|
}
|