12345678910111213141516171819202122232425262728293031323334 |
- #ifndef _BASE64_H_
- #define _BASE64_H_
- #include<string>
- using namespace std;
- //#include <conf.h>
- class CBase64Coder
- {
- private:
- static char ch64[];
- char* buf;
- int size;
- private:
- static int BinSearch(char p);
- int calc_base64_len(int data_len);
- int calc_data_len(const char * base64, int base64_len);
- char _getBase64Char(char c);
- void allocMem(int NewSize);
- public:
- int GetSize()
- {
- return size;
- }
- CBase64Coder();
- ~CBase64Coder();
- const char* encode(const string& message);
- const char* encode(const char* buffer, int buflen);
- const char* decode(const char* buffer, int Length);
- };
- #endif
|