Skip to content

Commit afcbc40

Browse files
committed
[C++]: move print of JSON to after decode and check and reset decoder before printing.
1 parent 8b6b0fb commit afcbc40

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sbe-samples/src/main/cpp/GeneratedStubExample.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@ int main(int argc, const char* argv[])
312312

313313
std::size_t decodeHdrLength = decodeHdr(hdr, buffer, 0, sizeof(buffer));
314314
std::size_t decodeMsgLength = decodeCar(car, buffer, hdr.encodedLength(), hdr.blockLength(), hdr.version(), sizeof(buffer));
315-
cout << "Encoded json: '" << car << "'" << endl;
316315

317316
cout << "Decoded Lengths are " << decodeHdrLength << " + " << decodeMsgLength << endl;
318317

@@ -328,5 +327,8 @@ int main(int argc, const char* argv[])
328327
return EXIT_FAILURE;
329328
}
330329

330+
car.wrapForDecode(buffer, hdr.encodedLength(), hdr.blockLength(), hdr.version(), sizeof(buffer));
331+
cout << "Encoded json: '" << car << "'" << endl;
332+
331333
return EXIT_SUCCESS;
332334
}

0 commit comments

Comments
 (0)