Index: src/libchcore/TPath.h =================================================================== diff -u -N -r280a99da8f4dfa84ea3587c5c9df3363ac0c8f4f -r591f291e22d2ece89acb266c8aa0b05c257a407c --- src/libchcore/TPath.h (.../TPath.h) (revision 280a99da8f4dfa84ea3587c5c9df3363ac0c8f4f) +++ src/libchcore/TPath.h (.../TPath.h) (revision 591f291e22d2ece89acb266c8aa0b05c257a407c) @@ -76,8 +76,8 @@ const wchar_t* ToString() const; std::wstring ToWString() const; - // other operations - void Clear() throw(); + // other operations + void Clear() throw(); bool Compare(const TSmartPath& rPath, bool bCaseSensitive = DefaultCaseSensitivity) const; bool IsChildOf(const TSmartPath& rPath, bool bCaseSensitive = DefaultCaseSensitivity) const; @@ -87,26 +87,42 @@ void AppendIfNotExists(const wchar_t* pszPostfix, bool bCaseSensitive = DefaultCaseSensitivity); void CutIfExists(const wchar_t* pszPostfix, bool bCaseSensitive = DefaultCaseSensitivity); - void DeleteLastComponent(); - TSmartPath GetLastComponent(); + bool HasLengthExtension() const; // checks if path is prefixed with "\\?\" + void AddLengthExtension(); + void DeleteLengthExtension(); - bool HasLengthExtension() const; + bool IsNetworkPath() const; bool HasDrive() const; - TSmartPath GetDrive() const; // c: for c:\windows\test.txt + TSmartPath GetDrive() const; // c: for c:\windows\test.txt - bool HasFileDir() const; // \windows\ for c:\windows\test.txt - TSmartPath GetFileDir() const; // \windows\ for c:\windows\test.txt + bool HasServerName() const; + TSmartPath GetServerName() const; - bool HasFileTitle() const; // test for c:\windows\test.txt - TSmartPath GetFileTitle() const; // test for c:\windows\test.txt + bool HasFileRoot() const; + TSmartPath GetFileRoot() const; // "c:\windows\" for "c:\windows\test.txt" - bool HasExtension() const; // txt for c:\windows\test.txt - TSmartPath GetExtension() const; // txt for c:\windows\test.txt + bool HasFileDir() const; // \windows\ for c:\windows\test.txt + TSmartPath GetFileDir() const; // \windows\ for c:\windows\test.txt - bool HasFileName() const; // test.txt for c:\windows\test.txt - TSmartPath GetFileName() const; // test.txt for c:\windows\test.txt + bool HasFileTitle() const; // test for c:\windows\test.txt + TSmartPath GetFileTitle() const; // test for c:\windows\test.txt + bool HasExtension() const; // txt for c:\windows\test.txt + TSmartPath GetExtension() const; // txt for c:\windows\test.txt + + bool HasFileName() const; // test.txt for c:\windows\test.txt + TSmartPath GetFileName() const; // test.txt for c:\windows\test.txt + void DeleteFileName(); // test.txt for c:\windows\test.txt + + bool EndsWithSeparator() const; + void AppendSeparatorIfDoesNotExist(); + void StripSeparatorAtEnd(); + + bool StartsWithSeparator() const; + void PrependSeparatorIfDoesNotExist(); + void StripSeparatorAtFront(); + bool IsEmpty() const; // Serialization @@ -128,6 +144,8 @@ protected: void PrepareToWrite(); + static bool IsSeparator(wchar_t wchSeparator); + protected: TPath* m_pPath; };