00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef INC_BASE64_H
00020 #define INC_BASE64_H
00021
00022 #ifndef INC_MI32_STDDEFNS_H
00023 #include <mi32/stddefns.h>
00024 #endif
00025
00026 #ifndef INC_MI32_SIMPLEAR_H
00027 #include <mi32/simplear.h>
00028 #endif
00029
00030 #ifndef GENERATING_DOXYGEN_OUTPUT
00031 class FILEPATH;
00032 class GENERICRW;
00033 #endif // GENERATING_DOXYGEN_OUTPUT
00034
00035 #ifdef MISYSTEMDLL
00036 #define CLASSLIBEXPORT MI_DLLCLASSEXPORT
00037 #else
00038 #define CLASSLIBEXPORT MI_DLLCLASSIMPORT
00039 #endif
00040
00041
00042 class CLASSLIBEXPORT BASE64_ENCODER {
00043 public:
00044 BASE64_ENCODER ();
00045 virtual ~BASE64_ENCODER ();
00046
00047
00048
00049 ERRVALUE Encode (
00050 const FILEPATH& filepath
00051 );
00052
00053
00054 ERRVALUE Encode (
00055 GENERICRW& stream
00056 );
00057
00058
00059
00060 ERRVALUE Encode (
00061 const UINT8* buffer,
00062 int NumBytes
00063 );
00064
00065 private:
00066 #ifndef GENERATING_DOXYGEN_OUTPUT
00067 SIMPLE_ARRAY<char> m_WorkBuffer;
00068
00069
00070 BASE64_ENCODER(const BASE64_ENCODER&);
00071 BASE64_ENCODER& operator=(const BASE64_ENCODER&);
00072 #endif // GENERATING_DOXYGEN_OUTPUT
00073
00074
00075
00076
00077
00078
00079 virtual ERRVALUE v_Write (
00080 const char* buffer
00081 ) = 0;
00082
00083
00084
00085
00086
00087
00088 virtual ERRVALUE v_ShowStatus (
00089 double PercentDone
00090 );
00091
00092 };
00093
00094
00095 class CLASSLIBEXPORT BASE64_DECODER {
00096 public:
00097 BASE64_DECODER();
00098 virtual ~BASE64_DECODER();
00099
00100
00101 ERRVALUE Decode (
00102 const FILEPATH& filepath
00103 );
00104
00105
00106
00107 ERRVALUE Decode (
00108 const char* buffer
00109 );
00110
00111
00112
00113
00114
00115 ERRVALUE Decode (
00116 GENERICRW& stream,
00117 INT64 size = -1
00118 );
00119
00120 private:
00121 #ifndef GENERATING_DOXYGEN_OUTPUT
00122
00123
00124 BASE64_DECODER(const BASE64_DECODER&);
00125 BASE64_DECODER& operator=(const BASE64_DECODER&);
00126 #endif // GENERATING_DOXYGEN_OUTPUT
00127
00128
00129
00130
00131 virtual ERRVALUE v_Write (
00132 const UINT8* buffer,
00133 int numbytes
00134 ) = 0;
00135
00136
00137
00138
00139 virtual ERRVALUE v_ShowStatus (
00140 double PercentDone
00141 );
00142
00143 };
00144
00145 #undef CLASSLIBEXPORT
00146
00147 #endif
00148