FileName.h 780 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef _FILENAME_H
  2. #define _FILENAME_H
  3. #include <vector>
  4. #include <string>
  5. class FileName
  6. {
  7. public:
  8. static const char pathdel = '/';
  9. static const char extdel = '.';
  10. FileName(): absolute(false) {};
  11. FileName(const std::string& filename);
  12. FileName(const std::string& path,
  13. const std::string& name,
  14. const std::string& ext);
  15. std::string getFileName() const;
  16. std::string getName() const
  17. {
  18. return name;
  19. }
  20. std::string getPath() const;
  21. std::string getExtension() const
  22. {
  23. return extension;
  24. }
  25. void setName(const std::string& n);
  26. void setPath(const std::string& p);
  27. void setExtension(const std::string& x);
  28. private:
  29. bool absolute;
  30. std::vector<std::string> path;
  31. std::string name;
  32. std::string extension;
  33. };
  34. #endif