MCPcopy Create free account
hub / github.com/KDE/labplot / main

Function main

src/3rdparty/vector_blf/src/Vector/BLF/docs/examples/Write-Example.cpp:15–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13#include <Vector/BLF.h>
14
15int main(int argc, char * argv[]) {
16 if (argc != 2) {
17 std::cout << "Write-Example <filename.blf>" << std::endl;
18 return -1;
19 }
20
21 /* open file for writing */
22 Vector::BLF::File file;
23 file.open(argv[1], std::ios_base::out);
24 if (!file.is_open()) {
25 std::cout << "Unable to open file" << std::endl;
26 return -1;
27 }
28
29 /* write a CanMessage */
30 auto * canMessage = new Vector::BLF::CanMessage;
31 canMessage->channel = 1;
32 canMessage->flags = 1; // TX
33 canMessage->dlc = 2;
34 canMessage->id = 0x33;
35 canMessage->data[0] = 0x44;
36 canMessage->data[1] = 0x55;
37 file.write(canMessage);
38
39 /* close file */
40 file.close();
41
42 return 0;
43}

Callers

nothing calls this directly

Calls 4

openMethod · 0.45
is_openMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected