00001 00020 #ifndef ARXX_ARCHIVEFILE_H 00021 #define ARXX_ARCHIVEFILE_H 00022 00023 #include "../Include/Common.h" 00024 00031 namespace Arxx 00032 { 00033 #pragma pack(1) 00034 00039 class ArchiveHeader 00040 { 00041 public: 00042 union 00043 { 00049 u4byte m_u4VersionNumber; 00050 struct 00051 { 00058 u1byte m_u1MajorMajorVersion; 00059 00066 u1byte m_u1MajorMinorVersion; 00067 00074 u1byte m_u1MinorMajorVersion; 00075 00082 u1byte m_u1MinorMinorVersion; 00083 }; 00084 }; 00085 00091 u4byte m_u4RootItemID; 00092 00096 u4byte m_u4ItemCount; 00097 }; 00098 00105 class ItemHeader 00106 { 00107 public: 00111 ItemHeader(void) : 00112 m_u4UniqueID(0), 00113 m_u4Type(0), 00114 m_u4SubType(0), 00115 m_u4VersionNumber(0), 00116 m_u4DataCompression(0), 00117 m_u4NameLength(0), 00118 m_u4DataDecompressedLength(0), 00119 m_u4DataCompressedLength(0), 00120 m_u4StructureDataLength(0) 00121 { 00122 } 00123 00129 u4byte m_u4UniqueID; 00130 00136 u4byte m_u4Type; 00137 00143 u4byte m_u4SubType; 00144 00145 union 00146 { 00152 u4byte m_u4VersionNumber; 00153 struct 00154 { 00161 u1byte m_u1MajorMajorVersion; 00162 00169 u1byte m_u1MajorMinorVersion; 00170 00177 u1byte m_u1MinorMajorVersion; 00178 00185 u1byte m_u1MinorMinorVersion; 00186 }; 00187 }; 00188 00194 u4byte m_u4DataCompression; 00195 00199 u1byte m_u1IsDataExternal; 00200 00206 u4byte m_u4NameLength; 00207 00213 u4byte m_u4DataOffset; 00214 00220 u4byte m_u4DataDecompressedLength; 00221 00227 u4byte m_u4DataCompressedLength; 00228 00234 u4byte m_u4StructureDataLength; 00235 }; 00236 #pragma pack() 00237 00243 inline std::ostream & operator<<(std::ostream & OStream, Arxx::ArchiveHeader & ArchiveHeader) 00244 { 00245 OStream.write(reinterpret_cast< const char * >(&ArchiveHeader), sizeof(Arxx::ArchiveHeader)); 00246 00247 return OStream; 00248 } 00249 00255 inline std::ostream & operator<<(std::ostream & OStream, Arxx::ItemHeader & ItemHeader) 00256 { 00257 OStream.write(reinterpret_cast< const char * >(&ItemHeader), sizeof(Arxx::ItemHeader)); 00258 00259 return OStream; 00260 } 00261 00267 inline std::istream & operator>>(std::istream & IStream, Arxx::ArchiveHeader & ArchiveHeader) 00268 { 00269 IStream.read(reinterpret_cast< char * >(&ArchiveHeader), sizeof(Arxx::ArchiveHeader)); 00270 00271 return IStream; 00272 } 00273 00279 inline std::istream & operator>>(std::istream & IStream, Arxx::ItemHeader & ItemHeader) 00280 { 00281 IStream.read(reinterpret_cast< char * >(&ItemHeader), sizeof(Arxx::ItemHeader)); 00282 00283 return IStream; 00284 } 00285 } 00286 00287 #endif