/*
 * encode the 'source' character array and write the result to 'dest'.
 *
 * the codec chain converts in the input to upper case, then the result to
 * Base64 and then insert a newline every 40 chars
 */

#include <iostream>
#include <stdio.h>
#include <mimetic/mimetic.h>

using namespace std;
using namespace mimetic;

int main()
{
	Base64::Encoder b64(0);                  // encodes in Base64
	MaxLineLen mll(40);                      // inserts a newline every 40 chars
	ToUpperCase tup;                         // convert text to upper case
	enum { sz = 2048 };
	char source[sz], dest[2*sz];
	// fill 'source' here 
	encode(source, source + sz, tup | b64 | mll, dest);  // encode
	return 0;
}
