JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | List of all members
juce::CodeDocument::Iterator Class Reference

Iterates the text in a CodeDocument. More...

#include "juce_CodeDocument.h"

Public Member Functions

 Iterator () noexcept
 Creates an uninitialised iterator.
 
 Iterator (const CodeDocument &document) noexcept
 
 Iterator (CodeDocument::Position) noexcept
 
 Iterator (const Iterator &)=default
 
Iteratoroperator= (const Iterator &)=default
 
juce_wchar nextChar () noexcept
 Reads the next character and returns it.
 
juce_wchar peekNextChar () const noexcept
 Reads the next character without moving the current position.
 
juce_wchar previousChar () noexcept
 Reads the previous character and returns it.
 
juce_wchar peekPreviousChar () const noexcept
 Reads the next character without moving the current position.
 
void skip () noexcept
 Advances the position by one character.
 
int getPosition () const noexcept
 Returns the position as the number of characters from the start of the document.
 
void skipWhitespace () noexcept
 Skips over any whitespace characters until the next character is non-whitespace.
 
void skipToEndOfLine () noexcept
 Skips forward until the next character will be the first character on the next line.
 
void skipToStartOfLine () noexcept
 Skips backward until the next character will be the first character on this line.
 
int getLine () const noexcept
 Returns the line number of the next character.
 
bool isEOF () const noexcept
 Returns true if the iterator has reached the end of the document.
 
bool isSOF () const noexcept
 Returns true if the iterator is at the start of the document.
 
CodeDocument::Position toPosition () const
 Convert this iterator to a CodeDocument::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

Definition at line 359 of file juce_CodeDocument.h.

Constructor & Destructor Documentation

◆ Iterator() [1/3]

juce::CodeDocument::Iterator::Iterator ( )
noexcept

Creates an uninitialised iterator.

Don't attempt to call any methods on this until you've given it an owner document to refer to!

Definition at line 151 of file juce_CodeDocument.cpp.

◆ Iterator() [2/3]

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

Definition at line 128 of file juce_CodeDocument.cpp.

◆ Iterator() [3/3]

juce::CodeDocument::Iterator::Iterator ( CodeDocument::Position  p)
noexcept

Definition at line 132 of file juce_CodeDocument.cpp.

◆ ~Iterator()

juce::CodeDocument::Iterator::~Iterator ( )
noexcept

Definition at line 156 of file juce_CodeDocument.cpp.

Member Function Documentation

◆ getLine()

int juce::CodeDocument::Iterator::getLine ( ) const
noexcept

Returns the line number of the next character.

Definition at line 409 of file juce_CodeDocument.h.

◆ getPosition()

int juce::CodeDocument::Iterator::getPosition ( ) const
noexcept

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

Definition at line 397 of file juce_CodeDocument.h.

◆ isEOF()

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

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

Definition at line 293 of file juce_CodeDocument.cpp.

◆ isSOF()

bool juce::CodeDocument::Iterator::isSOF ( ) const
noexcept

Returns true if the iterator is at the start of the document.

Definition at line 298 of file juce_CodeDocument.cpp.

◆ nextChar()

juce_wchar juce::CodeDocument::Iterator::nextChar ( )
noexcept

Reads the next character and returns it.

Returns 0 if you try to read past the document's end.

See also
peekNextChar, previousChar

Definition at line 175 of file juce_CodeDocument.cpp.

◆ peekNextChar()

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

Reads the next character without moving the current position.

Definition at line 227 of file juce_CodeDocument.cpp.

◆ peekPreviousChar()

juce_wchar juce::CodeDocument::Iterator::peekPreviousChar ( ) const
noexcept

Reads the next character without moving the current position.

Definition at line 270 of file juce_CodeDocument.cpp.

◆ previousChar()

juce_wchar juce::CodeDocument::Iterator::previousChar ( )
noexcept

Reads the previous character and returns it.

Returns 0 if you try to read past the document's start.

See also
isSOF, peekPreviousChar, nextChar

Definition at line 241 of file juce_CodeDocument.cpp.

◆ skip()

void juce::CodeDocument::Iterator::skip ( )
noexcept

Advances the position by one character.

Definition at line 199 of file juce_CodeDocument.cpp.

◆ skipToEndOfLine()

void juce::CodeDocument::Iterator::skipToEndOfLine ( )
noexcept

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

Definition at line 204 of file juce_CodeDocument.cpp.

◆ skipToStartOfLine()

void juce::CodeDocument::Iterator::skipToStartOfLine ( )
noexcept

Skips backward until the next character will be the first character on this line.

Definition at line 214 of file juce_CodeDocument.cpp.

◆ skipWhitespace()

void juce::CodeDocument::Iterator::skipWhitespace ( )
noexcept

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

Definition at line 287 of file juce_CodeDocument.cpp.

◆ toPosition()

CodeDocument::Position juce::CodeDocument::Iterator::toPosition ( ) const

Convert this iterator to a CodeDocument::Position.

Definition at line 303 of file juce_CodeDocument.cpp.


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