12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
-
-
-
-
- #ifndef base64codec_included
- #define base64codec_included
-
- #include <vector>
- #include <cstring>
- #include <string>
-
- using namespace std;
-
- typedef vector<unsigned char> base64buffer;
-
- class to_base64 : public base64buffer {
- private:
- bool BadConversion;
- void convert(const unsigned char* bfr, const int len);
-
- public:
- to_base64(const vector<unsigned char>& bfr);
- to_base64(const vector<char>& bfr);
- to_base64(const string& s);
- to_base64(const char* s);
- to_base64(const unsigned char* bfr, const int len);
- to_base64(const char* bfr, const int len);
- bool Bad();
- };
-
- class from_base64 : public base64buffer {
- private:
- bool BadConversion;
- unsigned char NextSixBits(
- int& cursor,
- const unsigned char* bfr,
- const int len);
- void convert(const unsigned char* bfr, const int len);
-
- public:
- from_base64(const vector<unsigned char>& bfr);
- from_base64(const vector<char>& bfr);
- from_base64(const string& s);
- from_base64(const char*);
- bool Bad();
- };
-
-
- #endif
|