00001 00020 #ifndef ARXX_DATA_H 00021 #define ARXX_DATA_H 00022 00023 #include "Buffer.h" 00024 #include "Common.h" 00025 #include "FetchStatus.h" 00026 #include "URI.h" 00027 00034 namespace Arxx 00035 { 00044 class Data : public Arxx::Buffer 00045 { 00046 public: 00047 typedef enum 00048 { 00049 NONE = 0, 00050 ZLIB_0 = 1, 00051 ZLIB_1 = 2, 00052 ZLIB_2 = 3, 00053 ZLIB_3 = 4, 00054 ZLIB_4 = 5, 00055 ZLIB_5 = 6, 00056 ZLIB_6 = 7, 00057 ZLIB_7 = 8, 00058 ZLIB_8 = 9, 00059 ZLIB_9 = 10, 00060 BZLIB = 11 00061 } Compression; 00062 00063 static Arxx::Data::Compression m_DefaultCompression; 00064 00068 Data(void); 00069 00073 ~Data(void); 00074 00078 void vDecompress(void); 00079 00083 void vCompress(const Arxx::Data::Compression & Compression = Arxx::Data::m_DefaultCompression); 00084 00088 bool bIsCompressed(void) const; 00089 00093 bool bIsDecompressed(void) const; 00094 00098 Arxx::Data::Compression GetCompression(void) const; 00099 00103 Arxx::u4byte u4GetDecompressedLength(void) const; 00104 00108 Arxx::u4byte u4GetCompressedLength(void) const; 00109 00115 const Arxx::URI & GetURI(void) const; 00116 00127 bool bFetch(void); 00128 00140 void vUnfetch(void); 00141 00151 void vReleaseDataChannel(void); 00152 00166 virtual void vSetExternal(const Arxx::URI & URI = "", const Arxx::Data::Compression & Compression = Arxx::Data::NONE, Arxx::u4byte u4DecompressedLength = 0, Arxx::u4byte u4CompressedLength = 0); 00167 00173 bool bIsInternal(void) const; 00174 00180 bool bIsExternal(void) const; 00181 00187 void vInternalize(void); 00188 00194 Arxx::FetchStatus GetFetchStatus(void) const; 00195 00199 bool bIsFetching(void) const; 00200 00204 bool bIsFetched(void) const; 00205 private: 00211 Arxx::URI m_URI; 00212 00218 Arxx::Data::Compression m_Compression; 00219 00223 mutable Arxx::u4byte m_u4DecompressedLength; 00224 00230 mutable Arxx::u4byte m_u4CompressedLength; 00231 00241 bool m_bIsExternal; 00242 00250 Arxx::FetchStatus m_FetchStatus; 00251 }; 00252 } 00253 00254 #endif