Barracuda Application Server C/C++ Reference
NO
ZipIo.h
1/*
2 * ____ _________ __ _
3 * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4 * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5 * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6 * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7 * /____/
8 *
9 * Barracuda Embedded Web-Server
10 *
11 ****************************************************************************
12 * HEADER
13 *
14 * $Id: ZipIo.h 5355 2022-11-16 10:33:45Z wini $
15 *
16 * COPYRIGHT: Real Time Logic LLC, 2006-2019
17 *
18 * This software is copyrighted by and is the sole property of Real
19 * Time Logic LLC. All rights, title, ownership, or other interests in
20 * the software remain the property of Real Time Logic LLC. This
21 * software may only be used in accordance with the terms and
22 * conditions stipulated in the corresponding license agreement under
23 * which the software has been supplied. Any unauthorized use,
24 * duplication, transmission, distribution, or disclosure of this
25 * software is expressly forbidden.
26 *
27 * This Copyright notice may not be removed or modified without prior
28 * written consent of Real Time Logic LLC.
29 *
30 * http://www.realtimelogic.com
31 ****************************************************************************
32 *
33 *
34 */
35
36#ifndef __ZipIo_h
37#define __ZipIo_h
38
39#include "IoIntf.h"
40#include "VirDir.h"
41#include "ZipFileIterator.h"
42
89typedef struct ZipIo
90#ifdef __cplusplus
91: public IoIntf
92{
93 ZipIo() {}
94 void *operator new(size_t s) { return ::baMalloc(s); }
95 void operator delete(void* d) { if(d) ::baFree(d); }
96 void *operator new(size_t, void *place) { return place; }
97 void operator delete(void*, void *) { }
98
123 ZipIo(ZipReader* reader,size_t size=256,AllocatorIntf* alloc=0);
124
127 ~ZipIo();
128
131 ZipErr getECode();
132#if 0
133}
134#endif
135#else
136{
137 IoIntf super; /* Inherits from IoIntf. */
138#endif
139 VirDirNode root;
140 ZipContainer zc;
141 AllocatorIntf* alloc;
142 char* password;
143 U16 passwordLen;
144 ZipErr ecode;
145 BaBool passwordRequired;
146 BaBool passwordBin;
148
149#ifdef __cplusplus
150extern "C" {
151#endif
152BA_API void ZipIo_constructor(
153 ZipIo* o,
154 ZipReader* reader,
155 size_t size,
156 AllocatorIntf* alloc);
157BA_API void ZipIo_destructor(ZipIo* o);
158#define ZipIo_getECode(o) (o)->ecode
159#ifdef __cplusplus
160}
161inline ZipIo::ZipIo(ZipReader* reader,size_t size,AllocatorIntf* alloc) {
162 ZipIo_constructor(this,reader,size,alloc);
163}
165 ZipIo_destructor(this);
166}
167inline ZipErr ZipIo::getECode() {
168 return ZipIo_getECode(this);
169}
170#endif
171 /* end of IO */
173
174#endif
void * baMalloc(size_t size)
Returns pointer to uninitialized newly-allocated space for an object of size "size",...
void baFree(void *p)
Deallocates space to which it points.
ZipIo ZipIo
The ZipIo class makes it possible for the web-server to work with resources in a ZIP file as if the Z...
ZipErr getECode()
Returns an error code if the ZipIo constructor failed.
Definition: ZipIo.h:167
~ZipIo()
ZipIo destructor.
Definition: ZipIo.h:164
Memory allocation and deallocation Interface class.
Definition: AllocatorIntf.h:83
The IoIntf class specifies an abstract file API, implementations include ZipIo, DiskIo,...
Definition: IoIntf.h:377
A ZipContainer is a buffer used by a ZipIo when reading data from a ZipReader.
Definition: ZipFileIterator.h:379
The ZipIo class makes it possible for the web-server to work with resources in a ZIP file as if the Z...
Definition: ZipIo.h:92
Abstract interface class for reading a ZipFile.
Definition: ZipFileIterator.h:72