Note that newer libsub version is required.
[dcpomatic.git] / src / lib / image_filename_sorter.cc
index 47f46e81d75ecbe5aa589c4b1fd592241a5f150d..f0370bdcb5d120bde7a9b06aabb5ea4aad9b2caa 100644 (file)
 
 */
 
+
 #include "image_filename_sorter.h"
 #include <dcp/locale_convert.h>
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <boost/optional.hpp>
 #include <iostream>
 
+
 using std::list;
 using std::string;
 using dcp::locale_convert;
 using boost::optional;
 
+
 bool
 ImageFilenameSorter::operator() (boost::filesystem::path a, boost::filesystem::path b)
 {
-       string an = extract_numbers (a);
-       string bn = extract_numbers (b);
+       auto an = extract_numbers (a);
+       auto bn = extract_numbers (b);
 
        int const anl = an.length ();
        int const bnl = bn.length ();
@@ -52,7 +54,7 @@ string
 ImageFilenameSorter::extract_numbers (boost::filesystem::path p)
 {
        string numbers;
-       string const ps = p.leaf().string();
+       auto const ps = p.filename().string();
        for (size_t i = 0; i < ps.size(); ++i) {
                if (isdigit (ps[i])) {
                        numbers += ps[i];