1 // Written by Thorsten Brehm, started November 2012.
3 // Copyright (C) 2012 Thorsten Brehm, brehmt at gmail dt com
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Library General Public
7 // License as published by the Free Software Foundation; either
8 // version 2 of the License, or (at your option) any later version.
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Library General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef GZ_CONTAINER_FILE_HXX
22 #define GZ_CONTAINER_FILE_HXX
25 #include <simgear/misc/sgstream.hxx>
32 typedef int ContainerType;
34 /** A class to write container files. */
35 class gzContainerReader : public sg_gzifstream
38 gzContainerReader( const std::string& name,
39 const std::string& fileMagic);
41 bool readContainerHeader(ContainerType* pType, size_t* pSize);
42 bool readContainer(ContainerType* pType, char** ppData, size_t* pSize);
47 /** A class to read container files. */
48 class gzContainerWriter : public sg_gzofstream
51 gzContainerWriter( const std::string& name,
52 const std::string& fileMagic);
54 bool writeContainerHeader(ContainerType Type, size_t Size);
55 bool writeContainer(ContainerType Type, const char* pData, size_t Size);
56 bool writeContainer(ContainerType Type, const char* stringBuffer);
57 bool writeContainer(ContainerType Type, SGPropertyNode* root);
64 #endif // GZ_CONTAINER_FILE_HXX