473,378 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

rdbuf() stream

What is purpose of rdbuf methode of stream class? Is rdbuf create new
buffer or just return some kind of pointer to existing?

Thanks,
Zaharije Pasalic
Jul 23 '05 #1
2 3180
"Zaharije Pasalic" <za**************@pmf.unsa.ba> wrote in message
news:f8**************************@posting.google.c om...
What is purpose of rdbuf methode of stream class? Is rdbuf create new
buffer or just return some kind of pointer to existing?

A pointer to the existing buffer.

All the stream classes (fstream, stringstream) derive from the
same base class(es) (stream, ostream, etc), without overriding
any virtual functions (except the destructor). However, each
of these subclasses stores internally a different kind of
stream buffer class, which is polymorphic, and decides what
the source/destination of the stream's data should be.
hth -Ivan
--
http://ivan.vecerina.com/contact/?subject=NG_POST <- email contact form
Jul 23 '05 #2
Zaharije Pasalic wrote:
What is purpose of rdbuf methode of stream class? Is rdbuf create new
buffer or just return some kind of pointer to existing?


'rdbuf()' accesses the stream buffer associated with a stream. There
are two overloads for 'rdbuf()', one reading the stream buffer and
one setting it (why it is called "rdbuf" is, however, beyond me).
Stream buffers abstract the character sequence a stream writes to.
--
<mailto:di***********@yahoo.com> <http://www.dietmar-kuehl.de/>
<http://www.contendix.com> - Software Development & Consulting

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bob Smith | last post by:
so is there any alternative ( standard only ) to using in_avail()? I need to poll with given intervals the input stream, and if there is data to be read I want to read it. thank you /B
1
by: wukexin | last post by:
Hi, hot heart men: I have a program in file input and output. I need copy the whole source file's content to a string only once, I don't know what? Help me? thank you. wukexin...
3
by: Omid | last post by:
Hi. I have a piece of code that can be compiled and linked both with Cygwin g++ and with VC++. The code is: //WORKS WITH CYGWIN G++ //BUT NOT WITH CL.EXE (VC++) (compiles, but error when...
4
by: Siemel Naran | last post by:
My compiler (Borland C++) fails to compile this code: ifstream file(filename.c_str()); ostringstream out; file >> out.rdbuf(); with the error in the 3rd line above that: realmain.cpp(83):...
5
by: Alex Vinokur | last post by:
I tried to print cout << "<" << infile.rdbuf() << ">" << endl; while infile is empty. Here is what I have got. < I expected to get <>
8
by: Marc Gravell | last post by:
I want to write a method that will accept a stream as a parameter, and which will write xml to the stream (based in reality on database results) using the XmlTextWriter class. However, this insists...
2
by: kelvSYC | last post by:
Suppose I have something like this: class foo { std::istream in; public: foo(std::istream& in_) : in(in_.rdbuf()); void doStuffWith(std::ostream& out); void bar(); };
0
by: srikar | last post by:
hi In C++ can any one explain me the meaning of this instruction. here line is the object of the class strstream i.e strstream &line line.get( *output.rdbuf(), ' ' );...
0
by: whatdoineed2do | last post by:
hi, i'm trying avoid uncessary copy of data whilst using the stringstream so i am using the sgetn() to copy the data into a buf as apposed to getting the same data via the .str() which will...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.