Support Forum       G3D Web Page     
Public Types | Public Member Functions | Public Attributes | List of all members
G3D::ParseError Class Reference

Thrown by TextInput, Any, and other parsers on unexpected input. More...

Inherited by G3D::Any::IndexOutOfBounds, G3D::Any::KeyNotFound, and G3D::TextInput::TokenException.

Public Types

enum  { UNKNOWN = -1 }
 

Public Member Functions

 ParseError ()
 
 ParseError (const String &f, int l, int c, const String &m)
 
 ParseError (const String &f, int64 b, const String &m)
 
virtual ~ParseError ()
 
String formatFileInfo () const
 If information is known, ends in ": ", otherwise empty. More...
 

Public Attributes

int64 byte
 For a binary file, the location of the parse error. More...
 
int character
 Character number (in the line) of the start of the token which caused the exception. More...
 
String filename
 Empty means unknown. More...
 
int line
 For a text file, the line number is the line number of start of token which caused the exception. More...
 
String message
 

Detailed Description

Thrown by TextInput, Any, and other parsers on unexpected input.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
UNKNOWN 

Constructor & Destructor Documentation

◆ ParseError() [1/3]

G3D::ParseError::ParseError ( )
inline

◆ ~ParseError()

virtual G3D::ParseError::~ParseError ( )
inlinevirtual

◆ ParseError() [2/3]

G3D::ParseError::ParseError ( const String f,
int  l,
int  c,
const String m 
)
inline

◆ ParseError() [3/3]

G3D::ParseError::ParseError ( const String f,
int64  b,
const String m 
)
inline

Member Function Documentation

◆ formatFileInfo()

String G3D::ParseError::formatFileInfo ( ) const

If information is known, ends in ": ", otherwise empty.

Referenced by G3D::AnyTableReader::get().

Member Data Documentation

◆ byte

int64 G3D::ParseError::byte

For a binary file, the location of the parse error.

ParseError::UNKNOWN if unknown.

◆ character

int G3D::ParseError::character

Character number (in the line) of the start of the token which caused the exception.

1 is the character in the line. ParseError::UNKNOWN if unknown.

Referenced by G3D::Any::IndexOutOfBounds::IndexOutOfBounds(), and G3D::Any::KeyNotFound::KeyNotFound().

◆ filename

String G3D::ParseError::filename

◆ line

int G3D::ParseError::line

For a text file, the line number is the line number of start of token which caused the exception.

1 is the first line of the file. ParseError::UNKNOWN if unknown. Note that you can use TextInput::Settings::startingLineNumberOffset to shift the effective line number that is reported by that class.

Referenced by G3D::Any::IndexOutOfBounds::IndexOutOfBounds(), and G3D::Any::KeyNotFound::KeyNotFound().

◆ message

String G3D::ParseError::message

documentation generated on Wed Nov 24 2021 08:01:58 using doxygen 1.8.15