Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef BASE64_H_
00009 #define BASE64_H_
00010
00011 #include <stdlib.h>
00012 #include <stdint.h>
00013
00014 namespace ibrcommon
00015 {
00016 class Base64
00017 {
00018 public:
00019 static const char encodeCharacterTable[];
00020 static const char decodeCharacterTable[];
00021
00022 static const int EQUAL_CHAR = -2;
00023 static const int UNKOWN_CHAR = -1;
00024
00025 static int getCharType(int val);
00026
00032 static size_t getLength(size_t length);
00033
00034 class Group
00035 {
00036 public:
00037 Group();
00038 virtual ~Group();
00039
00040 void zero();
00041 uint8_t get_0() const;
00042 uint8_t get_1() const;
00043 uint8_t get_2() const;
00044
00045 void set_0(uint8_t val);
00046 void set_1(uint8_t val);
00047 void set_2(uint8_t val);
00048
00049 int b64_0() const;
00050 int b64_1() const;
00051 int b64_2() const;
00052 int b64_3() const;
00053
00054 void b64_0(int val);
00055 void b64_1(int val);
00056 void b64_2(int val);
00057 void b64_3(int val);
00058
00059 private:
00060 uint8_t _data[3];
00061 };
00062 };
00063 }
00064 #endif