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

Function get_decoded_string

dlib/test/serialize.cpp:491–522  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

489 // This function returns the contents of the file 'stuff.bin' but using the old
490 // floating point serialization format.
491 const std::string get_decoded_string()
492 {
493 dlib::base64::kernel_1a base64_coder;
494 dlib::compress_stream::kernel_1ea compressor;
495 std::ostringstream sout;
496 std::istringstream sin;
497
498
499 // The base64 encoded data from the file 'stuff.bin' we want to decode and return.
500 sout << "AVaifX9zEbXa9aocsrcRuvnNrR3WLuuU5eLWiy0UeXmnKXGLKZz8V44gzT4CM6wnCmAHFQug8G3C";
501 sout << "4cuLdNgp2ApkeLcvwFNJRENE0ShrRaxEBFEA8nah7vm8B2VmgImNblCejuP5IcDt60EaCKlqiit8";
502 sout << "+JGrzYxqBm3xFS4P+qlOROdbxc7pXBmUdh0rqNSEvn0FBPdoqY/5SpHgA2yAcH8XFrM1cdu0xS3P";
503 sout << "8PBcmLMJ7bFdzplwhrjuxtm4NfEOi6Rl9sU44AXycYgJd0+uH+dyoI9X3co5b3YWJtjvdVeztNAr";
504 sout << "BfSPfR6oAVNfiMBG7QA=";
505
506
507 // Put the data into the istream sin
508 sin.str(sout.str());
509 sout.str("");
510
511 // Decode the base64 text into its compressed binary form
512 base64_coder.decode(sin,sout);
513 sin.clear();
514 sin.str(sout.str());
515 sout.str("");
516
517 // Decompress the data into its original form
518 compressor.decompress(sin,sout);
519
520 // Return the decoded and decompressed data
521 return sout.str();
522 }
523
524
525 // This function returns the contents of the file 'stuff.bin' but using the new

Callers 1

serialize_testFunction · 0.70

Calls 3

strMethod · 0.45
decodeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected