+ fsys.ChangePathTo(book);
+
+ const wxChar *lineptr;
+ wxChar linebuf[300];
+ wxString tmp;
+ wxHtmlFilterPlainText filter;
+ tmp = filter.ReadFile(*fi);
+ lineptr = tmp.c_str();
+
+ do
+ {
+ lineptr = ReadLine(lineptr, linebuf, 300);
+
+ for (wxChar *ch = linebuf; *ch != wxT('\0') && *ch != wxT('='); ch++)
+ *ch = (wxChar)wxTolower(*ch);
+
+ if (wxStrstr(linebuf, wxT("title=")) == linebuf)
+ title = linebuf + wxStrlen(wxT("title="));
+ if (wxStrstr(linebuf, wxT("default topic=")) == linebuf)
+ start = linebuf + wxStrlen(wxT("default topic="));
+ if (wxStrstr(linebuf, wxT("index file=")) == linebuf)
+ index = linebuf + wxStrlen(wxT("index file="));
+ if (wxStrstr(linebuf, wxT("contents file=")) == linebuf)
+ contents = linebuf + wxStrlen(wxT("contents file="));
+ if (wxStrstr(linebuf, wxT("charset=")) == linebuf)
+ charset = linebuf + wxStrlen(wxT("charset="));
+ } while (lineptr != NULL);
+
+ wxFontEncoding enc = wxFONTENCODING_SYSTEM;
+#if wxUSE_FONTMAP
+ if (charset != wxEmptyString)
+ enc = wxFontMapper::Get()->CharsetToEncoding(charset);
+#endif
+
+ bool rtval = AddBookParam(*fi, enc,
+ title, contents, index, start, fsys.GetPath());
+ delete fi;
+
+ return rtval;