#include #ifndef PORYGONLANG_DIAGNOSTIC_HPP #define PORYGONLANG_DIAGNOSTIC_HPP #include #include #include "DiagnosticSeverity.hpp" #include "DiagnosticCode.hpp" namespace Porygon::Diagnostics { class Diagnostic { DiagnosticSeverity _severity; DiagnosticCode _code; unsigned int _start; unsigned int _length; std::vector _arguments; std::string* _message; public: Diagnostic(DiagnosticSeverity severity, DiagnosticCode code, unsigned int start, unsigned int length, std::vector arguments) { _severity = severity; _code = code; _start = start; _length = length; _arguments = std::move(arguments); _message = nullptr; } ~Diagnostic(){ delete _message; } DiagnosticSeverity GetSeverity() { return _severity; } DiagnosticCode GetCode() { return _code; } unsigned int GetStartPosition() { return _start; } unsigned int GetLength() { return _length; } std::vector GetArguments(){ return _arguments; } void SetMessage(std::string* s){ this -> _message = s; } std::string* GetMessage(){ return _message; } }; } #endif //PORYGONLANG_DIAGNOSTIC_HPP