diff options
author | John Denker <jsd@av8n.com> | 2012-07-30 14:35:05 -0700 |
---|---|---|
committer | John Denker <jsd@av8n.com> | 2012-07-30 14:35:34 -0700 |
commit | c4cc2f1913b5b7d79ca2740bad6295a252017dea (patch) | |
tree | f50b83f0d0e65220792647d0d34bd79b9472b5b3 /tools/libltgrey.h | |
parent | 7024dc330299921af649330c45b99c21c3d7f022 (diff) |
start handling two (or more) directories
Diffstat (limited to 'tools/libltgrey.h')
-rw-r--r-- | tools/libltgrey.h | 47 |
1 files changed, 34 insertions, 13 deletions
diff --git a/tools/libltgrey.h b/tools/libltgrey.h index 14ed144..9891256 100644 --- a/tools/libltgrey.h +++ b/tools/libltgrey.h @@ -3,12 +3,7 @@ #include <vector> #include <map> -// beware: access illogically comes *before* modification -// in the array passed to utimes: -const int upd_ac(0); -const int upd_mod(1); - -#define state_40_macro \ +#define box_state_macro \ foo(unseen) \ foo(green) \ foo(ripe) \ @@ -18,10 +13,20 @@ foo(fail) // expand the codes to make some <const int> names: #define foo(name) name, typedef enum { - state_40_macro -} state_40; + box_state_macro +} box_state; #undef foo +class boxer{ +public: + std::string dir; + int min; + int max; + boxer(const std::string _dir, const int _min, const int _max) + : dir(_dir), min(_min), max(_max) + {} +}; + class whatsit{ public: std::string parent_dir; @@ -30,7 +35,7 @@ public: std::string suffix; std::string progid; int verbosity; - std::map<state_40,std::string> decode_40; + std::map<box_state,std::string> decode_40; whatsit(const std::string name, const std::string _parent_dir); int doit(const int penalty, const int stain); @@ -44,8 +49,24 @@ public: std::vector<std::string> &checked); void dump(const std::string var); int maybe_mkdir(const std::string somedir, const std::string msg); - state_40 get40(const std::string mid); - state_40 get40(const std::string mid, timeval times[2]); - int set40(const std::string mid, const int shift); - void scan40(const int copies); + + int set_box(const boxer, const std::string mid, const int shift); + box_state get_box(const boxer, const std::string mid, timeval times[2]); + void scan_box(const boxer, const int copies); + + box_state get_40(const std::string mid); + int set_40(const std::string mid, const int shift); + box_state get_rep(const std::string mid); }; + +// beware: access illogically comes *before* modification +// in the array passed to utimes: +const int upd_ac(0); +const int upd_mod(1); + +const int minute(60); +const int hour(60*minute); +const int day(24*hour); + +const boxer box_40 ("quarante", 15*minute, 4*hour); +const boxer box_rep("repute", 0, 35*day); |