JUCE  v5.1.1-3-g1a0b28c73
JUCE API
CodeDocument::Iterator Class Reference

Iterates the text in a CodeDocument. More...

#include <juce_CodeDocument.h>

Collaboration diagram for CodeDocument::Iterator:

Public Member Functions

 Iterator (const CodeDocument &document) noexcept
 
 Iterator (const Iterator &) noexcept
 
 ~Iterator () noexcept
 
int getLine () const noexcept
 Returns the line number of the next character. More...
 
int getPosition () const noexcept
 Returns the position as the number of characters from the start of the document. More...
 
bool isEOF () const noexcept
 Returns true if the iterator has reached the end of the document. More...
 
juce_wchar nextChar () noexcept
 Reads the next character and returns it. More...
 
Iteratoroperator= (const Iterator &) noexcept
 
juce_wchar peekNextChar () const noexcept
 Reads the next character without advancing the current position. More...
 
void skip () noexcept
 Advances the position by one character. More...
 
void skipToEndOfLine () noexcept
 Skips forward until the next character will be the first character on the next line. More...
 
void skipWhitespace () noexcept
 Skips over any whitespace characters until the next character is non-whitespace. More...
 

Private Attributes

String::CharPointerType charPointer
 
const CodeDocumentdocument
 
int line
 
int position
 

Detailed Description

Iterates the text in a CodeDocument.

This class lets you read characters from a CodeDocument. It's designed to be used by a CodeTokeniser object.

See also
CodeDocument

Constructor & Destructor Documentation

◆ Iterator() [1/2]

CodeDocument::Iterator::Iterator ( const CodeDocument document)
noexcept

◆ Iterator() [2/2]

CodeDocument::Iterator::Iterator ( const Iterator )
noexcept

◆ ~Iterator()

CodeDocument::Iterator::~Iterator ( )
noexcept

Member Function Documentation

◆ getLine()

int CodeDocument::Iterator::getLine ( ) const
inlinenoexcept

Returns the line number of the next character.

◆ getPosition()

int CodeDocument::Iterator::getPosition ( ) const
inlinenoexcept

Returns the position as the number of characters from the start of the document.

◆ isEOF()

bool CodeDocument::Iterator::isEOF ( ) const
noexcept

Returns true if the iterator has reached the end of the document.

◆ nextChar()

juce_wchar CodeDocument::Iterator::nextChar ( )
noexcept

Reads the next character and returns it.

See also
peekNextChar

◆ operator=()

Iterator& CodeDocument::Iterator::operator= ( const Iterator )
noexcept

◆ peekNextChar()

juce_wchar CodeDocument::Iterator::peekNextChar ( ) const
noexcept

Reads the next character without advancing the current position.

◆ skip()

void CodeDocument::Iterator::skip ( )
noexcept

Advances the position by one character.

◆ skipToEndOfLine()

void CodeDocument::Iterator::skipToEndOfLine ( )
noexcept

Skips forward until the next character will be the first character on the next line.

◆ skipWhitespace()

void CodeDocument::Iterator::skipWhitespace ( )
noexcept

Skips over any whitespace characters until the next character is non-whitespace.

Member Data Documentation

◆ charPointer

String::CharPointerType CodeDocument::Iterator::charPointer
mutableprivate

◆ document

const CodeDocument* CodeDocument::Iterator::document
private

◆ line

int CodeDocument::Iterator::line
private

◆ position

int CodeDocument::Iterator::position
private

The documentation for this class was generated from the following file: