MCPcopy Create free account
hub / github.com/USCiLab/cereal / loadBinaryValue

Method loadBinaryValue

include/cereal/archives/json.hpp:455–468  ·  view source on GitHub ↗

Loads some binary data, encoded as a base64 string ! This will automatically start and finish a node to load the data, and can be called directly by users. Note that this follows the same ordering rules specified in the class description in regards to loading in/out of order */

Source from the content-addressed store, hash-verified

453 Note that this follows the same ordering rules specified in the class description in regards
454 to loading in/out of order */
455 void loadBinaryValue( void * data, size_t size, const char * name = nullptr )
456 {
457 itsNextName = name;
458
459 std::string encoded;
460 loadValue( encoded );
461 auto decoded = base64::decode( encoded );
462
463 if( size != decoded.size() )
464 throw Exception("Decoded binary data size does not match specified size");
465
466 std::memcpy( data, decoded.data(), decoded.size() );
467 itsNextName = nullptr;
468 };
469
470 private:
471 //! @}

Callers

nothing calls this directly

Calls 4

decodeFunction · 0.85
ExceptionClass · 0.85
dataMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected