Hex.h++
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __ccxx_Hex_hxx
00024 #define __ccxx_Hex_hxx
00025
00026 #include <commonc++/Common.h++>
00027 #include <commonc++/Buffer.h++>
00028 #include <commonc++/String.h++>
00029
00030 namespace ccxx {
00031
00040 class COMMONCPP_API Hex
00041 {
00042 public:
00043
00056 static size_t encode(ByteBuffer& input, CharBuffer& output,
00057 bool lowercase = false) throw();
00058
00073 static size_t encode(const byte_t *input, size_t inputLen,
00074 char *output, size_t outputLen,
00075 bool lowercase = false) throw();
00076
00084 static String encode(const Blob &input, bool lowercase = false);
00085
00096 static size_t decode(CharBuffer& input, ByteBuffer& output) throw();
00097
00110 static size_t decode(const char *input, size_t inputLen,
00111 byte_t *output, size_t outputLen) throw();
00112
00118 static Blob decode(const String &input);
00119
00129 static char encodeDigit(uint_t i, bool lowercase = false) throw();
00130
00138 static uint_t decodeDigit(char c) throw();
00139
00140 private:
00141
00142 Hex();
00143 CCXX_COPY_DECLS(Hex);
00144 };
00145
00146 };
00147
00148 #endif // __ccxx_Hex_hxx
00149
00150