Jump to content
  • Advertisement
Sign in to follow this  
Fire Lancer

Easy way to make a new c++ stream

This topic is 3432 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, ive got a C style i/o library for some compressed/encrypted archives which I want to wrap up into a c++ stream. Can someone point me towards instructios on how to do this from the folloing functions. quick break down of the functions I have which look like useful ones
ARCHIVE OpenArchive(char *path);
void    CloseArchive(ARCHIVE a);

ARCHIVE_FILE OpenArchiveFile(ARCHIVE a, char *fileName, unsigned flags=AF_IN);
void         CloseArchiveFile(ARCHIVE_FILE f);
int          ReadArchiveFile (ARCHIVE_FILE f, char *buffer, int size);
int          WriteArchiveFile(ARCHIVE_FILE f, char *buffer, int size);

Theres also some functions for getting the size (uncompressed) of a file, getting an array of all the files in the archive, checking for eof, and other stuff like that. Ive already wrapped the open/close archive upinto a class with refrence counting. I need the c++ streams to then handle the ref counting of the archive they belong to, since closing the archive then trying to use one of the archive files crashes the library.

Share this post


Link to post
Share on other sites
Advertisement
opps, forgot to metion, the people I'm doing this for dont want to use boost for somereason, so I cant do it the same way as before :(

EDIT: I was thinking, could I use the boost way and then wrap it up into a static lib somehow, such that boost isnt needed to use the static lib?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!