6#include "zrythm-config.h"
11#include "utils/utf8_string.h"
13#include <QTemporaryDir>
14#include <QTemporaryFile>
16namespace zrythm::utils::io
18namespace fs = std::filesystem;
24get_path_separator_string ();
48get_dir (
const std::filesystem::path &filename);
56mkdir (
const std::filesystem::path &dir);
64touch_file (
const std::filesystem::path &file_path);
67uri_to_file (
const utils::Utf8String &uri);
73file_strip_ext (
const std::filesystem::path &filename);
79file_get_ext (
const std::filesystem::path &file);
92path_get_basename (
const std::filesystem::path &filename);
106path_get_basename_without_ext (
const std::filesystem::path &filename);
113file_get_last_modified_datetime (
const std::filesystem::path &filename);
116file_get_last_modified_datetime_as_str (
const std::filesystem::path &filename);
129remove (
const std::filesystem::path &path);
149std::unique_ptr<QTemporaryDir>
151 std::optional<QString> template_path = std::nullopt,
152 bool in_temp_dir =
true);
157inline std::unique_ptr<QTemporaryDir>
158make_tmp_dir_at_path (
const std::filesystem::path &absolute_template_path)
160 return make_tmp_dir (
161 Utf8String::from_path (absolute_template_path).to_qstring (),
false);
173std::unique_ptr<QTemporaryFile>
175 std::optional<utils::Utf8String> template_path = std::nullopt,
176 bool in_temp_dir =
true);
187rmdir (
const std::filesystem::path &path,
bool force);
195std::vector<std::filesystem::path>
196get_files_in_dir_as_basenames (
const std::filesystem::path &_dir);
205std::vector<std::filesystem::path>
206get_files_in_dir_ending_in (
207 const std::filesystem::path &_dir,
209 const std::optional<utils::Utf8String> &end_string);
218std::vector<std::filesystem::path>
219get_files_in_dir (
const std::filesystem::path &_dir);
234 const std::filesystem::path &destdir,
235 const std::filesystem::path &srcdir,
236 bool follow_symlinks,
252 const std::filesystem::path &destfile,
253 const std::filesystem::path &srcfile);
265 const std::filesystem::path &destfile,
266 const std::filesystem::path &srcfile,
278get_next_available_filepath (
const std::filesystem::path &filepath);
288get_legal_file_name (
const Utf8String &file_name);
294get_legal_path_name (
const Utf8String &path);
301get_registry_string_val (
const utils::Utf8String &key);
304#if defined(__APPLE__) && ZRYTHM_IS_INSTALLER_VER
311get_bundle_path (
char * bundle_path);
318path_exists (
const std::filesystem::path &path);
321is_file_hidden (
const std::filesystem::path &file);
330 const std::filesystem::path &dest,
331 const std::filesystem::path &src);
340[[nodiscard]] QByteArray
341read_file_contents (
const std::filesystem::path &path);
352 const std::filesystem::path &path,
353 const char * contents,
365 const std::filesystem::path &file_path,
366 const utils::Utf8String &data);
377split_paths (
const QString &paths);