| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |