Bond 0.9
C++ Bond Runtime Library API Documentation
Loading...
Searching...
No Matches
Bond::CharStream Class Reference

An iterator over the contents of a stream of text. More...

#include <bond/compiler/charstream.h>

Public Member Functions

 CharStream (InputStream &stream)
 Constructs a CharStream object. More...
 
void Reset ()
 Resets the position of the stream back to the beginning. More...
 
void Reset (const StreamPos &pos)
 Resets the position of the stream back to the specified position. More...
 
void Sync ()
 Ensures that the underlying InputStream is seeked to the same position as this stream. More...
 
bool HasNext () const
 Returns whether any characters remain in the stream. More...
 
char Next ()
 Returns the next character in the stream and advances the stream's position. More...
 
const StreamPosGetStreamPos () const
 Returns the stream's current position. More...
 

Detailed Description

An iterator over the contents of a stream of text.

CharStream is used internally by Lexer; it is unlikely that someone integrating Bond into their application will have to make direct use of it.

Constructor & Destructor Documentation

◆ CharStream()

Bond::CharStream::CharStream ( InputStream stream)
inlineexplicit

Constructs a CharStream object.

Parameters
streamThe underlying stream of characters over which this stream iterates.

Member Function Documentation

◆ GetStreamPos()

const StreamPos & Bond::CharStream::GetStreamPos ( ) const
inline

Returns the stream's current position.

◆ HasNext()

bool Bond::CharStream::HasNext ( ) const

Returns whether any characters remain in the stream.

◆ Next()

char Bond::CharStream::Next ( )

Returns the next character in the stream and advances the stream's position.

◆ Reset() [1/2]

void Bond::CharStream::Reset ( )
inline

Resets the position of the stream back to the beginning.

◆ Reset() [2/2]

void Bond::CharStream::Reset ( const StreamPos pos)

Resets the position of the stream back to the specified position.

◆ Sync()

void Bond::CharStream::Sync ( )
inline

Ensures that the underlying InputStream is seeked to the same position as this stream.


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