![]() |
Home | Libraries | People | FAQ | More |
boost::parser::callback_error_handler
// In header: <boost/parser/error_handling.hpp> struct callback_error_handler { // types typedef std::function< void(std::string const &)> callback_type; // public member functions callback_error_handler(); callback_error_handler(callback_type, callback_type = callback_type()); callback_error_handler(std::string_view, callback_type, callback_type = callback_type()); callback_error_handler(std::wstring_view, callback_type, callback_type = callback_type()); template<typename Iter, typename Sentinel> error_handler_result operator()(Iter, Sentinel, parse_error< Iter > const &) const; template<typename Context, typename Iter> void diagnose(diagnostic_kind, std::string_view, Context const &, Iter) const; template<typename Context> void diagnose(diagnostic_kind, std::string_view, Context const &) const; // public data members callback_type error_; callback_type warning_; std::string filename_; };
An error handler that allows users to supply callbacks to handle the reporting of warnings and errors. The reporting of errors and/or warnings can be suppressed by supplying one or both default-constructed callbacks.
callback_error_handler
public member functionscallback_error_handler();
callback_error_handler(callback_type error, callback_type warning = callback_type());
callback_error_handler(std::string_view filename, callback_type error, callback_type warning = callback_type());
callback_error_handler(std::wstring_view filename, callback_type error, callback_type warning = callback_type());
This overload is Windows-only.
template<typename Iter, typename Sentinel> error_handler_result operator()(Iter first, Sentinel last, parse_error< Iter > const & e) const;
template<typename Context, typename Iter> void diagnose(diagnostic_kind kind, std::string_view message, Context const & context, Iter it) const;
template<typename Context> void diagnose(diagnostic_kind kind, std::string_view message, Context const & context) const;