1 | /**************************************************************************
|
---|
2 | *
|
---|
3 | * FIvfLevelInfo.h -- File functions for document levels
|
---|
4 | * Copyright (C) 1999 Rodger McNab
|
---|
5 | *
|
---|
6 | * This program is free software; you can redistribute it and/or modify
|
---|
7 | * it under the terms of the GNU General Public License as published by
|
---|
8 | * the Free Software Foundation; either version 2 of the License, or
|
---|
9 | * (at your option) any later version.
|
---|
10 | *
|
---|
11 | * This program is distributed in the hope that it will be useful,
|
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
14 | * GNU General Public License for more details.
|
---|
15 | *
|
---|
16 | * You should have received a copy of the GNU General Public License
|
---|
17 | * along with this program; if not, write to the Free Software
|
---|
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
19 | *
|
---|
20 | **************************************************************************/
|
---|
21 |
|
---|
22 | #ifndef FIVFLEVELINFO_H
|
---|
23 | #define FIVFLEVELINFO_H
|
---|
24 |
|
---|
25 | #if defined(GSDL_USE_OBJECTSPACE)
|
---|
26 | # include <ospace\std\map>
|
---|
27 | #elif defined(GSDL_USE_STL_H)
|
---|
28 | # include <map.h>
|
---|
29 | #else
|
---|
30 | # include <map>
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | #include <stdio.h>
|
---|
34 | #include "UCArray.h"
|
---|
35 |
|
---|
36 |
|
---|
37 | class IvfLevelInfo {
|
---|
38 | public:
|
---|
39 | UCArray levelTag;
|
---|
40 | unsigned long numEntries; // N for level
|
---|
41 | unsigned long approxWeightsDiskPtr;
|
---|
42 | unsigned long exactWeightsDiskPtr;
|
---|
43 | bool workInLevel; // this is just a working variable,
|
---|
44 | // it is not saved or read from the file
|
---|
45 |
|
---|
46 | IvfLevelInfo ();
|
---|
47 | void Clear ();
|
---|
48 |
|
---|
49 | bool Read (FILE *f);
|
---|
50 | bool Write (FILE *f) const;
|
---|
51 | };
|
---|
52 |
|
---|
53 | // stream output for debugging purposes
|
---|
54 | ostream &operator<<(ostream &s, const IvfLevelInfo &l);
|
---|
55 |
|
---|
56 |
|
---|
57 | typedef map<UCArray, IvfLevelInfo, LTUCArray> IvfLevelInfoMap;
|
---|
58 |
|
---|
59 |
|
---|
60 | class FIvfLevel {
|
---|
61 | public:
|
---|
62 | UCArray docTag;
|
---|
63 | UCArray indexLevel; // empty for word level index
|
---|
64 | IvfLevelInfoMap levelInfo;
|
---|
65 |
|
---|
66 | FIvfLevel ();
|
---|
67 | void Clear ();
|
---|
68 |
|
---|
69 | bool Read (FILE *f);
|
---|
70 | bool Write (FILE *f) const;
|
---|
71 | };
|
---|
72 |
|
---|
73 | // stream output for debugging purposes
|
---|
74 | ostream &operator<<(ostream &s, const FIvfLevel &l);
|
---|
75 |
|
---|
76 |
|
---|
77 | #endif
|
---|