ServerPath.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //---------------------------------------------------------------------------
  2. #ifndef ServerPathH
  3. #define ServerPathH
  4. //---------------------------------------------------------------------------
  5. class CServerPath
  6. {
  7. public:
  8. BOOL AddSubdir(CString subdir);
  9. const BOOL IsEmpty() const;
  10. CServerPath GetParent() const;
  11. BOOL HasParent() const;
  12. CString GetLastSegment() const;
  13. CServerPath();
  14. CServerPath(CString path, bool trim = true);
  15. CServerPath(CString path, int nServerType, bool trim = true);
  16. CServerPath(const CServerPath & path);
  17. virtual ~CServerPath();
  18. void SetServer(const t_server & server);
  19. BOOL SetPath(CString & newpath, BOOL bIsFile);
  20. BOOL SetPath(CString newpath);
  21. const CString GetPath() const;
  22. const CString GetPathUnterminated() const;
  23. CServerPath & operator=(const CServerPath & op);
  24. const bool operator==(const CServerPath & op) const;
  25. const bool operator!=(const CServerPath & op) const;
  26. CString FormatFilename(CString fn, bool omitPath = false) const;
  27. protected:
  28. BOOL m_bEmpty;
  29. std::list<CString> m_Segments;
  30. typedef std::list<CString>::iterator tIter;
  31. typedef std::list<CString>::const_iterator tConstIter;
  32. CString m_Prefix;
  33. int m_nServerType;
  34. private:
  35. const CString DoGetPath(bool unterminated) const;
  36. };
  37. //---------------------------------------------------------------------------
  38. #endif // ServerPathH