File indexing completed on 2024-05-12 16:29:20

0001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
0002 /* femtozip - superlightweight class to create a compressed ZIP archive
0003    Copyright (C) 2005-2006 Ariya Hidayat <ariya@kde.org>
0004 
0005    Redistribution and use in source and binary forms, with or without
0006    modification, are permitted provided that the following conditions
0007    are met:
0008    * Redistributions of source code must retain the above copyright notice,
0009      this list of conditions and the following disclaimer.
0010    * Redistributions in binary form must reproduce the above copyright notice,
0011      this list of conditions and the following disclaimer in the documentation
0012      and/or other materials provided with the distribution.
0013    * Neither the name of the authors nor the names of its contributors may be
0014      used to endorse or promote products derived from this software without
0015      specific prior written permission.
0016 
0017    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0018    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0019    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0020    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0021    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0022    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0023    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0024    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0025    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0026    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
0027    THE POSSIBILITY OF SUCH DAMAGE.
0028  */
0029 
0030 #ifndef USE_GSF_OUTPUT
0031 
0032 #ifndef FEMTOZIP_H
0033 #define FEMTOZIP_H
0034 
0035 class FemtoZipPrivate;
0036 
0037 /*!
0038     FemtoZip implements a ZIP archive.
0039 */
0040 
0041 class FemtoZip
0042 {
0043 public:
0044 
0045     explicit FemtoZip(const char *zipfile);
0046     ~FemtoZip();
0047 
0048     void createEntry(const char *name, int compressionLevel = 3);
0049 
0050     void writeString(const char *str);
0051 
0052     void closeEntry();
0053 
0054     enum
0055     {
0056         NoError = 0,
0057         ErrorCreateZip = 1,
0058         ErrorWriteData = 2
0059     };
0060 
0061     /*!
0062         Returns the error code of the latest operation.
0063     */
0064     int errorCode() const;
0065 
0066 private:
0067     // no copy and assign allowed
0068     FemtoZip(const FemtoZip &);
0069     FemtoZip &operator=(const FemtoZip &);
0070 
0071     FemtoZipPrivate *d;
0072 };
0073 
0074 #endif // FEMTOZIP_H
0075 
0076 #endif // USE_GSF_OUTPUT
0077 
0078 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */