-
Notifications
You must be signed in to change notification settings - Fork 0
/
CUUENDEC.H
72 lines (62 loc) · 1.43 KB
/
CUUENDEC.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
File: UUENDEC.H
Description:
UUENCODE/UUDECODE classes.
Copyright 1995, David G. Roberts
*/
#ifndef _UUENDEC_H
#define _UUENDEC_H
#define STAT_END 0x99992222
#define STAT_ERROR 0x99994444
#define STAT_LONG 0x99993333
#include <windows.h>
#include <commdlg.h>
class CUUDEC {
private:
enum STATE { AWAIT_BEGIN, DECODING, AWAIT_END, DONE };
STATE m_state;
HFILE m_hfile;
int m_iMode;
char m_szFullName[MAX_PATH];
char m_szFileName[MAX_PATH];
char m_Filter[100];
char m_Title[100];
unsigned char m_uchDecode[64];
OPENFILENAME m_ofn;
// State functions.
int AwaitBegin(char *);
int Decode(char *);
int AwaitEnd(char *);
public:
CUUDEC(HWND hwnd);
virtual ~CUUDEC();
enum { RESULT_OK, RESULT_ERROR, RESULT_DONE, RESULT_CANCEL };
int DecodeLine(char * pszLine);
void Reset(void);
};
class CUUENC {
private:
enum STATE { BEGIN, ENCODING, END, DONE };
enum { MAXBYTESPERLINE = 45 };
STATE m_state;
HFILE m_hfile;
int m_MaxLines;
char m_szFullName[MAX_PATH];
char m_szFileName[MAX_PATH];
char m_Filter[100];
char m_Title[100];
unsigned char m_uchBuffer[MAXBYTESPERLINE];
OPENFILENAME m_ofn;
// State functions.
int Begin(char *, int);
int Encode(char *, int);
int End(char *, int);
public:
CUUENC(HWND hwnd);
virtual ~CUUENC();
enum { RESULT_OK, RESULT_ERROR, RESULT_DONE, RESULT_CANCEL,
RESULT_SMALLBUFFER };
int EncodeLine(char * pszLine, int nLength);
void Reset(void);
};
#endif