Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>filebuf::seekpos</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
filebuf::seekpos

Usage

   #include <filebuf.hpp>
   virtual streampos filebuf::seekpos(streampos,
                                      int mode = ios::in|ios::out);

Description

   Moves the file currency (file pointer), and adjusts the contents of the
   get and put areas so that any subsequent put or get will effectively be
   to the specified position in the file. Remember, in a filebuf the get and
   put pointers are tied - they are effectively the same. For this reason,
   the mode argument is ignored.

   The streampos values should be regarded as fixed. Values provided by the
   seekpos and seekoff functions can subsequently be used as an argument to
   the seekpos function, but should not be modified. However, streampos(0)
   and streampos(EOF) are special cases. The former may safely be used as an
   argument to seekpos, and the latter is returned by seekpos if an error
   occurs.

   The seekpos function will do nothing but return an error value if the
   file does not report seeking.

Example 

   filebuf fb;

   fb.open(...);
   ...;
   streampos newpos = fb.seekpos(0);
   // position at start of file

   // Also see function seekoff

Return Value

   A value of type streampos that indicates the current file pointer
   position.





Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson