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 213353004: GN: Move towards only using / on Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: restore convert_slashes in output path, misc fixes Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « tools/gn/command_desc.cc ('k') | tools/gn/filesystem_utils.cc » ('j') | no next file with comments »
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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // This will be the empty string for the root directories ("/" and "//"), and 131 // This will be the empty string for the root directories ("/" and "//"), and
132 // in all other cases, this is guaranteed to end in a slash. 132 // in all other cases, this is guaranteed to end in a slash.
133 std::string InvertDir(const SourceDir& dir); 133 std::string InvertDir(const SourceDir& dir);
134 134
135 // Collapses "." and sequential "/"s and evaluates "..". 135 // Collapses "." and sequential "/"s and evaluates "..".
136 void NormalizePath(std::string* path); 136 void NormalizePath(std::string* path);
137 137
138 // Converts slashes to backslashes for Windows. Keeps the string unchanged 138 // Converts slashes to backslashes for Windows. Keeps the string unchanged
139 // for other systems. 139 // for other systems.
140 void ConvertPathToSystem(std::string* path); 140 void ConvertPathToSystem(std::string* path);
141 std::string PathToSystem(const std::string& path);
142 141
143 // Takes a source-absolute path (must begin with "//") and makes it relative 142 // Takes a source-absolute path (must begin with "//") and makes it relative
144 // to the given directory, which also must be source-absolute. 143 // to the given directory, which also must be source-absolute.
145 std::string RebaseSourceAbsolutePath(const std::string& input, 144 std::string RebaseSourceAbsolutePath(const std::string& input,
146 const SourceDir& dest_dir); 145 const SourceDir& dest_dir);
147 146
148 // Returns the given directory with no terminating slash at the end, such that 147 // Returns the given directory with no terminating slash at the end, such that
149 // appending a slash and more stuff will produce a valid path. 148 // appending a slash and more stuff will produce a valid path.
150 // 149 //
151 // If the directory refers to either the source or system root, we'll append 150 // If the directory refers to either the source or system root, we'll append
(...skipping 19 matching lines...) Expand all
171 SourceDir GetOutputDirForSourceDir(const Settings* settings, 170 SourceDir GetOutputDirForSourceDir(const Settings* settings,
172 const SourceDir& source_dir); 171 const SourceDir& source_dir);
173 SourceDir GetGenDirForSourceDir(const Settings* settings, 172 SourceDir GetGenDirForSourceDir(const Settings* settings,
174 const SourceDir& source_dir); 173 const SourceDir& source_dir);
175 SourceDir GetTargetOutputDir(const Target* target); 174 SourceDir GetTargetOutputDir(const Target* target);
176 SourceDir GetTargetGenDir(const Target* target); 175 SourceDir GetTargetGenDir(const Target* target);
177 SourceDir GetCurrentOutputDir(const Scope* scope); 176 SourceDir GetCurrentOutputDir(const Scope* scope);
178 SourceDir GetCurrentGenDir(const Scope* scope); 177 SourceDir GetCurrentGenDir(const Scope* scope);
179 178
180 #endif // TOOLS_GN_FILESYSTEM_UTILS_H_ 179 #endif // TOOLS_GN_FILESYSTEM_UTILS_H_
OLDNEW
« no previous file with comments | « tools/gn/command_desc.cc ('k') | tools/gn/filesystem_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698