/win32/shellext/DirectoryStatus.h

https://bitbucket.org/tortoisehg/hgtk/ · C Header · 45 lines · 22 code · 9 blank · 14 comment · 0 complexity · 2efedd7779beca79e46d72e76977d286 MD5 · raw file

  1. // Copyright (C) 2009 Adrian Buehlmann
  2. //
  3. // This program is free software: you can redistribute it and/or modify
  4. // it under the terms of the GNU General Public License as published by
  5. // the Free Software Foundation, either version 2 of the License, or
  6. // (at your option) any later version.
  7. //
  8. // This program is distributed in the hope that it will be useful,
  9. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. // GNU General Public License for more details.
  12. //
  13. // You should have received a copy of the GNU General Public License
  14. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. #include <string>
  16. #include <vector>
  17. class DirectoryStatus
  18. {
  19. struct E
  20. {
  21. std::string path_;
  22. char status_;
  23. E(): status_(0) {}
  24. };
  25. typedef std::vector<E> V;
  26. V v_;
  27. bool noicons_;
  28. public:
  29. DirectoryStatus(): noicons_(false) {}
  30. static DirectoryStatus* get(
  31. const std::string& hgroot, const std::string& cwd);
  32. char status(const std::string& relpath) const;
  33. bool noicons() const { return noicons_; }
  34. private:
  35. int read(const std::string& hgroot, const std::string& cwd);
  36. };