#include <chmfile.h>
Public Member Functions | |
CHMFile () | |
Default constructor. | |
CHMFile (const wxString &archiveName) | |
This constructor attempts to open the .chm file passed as it's argument. If it fails, IsOk() will return false. | |
~CHMFile () | |
Destructor. If a file has been succesfully opened, it closes it. | |
wxString | HomePage () const |
Gets the name of the default page in the archive. | |
wxString | TopicsFile () const |
Gets name of the .hhc file in the archive that could potentially be used to generate content information from. | |
wxString | ArchiveName () const |
Gets the filename of the currently opened .chm file. | |
wxString | IndexFile () const |
Gets name of the .hhk file in the archive that could potentially be used to generate content information from. | |
wxString | Title () const |
Gets the name of the opened .chm. | |
bool | IsOk () const |
Checks if the last attempt to load a .chm file was succesful. | |
bool | HasChanged () |
Checks if a 'ms-its' link has been clicked and the chm changed. | |
wxFontEncoding | DesiredEncoding () const |
Determines the encoding that the CHM creator would like me to use. To be used in combination with DefaultFont(). | |
wxString | DefaultFont () const |
Determines the font to use for special charsets. | |
bool | LoadCHM (const wxString &archiveName) |
Attempts to load a .chm file from disk. | |
void | CloseCHM () |
Closes the currently opened .chm, or does nothing if none opened. | |
bool | GetTopicsTree (wxTreeCtrl *toBuild) |
Attempts to fill a wxTreeCtrl by parsing the topics file. | |
bool | GetIndex (CHMListCtrl *toBuild) |
Attempts to fill a CHMListCtrl by parsing the index file. | |
bool | LoadContextIDs () |
Attempts to build an index of context-ID/page pairs from the file. | |
bool | IsValidCID (const int contextID) |
Checks whether or not the context ID is valid for the loaded file. | |
wxString | GetPageByCID (const int contextID) |
Looks up the page referred to by the context-ID. | |
bool | AreContextIDsLoaded () const |
Have the context-IDs been loaded into memory or not. | |
bool | IndexSearch (const wxString &text, bool wholeWords, bool titlesOnly, CHMSearchResults *results) |
Fast search using the $FIftiMain file in the .chm. | |
bool | ResolveObject (const wxString &fileName, chmUnitInfo *ui) |
Looks up fileName in the archive. | |
size_t | RetrieveObject (chmUnitInfo *ui, unsigned char *buffer, off_t fileOffset, size_t bufferSize) |
Retrieves an uncompressed chunk of a file in the .chm. | |
Private Member Functions | |
wxFontEncoding | GetFontEncFromCharSet (int cs) |
Helper. Translates from Win32 encodings to generic wxWidgets ones. | |
wxFontEncoding | GetFontEncFromLCID (u_int32_t lcid) |
Helper. Translates from MS-specific LCID. | |
bool | GetArchiveInfo () |
Helper. Initializes most of the private data members. | |
u_int32_t | GetLeafNodeOffset (const wxString &text, u_int32_t initalOffset, u_int32_t buffSize, u_int16_t treeDepth, chmUnitInfo *ui) |
Helper. Returns the $FIftiMain offset of leaf node or 0. | |
bool | ProcessWLC (u_int64_t wlc_count, u_int64_t wlc_size, u_int32_t wlc_offset, unsigned char ds, unsigned char dr, unsigned char cs, unsigned char cr, unsigned char ls, unsigned char lr, chmUnitInfo *uifmain, chmUnitInfo *uitbl, chmUnitInfo *uistrings, chmUnitInfo *topics, chmUnitInfo *urlstr, CHMSearchResults *results) |
Helper. Processes the word location code entries while searching. | |
void | GetFileAsString (wxString &str, chmUnitInfo *ui) |
Puts in the str parameter the contents of the file referred by ui. | |
bool | InfoFromWindows () |
Looks up as much information as possible from #WINDOWS/#STRINGS. | |
bool | InfoFromSystem () |
Looks up as much information as possible from #SYSTEM. | |
CHMFile (const CHMFile &) | |
No copy construction allowed. | |
CHMFile & | operator= (const CHMFile &) |
No assignments. | |
Private Attributes | |
chmFile * | _chmFile |
wxString | _filename |
wxString | _home |
wxString | _topicsFile |
wxString | _indexFile |
wxString | _title |
wxString | _font |
wxFontEncoding | _enc |
CHMIDMap | _cidMap |
|
This constructor attempts to open the .chm file passed as it's argument. If it fails, IsOk() will return false.
|
|
Gets the filename of the currently opened .chm file.
|
|
Have the context-IDs been loaded into memory or not.
|
|
Determines the font to use for special charsets.
|
|
Determines the encoding that the CHM creator would like me to use. To be used in combination with DefaultFont().
|
|
Attempts to fill a CHMListCtrl by parsing the index file.
|
|
Looks up the page referred to by the context-ID.
|
|
Attempts to fill a wxTreeCtrl by parsing the topics file.
|
|
Gets the name of the default page in the archive.
|
|
Gets name of the .hhk file in the archive that could potentially be used to generate content information from.
|
|
Fast search using the $FIftiMain file in the .chm.
|
|
Checks if the last attempt to load a .chm file was succesful.
|
|
Checks whether or not the context ID is valid for the loaded file.
|
|
Attempts to load a .chm file from disk.
|
|
Attempts to build an index of context-ID/page pairs from the file.
|
|
Looks up fileName in the archive.
|
|
Retrieves an uncompressed chunk of a file in the .chm.
|
|
Gets the name of the opened .chm.
|
|
Gets name of the .hhc file in the archive that could potentially be used to generate content information from.
|