This commit is contained in:
@ -48,8 +48,6 @@ get_total_drive_space(const std::string &path) -> std::uint64_t;
|
||||
is_modified_date_older_than(std::string_view path,
|
||||
const std::chrono::hours &hours) -> bool;
|
||||
|
||||
[[nodiscard]] auto move_file(std::string from, std::string to) -> bool;
|
||||
|
||||
[[nodiscard]] auto
|
||||
read_file_lines(const std::string &path) -> std::vector<std::string>;
|
||||
|
||||
|
@ -248,24 +248,6 @@ auto is_modified_date_older_than(std::string_view path,
|
||||
utils::time::get_time_now();
|
||||
}
|
||||
|
||||
auto move_file(std::string from, std::string to) -> bool {
|
||||
from = utils::path::absolute(from);
|
||||
to = utils::path::absolute(to);
|
||||
|
||||
const auto directory = utils::path::get_parent_directory(to);
|
||||
if (not utils::file::directory(directory).create_directory()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#if defined(_WIN32)
|
||||
const bool ret = ::MoveFile(from.c_str(), to.c_str()) != 0;
|
||||
#else
|
||||
const bool ret = (rename(from.c_str(), to.c_str()) == 0);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
auto read_file_lines(const std::string &path) -> std::vector<std::string> {
|
||||
std::vector<std::string> ret;
|
||||
if (utils::file::file(path).exists()) {
|
||||
|
Reference in New Issue
Block a user