ServerPath.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. typedef std::list<CString>::const_iterator tConstIter;
  33. CString m_Prefix;
  34. int m_nServerType;
  35. private:
  36. const CString DoGetPath(bool unterminated) const;
  37. };
  38. //---------------------------------------------------------------------------
  39. #endif // ServerPathH