OLD | NEW |
| (Empty) |
1 /* file manager class - read lines of files [filename] OR [filename.hz] */ | |
2 #ifndef _FILEMGR_HXX_ | |
3 #define _FILEMGR_HXX_ | |
4 | |
5 #include "hunvisapi.h" | |
6 | |
7 #include "hunzip.hxx" | |
8 #include <stdio.h> | |
9 | |
10 #ifdef HUNSPELL_CHROME_CLIENT | |
11 namespace hunspell { | |
12 class LineIterator; | |
13 } // namespace hunspell | |
14 | |
15 // A class which encapsulates operations of reading a BDICT file. | |
16 // Chrome uses a BDICT file to compress hunspell dictionaries. A BDICT file is | |
17 // a binary file converted from a DIC file and an AFF file. (See | |
18 // "bdict_reader.h" for its format.) | |
19 // This class encapsulates the operations of reading a BDICT file and emulates | |
20 // the original FileMgr operations for AffixMgr so that it can read a BDICT | |
21 // file without so many changes. | |
22 class FileMgr { | |
23 public: | |
24 FileMgr(hunspell::LineIterator* iterator); | |
25 ~FileMgr(); | |
26 char* getline(); | |
27 int getlinenum(); | |
28 | |
29 protected: | |
30 hunspell::LineIterator* iterator_; | |
31 char line_[BUFSIZE + 50]; // input buffer | |
32 }; | |
33 #else | |
34 class LIBHUNSPELL_DLL_EXPORTED FileMgr | |
35 { | |
36 protected: | |
37 FILE * fin; | |
38 Hunzip * hin; | |
39 char in[BUFSIZE + 50]; // input buffer | |
40 int fail(const char * err, const char * par); | |
41 int linenum; | |
42 | |
43 public: | |
44 FileMgr(const char * filename, const char * key = NULL); | |
45 ~FileMgr(); | |
46 char * getline(); | |
47 int getlinenum(); | |
48 }; | |
49 #endif | |
50 #endif | |
OLD | NEW |