std::basic_string
Da 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.  | 
|   Defined in header <string>
   | 
||
|   template<      class CharT,   | 
||
O modelo de classe 
basic_string lojas e manipula seqüências de char-como objetos (ou seja, objetos para que uma especialização de std::char_traits ou classe traços compatível é 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 são armazenados de forma contígua, 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 funções que esperam um ponteiro para o primeiro elemento de uma matriz charT[]. (a partir do 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. (a partir do 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.
Várias especializações para tipos de caracteres comuns são 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> | 
[editar] 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
 | 
Signed integer type (usually ptrdiff_t) | 
  reference
 | 
  Allocator::reference (até C + 11)value_type& (a partir do C++ 11) 
 | 
  const_reference
 | 
  Allocator::const_reference (até C + 11)const value_type& (a partir do C++ 11) 
 | 
  pointer
 | 
  Allocator::pointer (até C + 11)std::allocator_traits<Allocator>::pointer (a partir do C++ 11)  | 
  const_pointer
 | 
  Allocator::const_pointer (até C + 11) std::allocator_traits<Allocator>::const_pointer (a partir do C++ 11)  | 
  iterator
 | 
  RandomAccessIterator 
 | 
  const_iterator
 | 
   Iterador constante acesso aleatório  
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> | 
[editar] Funções de membro
|     constrói 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. (função pública 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. (função pública 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. (função pública 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. (função pública 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 verificação 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. (função pública 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. (função pública 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. (função pública 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. (função pública 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. (função pública membro)  | |
|     retorna um não-modificáveis padrão C versão 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. (função pública 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 começo   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. (função pública 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. (função pública membro)  | 
|    (C++11)  | 
    retorna um iterador inverso ao início   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. (função pública 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. (função pública 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. (função pública membro)  | |
|    returns the number of characters   (função pública membro)  | |
|     devolve o número máximo 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. (função pública 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. (função pública membro)  | |
|     retorna o número 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. (função pública membro)  | |
|    (C++11)  | 
    reduz o uso de memória, liberando memória não 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. (função pública 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 conteúdo  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. (função pública 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. (função pública membro)  | |
|    removes characters   (função pública membro)  | |
|     acrescenta um caráter 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. (função pública 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. (função pública 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. (função pública 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. (função pública 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. (função pública membro)  | |
|     substitui todas as ocorrências 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. (função pública 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. (função pública membro)  | |
|     cópias 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. (função pública membro)  | |
|     altera o número 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. (função pública membro)  | |
|     Trocar o conteúdo   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. (função pública 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. (função pública membro)  | |
|     encontrar a última ocorrência 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. (função pública membro)  | |
|     encontrar a primeira ocorrência 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. (função pública membro)  | |
|     encontrar primeira ausência 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. (função pública membro)  | |
|     encontrar última ocorrência 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. (função pública membro)  | |
|     encontrar ausência 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. (função pública 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.  | |
|    [estática]  | 
    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 estático público constante)  | 
[editar] Não-membros funções
|     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 função)  | |
|     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 função)  | |
|     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 função)  | |
   
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 função)  | |
|     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. (função)  | |
   
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. (função)  | 
|    (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. (função)  | 
|    (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. (função)  | 
|    (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. (função)  | 
|    (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. (função)  | 
[editar] 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. (especialização modelo. classe)  |