6#include "zrythm-config.h"
10#include "utils/utf8_string.h"
12#include <QTemporaryDir>
13#include <QTemporaryFile>
15namespace zrythm::utils::io
22get_path_separator_string ();
46get_dir (
const fs::path &filename);
54mkdir (
const fs::path &dir);
62touch_file (
const fs::path &file_path);
65uri_to_file (
const utils::Utf8String &uri);
71file_strip_ext (
const fs::path &filename);
77file_get_ext (
const fs::path &file);
90path_get_basename (
const fs::path &filename);
104path_get_basename_without_ext (
const fs::path &filename);
111file_get_last_modified_datetime (
const fs::path &filename);
114file_get_last_modified_datetime_as_str (
const fs::path &filename);
127remove (
const fs::path &path);
147std::unique_ptr<QTemporaryDir>
149 std::optional<QString> template_path = std::nullopt,
150 bool in_temp_dir =
true);
155inline std::unique_ptr<QTemporaryDir>
156make_tmp_dir_at_path (
const fs::path &absolute_template_path)
158 return make_tmp_dir (
159 Utf8String::from_path (absolute_template_path).to_qstring (),
false);
171std::unique_ptr<QTemporaryFile>
173 std::optional<utils::Utf8String> template_path = std::nullopt,
174 bool in_temp_dir =
true);
185rmdir (
const fs::path &path,
bool force);
194get_files_in_dir_as_basenames (
const fs::path &_dir);
204get_files_in_dir_ending_in (
205 const fs::path &_dir,
207 const std::optional<utils::Utf8String> &end_string);
217get_files_in_dir (
const fs::path &_dir);
232 const fs::path &destdir,
233 const fs::path &srcdir,
234 bool follow_symlinks,
249copy_file (
const fs::path &destfile,
const fs::path &srcfile);
260move_file (
const fs::path &destfile,
const fs::path &srcfile,
bool force =
false);
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);