Espaços nominais
Variantes
Acções

std::collate

Da cppreference.com
< cpp‎ | locale

 
 
Biblioteca localizações
Localidades e facetas
Original:
Locales and facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
locale
Classificação de caracteres
Original:
Character classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Conversões
Original:
Conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Facet classes base da categoria
Original:
Facet category base classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Categorias faceta
Original:
Facet categories
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Específicos da localidade facetas
Original:
Locale-specific facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Facetas de conversão de código
Original:
Code conversion facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
codecvt_utf8(C++11)
codecvt_utf16(C++11)
C localidade
Original:
C locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
std::collate
Funções de membro
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
collate::collate
collate::~collate
collate::compare
collate::do_compare
collate::transform
collate::do_transform
collate::hash
collate::do_hash
 
Defined in header <locale>
template< class CharT >
class collate;
Classe std::collate encapsula agrupamento localidade específica (comparação) e hash de strings. Esta faceta é usado por std::basic_regex e podem ser aplicadas, por meio de std::locale::operator(), directamente a todos os algoritmos padrão que esperar um predicado comparação de cadeia.
Original:
Class std::collate encapsulates locale-specific collation (comparison) and hashing of strings. This facet is used by std::basic_regex and can be applied, by means of std::locale::operator(), directly to all standard algorithms that expect a string comparison predicate.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cpp/locale/locale/facetstd-collate-inheritance.svg
Sobre esta imagem

Inheritance diagram

Duas especializações são fornecidos pela biblioteca padrão e são implementadas por todos os objetos localidade criado em um programa em C + +:
Original:
Two specializations are provided by the standard library and are implemented by all locale objects created in a C++ program:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Defined in header <locale>
std::collate<char>
implementos lexicográfica ordenação de cadeias de bytes
Original:
implements lexicographical ordering of byte strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::collate<wchar_t>
implementos lexicográfica ordenação de seqüências de largura
Original:
implements lexicographical ordering of wide strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Índice

[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
char_type charT
string_type std::basic_string<charT>

[editar] Funções de membro

constrói uma faceta nova de agrupamento
Original:
constructs a new collate facet
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)
destrói uma faceta de agrupamento
Original:
destructs a collate facet
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(protegido função de membro)
Invoca do_compare
Original:
invokes do_compare
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]
Invoca do_transform
Original:
invokes do_transform
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]
Invoca do_hash
Original:
invokes do_hash
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]

[editar] Objetos Membros

static std::locale::id id
' ID da localidade
Original:
id of the locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(objeto membro público)

[editar] Protegido funções de membro

[virtual]
compara duas seqüências usando as regras esta faceta do agrupamento
Original:
compares two strings using this facet's collation rules
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(virtual protegido função de membro) [edit]
[virtual]
transforma uma cadeia de caracteres de modo a que agrupamento pode ser substituído por comparação
Original:
transforms a string so that collation can be replaced by comparison
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(virtual protegido função de membro) [edit]
[virtual]
gera um valor hash inteiro usando as regras esta faceta do agrupamento
Original:
generates an integer hash value using this facet's collation rules
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(virtual protegido função de membro) [edit]

[editar] Exemplo

#include <locale>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
int main()
{
    std::wcout.imbue(std::locale(""));
    std::vector<std::wstring> v = {L"ar", L"zebra", L"\u00f6grupp", L"Zebra", L"\u00e4ngel",
                                   L"\u00e5r", L"f\u00f6rnamn"};
 
    std::wcout << "Default locale collation order: ";
    std::sort(v.begin(), v.end());
    for(auto s : v) std::wcout << s << ' '; std::wcout << '\n';
 
    std::wcout << "English locale collation order: ";
    std::sort(v.begin(), v.end(), std::locale("en_US.UTF-8"));
    for(auto s : v) std::wcout << s << ' '; std::wcout << '\n';
 
    std::wcout << "Swedish locale collation order: ";
    std::sort(v.begin(), v.end(), std::locale("sv_SE.UTF-8"));
    for(auto s : v) std::wcout << s << ' '; std::wcout << '\n';
}

Output:

Default locale collation order: Zebra ar förnamn zebra ängel år ögrupp
English locale collation order: ängel ar år förnamn ögrupp zebra Zebra
Swedish locale collation order: ar förnamn zebra Zebra år ängel ögrupp

[editar] Veja também

lexicographically compares two strings using this locale's collate facet
(of std::locale função pública membro) [edit]
cria uma faceta de agrupamento para a localidade chamada
Original:
creates a collate facet for the named locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)