Class CAscWriter#

Class Documentation#

class CAscWriter#

This class allows writing the Vector ASC file format.

Attention

This class assumes no concurrency between writing the file and adding samples. No thread synchronization is implemented.

Public Functions

CAscWriter()#

Constructor.

void StartTimer()#

Start the timer for automatic timestamp creation.

Remark

Resets the start time only if there are no samples are available.

void AddSample(const SCanMessage &rsSample)#

Add a sample.

Attention

The sample will not be added if the timestamp is smaller than the last sample.

Parameters:

rsSample[in] Reference to the CAN sample structure. If the timestamp is empty, the timestamp is created automatically using the integrated timer.

bool HasSamples() const#

Returns whether at least one sample is stored.

Returns:

Returns ‘true’ when samples are available; ‘false’ when not.

void Clear()#

Clear the content.

bool Write(const std::filesystem::path &rpathFile)#

Write to a file (the file gets overwritten if existing).

Parameters:

rpathFile[in] Reference to the file path.

Returns:

Returns ‘true’ on success or ‘false’ when not.