MCPcopy Create free account
hub / github.com/davisking/dlib / get_decoded_string2

Function get_decoded_string2

dlib/test/serialize.cpp:527–554  ·  view source on GitHub ↗

This function returns the contents of the file 'stuff.bin' but using the new floating point serialization format.

Source from the content-addressed store, hash-verified

525 // This function returns the contents of the file 'stuff.bin' but using the new
526 // floating point serialization format.
527 const std::string get_decoded_string2()
528 {
529 dlib::base64 base64_coder;
530 dlib::compress_stream::kernel_1ea compressor;
531 std::ostringstream sout;
532 std::istringstream sin;
533
534 // The base64 encoded data from the file 'stuff.bin' we want to decode and return.
535 sout << "AVaifX9zEbXa9aocsrcRuvnNqzZLptZ5mRd46xScCIfX6sq/46hG9JwIInElG50EtJKJY/+jAWit";
536 sout << "TpDBWrxBz124JRLsBz62h0D3Tqgnd8zygRx7t33Ybw40o07MrhzNEHgYavUukaPje5by78JIWHgk";
537 sout << "l7nb/TK+9ndVLrAThJ4v+GiPT3kh9H1tAAAAAQhbLa06pQjhrnjTXcRox1ZBEAV9/q1zAA==";
538
539 // Put the data into the istream sin
540 sin.str(sout.str());
541 sout.str("");
542
543 // Decode the base64 text into its compressed binary form
544 base64_coder.decode(sin,sout);
545 sin.clear();
546 sin.str(sout.str());
547 sout.str("");
548
549 // Decompress the data into its original form
550 compressor.decompress(sin,sout);
551
552 // Return the decoded and decompressed data
553 return sout.str();
554 }
555
556// ----------------------------------------------------------------------------------------
557

Callers 1

serialize_testFunction · 0.85

Calls 3

strMethod · 0.45
decodeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected