Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/network/zip.h @ 9395

Last change on this file since 9395 was 8623, checked in by bensch, 19 years ago

orxonox/trunk: merged the network branche back here
merged with command:
svn merge -r8230:HEAD https://svn.orxonox.net/orxonox/branches/network .
conflicts resolved in favour of the network branche (conflicts were in network)

File size: 922 bytes
Line 
1/*!
2 * @file zip.h
3 * @brief Definition of the Zip singleton Class
4 */
5
6#ifndef _ZIP_H
7#define _ZIP_H
8
9#include <zlib.h>
10#include <string>
11#include <vector>
12
13#include "netdefs.h"
14
15struct DictionaryEntry
16{
17  byte * dict;
18  int    dictLen;
19  uLong  adler;
20};
21
22//! A class for compressing/uncompressing packes.
23class Zip
24{
25  public:
26    virtual ~Zip(void);
27    /** @returns a Pointer to the only object of this Class */
28    inline static Zip* getInstance(void) { if (!singletonRef) singletonRef = new Zip();  return singletonRef; };
29   
30    int loadDictionary( std::string name );
31    int zip( byte * from, int fromLength, byte * to, int maxLength, int dict = 0 );
32    int unZip( byte * from, int fromLength, byte * to, int maxLength );
33   
34    int getDictCount(){ return dicts.size(); }
35
36  private:
37    Zip();
38    static Zip* singletonRef;
39   
40    std::vector<DictionaryEntry> dicts;
41};
42
43#endif /* _PROTO_SINGLETON_H */
Note: See TracBrowser for help on using the repository browser.