Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Unified Diff: tools/gn/filesystem_utils.h

Issue 711113004: original (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: win compile fix Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/command_format.cc ('k') | tools/gn/filesystem_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/filesystem_utils.h
diff --git a/tools/gn/filesystem_utils.h b/tools/gn/filesystem_utils.h
index 20773cc7dd6a9e2354c943fb06211fca88a676ef..f5cf494ba8375774485cb49f8012fda49ea62b16 100644
--- a/tools/gn/filesystem_utils.h
+++ b/tools/gn/filesystem_utils.h
@@ -116,11 +116,6 @@ bool MakeAbsolutePathRelativeIfPossible(const base::StringPiece& source_root,
const base::StringPiece& path,
std::string* dest);
-// Converts a directory to its inverse (e.g. "/foo/bar/" -> "../../").
-// This will be the empty string for the root directories ("/" and "//"), and
-// in all other cases, this is guaranteed to end in a slash.
-std::string InvertDir(const SourceDir& dir);
-
// Collapses "." and sequential "/"s and evaluates "..".
void NormalizePath(std::string* path);
@@ -128,10 +123,17 @@ void NormalizePath(std::string* path);
// for other systems.
void ConvertPathToSystem(std::string* path);
-// Takes a source-absolute path (must begin with "//") and makes it relative
-// to the given directory, which also must be source-absolute.
-std::string RebaseSourceAbsolutePath(const std::string& input,
- const SourceDir& dest_dir);
+// Takes a path, |input|, and makes it relative to the given directory
+// |dest_dir|. Both inputs may be source-relative (e.g. begins with
+// with "//") or may be absolute.
+//
+// If supplied, the |source_root| parameter is the absolute path to
+// the source root and not end in a slash. Unless you know that the
+// inputs are always source relative, this should be supplied.
+std::string RebasePath(
+ const std::string& input,
+ const SourceDir& dest_dir,
+ const base::StringPiece& source_root = base::StringPiece());
// Returns the given directory with no terminating slash at the end, such that
// appending a slash and more stuff will produce a valid path.
« no previous file with comments | « tools/gn/command_format.cc ('k') | tools/gn/filesystem_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698