ServerPath.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //---------------------------------------------------------------------------
  2. #ifndef ServerPathH
  3. #define ServerPathH
  4. //---------------------------------------------------------------------------
  5. class CServerPath
  6. {
  7. public:
  8. BOOL AddSubdir(CString subdir);
  9. CString GetSafePath() const;
  10. const BOOL IsEmpty() const;
  11. CServerPath GetParent() const;
  12. BOOL HasParent() const;
  13. CString GetLastSegment() const;
  14. CServerPath();
  15. CServerPath(CString path, bool trim = true);
  16. CServerPath(CString path, int nServerType, bool trim = true);
  17. CServerPath(const CServerPath & path);
  18. virtual ~CServerPath();
  19. void SetServer(const t_server & server);
  20. BOOL SetPath(CString & newpath, BOOL bIsFile);
  21. BOOL SetPath(CString newpath);
  22. const CString GetPath() 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. };
  36. //---------------------------------------------------------------------------
  37. const BOOL operator==(const CServerPath & a, const CString & b);
  38. //---------------------------------------------------------------------------
  39. #endif // ServerPathH