streambuf

streambuf

Post by Demetriu » Sat, 14 Aug 1999 04:00:00



Anyone know off hand if there is a call to streambuf (or it's
descendants) to find out how many characters are
currently in the buffer?

thanks
Demetrius

 
 
 

1. Streambuf class change - seekpos method

Hi,

I am currently porting my application from AIX platform to Linux
platform using gcc 3.2. Previously my application code was using
strstream.h and fstream.h header files. But, as we are doing porting
to Linux, we are changing those files to standard header files -
sstream and fstream. But, during conversion I found that
streambuf::seekpos method which was public method in streambuf.h file
now made protected in streambuf. So, my code gives errors while
compiling as code uses seekpos method directly.

Code looks like:
#include <iostream.h>
#include <rw/bstream.h>
#include <fstream.h>
#include <strstream.h>

class FMIClientRegistrationRecord
{
        public:
                dump(int,RWbostream);
                      :
                      :

FMIClientRegistrationRecord::dump(int regTimeOut,
                                  RWbostream& ostrm) const
{
   RWBoolean retCode = TRUE;

   if ( ( !ostrm ) || ( !PregTimer ) )
   {
      retCode = FALSE;
   }
   else
   {
      // seek to beginning of file and update the timeOut value
      // need to convert ostrm to a streambuf to get this method

      streambuf* pTmpStrm =  ostrm.rdbuf();
      if ( pTmpStrm )
      {  
         pTmpStrm->seekpos(0);
         RWbostream tmpBostream( pTmpStrm );
         tmpBostream << PregTimer->timeOut();
         tmpBostream << PgetTimer->timeOut();
      }
      else
      {
      }
    }

The error I am getting is about seekpos is now protected method and
hence can't be accessed directly. So, if you can help me out in
changing the code or some workaround, will be helpful.

Thanks
Ryan

2. KDE2.01: how to make global menu entries ?

3. warnings from streambuf.h

4. mklinux

5. STREAMBUF.H

6. Ghostview reports : Unknown device: x11. Why?

7. Need help with streambuf.h errors in gcc

8. removing ^L^ and ^[[1m and ^[[m from a file

9. IOStream popen() streambuf wrapper class

10. streambuf.h problems

11. How to derive from class streambuf?

12. libg++: Compile error with streambuf.h

13. streambuf.h error in simple compile