summaryrefslogtreecommitdiffstats
path: root/base/file_path.h
diff options
context:
space:
mode:
authortim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-27 02:17:53 +0000
committertim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-27 02:17:53 +0000
commit71b0c7f62e9c674adb0ffc785ee0e8de05b55468 (patch)
treeee375dfcf70ac3957a999c5b05b21f90b395c8a6 /base/file_path.h
parentbd6bf836e379f88b7634c897d210355fbd4e67cb (diff)
downloadchromium_src-71b0c7f62e9c674adb0ffc785ee0e8de05b55468.zip
chromium_src-71b0c7f62e9c674adb0ffc785ee0e8de05b55468.tar.gz
chromium_src-71b0c7f62e9c674adb0ffc785ee0e8de05b55468.tar.bz2
Revert 30149 - The existing file_util::AbsolutePath() function was already doing what we needed to do in the ExtensionResource class.
BUG= http://crbug.com/25681 & http://crbug.com/25131 Review URL: http://codereview.chromium.org/334028 TBR=mad@chromium.org Review URL: http://codereview.chromium.org/335042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30152 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_path.h')
-rw-r--r--base/file_path.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/base/file_path.h b/base/file_path.h
index 7106c90b..5c8f183 100644
--- a/base/file_path.h
+++ b/base/file_path.h
@@ -178,6 +178,18 @@ class FilePath {
// and BaseName().value() on each child component.
void GetComponents(std::vector<FilePath::StringType>* components) const;
+ // Returns true, and sets *path to resulting full path, if relative_path can
+ // be applied to current path by resolving any '..' it may contain. Returns
+ // false otherwise, e.g., if relative path is absolute, or if it climbs back
+ // up the hierarchy too far (i.e., beyond the root of current path).
+ //
+ // Note that if the current path ends with a file name, we won't try to
+ // figure it out (so this method doesn't go to the disk) and we will blindly
+ // append relative_path at the end of the current path, including the file
+ // name in the current path (if any).
+ bool AppendAndResolveRelative(const FilePath& relative_path,
+ FilePath* path) 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