Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | List of all members
om::scripting::util::Position Class Reference

A class that represents a character position within a source file. More...

#include <omScriptingPosition.h>

Public Member Functions

 Position ()
 Create a new source position pointing to the first character of the first line in the source code. More...
 
 Position (Index newCodePointIndex, Index newLineNumber, Index newLineCharacterNumber)
 Create a new source position with the specified absolute index, line number, and line character number. More...
 
Index getCodePointIndex () const
 Return the code point index within the original source string of this position. More...
 
Index getLineNumber () const
 Return the line number of this position, where the lines are numbered starting from 1. More...
 
Index getLineCharacterNumber () const
 Return the character number of this position within its line. More...
 
Bool operator< (const Position &other) const
 Return whether or not this position is earlier than another. More...
 
Bool operator<= (const Position &other) const
 Return whether or not this position is earlier or the same as another. More...
 
Bool operator> (const Position &other) const
 Return whether or not this position is later than another. More...
 
Bool operator>= (const Position &other) const
 Return whether or not this position is later or the same as another. More...
 
UTF8String toString () const
 Return a string representation of the token type. More...
 
 operator UTF8String () const
 Convert this token type into a string representation. More...
 

Detailed Description

A class that represents a character position within a source file.

Constructor & Destructor Documentation

om::scripting::util::Position::Position ( )
inline

Create a new source position pointing to the first character of the first line in the source code.

om::scripting::util::Position::Position ( Index  newCodePointIndex,
Index  newLineNumber,
Index  newLineCharacterNumber 
)
inline

Create a new source position with the specified absolute index, line number, and line character number.

Member Function Documentation

Index om::scripting::util::Position::getCodePointIndex ( ) const
inline

Return the code point index within the original source string of this position.

Index om::scripting::util::Position::getLineNumber ( ) const
inline

Return the line number of this position, where the lines are numbered starting from 1.

Index om::scripting::util::Position::getLineCharacterNumber ( ) const
inline

Return the character number of this position within its line.

Characters are numbered starting from 1.

Bool om::scripting::util::Position::operator< ( const Position other) const
inline

Return whether or not this position is earlier than another.

Bool om::scripting::util::Position::operator<= ( const Position other) const
inline

Return whether or not this position is earlier or the same as another.

Bool om::scripting::util::Position::operator> ( const Position other) const
inline

Return whether or not this position is later than another.

Bool om::scripting::util::Position::operator>= ( const Position other) const
inline

Return whether or not this position is later or the same as another.

UTF8String om::scripting::util::Position::toString ( ) const

Return a string representation of the token type.

om::scripting::util::Position::operator UTF8String ( ) const
inline

Convert this token type into a string representation.


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