mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
Move ARDOUR::touch_file to pbd/file_utils.h
This commit is contained in:
parent
1a520b376f
commit
009a06a773
5 changed files with 21 additions and 17 deletions
|
|
@ -63,8 +63,6 @@ LIBARDOUR_API std::string bump_name_number(const std::string& s);
|
||||||
LIBARDOUR_API int cmp_nocase (const std::string& s, const std::string& s2);
|
LIBARDOUR_API int cmp_nocase (const std::string& s, const std::string& s2);
|
||||||
LIBARDOUR_API int cmp_nocase_utf8 (const std::string& s1, const std::string& s2);
|
LIBARDOUR_API int cmp_nocase_utf8 (const std::string& s1, const std::string& s2);
|
||||||
|
|
||||||
LIBARDOUR_API int touch_file(std::string path);
|
|
||||||
|
|
||||||
LIBARDOUR_API std::string region_name_from_path (std::string path, bool strip_channels, bool add_channel_suffix = false, uint32_t total = 0, uint32_t this_one = 0);
|
LIBARDOUR_API std::string region_name_from_path (std::string path, bool strip_channels, bool add_channel_suffix = false, uint32_t total = 0, uint32_t this_one = 0);
|
||||||
LIBARDOUR_API bool path_is_paired (std::string path, std::string& pair_base);
|
LIBARDOUR_API bool path_is_paired (std::string path, std::string& pair_base);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,10 @@
|
||||||
#include <glibmm/convert.h>
|
#include <glibmm/convert.h>
|
||||||
|
|
||||||
#include "pbd/compose.h"
|
#include "pbd/compose.h"
|
||||||
|
#include "pbd/error.h"
|
||||||
|
#include "pbd/file_utils.h"
|
||||||
|
|
||||||
#include "ardour/audio_library.h"
|
#include "ardour/audio_library.h"
|
||||||
#include "ardour/utils.h"
|
|
||||||
#include "ardour/filesystem_paths.h"
|
#include "ardour/filesystem_paths.h"
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
|
||||||
|
|
@ -42,9 +42,6 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <regex.h>
|
#include <regex.h>
|
||||||
|
|
||||||
#include <glib.h>
|
|
||||||
#include <glib/gstdio.h>
|
|
||||||
|
|
||||||
#include <glibmm/miscutils.h>
|
#include <glibmm/miscutils.h>
|
||||||
#include <glibmm/fileutils.h>
|
#include <glibmm/fileutils.h>
|
||||||
|
|
||||||
|
|
@ -299,17 +296,6 @@ ARDOUR::cmp_nocase_utf8 (const string& s1, const string& s2)
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
ARDOUR::touch_file (string path)
|
|
||||||
{
|
|
||||||
int fd = g_open (path.c_str(), O_RDWR|O_CREAT, 0660);
|
|
||||||
if (fd >= 0) {
|
|
||||||
close (fd);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
string
|
string
|
||||||
ARDOUR::region_name_from_path (string path, bool strip_channels, bool add_channel_suffix, uint32_t total, uint32_t this_one)
|
ARDOUR::region_name_from_path (string path, bool strip_channels, bool add_channel_suffix, uint32_t total, uint32_t this_one)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -343,6 +343,17 @@ copy_recurse(const std::string & from_path, const std::string & to_dir)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
touch_file (const std::string& path)
|
||||||
|
{
|
||||||
|
int fd = g_open (path.c_str(), O_RDWR|O_CREAT, 0660);
|
||||||
|
if (fd >= 0) {
|
||||||
|
close (fd);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
get_absolute_path (const std::string & p)
|
get_absolute_path (const std::string & p)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -181,6 +181,14 @@ LIBPBD_API void copy_files(const std::string & from_path, const std::string & to
|
||||||
*/
|
*/
|
||||||
LIBPBD_API void copy_recurse(const std::string & from_path, const std::string & to_dir);
|
LIBPBD_API void copy_recurse(const std::string & from_path, const std::string & to_dir);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the access and modification times of file at @path, creating file if it
|
||||||
|
* doesn't already exist.
|
||||||
|
* @path file path to touch
|
||||||
|
* @return true if file exists or was created and access time updated.
|
||||||
|
*/
|
||||||
|
LIBPBD_API bool touch_file (const std::string& path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Take a (possibly) relative path and make it absolute
|
* Take a (possibly) relative path and make it absolute
|
||||||
* @return An absolute path
|
* @return An absolute path
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue