Files
Work/uuencode/uuencode.hpp
2024-08-07 09:16:27 -04:00

42 lines
746 B
C++

#ifndef _UUENCODE_UUENCODE_HPP_
#define _UUENCODE_UUENCODE_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#endif
#ifndef _COMMON_BLOCK_HPP_
#include <common/block.hpp>
#endif
template <class T>
class Array;
class String;
class UUEncode
{
public:
UUEncode(void);
virtual ~UUEncode();
static bool encode(Array<BYTE> &bytes,const String &strName,Block<String> &encodedLines);
static String encode(Array<BYTE> &bytes,const String &strName);
private:
static DWORD read(Array<BYTE> &bytes,int &byteIndex,char *readBuff,int sizeBuff);
static BYTE chEncode(int ch);
};
inline
UUEncode::UUEncode(void)
{
}
inline
UUEncode::~UUEncode()
{
}
inline
BYTE UUEncode::chEncode(int ch)
{
return (ch?(ch&0x3F)+' ':'`');
}
#endif