#pragma once #include #include #include #include #include #include #include namespace ovdl::detail { /// Common interface for Parsers /// /// Derive from to build new Parsers class BasicParser { public: BasicParser(); void set_error_log_to_null(); void set_error_log_to_stderr(); void set_error_log_to_stdout(); void set_error_log_to(std::basic_ostream& stream); bool has_error() const; bool has_fatal_error() const; bool has_warning() const; const std::vector& get_errors() const; const std::vector& get_warnings() const; protected: std::vector _errors; std::vector _warnings; std::reference_wrapper _error_stream; const char* _file_path; bool _has_fatal_error = false; }; }