Support Forum       Library Source       SourceForge Page       G3D Web Page     
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 std::string &f, int l, int c, const std::string &m)
 
 ParseError (const std::string &f, int64 b, const std::string &m)
 
virtual ~ParseError ()
 
std::string formatFileInfo () const
 If information is known, ends in ": ", otherwise empty.
 

Public Attributes

int64 byte
 For a binary file, the location of the parse error.
 
int character
 
Character number (in the line) of the start of the token which caused the

exception.

 
std::string filename
 Empty means unknown.
 
int line
 For a text file, the line number is the line number of start of token which caused the exception.
 
std::string message
 

Detailed Description

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

Member Enumeration Documentation

anonymous enum
Enumerator:
UNKNOWN 

Constructor & Destructor Documentation

G3D::ParseError::ParseError ( )
inline
virtual G3D::ParseError::~ParseError ( )
inlinevirtual
G3D::ParseError::ParseError ( const std::string f,
int  l,
int  c,
const std::string m 
)
inline
G3D::ParseError::ParseError ( const std::string f,
int64  b,
const std::string m 
)
inline

Member Function Documentation

std::string G3D::ParseError::formatFileInfo ( ) const

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

Member Data Documentation

int64 G3D::ParseError::byte

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

-1 if unknown.

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. May be -1 if unknown.

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

std::string G3D::ParseError::filename
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. -1 means 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().

std::string G3D::ParseError::message

documentation generated on Sat Jan 12 2013 22:49:56 using doxygen 1.8.2