istrstream Class

 

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

Describes an object that controls extraction of elements and encoded objects from a stream buffer of class strstreambuf.

class istrstream : public istream

The object stores an object of class strstreambuf.

System_CAPS_ICON_note.jpg Note

This class is deprecated. Consider using istringstream or wistringstream instead.

Constructors

istrstreamConstructs an object of type istrstream.

Member Functions

rdbufReturns a pointer to the stream's associated strstreambuf object.
strCalls freeze, and then returns a pointer to the beginning of the controlled sequence.

Header: <strstream>

Namespace: std

Constructs an object of type istrstream.

explicit istrstream(
    const char* ptr);

explicit istrstream(
    char* ptr);

istrstream(
    const char* ptr,
    streamsize count);

istrstream(
    char* ptr,
    int count);

Parameters

count
The length of the buffer ( ptr).

ptr
The contents with which the buffer is initialized.

Remarks

All the constructors initialize the base class by calling istream( sb), where sb is the stored object of class strstreambuf. The first two constructors also initialize sb by calling strstreambuf( ( constchar *) ptr, 0 ). The remaining two constructors instead call strstreambuf( ( constchar *) ptr, count ).

Returns a pointer to the stream's associated strstreambuf object.

strstreambuf *rdbuf() const

Return Value

A pointer to the stream's associated strstreambuf object.

Remarks

The member function returns the address of the stored stream buffer, of type pointer to strstreambuf.

Example

See strstreambuf::pcount for a sample that uses rdbuf.

Calls freeze, and then returns a pointer to the beginning of the controlled sequence.

char *str();

Return Value

A pointer to the beginning of the controlled sequence.

Remarks

The member function returns rdbuf -> str.

Example

See strstream::str for a sample that uses str.

istream
Thread Safety in the C++ Standard Library
iostream Programming
iostreams Conventions

Show: