Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(765)

Unified Diff: trunk/src/tools/gn/c_include_iterator.h

Issue 231293003: Revert 262747 "Improve GN public header file checking" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/src/third_party/freetype2/BUILD.gn ('k') | trunk/src/tools/gn/c_include_iterator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/tools/gn/c_include_iterator.h
===================================================================
--- trunk/src/tools/gn/c_include_iterator.h (revision 262754)
+++ trunk/src/tools/gn/c_include_iterator.h (working copy)
@@ -8,43 +8,32 @@
#include "base/basictypes.h"
#include "base/strings/string_piece.h"
-class InputFile;
-class LocationRange;
-
// Iterates through #includes in C source and header files.
//
// This only returns includes we want to check, which is user includes with
// double-quotes: #include "..."
class CIncludeIterator {
public:
- // The InputFile pointed to must outlive this class.
- CIncludeIterator(const InputFile* input);
+ // The buffer pointed to must outlive this class.
+ CIncludeIterator(const base::StringPiece& file);
~CIncludeIterator();
- // Fills in the string with the contents of the next include, and the
- // location with where it came from, and returns true, or returns false if
- // there are no more includes.
- bool GetNextIncludeString(base::StringPiece* out, LocationRange* location);
+ // Fills in the string with the contents of the next include and returns
+ // true, or returns false if there are no more includes.
+ bool GetNextIncludeString(base::StringPiece* out);
// Maximum numbef of non-includes we'll tolerate before giving up. This does
// not count comments or preprocessor.
static const int kMaxNonIncludeLines;
private:
- // Returns false on EOF, otherwise fills in the given line and the one-based
- // line number into *line_number.
- bool GetNextLine(base::StringPiece* line, int* line_number);
+ // Returns false on EOF, otherwise fills in the given line.
+ bool GetNextLine(base::StringPiece* line);
- const InputFile* input_file_;
-
- // This just points into input_file_.contents() for convenience.
base::StringPiece file_;
- // 0-based offset into the file.
size_t offset_;
- int line_number_; // One-based. Indicates the last line we read.
-
// Number of lines we've processed since seeing the last include (or the
// beginning of the file) with some exceptions.
int lines_since_last_include_;
« no previous file with comments | « trunk/src/third_party/freetype2/BUILD.gn ('k') | trunk/src/tools/gn/c_include_iterator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698