Namensräume
Varianten
Aktionen

std::basic_stringbuf::setbuf

Aus cppreference.com
< cpp‎ | io‎ | basic stringbuf

 
 
Input / Output-Bibliothek
I / O-Manipulatoren
C-style I / O
Puffern
Original:
Buffers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_streambuf
basic_filebuf
basic_stringbuf
strstreambuf(veraltet)
Streams
Original:
Streams
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Abstraktionen
Original:
Abstractions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ios_base
basic_ios
basic_istream
basic_ostream
basic_iostream
Datei-I / O
Original:
File I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_ifstream
basic_ofstream
basic_fstream
String I / O
Original:
String I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_istringstream
basic_ostringstream
basic_stringstream
Array I / O
Original:
Array I/O
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
istrstream(veraltet)
ostrstream(veraltet)
strstream(veraltet)
Types
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
streamoff
streamsize
fpos
Fehler Kategorie Schnittstelle
Original:
Error category interface
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
iostream_category(C++11)
io_errc(C++11)
 
std::basic_stringbuf
Öffentliche Member-Funktionen
Original:
Public member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_stringbuf::basic_stringbuf
basic_stringbuf::operator=(C++11)
basic_stringbuf::swap(C++11)
basic_stringbuf::str
Geschützt Member-Funktionen
Original:
Protected member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_stringbuf::underflow
basic_stringbuf::pbackfail
basic_stringbuf::overflow
basic_stringbuf::setbuf
basic_stringbuf::seekoff
basic_stringbuf::seekpos
Non-Member-Funktionen
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap(std::basic_stringbuf)(C++11)
 
protected:
virtual std::basic_streambuf<CharT, Traits>* setbuf( char_type* s, std::streamsize n )
Wenn s ein NULL-Zeiger ist und n Null ist, hat diese Funktion keine Wirkung .
Original:
If s is a null pointer and n is zero, this function has no effect.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Ansonsten ist die Wirkung Implementierung definiert: einige Implementierungen nichts tun, während einige Implementierungen deaktivieren std::string Mitglied derzeit als Puffer verwendet und beginnen mit dem Benutzer gelieferten Zeichen Array der Größe n, deren erstes Element ist, um durch s hingewiesen, da die Puffer und der Eingabe / Ausgabe-Zeichenfolge .
Original:
Otherwise, the effect is implementation-defined: some implementations do nothing, while some implementations clear the std::string member currently used as the buffer and begin using the user-supplied character array of size n, whose first element is pointed to by s, as the buffer and the input/output character sequence.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Diese Funktion geschützt ist virtuell, kann es nur durch pubsetbuf() oder von Elementfunktionen einer benutzerdefinierten Klasse von std::basic_stringbuf abgeleitet aufgerufen werden .
Original:
This function is protected virtual, it may only be called through pubsetbuf() or from member functions of a user-defined class derived from std::basic_stringbuf.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Inhaltsverzeichnis

[Bearbeiten] Parameter

s -
Zeiger auf das erste Byte in der vom Benutzer bereitgestellten Puffer oder null
Original:
pointer to the first byte in the user-provided buffer or null
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
n -
die Anzahl von Bytes in dem Benutzer bereitgestellten Puffer oder Null
Original:
the number of bytes in the user-provided buffer or zero
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Rückgabewert

*this, auf die Basisklasse std::basic_streambuf geworfen .
Original:
*this, cast to the base class std::basic_streambuf.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Notes

Die veraltete Strompuffers std::strstreambuf oder boost.IOStreams Gerät boost::basic_array kann zur Implementierung I / O Puffer über einen vom Benutzer bereitgestellten char-Array in tragbaren Weise werden .
Original:
The deprecated stream buffer std::strstreambuf or the boost.IOStreams device boost::basic_array may be used to implement I/O buffering over a user-provided char array in portable manner.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Beispiel

Test für die stringstream die setbuf Funktionalität
Original:
Test for the stringstream's setbuf functionality
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

#include <iostream>
#include <sstream>
int main()
{
    std::ostringstream ss;
    char c[1024] = {};
    ss.rdbuf()->pubsetbuf(c, 1024);
    ss << 3.14 << '\n';
    std::cout << c << '\n';
}

Output:

3.14 (on GNU g++/libstdc++ and SunPro C++/roguewave)
<nothing> (on MS Visual Studio 2010, SunPro C++/stlport4, CLang++/libc++)

[Bearbeiten] Siehe auch

Beruft setbuf()
Original:
invokes setbuf()
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(öffentliche Elementfunktion of std::basic_streambuf) [edit]