PCL
|
Base class for exceptions thrown by source code interpreters. More...
#include <Exception.h>
Public Member Functions | |
SourceCodeError ()=default | |
SourceCodeError (const SourceCodeError &)=default | |
template<typename T1 > | |
SourceCodeError (const String &message, T1 line=-1, T1 column=-1) | |
template<typename T1 > | |
void | AddToPosition (T1 lines, T1 columns=0) |
int | ColumnNumber () const |
int | LineNumber () const |
String | Message () const override |
template<typename T1 > | |
void | SetPosition (T1 line, T1 column=-1) |
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 () |
A SourceCodeError represents a syntax error thrown by a source code parser or interpreter, such as a scripting engine or an XML decoder.
SourceCodeError provides an error message string associated to a line number and a column number that locate the error in the source code text being processed.
Definition at line 455 of file Exception.h.
|
default |
Constructs an empty SourceCodeError object: no error message and no source code location information.
|
default |
Copy constructor.
|
inline |
Constructs a SourceCodeError object.
message | The 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 in exception messages. |
line | The line number (starting from 1) corresponding to the position of this error in the source code text, or <= 0 if no specific source code line can be associated with this error. The default value is -1, meaning that no line number is specified by default. |
column | The column number (starting from 1) corresponding to the position of this error in the source code text, or <= 0 if no specific source code column can be associated with this error. The default value is -1, meaning that no column number is specified by default. |
Definition at line 493 of file Exception.h.
|
inline |
Adds the specified lines and columns (optional) increments to the source code coordinates for this exception.
Valid (meaningful) source code coordinates must be >= 1. When a value <= 0 results from a call to this function, the corresponding coordinate is interpreted to be unavailable for the current exception.
This member function is useful when nested sections of a source code block are being processed recursively; for example in XML decoders.
Definition at line 564 of file Exception.h.
|
inline |
Returns the column number in the source code text being processed, corresponding to this exception.
If a valid source code column can be associated with this exception, the returned value should be >= 1. Otherwise, if no text column can be determined for this exception, -1 is returned.
Definition at line 525 of file Exception.h.
|
inline |
Returns the line number in the source code text being processed, corresponding to this exception.
If a valid source code line can be associated with this exception, the returned value should be >= 1. Otherwise, if no text line can be determined for this exception, -1 is returned.
Definition at line 510 of file Exception.h.
|
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.
|
inline |
Sets the source code line number and column (optional) for this exception.
Valid (meaningful) source code coordinates must be >= 1. When a value < 0 is specified, the corresponding coordinate is interpreted to be unavailable for the current exception.
This member function is useful when nested sections of a source code block are being processed recursively; for example in XML decoders.
Definition at line 544 of file Exception.h.
References pcl::Range().
|
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.
Reimplemented from pcl::Exception.