added .chm support for Unix (Markus Sinner)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24117 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2003-10-07 20:15:27 +00:00
parent c839485c8e
commit 3527f29c87
8 changed files with 1233 additions and 14 deletions

View File

@@ -570,14 +570,24 @@ bool wxHtmlHelpData::AddBookParam(const wxFSFile& bookfile,
bool wxHtmlHelpData::AddBook(const wxString& book)
{
if (book.Right(4).Lower() == wxT(".zip") ||
book.Right(4).Lower() == wxT(".htb") /*html book*/)
wxString extension(book.Right(4).Lower());
if (extension == wxT(".zip") ||
#if wxUSE_LIBMSPACK
extension == wxT(".chm") /*compressed html help book*/ ||
#endif
extension == wxT(".htb") /*html book*/)
{
wxFileSystem fsys;
wxString s;
bool rt = FALSE;
s = fsys.FindFirst(book + wxT("#zip:") + wxT("*.hhp"), wxFILE);
#if wxUSE_LIBMSPACK
if (extension == wxT(".chm"))
s = fsys.FindFirst(book + wxT("#chm:*.hhp"), wxFILE);
else
#endif
s = fsys.FindFirst(book + wxT("#zip:*.hhp"), wxFILE);
while (!s.IsEmpty())
{
if (AddBook(s)) rt = TRUE;