std::basic_string
De cppreference.com
[] |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Definido no cabealho <string>
|
||
template< class CharT, class Traits = std::char_traits<CharT>, class Allocator = std::allocator<CharT> > class basic_string; |
||
O modelo de classe
basic_string lojas e manipula seqncias de char-como objetos (ou seja, objetos para que uma especializao de std::char_traits ou classe traos compatvel fornecido). Original:
The class template
basic_string stores and manipulates sequences of char-like objects (that is, objects for which a specialization of std::char_traits or compatible traits class is provided). The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Os elementos de um
basic_string so armazenados de forma contgua, ou seja, para um basic_string s, &*(s.begin() + n) == &*s.begin() + n para qualquer n em [0, s.size()), ou, de modo equivalente, um ponteiro para s[0] podem ser passados para funes que esperam um ponteiro para o primeiro elemento de uma matriz charT[]. (desde C++11)Original:
The elements of a
basic_string are stored contiguously, that is, for a basic_string s, &*(s.begin() + n) == &*s.begin() + n for any n in [0, s.size()), or, equivalently, a pointer to s[0] can be passed to functions that expect a pointer to the first element of a charT[] array. (desde C++11)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Vrias especializaes para tipos de caracteres comuns so fornecidos:
Original:
Several specializations for common character types are provided:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Defined in header
<string> | |
Tipo
Original: Type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
| std::string | std::basic_string<char>
|
| std::wstring | std::basic_string<wchar_t>
|
| std::u16string | std::basic_string<char16_t>
|
| std::u32string | std::basic_string<char32_t>
|
Tipos de membro
Tipo de membro
Original: Member type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
traits_type
|
Traits
|
value_type
|
Traits::char_type
|
allocator_type
|
Allocator
|
size_type
|
Tipo integral sem sinal (geralmente
size_t) Original: Unsigned integral type (usually size_t) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
difference_type
|
tipo inteiro com sinal (geralmente Original: Signed integer type (usually The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. ptrdiff_t)
|
reference
|
Allocator::reference (at C++11)value_type& (desde C++11)
|
const_reference
|
Allocator::const_reference (at C++11)const value_type& (desde C++11)
|
pointer
|
Allocator::pointer (at C++11)std::allocator_traits<Allocator>::pointer (desde C++11)
|
const_pointer
|
Allocator::const_pointer (at C++11)std::allocator_traits<Allocator>::const_pointer (desde C++11)
|
iterator
|
RandomAccessIterator
|
const_iterator
|
Iterador constante acesso aleatrio
Original: Constant random access iterator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
reverse_iterator
|
std::reverse_iterator<iterator>
|
const_reverse_iterator
|
std::reverse_iterator<const_iterator>
|
Funes de membro
constri um basic_string Original: constructs a basic_string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
atribui valores para a cadeia Original: assigns values to the string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
atribuir caracteres para uma string Original: assign characters to a string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
retorna o alocador de associado Original: returns the associated allocator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
Original: Element access The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
acesso de caracteres especificada com verificao de limites Original: access specified character with bounds checking The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
acesso de caracteres especificada Original: access specified character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
(C++11) |
acessa o primeiro caractere Original: accesses the first character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) |
(C++11) |
acessa o ltimo caractere Original: accesses the last character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) |
retorna um ponteiro para o primeiro caractere de uma string Original: returns a pointer to the first character of a string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
retorna um no-modificveis padro C verso matriz de caracteres da cadeia Original: returns a non-modifiable standard C character array version of the string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
Original: Iterators The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
(C++11) |
retorna um iterador para o comeo Original: returns an iterator to the beginning The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) |
(C++11) |
retorna um iterador para o fim Original: returns an iterator to the end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) |
(C++11) |
retorna um iterador inverso ao incio Original: returns a reverse iterator to the beginning The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) |
(C++11) |
retorna um iterador inverso at ao fim Original: returns a reverse iterator to the end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) |
Original: Capacity The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
verifica se a string est vazia Original: checks whether the string is empty The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
| returns the number of characters (funo pblica membro) | |
devolve o nmero mximo de caracteres Original: returns the maximum number of characters The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
As reservas de armazenagem Original: reserves storage The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
retorna o nmero de caracteres que podem ser mantidos em armazenamento atualmente alocado Original: returns the number of characters that can be held in currently allocated storage The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
(C++11) |
reduz o uso de memria, liberando memria no utilizada Original: reduces memory usage by freeing unused memory The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) |
Original: Operations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
apaga o contedo Original: clears the contents The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
insere personagens Original: inserts characters The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
| removes characters (funo pblica membro) | |
acrescenta um carter at o fim Original: appends a character to the end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
(C++11) |
remove o ltimo caractere Original: removes the last character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) |
Acrescenta caracteres at o fim Original: appends characters to the end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
Acrescenta caracteres at o fim Original: appends characters to the end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
compara duas strings Original: compares two strings The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
substitui todas as ocorrncias de caracteres especificados Original: replaces every occurrence of specified characters The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
retorna uma substring Original: returns a substring The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
cpias personagens Original: copies characters The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
altera o nmero de caracteres armazenados Original: changes the number of characters stored The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
Trocar o contedo Original: swaps the contents The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
Original: Search The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
encontrar caracteres na string Original: find characters in the string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
encontrar a ltima ocorrncia de uma substring Original: find the last occurrence of a substring The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
encontrar a primeira ocorrncia de caracteres Original: find first occurrence of characters The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
encontrar primeira ausncia de caracteres Original: find first absence of characters The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
encontrar ltima ocorrncia de caracteres Original: find last occurrence of characters The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
encontrar ausncia de ltima caracteres Original: find last absence of characters The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo pblica membro) | |
Original: Constants The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
[esttica] |
valor especial. O significado exato depende do contexto Original: special value. The exact meaning depends on the context The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (membro esttico pblico constante) |
No-membros funes
concatena duas strings ou uma String e um char Original: concatenates two strings or a string and a char The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de funo) | |
lexicographically compara duas strings Original: lexicographically compares two strings The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de funo) | |
o algoritmo especializado std::swap Original: specializes the std::swap algorithm The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de funo) | |
Original: Input/output The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
executa fluxo de I / O em cordas Original: performs stream I/O on strings The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de funo) | |
ler dados de um fluxo de I / O em uma string Original: read data from an I/O stream into a string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo) | |
Original: Numeric conversions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
(C++11) (C++11) (C++11) |
converte uma string para um inteiro assinado Original: converts a string to an signed integer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo) |
(C++11) (C++11) |
converte uma string para um inteiro sem sinal Original: converts a string to an unsigned integer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo) |
(C++11) (C++11) (C++11) |
converte uma string para um valor de ponto flutuante Original: converts a string to an floating point value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo) |
(C++11) |
converte um valor de ponto flutuante para integral ou string Original: converts an integral or floating point value to string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo) |
(C++11) |
converte um valor de ponto flutuante para integral ou wstring Original: converts an integral or floating point value to wstring The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funo) |
Classes auxiliares
(C++11) (C++11) (C++11) (C++11) |
apoio de hash para strings Original: hash support for strings The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (especializao modelo. classe) |