2 #include "boost/regex.hpp" 13 std::string
const& digitFormat)
37 for (; b1 != e1; ++b1, ++b2) {
38 if (b1->first < b2->first)
48 std::ostringstream num_str;
50 auto const& prefix = pr.first;
51 auto const& specifier = pr.second;
53 if (!specifier.empty()) {
54 num_str << std::setfill(
'0') << std::setw(std::stoul(specifier));
68 auto si = cbegin(pattern), se = cend(pattern);
69 while (boost::regex_search(
73 boost::regex{
"%(\\d+)?#", boost::regex_constants::ECMAScript})) {
74 assert(match.size() == 2);
78 result.
add(match.prefix(), match[1].str());
bool operator<(FileNameComponents const &fnc) const
void setSuffix(std::string suffix)
FileNameComponents componentsFromPattern(std::string const &pattern)
std::string fileNameWithIndex(std::size_t index) const
void add(std::string const &prefix, std::string const &digitFormat)
std::vector< std::pair< std::string, std::string > > components_