DBC Framework
DBC parsing and CAN signal decoding framework
Loading...
Searching...
No Matches
dbc_diagnostic.h
1// SPDX-License-Identifier: MIT
2#ifndef DBC_DIAGNOSTIC_H
3#define DBC_DIAGNOSTIC_H
4
5#include "dbc_database.h"
6#include <cstddef>
7#include <string>
8#include <vector>
9
10enum class DbcDiagnosticSeverity {
11 Warning,
12 Error
13};
14
16enum class DbcDiagnosticCode {
17 FileOpenError,
18 FileReadError,
19 InvalidStatement,
20 InvalidValueDescription,
21 InvalidMultiplexing,
22 UnsupportedStatement
23};
24
26 DbcDiagnosticSeverity severity;
27 DbcDiagnosticCode code;
28 std::string filePath;
29 std::size_t lineNumber; // One-based physical line; zero for file-level errors.
30 std::string message;
31};
32
34 DbcDatabase database;
35 std::vector<DbcDiagnostic> diagnostics;
36
37 bool HasErrors() const {
38 for (const DbcDiagnostic &diagnostic : diagnostics) {
39 if (diagnostic.severity == DbcDiagnosticSeverity::Error)
40 return true;
41 }
42 return false;
43 }
44};
45
46#endif /* DBC_DIAGNOSTIC_H */
Created: 2026-03-13 Author: Deeaitch (Dim. Himro)
Parsed DBC content stored in a simple internal form.