Guest User

Untitled

a guest
Nov 17th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. class ArgParse {
  2. public:
  3. ArgParse(const int& argc, char** &argv)
  4. {
  5. args = [x for x in argv];
  6. init();
  7. }
  8. bool is_filename();
  9. string filename();
  10.  
  11. bool is_keys();
  12. vector<string> keys(); // these are ordered
  13.  
  14. string logfile();
  15. vool is_logfile();
  16. public:
  17. void init()
  18. {
  19. keys = [k for k in args if k is a key];
  20. filename = args[1];
  21. logfile_ = [if '--log' in args and args[(index next to --log)]]
  22. }
  23.  
  24. vector<string> args;
  25. const string filename_;
  26. const string logfile_;
  27. const vector<string> keys_;
  28. }
  29.  
  30. ArgParse ArgParse(argc, argv)
  31. vector<string> keys = ArgParse.keys()
Add Comment
Please, Sign In to add comment