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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 Label(const SourceDir& dir, | 25 Label(const SourceDir& dir, |
26 const base::StringPiece& name, | 26 const base::StringPiece& name, |
27 const SourceDir& toolchain_dir, | 27 const SourceDir& toolchain_dir, |
28 const base::StringPiece& toolchain_name); | 28 const base::StringPiece& toolchain_name); |
29 | 29 |
30 // Makes a label with an empty toolchain. | 30 // Makes a label with an empty toolchain. |
31 Label(const SourceDir& dir, const base::StringPiece& name); | 31 Label(const SourceDir& dir, const base::StringPiece& name); |
32 Label(const Label& other); | 32 Label(const Label& other); |
33 ~Label(); | 33 ~Label(); |
34 | 34 |
35 // Resolives a string from a build file that may be relative to the | 35 // Resolves a string from a build file that may be relative to the |
36 // current directory into a fully qualified label. On failure returns an | 36 // current directory into a fully qualified label. On failure returns an |
37 // is_null() label and sets the error. | 37 // is_null() label and sets the error. |
38 static Label Resolve(const SourceDir& current_dir, | 38 static Label Resolve(const SourceDir& current_dir, |
39 const Label& current_toolchain, | 39 const Label& current_toolchain, |
40 const Value& input, | 40 const Value& input, |
41 Err* err); | 41 Err* err); |
42 | 42 |
43 bool is_null() const { return dir_.is_null(); } | 43 bool is_null() const { return dir_.is_null(); } |
44 | 44 |
45 const SourceDir& dir() const { return dir_; } | 45 const SourceDir& dir() const { return dir_; } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 117 } |
118 }; | 118 }; |
119 | 119 |
120 } // namespace BASE_HASH_NAMESPACE | 120 } // namespace BASE_HASH_NAMESPACE |
121 | 121 |
122 inline void swap(Label& lhs, Label& rhs) { | 122 inline void swap(Label& lhs, Label& rhs) { |
123 lhs.swap(rhs); | 123 lhs.swap(rhs); |
124 } | 124 } |
125 | 125 |
126 #endif // TOOLS_GN_LABEL_H_ | 126 #endif // TOOLS_GN_LABEL_H_ |
OLD | NEW |