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

Side by Side Diff: tools/gn/filesystem_utils.h

Issue 1256043006: Reference written files relatively when possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/gn/filesystem_utils.cc » ('j') | tools/gn/ninja_build_writer.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef TOOLS_GN_FILESYSTEM_UTILS_H_ 5 #ifndef TOOLS_GN_FILESYSTEM_UTILS_H_
6 #define TOOLS_GN_FILESYSTEM_UTILS_H_ 6 #define TOOLS_GN_FILESYSTEM_UTILS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 // 93 //
94 // The origin will be blamed in the error. 94 // The origin will be blamed in the error.
95 // 95 //
96 // If the file isn't in the dir, returns false and sets the error. Otherwise 96 // If the file isn't in the dir, returns false and sets the error. Otherwise
97 // returns true and leaves the error untouched. 97 // returns true and leaves the error untouched.
98 bool EnsureStringIsInOutputDir(const SourceDir& output_dir, 98 bool EnsureStringIsInOutputDir(const SourceDir& output_dir,
99 const std::string& str, 99 const std::string& str,
100 const ParseNode* origin, 100 const ParseNode* origin,
101 Err* err); 101 Err* err);
102 102
103 // If the file isn't in the dir, returns the empty string and sets the error.
104 // Otherwise returns the short output name and leaves the error untouched.
105 base::FilePath::StringType ComputeStringInOutputDir(const SourceDir& output_dir,
106 const SourceFile& file,
107 Err* err);
108
109
103 // ---------------------------------------------------------------------------- 110 // ----------------------------------------------------------------------------
104 111
105 // Returns true if the input string is absolute. Double-slashes at the 112 // Returns true if the input string is absolute. Double-slashes at the
106 // beginning are treated as source-relative paths. On Windows, this handles 113 // beginning are treated as source-relative paths. On Windows, this handles
107 // paths of both the native format: "C:/foo" and ours "/C:/foo" 114 // paths of both the native format: "C:/foo" and ours "/C:/foo"
108 bool IsPathAbsolute(const base::StringPiece& path); 115 bool IsPathAbsolute(const base::StringPiece& path);
109 116
110 // Given an absolute path, checks to see if is it is inside the source root. 117 // Given an absolute path, checks to see if is it is inside the source root.
111 // If it is, fills a source-absolute path into the given output and returns 118 // If it is, fills a source-absolute path into the given output and returns
112 // true. If it isn't, clears the dest and returns false. 119 // true. If it isn't, clears the dest and returns false.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 195
189 SourceDir GetTargetOutputDir(const Target* target); 196 SourceDir GetTargetOutputDir(const Target* target);
190 OutputFile GetTargetOutputDirAsOutputFile(const Target* target); 197 OutputFile GetTargetOutputDirAsOutputFile(const Target* target);
191 SourceDir GetTargetGenDir(const Target* target); 198 SourceDir GetTargetGenDir(const Target* target);
192 OutputFile GetTargetGenDirAsOutputFile(const Target* target); 199 OutputFile GetTargetGenDirAsOutputFile(const Target* target);
193 200
194 SourceDir GetCurrentOutputDir(const Scope* scope); 201 SourceDir GetCurrentOutputDir(const Scope* scope);
195 SourceDir GetCurrentGenDir(const Scope* scope); 202 SourceDir GetCurrentGenDir(const Scope* scope);
196 203
197 #endif // TOOLS_GN_FILESYSTEM_UTILS_H_ 204 #endif // TOOLS_GN_FILESYSTEM_UTILS_H_
OLDNEW
« no previous file with comments | « no previous file | tools/gn/filesystem_utils.cc » ('j') | tools/gn/ninja_build_writer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698