Here's some lovely screenshots of the pack utility in action, packing some data for my bomberman clone:
Accessing data in the pack file is easy, the pack reader manages an internal buffer for you, so you can extract files into the buffer, and then just get a BYTE* to the uncompressed data. Here's some sample code:
// Create reader and open the file //IPackReader* pReader = CreateReader();if(!pReader->OpenFile("Data.pak")){ DestroyInstance(pReader); return -1;}// Get a handle (index) to the file //DWORD dwHandle = pReader->GetFileIndex("Data/Test.txt");if(dwHandle == INVALID_PAK_HANDLE){ DestroyInstance(pReader); return -1;}// Get it's length and extract it //DWORD dwLength = pReader->GetFileSize(dwHandle);BYTE* pTempBuff = pReader->ExtractFile(dwHandle);// Do something with the buffer here //// Cleanup //pReader->CloseFile();DestroyInstance(pReader);return 0;
Well, this'll do for now I think. If you want to play around with Fudge Packer, you can Download the dll, lib and header file and give it a go.
Seriously though, that looks pretty neat. You should write a tutorial or something.