48#ifndef GUM_ERRORS_CONTAINERS_H
49#define GUM_ERRORS_CONTAINERS_H
57#include <agrum/base/core/cocoR/common.h>
93 const std::string&
msg,
108 const std::string&
msg,
110 const std::string&
code,
182 mutable std::vector< ParseError >
errors;
241 void addError(
const std::string& msg,
const std::string& filename,
Idx line,
Idx col);
250 void addWarning(
const std::string& msg,
const std::string& filename,
Idx line,
Idx col);
257 void addException(
const std::string& msg,
const std::string& filename);
308 void Error(
const std::wstring& filename,
Idx line,
Idx col,
const wchar_t* msg);
317 void Warning(
const std::wstring& filename,
Idx line,
Idx col,
const wchar_t* msg);
324 void Exception(
const std::wstring& filename,
const wchar_t* msg);
ParseError last() const
Returns the last added error.
Size count() const
Returns the number of errors and warnings.
ParseError error(Idx i) const
Returns the i-th error.
void addException(const std::string &msg, const std::string &filename)
Add an exception.
ErrorsContainer(const ErrorsContainer &cont)
Copy constructor.
ErrorsContainer()
Class Constructor.
ErrorsContainer operator+=(const ErrorsContainer &cont)
Add the content of a gum::ErrorsContainer to this gum::ErrorsContainer.
ErrorsContainer operator+(const ErrorsContainer &cont) const
Return the sum of two gum::ErrorsContainer.
void add(ParseError error)
Add an error object to the container.
void Error(const std::wstring &filename, Idx line, Idx col, const wchar_t *msg)
For adding errors.
Size error_count
Number of errors detected.
void addWarning(const std::string &msg, const std::string &filename, Idx line, Idx col)
Adds a warning.
void simpleErrorsAndWarnings(std::ostream &o) const
Print errors on output stream.
void Warning(const std::wstring &filename, Idx line, Idx col, const wchar_t *msg)
For adding warnings.
void Exception(const std::wstring &filename, const wchar_t *msg)
For adding exceptions.
void simpleErrors(std::ostream &o) const
Print errors on output stream.
void elegantErrorsAndWarnings(std::ostream &o) const
Print errors on output stream.
void addError(const std::string &msg, const std::string &filename, Idx line, Idx col)
Adds an error.
void syntheticResults(std::ostream &o) const
Print errors on output stream.
void elegantErrors(std::ostream &o) const
Print errors on output stream.
ErrorsContainer operator=(const ErrorsContainer &cont)
Copy Operator.
std::vector< ParseError > errors
The list of gum::ParseError contained in this gum::ErrorsContainer.
This class is used to represent parsing errors for the different parser implemented in aGrUM.
ParseError(bool is_error, const std::string &msg, Idx line)
Class constructor.
std::string filename
The file of this gum::ParseError, default is "".
Idx column
The column of this gum::ParseError, default is 0.
std::string msg
The gum::ParseError message.
Idx line
The line of this gum::ParseError.
bool is_error
If false, this gum::ParseError is a warning.
std::string code
The code of this gum::ParseError, default is "".
ParseError operator=(const ParseError &cont)
Copy operator.
std::string toString() const
Return a std::string representation of this gum::ParseError.
ParseError(const ParseError &cont)
Copy constructor.
ParseError(bool is_error, const std::string &msg, const std::string &filename, Idx line, Idx col=0)
Class constructor.
ParseError(bool is_error, const std::string &msg, const std::string &filename, const std::string &code, Idx line, Idx col=0)
Class constructor.
std::string toElegantString() const
Return an elegant std::string representation of this gum::ParseError.
Inlined implementation of the basic methods of ErrorsContainer.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size Idx
Type for indexes.
gum is the global namespace for all aGrUM entities