ServerPath.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. CServerPath & operator=(const CServerPath & op);
  23. const bool operator==(const CServerPath & op) const;
  24. const bool operator!=(const CServerPath & op) const;
  25. CString FormatFilename(CString fn, bool omitPath = false) const;
  26. protected:
  27. BOOL m_bEmpty;
  28. std::list<CString> m_Segments;
  29. typedef std::list<CString>::iterator tIter;
  30. typedef std::list<CString>::const_iterator tConstIter;
  31. typedef std::list<CString>::const_iterator tConstIter;
  32. CString m_Prefix;
  33. int m_nServerType;
  34. };
  35. //---------------------------------------------------------------------------
  36. #endif // ServerPathH