// helper classes & structs
//--------------------------------------------------------------------------------
// helper classes & structs
//--------------------------------------------------------------------------------
- wxHtmlBookRecord(const wxString& basepath, const wxString& title,
- const wxString& start)
+ wxHtmlBookRecord(const wxString& bookfile, const wxString& basepath,
+ const wxString& title, const wxString& start)
m_BasePath = basepath;
m_Title = title;
m_Start = start;
// for debugging, give the contents index obvious default values
m_ContentsStart = m_ContentsEnd = -1;
}
m_BasePath = basepath;
m_Title = title;
m_Start = start;
// for debugging, give the contents index obvious default values
m_ContentsStart = m_ContentsEnd = -1;
}
wxString GetTitle() const { return m_Title; }
wxString GetStart() const { return m_Start; }
wxString GetBasePath() const { return m_BasePath; }
wxString GetTitle() const { return m_Title; }
wxString GetStart() const { return m_Start; }
wxString GetBasePath() const { return m_BasePath; }
void SetBasePath(const wxString& path) { m_BasePath = path; }
void SetStart(const wxString& start) { m_Start = start; }
void SetBasePath(const wxString& path) { m_BasePath = path; }
void SetStart(const wxString& start) { m_Start = start; }
+ // returns full filename of page (which is part of the book),
+ // i.e. with book's basePath prepended. If page is already absolute
+ // path, basePath is _not_ prepended.
+ wxString GetFullPath(const wxString &page) const;
+
// This class takes input streams and scans them for occurence
// of keyword(s)
//------------------------------------------------------------------------------
// This class takes input streams and scans them for occurence
// of keyword(s)
//------------------------------------------------------------------------------
- wxSearchEngine() : wxObject() {m_Keyword = NULL; }
- ~wxSearchEngine() {if (m_Keyword) delete[] m_Keyword; }
+ wxHtmlSearchEngine() : wxObject() {m_Keyword = NULL; }
+ ~wxHtmlSearchEngine() {if (m_Keyword) delete[] m_Keyword; }
// Sets the keyword we will be searching for
virtual void LookFor(const wxString& keyword, bool case_sensitive, bool whole_words_only);
// Scans the stream for the keyword.
// Returns TRUE if the stream contains keyword, fALSE otherwise
// Sets the keyword we will be searching for
virtual void LookFor(const wxString& keyword, bool case_sensitive, bool whole_words_only);
// Scans the stream for the keyword.
// Returns TRUE if the stream contains keyword, fALSE otherwise
wxString m_Keyword, m_Name;
wxChar *m_LastPage;
wxHtmlContentsItem* m_ContentsItem;
wxString m_Keyword, m_Name;
wxChar *m_LastPage;
wxHtmlContentsItem* m_ContentsItem;
int m_CurIndex; // where we are now
int m_MaxIndex; // number of files we search
// For progress bar: 100*curindex/maxindex = % complete
int m_CurIndex; // where we are now
int m_MaxIndex; // number of files we search
// For progress bar: 100*curindex/maxindex = % complete
bool LoadCachedBook(wxHtmlBookRecord *book, wxInputStream *f);
// Writes binary book
bool SaveCachedBook(wxHtmlBookRecord *book, wxOutputStream *f);
bool LoadCachedBook(wxHtmlBookRecord *book, wxInputStream *f);
// Writes binary book
bool SaveCachedBook(wxHtmlBookRecord *book, wxOutputStream *f);