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::filebuf</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
filebuf::filebuf

Usage

   #include <fstream.hpp>

   filebuf::filebuf();
   filebuf::filebuf(int file_descriptor);
   filebuf::filebuf(int file_descriptor, char *memory, int
   length);

Description

   The default constructor creates a filebuf with dynamic get and put area
   allocation, and with its associated file descriptor set to EOF, to
   signify that it is unattached.

   The constructor with the file descriptor argument also creates a dynamic
   allocating filebuf, but associates it with the specified file.

   The third constructor creates a filebuf using user specified memory for
   its get and put areas. For efficiency a multiple of 1024 bytes is
   suggested as a buffer size for DOS applications. Larger buffers may be
   appropriate for UNIX systems. As is customary with streambuf derivatives,
   a zero memory pointer or a length less than or equal to zero causes
   unbuffered operation.

Example 

   filebuf fb1;
   filebuf fb2(1)  // suitable for cout
   filebuf(2,0,0)  // unbuffered error output

   char buffer[1024];

   int fd = open(...);

   filebuf fb3(fd, buffer, 1024);





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