VAPoR  0.1
Base64.h
Go to the documentation of this file.
1 
2 #ifndef _Base64_h_
3 #define _Base64_h_
4 #include <vapor/MyBase.h>
5 
6 namespace VetsUtil {
7 
8 class COMMON_API Base64 : public MyBase {
9 
10 public:
11 
12 
13  Base64();
14  ~Base64();
15  void Encode(const unsigned char *input, size_t n, string &output);
16  void EncodeStreamBegin(string &output);
17  void EncodeStreamNext(const unsigned char *input, size_t n, string &output);
18  void EncodeStreamEnd(string &output);
19 
22  size_t GetEncodeSize(size_t n);
23  int Decode(const string &input, unsigned char *output, size_t *n);
24 
25 private:
26  unsigned char _eTable[64]; // encoding table
27  unsigned char _dTable[256]; // decoding table
28  int _maxLineLength;
29  int _ngrps; // num encoded output characters for current line
30  unsigned char _inbuf[3]; // input buffer
31  int _inbufctr; // num bytes in input buffer
32 
33 };
34 
35 };
36 
37 #endif
#define COMMON_API
Definition: common.h:60
VetsUtil base class.
Definition: MyBase.h:68