summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
Diffstat (limited to 'base')
-rw-r--r--base/file_util.cc7
-rw-r--r--base/file_util.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/base/file_util.cc b/base/file_util.cc
index 37adb04..d3a989b5 100644
--- a/base/file_util.cc
+++ b/base/file_util.cc
@@ -294,6 +294,13 @@ bool ReadFileToString(const std::wstring& path, std::string* contents) {
return ReadFileToString(FilePath::FromWStringHack(path), contents);
}
+bool AbsolutePath(std::wstring* path_str) {
+ FilePath path(FilePath::FromWStringHack(*path_str));
+ if (!AbsolutePath(&path))
+ return false;
+ *path_str = path.ToWStringHack();
+ return true;
+}
void AppendToPath(std::wstring* path, const std::wstring& new_ending) {
if (!path) {
NOTREACHED();
diff --git a/base/file_util.h b/base/file_util.h
index e9f9254..37634b9 100644
--- a/base/file_util.h
+++ b/base/file_util.h
@@ -89,6 +89,8 @@ void AppendToPath(std::wstring* path, const std::wstring& new_ending);
// Convert provided relative path into an absolute path. Returns false on
// error. On POSIX, this function fails if the path does not exist.
bool AbsolutePath(FilePath* path);
+// Deprecated temporary compatibility function.
+bool AbsolutePath(std::wstring* path);
// Returns true if |parent| contains |child|. Both paths are converted to
// absolute paths before doing the comparison.