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_LABEL_H_ | 5 #ifndef TOOLS_GN_LABEL_H_ |
6 #define TOOLS_GN_LABEL_H_ | 6 #define TOOLS_GN_LABEL_H_ |
7 | 7 |
8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
9 #include "tools/gn/source_dir.h" | 9 #include "tools/gn/source_dir.h" |
10 | 10 |
11 class Err; | 11 class Err; |
12 class Value; | 12 class Value; |
13 | 13 |
14 // A label represents the name of a target or some other named thing in | 14 // A label represents the name of a target or some other named thing in |
15 // the source path. The label is always absolute and always includes a name | 15 // the source path. The label is always absolute and always includes a name |
16 // part, so it starts with a slash, and has one colon. | 16 // part, so it starts with a slash, and has one colon. |
17 class Label { | 17 class Label { |
18 public: | 18 public: |
19 Label(); | 19 Label(); |
20 | 20 |
21 // Makes a label given an already-separate out path and name. | 21 // Makes a label given an already-separated out path and name. |
22 // See also Resolve(). | 22 // See also Resolve(). |
23 Label(const SourceDir& dir, | 23 Label(const SourceDir& dir, |
24 const base::StringPiece& name, | 24 const base::StringPiece& name, |
25 const SourceDir& toolchain_dir, | 25 const SourceDir& toolchain_dir, |
26 const base::StringPiece& toolchain_name); | 26 const base::StringPiece& toolchain_name); |
27 | 27 |
28 // Makes a label with an empty toolchain. | 28 // Makes a label with an empty toolchain. |
29 Label(const SourceDir& dir, const base::StringPiece& name); | 29 Label(const SourceDir& dir, const base::StringPiece& name); |
30 ~Label(); | 30 ~Label(); |
31 | 31 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } | 116 } |
117 }; | 117 }; |
118 | 118 |
119 } // namespace BASE_HASH_NAMESPACE | 119 } // namespace BASE_HASH_NAMESPACE |
120 | 120 |
121 inline void swap(Label& lhs, Label& rhs) { | 121 inline void swap(Label& lhs, Label& rhs) { |
122 lhs.swap(rhs); | 122 lhs.swap(rhs); |
123 } | 123 } |
124 | 124 |
125 #endif // TOOLS_GN_LABEL_H_ | 125 #endif // TOOLS_GN_LABEL_H_ |
OLD | NEW |