PostCloseFileRenamer.h
Go to the documentation of this file.
1 #ifndef art_Framework_IO_PostCloseFileRenamer_h
2 #define art_Framework_IO_PostCloseFileRenamer_h
3 
5 #include "boost/regex.hpp"
6 
7 #include <string>
8 
9 namespace art {
10  class FileStatsCollector;
11  class PostCloseFileRenamer;
12 } // namespace art
13 
15 public:
17 
18  // Apply substitutions according to given pattern from currently
19  // collected stats.
20  std::string applySubstitutions(std::string const& filePattern);
21 
22  // Rename file inPath according to pattern toPattern, returning
23  // destination.
25  std::string const& toPattern);
26 
27 private:
28  std::string applySubstitutionsNoIndex_(std::string const& filePattern) const;
29  std::string subInputFileName_(boost::smatch const& match) const;
30  std::string subTimestamp_(boost::smatch const& match) const;
31  std::string subFilledNumericNoIndex_(boost::smatch const& match) const;
32 
34  std::map<detail::FileNameComponents, std::size_t> indexForProcessedPattern_{};
35 };
36 
37 #endif /* art_Framework_IO_PostCloseFileRenamer_h */
38 
39 // Local Variables:
40 // mode: c++
41 // End:
std::string subFilledNumericNoIndex_(boost::smatch const &match) const
std::map< detail::FileNameComponents, std::size_t > indexForProcessedPattern_
std::string string
Definition: nybbler.cc:12
std::string applySubstitutionsNoIndex_(std::string const &filePattern) const
PostCloseFileRenamer(FileStatsCollector const &stats)
FileStatsCollector const & stats_
std::string applySubstitutions(std::string const &filePattern)
std::string maybeRenameFile(std::string const &inPath, std::string const &toPattern)
std::string subTimestamp_(boost::smatch const &match) const
std::string subInputFileName_(boost::smatch const &match) const