| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "tools/gn/label_pattern.h" | 5 #include "tools/gn/label_pattern.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 LabelPattern::LabelPattern(Type type, | 54 LabelPattern::LabelPattern(Type type, |
| 55 const SourceDir& dir, | 55 const SourceDir& dir, |
| 56 const base::StringPiece& name, | 56 const base::StringPiece& name, |
| 57 const Label& toolchain_label) | 57 const Label& toolchain_label) |
| 58 : toolchain_(toolchain_label), | 58 : toolchain_(toolchain_label), |
| 59 type_(type), | 59 type_(type), |
| 60 dir_(dir) { | 60 dir_(dir) { |
| 61 name.CopyToString(&name_); | 61 name.CopyToString(&name_); |
| 62 } | 62 } |
| 63 | 63 |
| 64 LabelPattern::LabelPattern(const LabelPattern& other) = default; |
| 65 |
| 64 LabelPattern::~LabelPattern() { | 66 LabelPattern::~LabelPattern() { |
| 65 } | 67 } |
| 66 | 68 |
| 67 // static | 69 // static |
| 68 LabelPattern LabelPattern::GetPattern(const SourceDir& current_dir, | 70 LabelPattern LabelPattern::GetPattern(const SourceDir& current_dir, |
| 69 const Value& value, | 71 const Value& value, |
| 70 Err* err) { | 72 Err* err) { |
| 71 if (!value.VerifyTypeIs(Value::STRING, err)) | 73 if (!value.VerifyTypeIs(Value::STRING, err)) |
| 72 return LabelPattern(); | 74 return LabelPattern(); |
| 73 | 75 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 break; | 262 break; |
| 261 } | 263 } |
| 262 | 264 |
| 263 if (!toolchain_.is_null()) { | 265 if (!toolchain_.is_null()) { |
| 264 result.push_back('('); | 266 result.push_back('('); |
| 265 result.append(toolchain_.GetUserVisibleName(false)); | 267 result.append(toolchain_.GetUserVisibleName(false)); |
| 266 result.push_back(')'); | 268 result.push_back(')'); |
| 267 } | 269 } |
| 268 return result; | 270 return result; |
| 269 } | 271 } |
| OLD | NEW |