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/c_include_iterator.h" | 5 #include "tools/gn/c_include_iterator.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" |
8 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
9 #include "tools/gn/input_file.h" | 10 #include "tools/gn/input_file.h" |
10 #include "tools/gn/location.h" | 11 #include "tools/gn/location.h" |
11 | 12 |
12 namespace { | 13 namespace { |
13 | 14 |
14 enum IncludeType { | 15 enum IncludeType { |
15 INCLUDE_NONE, | 16 INCLUDE_NONE, |
16 INCLUDE_SYSTEM, // #include <...> | 17 INCLUDE_SYSTEM, // #include <...> |
17 INCLUDE_USER // #include "..." | 18 INCLUDE_USER // #include "..." |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 line_number_++; | 167 line_number_++; |
167 | 168 |
168 *line = file_.substr(begin, offset_ - begin); | 169 *line = file_.substr(begin, offset_ - begin); |
169 *line_number = line_number_; | 170 *line_number = line_number_; |
170 | 171 |
171 // If we didn't hit EOF, skip past the newline for the next one. | 172 // If we didn't hit EOF, skip past the newline for the next one. |
172 if (offset_ < file_.size()) | 173 if (offset_ < file_.size()) |
173 offset_++; | 174 offset_++; |
174 return true; | 175 return true; |
175 } | 176 } |
OLD | NEW |