#include "ardour/session_state_utils.h"
#include "ardour/filename_extensions.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace std;
using namespace PBD;
bool
create_backup_file (const std::string & file_path)
{
- if (!Glib::file_test (file_path, Glib::FILE_TEST_EXISTS)) return false;
-
- Glib::RefPtr<Gio::File> backup_path = Gio::File::create_for_path(file_path + backup_suffix);
- Glib::RefPtr<Gio::File> path = Gio::File::create_for_path(file_path);
-
- try
- {
- path->copy (backup_path);
- }
- catch(const Glib::Exception& ex)
- {
- error << string_compose (_("Unable to create a backup copy of file %1 (%2)"),
- file_path, ex.what())
- << endmsg;
- return false;
- }
- return true;
+ return copy_file (file_path, file_path + backup_suffix);
}
void
get_state_files_in_directory (const std::string & directory_path,
vector<std::string> & result)
{
- Glib::PatternSpec state_file_pattern('*' + string(statefile_suffix));
-
- find_matching_files_in_directory (directory_path, state_file_pattern,
- result);
+ find_files_matching_pattern (result, directory_path,
+ '*' + string(statefile_suffix));
}
vector<string>