simlyfy
This commit is contained in:
1 parent
849ce31e2f
commit
a55d1c58ed
272 files changed
+41866
-261
No files matched your search
+11
-7
@@ -7,6 +7,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
/** @brief Warning or fatal parse error. */
|
||||
enum class DbcDiagnosticSeverity {
|
||||
Warning,
|
||||
Error
|
||||
@@ -24,18 +25,21 @@ enum class DbcDiagnosticCode {
|
||||
UnsupportedAttribute
|
||||
};
|
||||
|
||||
/** @brief Diagnostic message and physical source location. */
|
||||
struct DbcDiagnostic {
|
||||
DbcDiagnosticSeverity severity;
|
||||
DbcDiagnosticCode code;
|
||||
std::string filePath;
|
||||
std::size_t lineNumber;// One-based physical line; zero for file-level errors.
|
||||
std::string message;
|
||||
DbcDiagnosticSeverity severity; /**< Message severity. */
|
||||
DbcDiagnosticCode code; /**< Stable diagnostic category. */
|
||||
std::string filePath; /**< Input file path. */
|
||||
std::size_t lineNumber; /**< One-based physical line; zero for file-level errors. */
|
||||
std::string message; /**< Human-readable diagnostic details. */
|
||||
};
|
||||
|
||||
/** @brief Parsed database and diagnostics; the database is empty on error. */
|
||||
struct DbcParseResult {
|
||||
DbcDatabase database;
|
||||
std::vector<DbcDiagnostic> diagnostics;
|
||||
DbcDatabase database; /**< Parsed content, published only on success. */
|
||||
std::vector<DbcDiagnostic> diagnostics; /**< Warnings and the first error, if any. */
|
||||
|
||||
/** @brief Return whether any diagnostic has error severity. */
|
||||
bool HasErrors() const {
|
||||
for (const DbcDiagnostic &diagnostic: diagnostics) {
|
||||
if (diagnostic.severity == DbcDiagnosticSeverity::Error)
|
||||
|
||||
Reference in new issue
Block a user