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 */
| 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 | //! @} |