bulkrename

Bulk file/directory renaming utility, similar to ranger's built-in bulkrename command
git clone git://git.deurzen.net/bulkrename
Log | Files | Refs | LICENSE

bulkrename.hh (817B)


      1 #ifndef __BULKRENAME_BULKRENAME_GUARD__
      2 #define __BULKRENAME_BULKRENAME_GUARD__
      3 
      4 #include "parse.hh"
      5 #include "node.hh"
      6 #include "file.hh"
      7 
      8 #include <filesystem>
      9 #include <filesystem>
     10 #include <memory>
     11 
     12 
     13 class bulkrename_t
     14 {
     15 public:
     16     explicit bulkrename_t(int argc, char** argv)
     17         : m_parser(argc, argv),
     18           m_dir(m_parser.getargs().first ? m_parser.getargs().second[0] : "."),
     19           dir_it(m_dir),
     20           tree(!(m_parser.isset("n") || m_parser.isset("no-recurse")), m_dir)
     21     {}
     22 
     23     void setup();
     24     void run();
     25 
     26     static ::std::unique_ptr<bulkrename_t> init(int argc, char** argv);
     27 
     28 private:
     29     parser_t m_parser;
     30     ::std::string m_dir;
     31     ::std::filesystem::directory_iterator dir_it;
     32     nodetree_t tree;
     33     filehandler_t filehandler;
     34 
     35 };
     36 
     37 #endif//__BULKRENAME_BULKRENAME_GUARD__