7#include "zrythm-config.h"
11#include "utils/utf8_string.h"
13#include <QTemporaryDir>
14#include <QTemporaryFile>
16namespace zrythm::utils::io
23get_path_separator_string ();
47get_dir (
const fs::path &filename);
55mkdir (
const fs::path &dir);
63touch_file (
const fs::path &file_path);
66uri_to_file (
const utils::Utf8String &uri);
72file_strip_ext (
const fs::path &filename);
78file_get_ext (
const fs::path &file);
91path_get_basename (
const fs::path &filename);
105path_get_basename_without_ext (
const fs::path &filename);
112file_get_last_modified_datetime (
const fs::path &filename);
115file_get_last_modified_datetime_as_str (
const fs::path &filename);
128remove (
const fs::path &path);
148std::unique_ptr<QTemporaryDir>
150 std::optional<QString> template_path = std::nullopt,
151 bool in_temp_dir =
true);
156inline std::unique_ptr<QTemporaryDir>
157make_tmp_dir_at_path (
const fs::path &absolute_template_path)
159 return make_tmp_dir (
160 Utf8String::from_path (absolute_template_path).to_qstring (),
false);
172std::unique_ptr<QTemporaryFile>
174 std::optional<utils::Utf8String> template_path = std::nullopt,
175 bool in_temp_dir =
true);
186rmdir (
const fs::path &path,
bool force);
195get_files_in_dir_as_basenames (
const fs::path &_dir);
205get_files_in_dir_ending_in (
206 const fs::path &_dir,
208 const std::optional<utils::Utf8String> &end_string);
218get_files_in_dir (
const fs::path &_dir);
233 const fs::path &destdir,
234 const fs::path &srcdir,
235 bool follow_symlinks,
250copy_file (
const fs::path &destfile,
const fs::path &srcfile);
260move_file (
const fs::path &destfile,
const fs::path &srcfile);
271get_next_available_filepath (
const fs::path &filepath);
281get_legal_file_name (
const Utf8String &file_name);
287get_legal_path_name (
const Utf8String &path);
294get_registry_string_val (
const utils::Utf8String &key);
297#if defined(__APPLE__) && ZRYTHM_IS_INSTALLER_VER
304get_bundle_path (
char * bundle_path);
311path_exists (
const fs::path &path);
314is_file_hidden (
const fs::path &file);
322reflink_file (
const fs::path &dest,
const fs::path &src);
331[[nodiscard]] QByteArray
332read_file_contents (
const fs::path &path);
342set_file_contents (
const fs::path &path,
const char * contents,
size_t size);
352set_file_contents (
const fs::path &file_path,
const utils::Utf8String &data);
363split_paths (
const QString &paths);