Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
ZipIo.h
Go to the documentation of this file.
1/*
2 * ____ _________ __ _
3 * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4 * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5 * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6 * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7 * /____/
8 *
9 * Barracuda Embedded Web-Server
10 *
11 ****************************************************************************
12 * HEADER
13 *
14 * $Id: ZipIo.h 5978 2026-09-11 16:13:48Z 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
38#ifndef __ZipIo_h
39#define __ZipIo_h
40
41#include "IoIntf.h"
42#include "VirDir.h"
43#include "ZipFileIterator.h"
44
90typedef struct ZipIo
91#ifdef __cplusplus
92: public IoIntf
93{
95 ZipIo() {}
96 void *operator new(size_t s) { return ::baMalloc(s); }
97 void operator delete(void* d) { if(d) ::baFree(d); }
98 void *operator new(size_t, void *place) { return place; }
99 void operator delete(void*, void *) { }
100
127 ZipIo(ZipReader* reader,size_t size=256,AllocatorIntf* alloc=0);
128
132 ~ZipIo();
133
138#if 0
139}
140#endif
141#else
142{
143 IoIntf super; /* Inherits from IoIntf. */
144#endif
145 VirDirNode root;
146 ZipContainer zc;
147 AllocatorIntf* alloc;
148 char* password;
149 U16 passwordLen;
150 ZipErr ecode;
151 BaBool passwordRequired;
152 BaBool passwordBin;
154
155#ifdef __cplusplus
156extern "C" {
157#endif
162 ZipIo* o,
163 ZipReader* reader,
164 size_t size,
165 AllocatorIntf* alloc);
169BA_API void ZipIo_destructor(ZipIo* o);
173#define ZipIo_getECode(o) (o)->ecode
174#ifdef __cplusplus
175}
176inline ZipIo::ZipIo(ZipReader* reader,size_t size,AllocatorIntf* alloc) {
177 ZipIo_constructor(this,reader,size,alloc);
178}
180 ZipIo_destructor(this);
181}
183 return ZipIo_getECode(this);
184}
185#endif
186 /* end of IO */
188
189#endif
void * baMalloc(size_t size)
Allocate uninitialized storage using the target's configured allocator.
void baFree(void *p)
Release storage using the target's configured allocator.
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
ZIP metadata parsing result; zero is success, negative values are failures.
Definition: ZipFileIterator.h:108
ZipErr getECode()
Query construction status without performing I/O.
Definition: ZipIo.h:182
~ZipIo()
Notify an attached IoIntf, free the index/buffer/password storage, and leave the borrowed ZipReader a...
Definition: ZipIo.h:179
#define ZipIo_getECode(o)
Query construction status without performing I/O.
Definition: ZipIo.h:173
BA_API void ZipIo_destructor(ZipIo *o)
Notify an attached IoIntf, free the index/buffer/password storage, and leave the borrowed ZipReader a...
BA_API void ZipIo_constructor(ZipIo *o, ZipReader *reader, size_t size, AllocatorIntf *alloc)
ZipIo constructor.
uint16_t U16
Unsigned 16-bit integer.
Definition: GenPrimT.h:91
U8 BaBool
Boolean stored in an unsigned byte; FALSE is zero and TRUE is one.
Definition: GenPrimT.h:118
Memory allocation and deallocation Interface class.
Definition: AllocatorIntf.h:98
The IoIntf class specifies an abstract file API, implementations include ZipIo, DiskIo,...
Definition: IoIntf.h:482
A ZipContainer is a buffer used by a ZipIo when reading data from a ZipReader.
Definition: ZipFileIterator.h:434
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:93
ZipIo()
Uninitialized storage; call ZipIo_constructor before use.
Definition: ZipIo.h:95
Abstract interface class for reading a ZipFile.
Definition: ZipFileIterator.h:74