Skip navigation.
KDE Developer's Journals

KCabinet

brad hards's picture

I've just checked in the start of a new class - KCabinet. Its in playground/libs/kcabinet for the morbidly curious. I'm not sure if it is really going to be right for kdelibs - need to get it a bit more mature before needing to make that decision.

The format is reasonably well documented, at http://msdn2.microsoft.com/en-us/library/bb417343.aspx, and there are other tools that can read it.

This is the first time I've really set out to do test-driven development of a class. It is interesting in the "confidence" that it brings to have even a few tests that exercise the code you've written. It is also amazing how it changes your thinking about design and implementation (rather than about testing). In this case, I'm subclassing KArchive, so there isn't so much design, but the effect is still there at a lower level.

Of course, right now I'm stuck. I'm trying to parse out the date and time (into a q:QDateTime), and it all works. Except that one field (the minutes) are wrong, and I can't see why. Argh!

Other than that though, TDD really does add quite a lot of enjoyment to development.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vdboor's picture

Looking forward to it!

Whoa.. that's interesting news!

With KMess I have to extract CAB files to process "Winks" sent by MSN Messenger (Winks are short flash movies in a signed CAB file). Currently we use cabextract for this, but I'd be very grateful to use your class instead.

Beware of "reasonably documented" though. I guess there will be some quirks, as MS' formats are always "reasonably documented". ...until you want to make a really good implementation and get stuck at some detail they've missed in the docs. Eye-wink Did you look at `cabextract` and libmspack as well?

brad hards's picture

Using some of cabextract

I am using the test cases from cabextract (well, actually from libmspack), and some of the other ideas and reading some of the code. That is my backup "documentation" Smiling

libmspack was considered, but not many distros package it separately to cabextract (Suse does, apparently, but I don't know of any others).

I'm interested in the "signed" CAB file. Is there any documentation on how it gets packaged up?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.