This commit is contained in:
deeaitch committed 2026-10-11 06:19:42 -04:00
1 parent bce707daf6
commit 51fcdb88ac
174 files changed
+5220 -2213

No files matched your search

+46
View File
@@ -0,0 +1,46 @@
// SPDX-License-Identifier: MIT
#ifndef DBC_DIAGNOSTIC_H
#define DBC_DIAGNOSTIC_H
#include "dbc_database.h"
#include <cstddef>
#include <string>
#include <vector>
enum class DbcDiagnosticSeverity {
Warning,
Error
};
/** Stable categories; messages provide the details. */
enum class DbcDiagnosticCode {
FileOpenError,
FileReadError,
InvalidStatement,
InvalidValueDescription,
InvalidMultiplexing,
UnsupportedStatement
};
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;
};
struct DbcParseResult {
DbcDatabase database;
std::vector<DbcDiagnostic> diagnostics;
bool HasErrors() const {
for (const DbcDiagnostic &diagnostic : diagnostics) {
if (diagnostic.severity == DbcDiagnosticSeverity::Error)
return true;
}
return false;
}
};
#endif /* DBC_DIAGNOSTIC_H */