projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't scan content if we don't need to (#2661).
[dcpomatic.git]
/
src
/
lib
/
image_filename_sorter.cc
diff --git
a/src/lib/image_filename_sorter.cc
b/src/lib/image_filename_sorter.cc
index 47f46e81d75ecbe5aa589c4b1fd592241a5f150d..f0370bdcb5d120bde7a9b06aabb5ea4aad9b2caa 100644
(file)
--- a/
src/lib/image_filename_sorter.cc
+++ b/
src/lib/image_filename_sorter.cc
@@
-18,23
+18,25
@@
*/
*/
+
#include "image_filename_sorter.h"
#include <dcp/locale_convert.h>
#include <boost/filesystem.hpp>
#include "image_filename_sorter.h"
#include <dcp/locale_convert.h>
#include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
#include <boost/optional.hpp>
#include <iostream>
#include <boost/optional.hpp>
#include <iostream>
+
using std::list;
using std::string;
using dcp::locale_convert;
using boost::optional;
using std::list;
using std::string;
using dcp::locale_convert;
using boost::optional;
+
bool
ImageFilenameSorter::operator() (boost::filesystem::path a, boost::filesystem::path b)
{
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 ();
int const anl = an.length ();
int const bnl = bn.length ();
@@
-52,7
+54,7
@@
string
ImageFilenameSorter::extract_numbers (boost::filesystem::path p)
{
string numbers;
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];
for (size_t i = 0; i < ps.size(); ++i) {
if (isdigit (ps[i])) {
numbers += ps[i];