Jump to content
  • Advertisement
Sign in to follow this  
tonymontana

Making your own stream objects

This topic is 4501 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

I am thinking of making my own stream object.That object will use Platform specific codes (WINAPI for windows ...) to write binary code to a file(harddisk).it will have its own buffer overflow mechanism ,flush() vb..functions and features.(for example; my stream object will manage when it will flush from buffer to harrdisk , i want to create a stream object that will only flush one time (it will store big amount of data and then writes this at once..) Is there a tutorial for that ? or how can i find source for this? Also one last question is how can implement this platform-independent?

Share this post


Link to post
Share on other sites
Advertisement
If you're using C++, what you want to do is derive from std::streambuf (not std::iostream and its cousins). You replace the streambuf in a regular stream using the rdbuf() member function.

Google for streambuf to find a tutorial, or get the Langer and Kreft book.

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!