MCPcopy Create free account
hub / github.com/apache/brpc / ReadAMFBool

Function ReadAMFBool

src/brpc/amf.cpp:296–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296bool ReadAMFBool(bool* val, AMFInputStream* stream) {
297 uint8_t marker;
298 if (stream->cut_u8(&marker) != 1u) {
299 LOG(ERROR) << "stream is not long enough";
300 return false;
301 }
302 if ((AMFMarker)marker == AMF_MARKER_BOOLEAN) {
303 uint8_t tmp;
304 if (stream->cut_u8(&tmp) != 1u) {
305 LOG(ERROR) << "stream is not long enough";
306 return false;
307 }
308 *val = tmp;
309 return true;
310 }
311 LOG(ERROR) << "Expected boolean, actually " << marker2str(marker);
312 return false;
313}
314
315bool ReadAMFNumber(double* val, AMFInputStream* stream) {
316 uint8_t marker;

Callers 2

OnPlayMethod · 0.85
OnPauseMethod · 0.85

Calls 2

marker2strFunction · 0.85
cut_u8Method · 0.80

Tested by

no test coverage detected