ErrorStore Class Reference

NEDXML API: ErrorStore Class Reference
NEDXML API
ErrorStore Class Reference

Public Member Functions

 ErrorStore ()
void setPrintToStderr (bool p)
void addError (ASTNode *context, const char *messagefmt,...)
void addError (const char *location, const char *messagefmt,...)
void addWarning (ASTNode *context, const char *messagefmt,...)
void addWarning (const char *location, const char *messagefmt,...)
void add (ASTNode *context, int severity, const char *messagefmt,...)
void add (const char *location, int severity, const char *messagefmt,...)
bool empty () const
int numMessages () const
bool containsError () const
void clear ()

Returns properties of the ith message stored (i=0..numMessages-1)

int findFirstErrorFor (ASTNode *node, int startIndex) const
static const char * severityName (int severity)

Description

Stores error and warning messages

Constructor & Destructor Documentation

◆ ErrorStore()

ErrorStore ( )
inline

Ctor

Member Function Documentation

◆ setPrintToStderr()

void setPrintToStderr ( bool p)
inline

If set, errors get dumped to stderr as well as stored

◆ addError() [1/2]

void addError ( ASTNode * context,
const char * messagefmt,
... )

Add an error message with the severity ERROR.

References addError().

Referenced by addError(), and addError().

◆ addError() [2/2]

void addError ( const char * location,
const char * messagefmt,
... )

Add an error message with the severity ERROR.

References addError().

◆ addWarning() [1/2]

void addWarning ( ASTNode * context,
const char * messagefmt,
... )

Add an error message with the severity WARNING.

References addWarning().

Referenced by addWarning(), and addWarning().

◆ addWarning() [2/2]

void addWarning ( const char * location,
const char * messagefmt,
... )

Add an error message with the severity WARNING.

References addWarning().

◆ add() [1/2]

void add ( ASTNode * context,
int severity,
const char * messagefmt,
... )

Add an error message.

References add().

Referenced by add(), and add().

◆ add() [2/2]

void add ( const char * location,
int severity,
const char * messagefmt,
... )

Add an error message.

References add().

◆ empty()

bool empty ( ) const
inline

Return true if there are no messages stored.

References empty().

Referenced by empty().

◆ numMessages()

int numMessages ( ) const
inline

Total number of error, warning and info messages.

◆ containsError()

bool containsError ( ) const

Returns true if there is an error or fatal error stored.

◆ clear()

void clear ( )
inline

Discard all messages stored.

◆ findFirstErrorFor()

int findFirstErrorFor ( ASTNode * node,
int startIndex ) const

Return the first message with index >= startIndex whose context is the given node. Returns -1 if none found.

◆ severityName()

const char * severityName ( int severity)
static

Convert severities from numeric to textual form.