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_PATH_OUTPUT_H_ | 5 #ifndef TOOLS_GN_PATH_OUTPUT_H_ |
6 #define TOOLS_GN_PATH_OUTPUT_H_ | 6 #define TOOLS_GN_PATH_OUTPUT_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/strings/string_piece.h" | 12 #include "base/strings/string_piece.h" |
13 #include "tools/gn/escape.h" | 13 #include "tools/gn/escape.h" |
14 #include "tools/gn/source_dir.h" | 14 #include "tools/gn/source_dir.h" |
| 15 #include "tools/gn/unique_vector.h" |
15 | 16 |
16 class OutputFile; | 17 class OutputFile; |
17 class SourceFile; | 18 class SourceFile; |
18 | 19 |
19 namespace base { | 20 namespace base { |
20 class FilePath; | 21 class FilePath; |
21 } | 22 } |
22 | 23 |
23 // Writes file names to streams assuming a certain input directory and | 24 // Writes file names to streams assuming a certain input directory and |
24 // escaping rules. This gives us a central place for managing this state. | 25 // escaping rules. This gives us a central place for managing this state. |
(...skipping 23 matching lines...) Expand all Loading... |
48 void set_escape_platform(EscapingPlatform p) { options_.platform = p; } | 49 void set_escape_platform(EscapingPlatform p) { options_.platform = p; } |
49 | 50 |
50 void WriteFile(std::ostream& out, const SourceFile& file) const; | 51 void WriteFile(std::ostream& out, const SourceFile& file) const; |
51 void WriteFile(std::ostream& out, const OutputFile& file) const; | 52 void WriteFile(std::ostream& out, const OutputFile& file) const; |
52 void WriteFile(std::ostream& out, const base::FilePath& file) const; | 53 void WriteFile(std::ostream& out, const base::FilePath& file) const; |
53 | 54 |
54 // Writes the given OutputFiles with spaces separating them. This will also | 55 // Writes the given OutputFiles with spaces separating them. This will also |
55 // write an initial space before the first item. | 56 // write an initial space before the first item. |
56 void WriteFiles(std::ostream& out, | 57 void WriteFiles(std::ostream& out, |
57 const std::vector<OutputFile>& files) const; | 58 const std::vector<OutputFile>& files) const; |
| 59 void WriteFiles(std::ostream& out, |
| 60 const UniqueVector<OutputFile>& files) const; |
58 | 61 |
59 // This variant assumes the dir ends in a trailing slash or is empty. | 62 // This variant assumes the dir ends in a trailing slash or is empty. |
60 void WriteDir(std::ostream& out, | 63 void WriteDir(std::ostream& out, |
61 const SourceDir& dir, | 64 const SourceDir& dir, |
62 DirSlashEnding slash_ending) const; | 65 DirSlashEnding slash_ending) const; |
63 | 66 |
64 void WriteDir(std::ostream& out, | 67 void WriteDir(std::ostream& out, |
65 const OutputFile& file, | 68 const OutputFile& file, |
66 DirSlashEnding slash_ending) const; | 69 DirSlashEnding slash_ending) const; |
67 | 70 |
(...skipping 11 matching lines...) Expand all Loading... |
79 | 82 |
80 // Uses system slashes if convert_slashes_to_system_. | 83 // Uses system slashes if convert_slashes_to_system_. |
81 std::string inverse_current_dir_; | 84 std::string inverse_current_dir_; |
82 | 85 |
83 // Since the inverse_current_dir_ depends on some of these, we don't expose | 86 // Since the inverse_current_dir_ depends on some of these, we don't expose |
84 // this directly to modification. | 87 // this directly to modification. |
85 EscapeOptions options_; | 88 EscapeOptions options_; |
86 }; | 89 }; |
87 | 90 |
88 #endif // TOOLS_GN_PATH_OUTPUT_H_ | 91 #endif // TOOLS_GN_PATH_OUTPUT_H_ |
OLD | NEW |