Namespace
Varianti

std::basic_stringbuf::basic_stringbuf

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

 
 
Ingresso / libreria di output
I / O manipolatori
C-style I / O
Buffer
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(deprecato)
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.
Astrazioni
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
File 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(deprecato)
ostrstream(deprecato)
strstream(deprecato)
Tipi
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
Errore categoria interfaccia
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
Funzioni membro pubbliche
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
Protetto funzioni membro
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 membri funzioni
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)
 
explicit basic_stringbuf(std::ios_base::openmode which = std::ios_base::in
                                                       | std::ios_base::out);
(1)
explicit basic_stringbuf (const std::basic_string<CharT, traits, Allocator>& new_str,

                          std::ios_base::openmode which = std::ios_base::in

                                                        | std::ios_base::out);
(2)
basic_stringbuf(const basic_stringbuf& rhs) = delete;
(3)
basic_stringbuf(basic_stringbuf&& rhs);
(4) (dal C++11)
1)
Costruisce un oggetto std::basic_stringbuf: inizializza la classe base chiamando il costruttore predefinito di std::basic_streambuf, inizializza la sequenza di caratteri con una stringa vuota, e imposta la modalità di which.
Original:
Constructs a std::basic_stringbuf object: initializes the base class by calling the default constructor of std::basic_streambuf, initializes the character sequence with an empty string, and sets the mode to which.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2) .
Original:
Constructs a std::basic_stringbuf object by performing the same initialization as 1), followed by initializing the associated character sequence as if by calling
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
Il costruttore di copia è soppresso; std::basic_stringbuf non è CopyConstructible
Original:
The copy constructor is deleted; std::basic_stringbuf is not CopyConstructible
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
4)
Move-costruisce un oggetto std::basic_stringbuf spostando tutto lo stato da un altro oggetto std::basic_stringbuf rhs, compresa la stringa associata, la modalità di apertura, il locale, e tutto altro stato. Dopo lo spostamento, i sei indicatori di std::basic_streambuf in *this sono garantiti per essere diversi dai puntatori corrispondenti nel mosso-da rhs a meno che nulla.
Original:
Move-constructs a std::basic_stringbuf object by moving all state from another std::basic_stringbuf object rhs, including the associated string, the open mode, the locale, and all other state. After the move, the six pointers of std::basic_streambuf in *this are guaranteed to be different from the corresponding pointers in the moved-from rhs unless null.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Indice

[modifica] Parametri

new_str -
un basic_string utilizzato per inizializzare il buffer
Original:
a basic_string used to initialize the buffer
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rhs -
un altro basic_stringbuf
Original:
another basic_stringbuf
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
mode -
specifica modalità di apertura flusso. E 'tipo di maschera di bit, le seguenti costanti sono definite:
Constant
Original:
Constant
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Explanation
app
cercano alla fine del flusso prima di ogni scrittura
Original:
seek to the end of stream before each write
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
binary
aperto in modalità binaria
Original:
open in binary mode
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
in
aprire per la lettura
Original:
open for reading
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
out
aperto per la scrittura
Original:
open for writing
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
trunc
scartare il contenuto del flusso durante l'apertura
Original:
discard the contents of the stream when opening
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ate
cercano di fine flusso subito dopo aperto
Original:
seek to the end of stream immediately after open
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Original:
specifies stream open mode. It is bitmask type, the following constants are defined:
Constant
Original:
Constant
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Explanation
app
cercano alla fine del flusso prima di ogni scrittura
Original:
seek to the end of stream before each write
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
binary
aperto in modalità binaria
Original:
open in binary mode
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
in
aprire per la lettura
Original:
open for reading
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
out
aperto per la scrittura
Original:
open for writing
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
trunc
scartare il contenuto del flusso durante l'apertura
Original:
discard the contents of the stream when opening
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ate
cercano di fine flusso subito dopo aperto
Original:
seek to the end of stream immediately after open
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica] Note

In genere chiamato dal costruttore di std::basic_stringstream.
Original:
Typically called by the constructor of std::basic_stringstream.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Il livello di supporto per le modalità aperte diverse std::ios_base::in e std::ios_base::out varia tra le implementazioni. C + 11 specifica in modo esplicito il sostegno std::ios_base::ate in str() e in questo costruttore, ma std::ios_base::app, std::ios_base::trunc e std::ios_base::binary hanno effetti diversi su diverse implementazioni.
Original:
The level of support for the open modes other than std::ios_base::in and std::ios_base::out varies among implementations. C++11 explicitly specifies the support for std::ios_base::ate in str() and in this constructor, but std::ios_base::app, std::ios_base::trunc, and std::ios_base::binary have different effects on different implementations.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica] Esempio

Dimostra di chiamare il costruttore di basic_stringbuf direttamente .
Original:
Demonstrates calling the constructor of basic_stringbuf directly.
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()
{
    // default constructor (mode = in|out)
    std::stringbuf buf1;
    buf1.sputc('1');
    std::cout << &buf1 << '\n';
 
    // string constructor in at-end mode (C++11)
    std::stringbuf buf2("test", std::ios_base::in
                              | std::ios_base::out
                              | std::ios_base::ate);
    buf2.sputc('1');
    std::cout << &buf2 << '\n';
 
    // append mode test (results differ among compilers)
    std::stringbuf buf3("test", std::ios_base::in
                              | std::ios_base::out
                              | std::ios_base::app);
    buf3.sputc('1');
    buf3.pubseekpos(1);
    buf3.sputc('2');
    std::cout << &buf3 << '\n';
}

Output:

1
test1
est12 (Sun Studio) 2st1 (GCC)

[modifica] Vedi anche

costruisce il flusso di stringa
Original:
constructs the string stream
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(membro pubblico of std::basic_stringstream funzione) [edit]