Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: third_party/hunspell128/src/hunspell/filemgr.hxx

Issue 173468: The first step towards fixing valgrind errors in the new hunspell.... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/deps/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* file manager class - read lines of files [filename] OR [filename.hz] */ 1 /* file manager class - read lines of files [filename] OR [filename.hz] */
2 #ifndef _FILEMGR_HXX_ 2 #ifndef _FILEMGR_HXX_
3 #define _FILEMGR_HXX_ 3 #define _FILEMGR_HXX_
4 #include "hunzip.hxx" 4 #include "hunzip.hxx"
5 5
6 #ifdef HUNSPELL_CHROME_CLIENT
7 namespace hunspell {
8 class LineIterator;
9 } // namespace hunspell
10
11 // A class which encapsulates operations of reading a BDICT file.
12 // Chrome uses a BDICT file to compress hunspell dictionaries. A BDICT file is
13 // a binary file converted from a DIC file and an AFF file. (See
14 // "bdict_reader.h" for its format.)
15 // This class encapsulates the operations of reading a BDICT file and emulates
16 // the original FileMgr operations for AffixMgr so that it can read a BDICT
17 // file without so many changes.
18 class FileMgr {
19 public:
20 FileMgr(hunspell::LineIterator* iterator);
21 ~FileMgr();
22 char * getline();
23 int getlinenum();
24
25 protected:
26 hunspell::LineIterator* iterator_;
27 char line_[BUFSIZE + 50]; // input buffer
28 };
29 #else
6 class FileMgr 30 class FileMgr
7 { 31 {
8 protected: 32 protected:
9 FILE * fin; 33 FILE * fin;
10 Hunzip * hin; 34 Hunzip * hin;
11 char in[BUFSIZE + 50]; // input buffer 35 char in[BUFSIZE + 50]; // input buffer
12 int fail(const char * err, const char * par); 36 int fail(const char * err, const char * par);
13 int linenum; 37 int linenum;
14 38
15 public: 39 public:
16 FileMgr(const char * filename, const char * key = NULL); 40 FileMgr(const char * filename, const char * key = NULL);
17 ~FileMgr(); 41 ~FileMgr();
18 char * getline(); 42 char * getline();
19 int getlinenum(); 43 int getlinenum();
20 }; 44 };
21 #endif 45 #endif
46
47 #endif
OLDNEW
« no previous file with comments | « third_party/hunspell128/src/hunspell/affixmgr.cxx ('k') | third_party/hunspell128/src/hunspell/filemgr.cxx » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698