28 #ifndef GUM_ERRORS_CONTAINERS_H 29 #define GUM_ERRORS_CONTAINERS_H 35 #include <agrum/agrum.h> 37 #include <agrum/tools/core/cocoR/common.h> 62 ParseError(
bool is_error,
const std::string& msg, Idx line);
72 ParseError(
bool is_error,
73 const std::string& msg,
74 const std::string& filename,
87 ParseError(
bool is_error,
88 const std::string& msg,
89 const std::string& filename,
90 const std::string& code,
98 ParseError(
const ParseError& cont);
111 ParseError operator=(
const ParseError& cont);
132 std::string filename;
135 mutable std::string code;
141 std::string toString()
const;
149 std::string toElegantString()
const;
160 class ErrorsContainer {
162 mutable std::vector< ParseError > errors;
185 ErrorsContainer(
const ErrorsContainer& cont);
197 void add(ParseError error);
205 ParseError error(Idx i)
const;
212 ParseError last()
const;
221 void addError(
const std::string& msg,
const std::string& filename, Idx line, Idx col);
230 void addWarning(
const std::string& msg,
const std::string& filename, Idx line, Idx col);
237 void addException(
const std::string& msg,
const std::string& filename);
249 void syntheticResults(std::ostream& o)
const;
255 void simpleErrors(std::ostream& o)
const;
261 void simpleErrorsAndWarnings(std::ostream& o)
const;
267 void elegantErrors(std::ostream& o)
const;
273 void elegantErrorsAndWarnings(std::ostream& o)
const;
288 void Error(
const std::wstring& filename, Idx line, Idx col,
const wchar_t* msg);
297 void Warning(
const std::wstring& filename, Idx line, Idx col,
const wchar_t* msg);
304 void Exception(
const std::wstring& filename,
const wchar_t* msg);
317 ErrorsContainer operator+(
const ErrorsContainer& cont)
const;
324 ErrorsContainer operator=(
const ErrorsContainer& cont);
332 ErrorsContainer operator+=(
const ErrorsContainer& cont);
341 #ifndef GUM_NO_INLINE 342 # include <agrum/tools/core/errorsContainer_inl.h>