diff options
author | Brad King <brad.king@kitware.com> | 2005-02-10 15:32:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2005-02-10 15:32:53 (GMT) |
commit | 4bf8aa62933f9ceac89628101ec6190a794b3c79 (patch) | |
tree | 1a7fca0b3d3c95d519afb38782d78794af006356 /Source/kwsys/SystemTools.hxx.in | |
parent | 52a6bb1bca5f5a79bac95bf3200b78593d830716 (diff) | |
download | CMake-4bf8aa62933f9ceac89628101ec6190a794b3c79.zip CMake-4bf8aa62933f9ceac89628101ec6190a794b3c79.tar.gz CMake-4bf8aa62933f9ceac89628101ec6190a794b3c79.tar.bz2 |
ENH: Added SystemTools::SplitPath method to split any file path into its basic components.
Diffstat (limited to 'Source/kwsys/SystemTools.hxx.in')
-rw-r--r-- | Source/kwsys/SystemTools.hxx.in | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in index e2fee45..e65ee05 100644 --- a/Source/kwsys/SystemTools.hxx.in +++ b/Source/kwsys/SystemTools.hxx.in @@ -237,6 +237,23 @@ public: static kwsys_stl::string CollapseFullPath(const char* in_relative); static kwsys_stl::string CollapseFullPath(const char* in_relative, const char* in_base); + + /** + * Split a path name into its basic components. The first component + * is one of the following roots: + * "/" = UNIX + * "c:/" = Windows full path (can be any drive letter) + * "c:" = Windows drive-letter relative path (can be any drive letter) + * "//" = Network path + * "" = Relative path + * The remaining components form the path. If there is a trailing + * slash then the last component is the empty string. The + * components can be recombined as "c[0]c[1]/c[2]/.../c[n]" to + * produce the original path. The input is assumed to be formatted + * with forward slashes. + */ + static void SplitPath(const char* p, + kwsys_stl::vector<kwsys_stl::string>& components); ///! return path of a full filename (no trailing slashes). static kwsys_stl::string GetFilenamePath(const kwsys_stl::string&); |