Go Back   EQEmulator Home > EQEmulator Forums > Archives > OpenEQ > OpenEQ::Development

OpenEQ::Development Development discussion for OpenEQ. Do not post for support.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-19-2004, 01:45 PM
daeken_bb
Discordant
 
Join Date: Mar 2003
Location: Chambersburg, PA
Posts: 469
Default Finished Archive and PFSLoader classes

Well, after long hours of work on this code, it's finally finished. We now have a complete Archive abstract class and a PFSLoader class that implements it. The Archive class itself does nothing, but it provides the interface that all archived file loaders must implement. The PFSLoader class does the real work, and supports both S3D and EQG files fully (not that there's a difference between them).

Full source is available at http://home.archshadow.com/~daeken/openeq/
The main.cpp file that follows takes 2 arguments, a PFS (s3d or eqg) filename and a filename within that. It prints the contents of the file inside the PFS up until the first null.

Code:
#include <stdio.h>
#include "archive.hpp"
#include "pfs.hpp"

int main(int argc, char **argv) {
  Archive *archive;
  unsigned char *buf;
  int len;

  archive = new PFSLoader();
  archive->Open(fopen(argv[1], "rb"));
  archive->GetFile(argv[2], &buf, &len);
  printf("%s\n", buf);
}
This is also on the site as main.cpp for the time being, though I'll be changing that file as I develop, so I suggest you just use the one provided here.

Happy Hacking,
Lord Daeken M. BlackBlade
(Cody Brocious)
__________________
Keep me unemployed and working on OpenEQ, PM me about donating

Check out my deviantART page at http://daeken.deviantart.com/
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 04:06 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3