aGrUM  0.16.0
gum::ParseError Class Reference

This class is used to represent parsing errors for the different parser implemented in aGrUM. More...

#include <agrum/core/errorsContainer.h>

+ Collaboration diagram for gum::ParseError:

Public Member Functions

Class constructors and destructors
 ParseError (bool is_error, const std::string &msg, Idx line)
 Class constructor. More...
 
 ParseError (bool is_error, const std::string &msg, const std::string &filename, Idx line, Idx col=0)
 Class constructor. More...
 
 ParseError (bool is_error, const std::string &msg, const std::string &filename, const std::string &code, Idx line, Idx col=0)
 Class constructor. More...
 
 ParseError (const ParseError &cont)
 Copy constructor. More...
 

Class operator

bool is_error
 If false, this gum::ParseError is a warning. More...
 
Idx line
 The line of this gum::ParseError. More...
 
Idx column
 The column of this gum::ParseError, default is 0. More...
 
std::string msg
 The gum::ParseError message. More...
 
std::string filename
 The file of this gum::ParseError, default is "". More...
 
std::string code
 The code of this gum::ParseError, default is "". More...
 
ParseError operator= (const ParseError &cont)
 Copy operator. More...
 
std::string toString () const
 Return a std::string representation of this gum::ParseError. More...
 
std::string toElegantString () const
 Return an elegant std::string representation of this gum::ParseError. More...
 

Detailed Description

This class is used to represent parsing errors for the different parser implemented in aGrUM.

Definition at line 50 of file errorsContainer.h.

Constructor & Destructor Documentation

◆ ParseError() [1/4]

gum::ParseError::ParseError ( bool  is_error,
const std::string &  msg,
Idx  line 
)

Class constructor.

Parameters
is_errorTrue if this is an error.
msgThe parsing error message.
lineThe line where the parsing error occured.

◆ ParseError() [2/4]

gum::ParseError::ParseError ( bool  is_error,
const std::string &  msg,
const std::string &  filename,
Idx  line,
Idx  col = 0 
)

Class constructor.

Parameters
is_errorIf false, then this ParseError is a warning.
msgThe parsing error message.
filenameThe file where the parsing error occured.
lineThe line where the parsing error occured.
colThe column where the parsing error occured.

◆ ParseError() [3/4]

gum::ParseError::ParseError ( bool  is_error,
const std::string &  msg,
const std::string &  filename,
const std::string &  code,
Idx  line,
Idx  col = 0 
)

Class constructor.

Parameters
is_errorIf false, then this ParseError is a warning.
msgThe parsing error message.
filenameThe file where the parsing error occured.
codeThe code of the parsing error.
lineThe line where the parsing error occured.
colThe column where the parsing error occured.

◆ ParseError() [4/4]

gum::ParseError::ParseError ( const ParseError cont)

Copy constructor.

Parameters
contThe gum::ParseError to copy.

Member Function Documentation

◆ operator=()

ParseError gum::ParseError::operator= ( const ParseError cont)

Copy operator.

Parameters
contThe gum::ParseError to copy.
Returns
Returns this gum::ParseError.

◆ toElegantString()

std::string gum::ParseError::toElegantString ( ) const

Return an elegant std::string representation of this gum::ParseError.

Returns
Return an elegant std::string representation of this gum::ParseError.

◆ toString()

std::string gum::ParseError::toString ( ) const

Return a std::string representation of this gum::ParseError.

Returns
Return a std::string representation of this gum::ParseError.

Referenced by gum::prm::o3prmr::O3prmrInterpreter::addError(), and gum::prm::o3prmr::O3prmrInterpreter::addWarning().

+ Here is the caller graph for this function:

Member Data Documentation

◆ code

std::string gum::ParseError::code
mutable

The code of this gum::ParseError, default is "".

Definition at line 136 of file errorsContainer.h.

◆ column

Idx gum::ParseError::column

The column of this gum::ParseError, default is 0.

Definition at line 127 of file errorsContainer.h.

Referenced by gum::prm::o3prm::O3prmReader< double >::__print(), and gum::O3prmBNReader< GUM_SCALAR >::errCol().

◆ filename

std::string gum::ParseError::filename

The file of this gum::ParseError, default is "".

Definition at line 133 of file errorsContainer.h.

Referenced by gum::prm::o3prm::O3prmReader< double >::__print().

◆ is_error

bool gum::ParseError::is_error

If false, this gum::ParseError is a warning.

Definition at line 121 of file errorsContainer.h.

Referenced by gum::ErrorsContainer::add(), and gum::O3prmBNReader< GUM_SCALAR >::errIsError().

◆ line

Idx gum::ParseError::line

◆ msg

std::string gum::ParseError::msg

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