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

Unified Diff: third_party/hunspell/src/hunspell/filemgr.cxx

Issue 2239005: Merges our hunspell change to hunspell 1.2.10.... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/deps/
Patch Set: '' Created 10 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/hunspell/src/hunspell/filemgr.hxx ('k') | third_party/hunspell/src/hunspell/hashmgr.hxx » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/hunspell/src/hunspell/filemgr.cxx
===================================================================
--- third_party/hunspell/src/hunspell/filemgr.cxx (revision 50428)
+++ third_party/hunspell/src/hunspell/filemgr.cxx (working copy)
@@ -7,6 +7,32 @@
#include "filemgr.hxx"
+#ifdef HUNSPELL_CHROME_CLIENT
+#include "third_party/hunspell/google/bdict_reader.h"
+
+FileMgr::FileMgr(hunspell::LineIterator* iterator) : iterator_(iterator) {
+}
+
+FileMgr::~FileMgr() {
+}
+
+char * FileMgr::getline() {
+ // Read one line from a BDICT file and store the line to our line buffer.
+ // To emulate the original FileMgr::getline(), this function returns
+ // the pointer to our line buffer if we can read a line without errors.
+ // Otherwise, this function returns NULL.
+ bool result = iterator_->AdvanceAndCopy(line_, BUFSIZE - 1);
+ return result ? line_ : NULL;
+}
+
+int FileMgr::getlinenum() {
+ // This function is used only for displaying a line number that causes a
+ // parser error. For a BDICT file, providing a line number doesn't help
+ // identifying the place where causes a parser error so much since it is a
+ // binary file. So, we just return 0.
+ return 0;
+}
+#else
int FileMgr::fail(const char * err, const char * par) {
fprintf(stderr, err, par);
return -1;
@@ -47,3 +73,4 @@
int FileMgr::getlinenum() {
return linenum;
}
+#endif
« no previous file with comments | « third_party/hunspell/src/hunspell/filemgr.hxx ('k') | third_party/hunspell/src/hunspell/hashmgr.hxx » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698