// This file is part of VSTGUI. It is subject to the license terms // in the LICENSE file found in the top-level directory of this // distribution and at http://github.com/steinbergmedia/vstgui/LICENSE #include "vstgui/uidescription/base64codec.h" #include "vstgui/lib/malloc.h" #include #include using namespace VSTGUI; int main () { Buffer origData; origData.allocate (1024*1024*500); std::independent_bits_engine rbe; std::generate (origData.get (), origData.get () + origData.size (), std::ref (rbe)); auto encoderResult = Base64Codec::encode (origData.get (), origData.size ()); auto decoderResult = Base64Codec::decode (encoderResult.data.get (), encoderResult.dataSize); if (origData.size () != decoderResult.dataSize) return -1; if (memcmp (origData.get (), decoderResult.data.get (), origData.size ()) != 0) return -1; return 0; }