diff options
author | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-24 21:28:30 +0000 |
---|---|---|
committer | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-24 21:28:30 +0000 |
commit | 0e4f68db63e565201a6eaa2f600441c37b150d1b (patch) | |
tree | b4cfc4f35e6d8ae7fa6266fd2c3faaed9e006adb /base/file_path.h | |
parent | a86c97ccfe0038b1672d5a06d283561b7f294640 (diff) | |
download | chromium_src-0e4f68db63e565201a6eaa2f600441c37b150d1b.zip chromium_src-0e4f68db63e565201a6eaa2f600441c37b150d1b.tar.gz chromium_src-0e4f68db63e565201a6eaa2f600441c37b150d1b.tar.bz2 |
Move PathComponents from file_util to FilePath, add FilePath::IsParent()
r=erikkay,mark
Review URL: http://codereview.chromium.org/145026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19174 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_path.h')
-rw-r--r-- | base/file_path.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/base/file_path.h b/base/file_path.h index 73de4a6..ae4d36d 100644 --- a/base/file_path.h +++ b/base/file_path.h @@ -142,6 +142,18 @@ class FilePath { // Returns true if |character| is in kSeparators. static bool IsSeparator(CharType character); + // Returns a vector of all of the components of the provided path. It is + // equivalent to calling DirName().value() on the path's root component, + // and BaseName().value() on each child component. + void GetComponents(std::vector<FilePath::StringType>* components) const; + + // Returns true if this FilePath is a strict parent of the |child|. Absolute + // and relative paths are accepted i.e. is /foo parent to /foo/bar and + // is foo parent to foo/bar. Does not convert paths to absolute, follow + // symlinks or directory navigation (e.g. ".."). A path is *NOT* its own + // parent. + bool IsParent(const FilePath& child) const; + // Returns a FilePath corresponding to the directory containing the path // named by this object, stripping away the file component. If this object // only contains one component, returns a FilePath identifying |