Pegmatite
Public Member Functions | List of all members
pegmatite::Input::iterator Class Reference

Iterator, refers back into the input stream. More...

#include <parser.hh>

Inheritance diagram for pegmatite::Input::iterator:

Public Member Functions

 iterator ()
 Default constructor, constructs an invalid iterator into no buffer.
 
const std::string & filename () const
 Filename given by Input this iterator is derived from. More...
 
char32_t operator* () const
 Dereference operator, returns the character represented by this index.
 
iteratoroperator++ ()
 Move the iterator on to the next location. More...
 
iterator operator++ (int)
 
iteratoroperator+= (size_t amount)
 Move the iterator forward by the specified amount.
 
iteratoroperator-- ()
 Move the iterator to the previous location. More...
 
bool operator== (const iterator &other) const
 Compares iterators for equality. More...
 
bool operator!= (const iterator &other) const
 Compares iterators for inequality.
 
bool operator> (const iterator &other) const
 Compares locations of iterators in the input.
 
bool operator< (const iterator &other) const
 Compares locations of iterators in the input.
 
Index operator- (const iterator &other) const
 Subtracts one iterator from another,.
 
Index index () const
 Returns the index into the input stream.
 

Detailed Description

Iterator, refers back into the input stream.

Member Function Documentation

const std::string& pegmatite::Input::iterator::filename ( ) const

Filename given by Input this iterator is derived from.

Typically a real filename, but not guaranteed (e.g., could be "-" when input is derived from stdin).

iterator& pegmatite::Input::iterator::operator++ ( )
inline

Move the iterator on to the next location.

Note that this does not check for validity, so will allow constructing iterators past the end of the permitted. They will fail on dereference (this check is performed in the Input class - iterators perform no validation.

iterator& pegmatite::Input::iterator::operator-- ( )
inline

Move the iterator to the previous location.

Note that this does not check validity.

bool pegmatite::Input::iterator::operator== ( const iterator other) const
inline

Compares iterators for equality.

Iterators are equal if they are the same index in the same buffer.


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