OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/pool.h" | 5 #include "tools/gn/pool.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 | 10 |
11 Pool::Pool(const Settings* settings, const Label& label) | |
12 : Item(settings, label) {} | |
13 | |
14 Pool::~Pool() {} | 11 Pool::~Pool() {} |
15 | 12 |
16 Pool* Pool::AsPool() { | 13 Pool* Pool::AsPool() { |
17 return this; | 14 return this; |
18 } | 15 } |
19 | 16 |
20 const Pool* Pool::AsPool() const { | 17 const Pool* Pool::AsPool() const { |
21 return this; | 18 return this; |
22 } | 19 } |
23 | 20 |
(...skipping 15 matching lines...) Expand all Loading... |
39 } | 36 } |
40 | 37 |
41 DCHECK(label().dir().is_source_absolute()); | 38 DCHECK(label().dir().is_source_absolute()); |
42 std::string label_dir = label().dir().value(); | 39 std::string label_dir = label().dir().value(); |
43 for (std::string::size_type i = 2; i < label_dir.size(); ++i) { | 40 for (std::string::size_type i = 2; i < label_dir.size(); ++i) { |
44 buffer << (label_dir[i] == '/' ? '_' : label_dir[i]); | 41 buffer << (label_dir[i] == '/' ? '_' : label_dir[i]); |
45 } | 42 } |
46 buffer << label().name(); | 43 buffer << label().name(); |
47 return buffer.str(); | 44 return buffer.str(); |
48 } | 45 } |
OLD | NEW |