bulkrename.cc (572B)
1 #include "bulkrename.hh" 2 3 #include <fstream> 4 #include <iostream> 5 6 ::std::unique_ptr<bulkrename_t> 7 bulkrename_t::init(int argc, char** argv) 8 { 9 return ::std::make_unique<bulkrename_t>(argc, argv); 10 } 11 12 void 13 bulkrename_t::setup() 14 { 15 tree.populate(dir_it); 16 } 17 18 void 19 bulkrename_t::run() 20 { 21 filehandler.write_out(tree); 22 23 try { 24 filehandler.edit(); 25 filehandler.read_in(tree); 26 } catch(const ::std::runtime_error& e) { 27 ::std::cerr << "bulkrename: " << e.what() << ::std::endl; 28 exit(1); 29 } 30 31 filehandler.propagate_rename(tree); 32 }