Class CDbcSource#
Defined in File dbcparser.h
Nested Relationships#
Nested Types#
Class Documentation#
-
class CDbcSource#
DBC source management class.
Unnamed Group
-
const size_t &Pos() const#
Return the current position.
- Returns:
A reference to the position.
-
size_t &Pos()#
Return the current position.
- Returns:
A reference to the position.
Public Functions
-
CDbcSource() = default#
Default constructor.
-
CDbcSource(const std::filesystem::path &rpathDbcfile)#
Open and read the DBC source file.
- Parameters:
rpathDbcfile – [in] Reference to the DBC file path.
-
CDbcSource(const std::string &rssContent)#
Set DBC content.
- Parameters:
rssContent – [in] Reference to the DBC content.
-
bool IsValid() const#
Is a valid source?
- Returns:
Returns whether the source is valid (has content).
-
const std::filesystem::path &Path() const#
Get the currently assigned path.
- Returns:
The path to the source or an empty path when no path was assigned.
-
const std::string &Content() const#
Return a reference to the complete content.
- Returns:
Reference to the content string.
-
const char *ContentPtr() const#
Return a pointer to the content at the current location.
- Returns:
Pointer to a character string starting at the current location.
-
char CurrentChar() const#
Return the character at the current location.
- Returns:
Character or ‘\0’ when there is no character at the current location.
-
void ResetPos()#
Reset the position to the beginning of the content.
-
bool IsEOF() const#
Does the current position point to the end of the content?
- Returns:
Returns whether the end of the content has been reached.
-
SPosLock CreatePosLock()#
Create a position lock structure.
- Returns:
The position lock structure that allows a rollback.
-
size_t CalcLine() const#
Calculate the line the current position is on.
- Returns:
The line number starting with 1 for the first line.
-
size_t CalcColumn() const#
Calculate the column the current position is on.
- Returns:
The column number starting with 1 for the first column.
-
struct SPosLock#
A position lock structure, allowing to rollback to a specific position.
Public Functions
-
SPosLock() = default#
Default constructor.
-
SPosLock(CDbcSource &rThis)#
Constructor.
- Parameters:
rThis – [in] Reference to the source class.
-
SPosLock(SPosLock &&rsPosLock) noexcept#
Move constructor.
- Parameters:
rsPosLock – [in] Reference to the SPosLock structure to move from.
-
~SPosLock()#
Destructor.
-
SPosLock &operator=(const SPosLock&) = delete#
Deleted assignment operator.
- Returns:
Reference to this SPosLock structure.
-
void Promote()#
Accespt the current position; releases the lock.
-
void Rollback()#
Rollback to the stored position and releases the lock.
-
SPosLock() = default#
-
const size_t &Pos() const#