52 lines
1.1 KiB
C++
52 lines
1.1 KiB
C++
#ifndef _UUDECODE_DECODE_HPP_
|
|
#define _UUDECODE_DECODE_HPP_
|
|
#ifndef _COMMON_WINDOWS_HPP_
|
|
#include <common/windows.hpp>
|
|
#endif
|
|
|
|
extern "C"
|
|
{
|
|
WORD _cdecl uudecode(const char *szPathFileName,char *szPathOutputFileName);
|
|
WORD _cdecl decodeBase64(const char *szPathFileName,char *szPathOutputFileName);
|
|
}
|
|
|
|
class GenDecode
|
|
{
|
|
public:
|
|
static bool decode(const String &pathFileName,String &pathOutputFileName);
|
|
static bool decode(const String &pathFileName);
|
|
private:
|
|
GenDecode(void);
|
|
virtual ~GenDecode();
|
|
};
|
|
|
|
inline
|
|
GenDecode::GenDecode(void)
|
|
{
|
|
}
|
|
|
|
inline
|
|
GenDecode::~GenDecode()
|
|
{
|
|
}
|
|
|
|
inline
|
|
bool GenDecode::decode(const String &pathFileName)
|
|
{
|
|
String strPathOutputFileName;
|
|
strPathOutputFileName.reserve(256);
|
|
return decode(pathFileName,strPathOutputFileName);
|
|
}
|
|
|
|
inline
|
|
bool GenDecode::decode(const String &pathFileName,String &pathOutputFileName)
|
|
{
|
|
String strPathOutputFileName;
|
|
|
|
strPathOutputFileName.reserve(256);
|
|
if(!uudecode((LPSTR)pathFileName,(LPSTR)strPathOutputFileName))
|
|
if(!decodeBase64((LPSTR)pathFileName,strPathOutputFileName))return false;
|
|
pathOutputFileName=strPathOutputFileName;
|
|
return true;
|
|
}
|
|
#endif |