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
10
enum class
DbcDiagnosticSeverity {
11
Warning,
12
Error
13
};
14
16
enum class
DbcDiagnosticCode {
17
FileOpenError,
18
FileReadError,
19
InvalidStatement,
20
InvalidValueDescription,
21
InvalidMultiplexing,
22
UnsupportedStatement
23
};
24
25
struct
DbcDiagnostic
{
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
33
struct
DbcParseResult
{
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 */
dbc_database.h
Created: 2026-03-13 Author: Deeaitch (Dim. Himro)
DbcDatabase
Parsed DBC content stored in a simple internal form.
Definition
dbc_database.h:22
DbcDiagnostic
Definition
dbc_diagnostic.h:25
DbcParseResult
Definition
dbc_diagnostic.h:33
core
dbc_diagnostic.h
Generated by
1.9.8