| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- /**
- 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
- */
|