// Base64.h: interface for the WMBase64 class.
//
//////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000 Robert Cunnings. All rights reserved.
//
// You may copy, modify, distribute or publish this code free of charge.
//
// NO WARRANTY: This software is provided AS IS, without warranty of any kind.
//
//////////////////////////////////////////////////////////////////////
//
// Class used to base64 encode and decode binary data.
// 
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_BASE64_H__1D1DE6A0_8891_11D2_841C_0000B43304F1__INCLUDED_)
#define AFX_BASE64_H__1D1DE6A0_8891_11D2_841C_0000B43304F1__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#include <string>

using namespace std;

class WMBase64  
{
public:
	WMBase64();
	virtual ~WMBase64();

	bool Encode(const unsigned char *pszUnencoded, int nLength, string& strEncoded);
	bool Decode(const string& strEncoded, unsigned char *pszDecoded, int& nOutLength);

protected:
	unsigned char EncodeArray[64];
	unsigned char DecodeArray[256];
};

#define PADDING 64

#endif // !defined(AFX_BASE64_H__1D1DE6A0_8891_11D2_841C_0000B43304F1__INCLUDED_)
