Espaços nominais
Variantes
Acções

Diferenças entre edições de "cpp/io/basic stringbuf/swap"

Da cppreference.com
< cpp‎ | io‎ | basic stringbuf
m (uma edição: Translate from the English version)
m (Use {{lc}}. Update links. Various fixes.)
 
(Uma edição intermédia de um utilizador não apresentada)
Linha 2: Linha 2:
 
{{cpp/io/basic_stringbuf/title |swap}}
 
{{cpp/io/basic_stringbuf/title |swap}}
 
{{cpp/io/basic_stringbuf/navbar}}
 
{{cpp/io/basic_stringbuf/navbar}}
{{ddcl list begin}}
+
{{begin}}
{{ddcl list item | notes={{mark since c++11}} |
+
{{| =c++11 |
 
void swap( std::basic_stringbuf& rhs )
 
void swap( std::basic_stringbuf& rhs )
 
}}
 
}}
{{ddcl list end}}
+
{{end}}
  
 
{{tr|Trocas do estado e os conteúdos de {{c|*this}} e {{tt|rhs}}.|Swaps the state and the contents of {{c|*this}} and {{tt|rhs}}.}}
 
{{tr|Trocas do estado e os conteúdos de {{c|*this}} e {{tt|rhs}}.|Swaps the state and the contents of {{c|*this}} and {{tt|rhs}}.}}
  
 
===Parâmetros===
 
===Parâmetros===
{{param list begin}}
+
{{begin}}
{{param list item | rhs |{{tr| outro {{tt|basic_stringbuf}} | another {{tt|basic_stringbuf}} }}}}
+
{{| rhs |{{tr| outro {{tt|basic_stringbuf}} | another {{tt|basic_stringbuf}} }}}}
{{param list end}}
+
{{end}}
  
 
===Valor de retorno===
 
===Valor de retorno===
Linha 19: Linha 19:
  
 
===Notas===
 
===Notas===
{{tr|Esta função é chamada automaticamente quando a troca de objetos {{c|std::stringstream}}, raramente é necessário chamá-lo diretamente.|This function is called automatically when swapping {{c|std::stringstream}} objects, it is rarely necessary to call it directly.}}
+
{{tr|Esta função é chamada automaticamente quando a troca de objetos {{|std::stringstream}}, raramente é necessário chamá-lo diretamente.|This function is called automatically when swapping {{|std::stringstream}} objects, it is rarely necessary to call it directly.}}
  
 
===Exemplo===
 
===Exemplo===
Linha 49: Linha 49:
  
 
===Veja também===
 
===Veja também===
{{dcl list begin}}
+
{{begin}}
{{dcl list template | cpp/io/basic_stringbuf/dcl list constructor}}
+
{{| cpp/io/basic_stringbuf/constructor}}
{{dcl list template | cpp/io/basic_stringstream/dcl list swap | basic_stringstream}}
+
{{| cpp/io/basic_stringstream/swap | basic_stringstream}}
{{dcl list end}}
+
{{end}}
 +
 
 +
 +
 +
 +
 +
 +
 +
 +

Edição actual desde as 09h18min de 2 de julho de 2013

 
 
De entrada / saída da biblioteca
I / O manipuladores
C estilo de I / O
Buffers
Original:
Buffers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(obsoleta)
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.
Abstrações
Original:
Abstractions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
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.
Cordas 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.
Matriz de 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.
(obsoleta)
(obsoleta)
(obsoleta)
Tipos
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Interface de categoria de erro
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.
(C++11)
 
std::basic_stringbuf
Membro funções públicas
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
Protegido funções de 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
Não-membros funções
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.
 
void swap( std::basic_stringbuf& rhs )
(desde C++11)
Trocas do estado e os conteúdos de *this e rhs.
Original:
Swaps the state and the contents of *this and rhs.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Índice

[editar] Parâmetros

rhs -
outro 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.

[editar] Valor de retorno

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

[editar] Notas

Esta função é chamada automaticamente quando a troca de objetos std::stringstream, raramente é necessário chamá-lo diretamente.
Original:
This function is called automatically when swapping std::stringstream objects, it is rarely necessary to call it directly.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Exemplo

#include <sstream>
#include <string>
#include <iostream>
 
int main()
{
 
    std::istringstream one("one");
    std::ostringstream two("two");
 
    std::cout << "Before swap, one = \"" << one.str() << '"'
              << " two = \"" << two.str() << "\"\n";
 
    *one.rdbuf()->swap(*two.rdbuf());
 
    std::cout << "Before swap, one = \"" << one.str() << '"'
              << " two = \"" << two.str() << "\"\n";
}

Saída:

Before swap, one = "one" two = "two"
Before swap, one = "two" two = "one"

[editar] Veja também

constrói um objeto basic_stringbuf
Original:
constructs a basic_stringbuf object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(função pública membro) [edit]
(C++11)
swaps two string streams
(of std::basic_stringstream função pública membro) [edit]