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 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 bool path_is_paired (std::string path, std::string& pair_base);
#include <glibmm/convert.h>
#include "pbd/compose.h"
+#include "pbd/error.h"
+#include "pbd/file_utils.h"
#include "ardour/audio_library.h"
-#include "ardour/utils.h"
#include "ardour/filesystem_paths.h"
#include "i18n.h"
#include <errno.h>
#include <regex.h>
-#include <glib.h>
-#include <glib/gstdio.h>
-
#include <glibmm/miscutils.h>
#include <glibmm/fileutils.h>
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
ARDOUR::region_name_from_path (string path, bool strip_channels, bool add_channel_suffix, uint32_t total, uint32_t this_one)
{
}
}
+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
get_absolute_path (const std::string & p)
{
*/
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
* @return An absolute path