class line_iterator
Declaration
class line_iterator : public std::iterator { /* full declaration omitted */ };
Description
A forward iterator which reads text lines from a buffer. This class provides a forward iterator interface for reading one line at a time from a buffer. When default constructed the iterator will be the "end" iterator. The iterator is aware of what line number it is currently processing. It strips blank lines by default, and comment lines given a comment-starting character. Note that this iterator requires the buffer to be nul terminated.
Declared at: llvm/include/llvm/Support/LineIterator.h:31
Inherits from: std::iterator
Method Overview
- public bool is_at_end() const
- public bool is_at_eof() const
- public line_iterator()
- public line_iterator(const llvm::MemoryBuffer & Buffer, bool SkipBlanks = true, char CommentMarker = '\x00')
- public int64_t line_number() const
Methods
¶bool is_at_end() const
bool is_at_end() const
Description
Return true if we're an "end" iterator or have reached EOF.
Declared at: llvm/include/llvm/Support/LineIterator.h:52
¶bool is_at_eof() const
bool is_at_eof() const
Description
Return true if we've reached EOF or are an "end" iterator.
Declared at: llvm/include/llvm/Support/LineIterator.h:49
¶line_iterator()
line_iterator()
Description
Default construct an "end" iterator.
Declared at: llvm/include/llvm/Support/LineIterator.h:42
¶line_iterator(const llvm::MemoryBuffer& Buffer,
bool SkipBlanks = true,
char CommentMarker = '\x00')
line_iterator(const llvm::MemoryBuffer& Buffer,
bool SkipBlanks = true,
char CommentMarker = '\x00')
Description
Construct a new iterator around some memory buffer.
Declared at: llvm/include/llvm/Support/LineIterator.h:45
Parameters
- const llvm::MemoryBuffer& Buffer
- bool SkipBlanks = true
- char CommentMarker = '\x00'
¶int64_t line_number() const
int64_t line_number() const
Description
Return the current line number. May return any number at EOF.
Declared at: llvm/include/llvm/Support/LineIterator.h:55