diffCmd.hh 839 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. #include <string>
  3. #include <deque>
  4. class DiffCmd
  5. {
  6. public:
  7. DiffCmd();
  8. ~DiffCmd();
  9. /**
  10. * Append parameter to cmd params
  11. **/
  12. void add(const std::string &param);
  13. /**
  14. * file to pass to execvp to construct executable path from PATH or ./
  15. **/
  16. std::string getFile() const;
  17. /**
  18. * get args to pass to execvp
  19. **/
  20. std::deque<std::string> getArgv() const;
  21. /**
  22. * lazy-compute char*argv[] from File &a and File &b
  23. **/
  24. char **computeArgv(const std::deque<std::string> &inputFiles);
  25. /**
  26. * Hash string
  27. **/
  28. static unsigned long long hashString(const std::string &s);
  29. private:
  30. std::deque<std::string> argv;
  31. char **allocatedArgv;
  32. };