[Kde-games-devel] Create file archives with Qt/kdelibs
Andreas Pakulat
apaku at gmx.de
Fri May 16 08:24:33 CEST 2008
On 16.05.08 01:24:12, Andreas Beckermann wrote:
> On Thursday 15 May 2008, Stefan Majewsky wrote:
> > Am Donnerstag 15 Mai 2008 23:27:29 schrieb Andreas Pakulat:
> > > If we're talking about code, then there's KArchive and its subclasses in
> > > kdelibs. You can read and write from/to tar.bz2, tar.gz, .zip and even
> > > .ar in case you need that. Its all in kdelibs/kio, api docs are here:
> > > http://api.kde.org/4.x-api/kdelibs-apidocs/kio/html/classKArchive.html
> >
> > Thank you for the hint. I already scanned the apidocs but seem to have
> > missed it.
> >
> > Stefan
>
> Hi
> I second that recommendation of KArchive for this kind of thing.
> We've been using KTar in Boson for our file format(s) for ages, see
> http://boson.svn.sourceforge.net/viewvc/boson/branches/qt4/code/boson/gameengine/bofile.h?revision=8016&view=markup
> for sample use. Note however that the API changed slightly in KDE4 and this is
> only a quick port.
>
> There's a huge advantage that comes with using .tar.gz files: not only can you
> easily write code to read them, but you also can untar them manually whenever
> you need to, which comes in very handy occasionally.
There's one downside as well, depending on how you create the files in
the first place. If you have your game data checked into svn as source
files, you probably want to pack them up as .tar.gz during building your
project. Thats unfortunately not portable, if you use the standard
tar/gzip tools, because those don't exist in a usable fashion on win32.
In KDevelop we "work around" this problem by allowing our
project-template-archives to be either .tar.gz or .zip, independent of
the platform that it currently runs on. And the buildsystem rules for
packaging the project templates use a zip-tool on win32 and tar on any
other platform.
Andreas
--
Good day for a change of scene. Repaper the bedroom wall.
More information about the kde-games-devel
mailing list