50 lines
1.0 KiB
C++
50 lines
1.0 KiB
C++
/**
|
|
* @file dbc_parser.h
|
|
* @brief
|
|
*
|
|
* Created: 2026-03-13
|
|
* Author: Deeaitch (Dim. Himro)
|
|
*
|
|
* Licensed under the MIT License.
|
|
* See LICENSE file in the project root for full license text.
|
|
*/
|
|
|
|
#ifndef DBC_PARSER_H
|
|
#define DBC_PARSER_H
|
|
|
|
#include <string>
|
|
|
|
#include "dbc_database.h"
|
|
|
|
/**
|
|
* @brief Minimal DBC parser.
|
|
*
|
|
* Supports:
|
|
* - BO_
|
|
* - SG_
|
|
* - CM_ BO_
|
|
* - CM_ SG_
|
|
* - basic M / mN multiplexing
|
|
* - VAL_ signal value descriptions
|
|
*
|
|
* Ignores:
|
|
* - attributes
|
|
* - named VAL_TABLE_ tables
|
|
*/
|
|
class DbcParser {
|
|
public:
|
|
/**
|
|
* @brief Parse DBC file.
|
|
* @param filePath Path to input file.
|
|
* @return Parsed database.
|
|
* @throws std::runtime_error on file or parse errors.
|
|
* Line parse errors include the file path and one-based line number.
|
|
* Duplicate normalized CAN IDs of the same frame type and duplicate signal
|
|
* names within a frame are rejected at the repeated definition's line.
|
|
*/
|
|
DbcDatabase ParseFile(const std::string &filePath) const;
|
|
|
|
};
|
|
|
|
#endif /* DBC_PARSER_H */
|