The SWORD Project  1.9.0.svnversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
entriesblk.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * entriesblk.h - class EntriesBlock: a helper class for module drivers
4  * which support compressed blocks of multiple entries
5  *
6  * $Id: entriesblk.h 3786 2020-08-30 11:35:14Z scribe $
7  *
8  * Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
9  * CrossWire Bible Society
10  * P. O. Box 2528
11  * Tempe, AZ 85280-2528
12  *
13  * This program is free software; you can redistribute it and/or modify it
14  * under the terms of the GNU General Public License as published by the
15  * Free Software Foundation version 2.
16  *
17  * This program is distributed in the hope that it will be useful, but
18  * WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * General Public License for more details.
21  *
22  */
23 
24 #ifndef ENTRIESBLK_H
25 #define ENTRIESBLK_H
26 
27 #include <sysdata.h>
28 #include <defs.h>
29 
31 
33  static const int METAHEADERSIZE;
34  static const int METAENTRYSIZE;
35 
36 private:
37  char *block;
38  void setCount(int count);
39  void getMetaEntry(int index, unsigned long *offset, unsigned long *size);
40  void setMetaEntry(int index, unsigned long offset, unsigned long size);
41 
42 public:
43  EntriesBlock(const char *iBlock, unsigned long size);
44  EntriesBlock();
45  ~EntriesBlock();
46 
47  int getCount();
48  int addEntry(const char *entry);
49  const char *getEntry(int entryIndex);
50  unsigned long getEntrySize(int entryIndex);
51  void removeEntry(int entryIndex);
52  const char *getRawData(unsigned long *size);
53 };
54 
55 
57 #endif
#define SWORD_NAMESPACE_START
Definition: defs.h:39
void removeEntry(EntriesBlock *eb, int index)
static const int METAHEADERSIZE
Definition: entriesblk.h:33
#define SWDLLEXPORT
Definition: defs.h:171
char * block
Definition: entriesblk.h:37
int size
Definition: regex.c:5043
static const int METAENTRYSIZE
Definition: entriesblk.h:34
#define SWORD_NAMESPACE_END
Definition: defs.h:40