CHM files

Thomas Ritter th.ritter at gmx.net
Sat Sep 4 18:13:09 UTC 2004


Hi Alexander,

it was some time ago when we discussed chm support in KDevelop. I looked at 
chmlib and think it throws away too much of my chm files, so I just parse the 
html file and write a .toc file with the chm filename with full path as base 
url, it works like a charm.

This code should be easily modifyable to directly import a chm file into the 
konqueror doctree. The only tricky thing is that the currently parsed item 
must be cached because it is an opening tag if the next item has a higher toc 
level. I didn't bother to implement lookahead in the parser.

The KIO system should be able to open the chm file index, which must be saved 
to disk for this test program.

The parse function creates an xml toc file with links into the chm file at 
this moment, but it should be no problem to write it into a kdevelop data 
structure to put it into the doctree. The xml string is being printed out in 
this test program.

I have no idea how to find out the CHM file's descriptive title, so it must be 
entered manually (Maybe with the filename without extension as suggestion), 
but as xchm shows, there must be a way to get the title...

Is this code of any use for you? I think it should be easily modifiable for 
kdevelop.

Greetings,

Thomas Ritter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chmparser.cpp
Type: text/x-c++src
Size: 4980 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20040904/fb57711b/attachment.cpp>


More information about the KDevelop-devel mailing list