Fix some unused parameter warnings.
[ardour.git] / libs / ardour / session_state_utils.cc
index 1ce61954a425230fa7724552780d2247209c7980..7f12cb40665f1ecb4a2fd2df07bccd33c138c350 100644 (file)
        Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <pbd/compose.h>
-#include <pbd/error.h>
+#include <algorithm>
 
-#include <ardour/session_state_utils.h>
-#include <ardour/filename_extensions.h>
+#include "pbd/compose.h"
+#include "pbd/error.h"
+#include "pbd/file_utils.h"
+
+#include "ardour/session_state_utils.h"
+#include "ardour/filename_extensions.h"
 
 #include "i18n.h"
 
+using namespace std;
+using namespace PBD;
+
 namespace ARDOUR {
 
 bool
@@ -47,4 +53,27 @@ create_backup_file (const sys::path & file_path)
        return true;
 }
 
+void
+get_state_files_in_directory (const sys::path & directory_path,
+                             vector<sys::path> & result)
+{
+       Glib::PatternSpec state_file_pattern('*' + string(statefile_suffix));
+       
+       find_matching_files_in_directory (directory_path, state_file_pattern,
+                       result);
+}
+
+vector<string>
+get_file_names_no_extension (const vector<sys::path> & file_paths)
+{
+       vector<string> result;
+
+       std::transform (file_paths.begin(), file_paths.end(),
+                       std::back_inserter(result), sys::basename);
+
+       sort (result.begin(), result.end(), std::less<string>());
+
+       return result;
+}
+
 } // namespace ARDOUR