PCL
pcl::ParseError Class Reference

Base class for exceptions thrown by parsing routines. More...

#include <Exception.h>

+ Inheritance diagram for pcl::ParseError:

Public Member Functions

 ParseError ()=default
 
 ParseError (const ParseError &)=default
 
 ParseError (const String &message, const String &beingParsed=String(), int errorPosition=-1)
 
String Message () const override
 
void Show () const override
 
- Public Member Functions inherited from pcl::Error
 Error ()=default
 
 Error (const Error &)=default
 
 Error (const String &message)
 
String Caption () const override
 
- Public Member Functions inherited from pcl::Exception
 Exception ()=default
 
 Exception (const pcl::Exception &)=default
 
virtual ~Exception ()
 
virtual String ExceptionClass () const
 
virtual String FormatInfo () const
 
PCL_FORCE_INLINE void ShowOnConsole () const
 

Additional Inherited Members

- Static Public Member Functions inherited from pcl::Exception
static void DisableConsoleOutput (bool disable=true)
 
static void DisableGUIOutput (bool disable=true)
 
static void EnableConsoleOutput (bool=true)
 
static void EnableGUIOutput (bool=true)
 
static bool IsConsoleOutputEnabled ()
 
static bool IsGUIOutputEnabled ()
 

Detailed Description

A ParseError indicates an syntactic or semantic error found while interpreting some code or trying to translate some text into an object.

For example, String and IsoString throw ParseError exceptions to indicate syntax errors while converting strings to numbers.

Definition at line 387 of file Exception.h.

Constructor & Destructor Documentation

◆ ParseError() [1/3]

pcl::ParseError::ParseError ( )
default

Constructs an empty ParseError object: no error message and no position information.

◆ ParseError() [2/3]

pcl::ParseError::ParseError ( const ParseError )
default

Copy constructor.

◆ ParseError() [3/3]

pcl::ParseError::ParseError ( const String message,
const String beingParsed = String(),
int  errorPosition = -1 
)
inline

Constructs a ParseError object.

Parameters
messageThe error message. HTML entities are not interpreted as ISO 8859-1 characters, and console tags are ignored, even if the exception is to be represented on a PixInsight console. HTML entities and console tags are always written literally. This limitation is necessary to ensure representativeness of source code fragments shown in exception messages.
beingParsedThe string being parsed, or an empty string if the error is not associated to a particular source code string.
errorPositionThe position >= 0 of the first offending character in the string beingParsed, or < 0 if no specific position can be associated with the error.

Definition at line 419 of file Exception.h.

Member Function Documentation

◆ Message()

String pcl::ParseError::Message ( ) const
overridevirtual

Returns descriptive information for this Error object. The default implementation returns the message specified upon construction. A derived class can reimplement this function to provide additional information items such as file names, object identifiers, source code positions, date and time representations, etc.

Reimplemented from pcl::Error.

◆ Show()

void pcl::ParseError::Show ( ) const
overridevirtual

Shows a representation of the information transported by this exception.

Exception information can be shown as text on the platform console or using graphical interfaces, depending on a global setting controlled with the EnableConsoleOutput() and EnableGUIOutput() static member functions.

See also
IsConsoleOutputEnabled(), IsGUIOutputEnabled()

Reimplemented from pcl::Exception.


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