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 4915 2021-12-01 18:26:55Z 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 
89 typedef 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
150 extern "C" {
151 #endif
152 BA_API void ZipIo_constructor(
153  ZipIo* o,
154  ZipReader* reader,
155  size_t size,
156  AllocatorIntf* alloc);
157 BA_API void ZipIo_destructor(ZipIo* o);
158 #define ZipIo_getECode(o) (o)->ecode
159 #ifdef __cplusplus
160 }
161 inline ZipIo::ZipIo(ZipReader* reader,size_t size,AllocatorIntf* alloc) {
162  ZipIo_constructor(this,reader,size,alloc);
163 }
164 inline ZipIo::~ZipIo() {
165  ZipIo_destructor(this);
166 }
167 inline ZipErr ZipIo::getECode() {
168  return ZipIo_getECode(this);
169 }
170 #endif
171  /* end of IO */
173 
174 #endif
ZipIo::~ZipIo
~ZipIo()
ZipIo destructor.
Definition: ZipIo.h:164
AllocatorIntf
Memory allocation and deallocation Interface class.
Definition: AllocatorIntf.h:83
ZipReader
Abstract interface class for reading a ZipFile.
Definition: ZipFileIterator.h:72
ZipIo
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
baFree
void baFree(void *p)
Deallocates space to which it points.
ZipIo::getECode
ZipErr getECode()
Returns an error code if the ZipIo constructor failed.
Definition: ZipIo.h:167
baMalloc
void * baMalloc(size_t size)
Returns pointer to uninitialized newly-allocated space for an object of size "size",...
IoIntf
The IoIntf class specifies an abstract file API, implementations include ZipIo, DiskIo,...
Definition: IoIntf.h:377
ZipContainer
A ZipContainer is a buffer used by a ZipIo when reading data from a ZipReader.
Definition: ZipFileIterator.h:379
ZipIo
ZipIo ZipIo
The ZipIo class makes it possible for the web-server to work with resources in a ZIP file as if the Z...