MCPcopy Create free account
hub / github.com/andreasfertig/programming-with-cpp20 / main

Function main

02.08-parsingDataStream0/main.cpp:50–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50int main()
51{
52 const std::vector<byte> fakeBytes1{byte{0x70},
53 byte{0x24},
54 ESC,
55 SOF,
56 ESC,
57 byte{'H'},
58 byte{'e'},
59 byte{'l'},
60 byte{'l'},
61 byte{'o'},
62 ESC,
63 SOF,
64 byte{0x7},
65 ESC,
66 SOF};
67
68 auto frameCompleteHandler = [](std::string& res) { printf("CCCB: %s\n", res.c_str()); };
69 for(const auto& b : fakeBytes1) { ProcessNextByte(b, frameCompleteHandler); }
70
71 puts("----------");
72
73 const std::vector<byte> fakeBytes2{
74 byte{'W'}, byte{'o'}, byte{'r'}, byte{'l'}, byte{'d'}, ESC, SOF, byte{0x99}};
75
76 for(const auto& b : fakeBytes2) { ProcessNextByte(b, frameCompleteHandler); }
77}

Callers

nothing calls this directly

Calls 1

ProcessNextByteFunction · 0.85

Tested by

no test coverage detected