|
@@ -1,126 +0,0 @@
|
|
|
- /**
|
|
|
|
|
- Returns whether the segment is valid.
|
|
|
|
|
- @note
|
|
|
|
|
- The rules for valid segments are as follows:
|
|
|
|
|
- a) The empty string is not valid.
|
|
|
|
|
- b) Any string containing the slash character ('/') is not valid.
|
|
|
|
|
- c) Common notations for current ('.') and parent ('..') directory are forbidden.
|
|
|
|
|
- d) Any string containing segment or device separator characters on the local file system,
|
|
|
|
|
- such as the backslash ('\') and colon (':') on some file systems.
|
|
|
|
|
- (Thanks org.eclipse.core.runtime for the documentation ;D).
|
|
|
|
|
- @param segment
|
|
|
|
|
- The segment to be checked
|
|
|
|
|
- @return
|
|
|
|
|
- True if the segment is valid, false otherwise
|
|
|
|
|
- */
|
|
|
|
|
- static bool IsValidSegment(const Str& segment);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- Returns whether the path is valid.
|
|
|
|
|
- @note
|
|
|
|
|
- The rules for valid paths are as follows:
|
|
|
|
|
- a) The empty string is not valid.
|
|
|
|
|
- b) If the path is absolute, it mustn't contain any leading character.
|
|
|
|
|
- @param path
|
|
|
|
|
- The path to be checked
|
|
|
|
|
- @return
|
|
|
|
|
- True if the path is valid, false otherwise
|
|
|
|
|
- */
|
|
|
|
|
- static bool IsValidPath(const Str& path);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- Fills 'ret' with the same path but without the trailing directory separator.
|
|
|
|
|
- @note
|
|
|
|
|
- (e.g. /home/babbeo/texture.tga/ -> /home/babbeo/texture.tga).
|
|
|
|
|
- @param path
|
|
|
|
|
- The input path
|
|
|
|
|
- @param ret
|
|
|
|
|
- The ouput path
|
|
|
|
|
- @return
|
|
|
|
|
- True if success, false otherwise
|
|
|
|
|
- */
|
|
|
|
|
- static bool RemoveTrailingSeparator(const Str& path, Str& ret);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- Returns whether the path is absolute.
|
|
|
|
|
- @note
|
|
|
|
|
- (i.e. starts with Path::SEPARATOR or <a-Z><Path::DEVICE_SEPARATOR><Path::SEPARATOR>).
|
|
|
|
|
- @param path
|
|
|
|
|
- The path to be checked
|
|
|
|
|
- @return
|
|
|
|
|
- True if absolute, false otherwise
|
|
|
|
|
- */
|
|
|
|
|
- static bool IsAbsolutePath(const Str& path);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- Returns whether the path is a root path.
|
|
|
|
|
- @note
|
|
|
|
|
- (i.e. starts and ends with Path::SEPARATOR or <a-Z><Path::DEVICE_SEPARATOR><Path::SEPARATOR>).
|
|
|
|
|
- @param path
|
|
|
|
|
- The path to be checked
|
|
|
|
|
- @return
|
|
|
|
|
- True if root, false otherwise
|
|
|
|
|
- */
|
|
|
|
|
- static bool IsRootPath(const Str& path);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- Returns the pathname of the path.
|
|
|
|
|
- @note
|
|
|
|
|
- (e.g. /home/babbeo/texture.tga -> /home/babbeo).
|
|
|
|
|
- @param path
|
|
|
|
|
- The input path
|
|
|
|
|
- @param ret
|
|
|
|
|
- The output pathname
|
|
|
|
|
- @return
|
|
|
|
|
- True if success, false otherwise
|
|
|
|
|
- */
|
|
|
|
|
- static bool GetPathname(const Str& path, Str& ret);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- Returns the filename of the path.
|
|
|
|
|
- @note
|
|
|
|
|
- (e.g. /home/babbeo/texture.tga -> texture.tga).
|
|
|
|
|
- @param path
|
|
|
|
|
- The input path
|
|
|
|
|
- @param ret
|
|
|
|
|
- The output filename
|
|
|
|
|
- @return
|
|
|
|
|
- True if success, false otherwise
|
|
|
|
|
- */
|
|
|
|
|
- static bool GetFilename(const Str& path, Str& ret);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- Returns the basename of the path.
|
|
|
|
|
- @note
|
|
|
|
|
- (e.g. /home/babbeo/texture.tga -> texture).
|
|
|
|
|
- @param path
|
|
|
|
|
- The input path
|
|
|
|
|
- @param ret
|
|
|
|
|
- The output basename
|
|
|
|
|
- @return
|
|
|
|
|
- True if success, false otherwise
|
|
|
|
|
- */
|
|
|
|
|
- static bool GetBasename(const Str& path, Str& ret);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- Returns the extension of the path.
|
|
|
|
|
- @note
|
|
|
|
|
- (e.g. /home/babbeo/texture.tga -> tga).
|
|
|
|
|
- @param path
|
|
|
|
|
- The input path
|
|
|
|
|
- @param ret
|
|
|
|
|
- The output extension
|
|
|
|
|
- @return
|
|
|
|
|
- True if success, false otherwise
|
|
|
|
|
- */
|
|
|
|
|
- static bool GetFileExtension(const Str& path, Str& ret);
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- Returns the segments contained in path.
|
|
|
|
|
- @param path
|
|
|
|
|
- The input path
|
|
|
|
|
- @param ret
|
|
|
|
|
- The output list containing path's segments
|
|
|
|
|
- @return
|
|
|
|
|
- True if success, false otherwise
|
|
|
|
|
- */
|
|
|