Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

Boost.Locale: boost::locale::collator< CharType > Class Template Reference

Boost , ,

boost::locale::collator< CharType > Class Template Referenceabstract

Сравнительный аспект.Больше...

<#include <boost/locale/collator.hpp>>

Inheritance diagram for boost::locale::collator< CharType >:
boost::locale::collator_base

Public Types

typedef CharType char_type
 
typedef std::basic_string
< CharType > 
string_type
 
- Public Types inherited from boost::locale::collator_base
enum  level_type {
  primary = 0, secondary = 1, tertiary = 2, quaternary = 3,
  identical = 4
}
 

Public Member Functions

int compare (level_type level, char_type const *b1, char_type const *e1, char_type const *b2, char_type const *e2) const
 
string_type transform (level_type level, char_type const *b, char_type const *e) const
 
long hash (level_type level, char_type const *b, char_type const *e) const
 
int compare (level_type level, string_type const &l, string_type const &r) const
 
long hash (level_type level, string_type const &s) const
 
string_type transform (level_type level, string_type const &s) const
 

Protected Member Functions

 collator (size_t refs=0)
 
virtual int do_compare (char_type const *b1, char_type const *e1, char_type const *b2, char_type const *e2) const
 
virtual string_type do_transform (char_type const *b, char_type const *e) const
 
virtual long do_hash (char_type const *b, char_type const *e) const
 
virtual int do_compare (level_type level, char_type const *b1, char_type const *e1, char_type const *b2, char_type const *e2) const =0
 
virtual string_type do_transform (level_type level, char_type const *b, char_type const *e) const =0
 
virtual long do_hash (level_type level, char_type const *b, char_type const *e) const =0
 

Detailed Description

template<typename CharType>
class boost::locale::collator< CharType >

Сравнительный аспект.

Он реализовывает стандартный C++ std::collate, позволяя использовать std::locale для прямого сравнения строк.

Member Typedef Documentation

template<typename CharType >
typedef CharType boost::locale::collator< CharType >::char_type

Тип основного персонажа

template<typename CharType >
typedef std::basic_string<CharType> boost::locale::collator< CharType >::string_type

Тип струны, используемой с этой гранью

Constructor & Destructor Documentation

template<typename CharType >
boost::locale::collator< CharType >::collator ( size_t  refs = 0)
inlineprotected

Конструктор объекта коллатора

Member Function Documentation

template<typename CharType >
int boost::locale::collator< CharType >::compare ( level_type  level,
char_type const *  b1,
char_type const *  e1,
char_type const *  b2,
char_type const *  e2 
) конст
inline

Сравните две строки в ярости [b1,e1), [b2,e2) с использованием уровня коллации. Вызовы do_compare

Возвращается -1, если первая из двух струн сортируется до секунды, возвращается 1, если сортируется после и 0, если они считаются равными.

template<typename CharType >
int boost::locale::collator< CharType >::compare ( level_type  level,
string_type const &  l,
string_type const &  r 
) конст
inline

Сравнить две струныlиrс использованием уровня коллацииуровень

Возвращается -1, если первая из двух струн сортируется до секунды, возвращается 1, если сортируется после и 0, если они считаются равными.

template<typename CharType >
virtual int boost::locale::collator< CharType >::do_compare ( char_type const *  b1,
char_type const *  e1,
char_type const *  b2,
char_type const *  e2 
) конст
inlineprotectedvirtual

Эта функция используется для переопределения функции коллаций по умолчанию, которая не учитывает уровень коллаций. Использует первичный уровень

template<typename CharType >
virtual int boost::locale::collator< CharType >::do_compare ( level_type  level,
char_type const *  b1,
char_type const *  e1,
char_type const *  b2,
char_type const *  e2 
) конст
protectedpure virtual

Функция, которая выполняет сравнение между строками. Подробности см. в функции сравнения. Можно переборщить.

template<typename CharType >
virtual long boost::locale::collator< CharType >::do_hash ( char_type const *  b,
char_type const *  e 
) конст
inlineprotectedvirtual

Эта функция используется для переопределения функции коллаций по умолчанию, которая не учитывает уровень коллаций. Использует первичный уровень

template<typename CharType >
virtual long boost::locale::collator< CharType >::do_hash ( level_type  level,
char_type const *  b,
char_type const *  e 
) конст
protectedpure virtual

Функция, которая вычисляет хеш. Подробнее см. Функция хеш-члена. Можно переборщить.

template<typename CharType >
virtual string_type boost::locale::collator< CharType >::do_transform ( char_type const *  b,
char_type const *  e 
) конст
inlineprotectedvirtual

Эта функция используется для переопределения функции коллаций по умолчанию, которая не учитывает уровень коллаций. Использует первичный уровень

template<typename CharType >
virtual string_type boost::locale::collator< CharType >::do_transform ( level_type  level,
char_type const *  b,
char_type const *  e 
) конст
protectedpure virtual

Функция, которая выполняет трансформацию. Подробнее см. Функция трансформатора. Можно переборщить.

template<typename CharType >
long boost::locale::collator< CharType >::hash ( level_type  level,
char_type const *  b,
char_type const *  e 
) конст
inline

Вычислите хэш текста в диапазоне [b,e]. Значение может быть использовано для сравнения чувствительных струн.

Если сравнивать (уровень,b1,e1,b2,e2) == 0, то хеш (уровень,b1,e1) == хеш (уровень,b2,e2)

Обсуждение Do_hash

template<typename CharType >
long boost::locale::collator< CharType >::hash ( level_type  level,
string_type const &  s 
) конст
inline

Вычислите хеш, который может быть использован для сравнения чувствительной струны струныs

Если сравнить (уровень, s1, s2) == 0, то хеш(уровень, s1) == хеш(уровень, s2)

template<typename CharType >
string_type boost::locale::collator< CharType >::transform ( level_type  level,
char_type const *  b,
char_type const *  e 
) конст
inline

Создайте двоичную строку, которую можно сравнить с другой, чтобы получить порядок коллаций. Строка создана для текста в диапазоне [b,e]. Полезно для сопоставления нескольких строк для текста.

Трансформация осуществляется по следующим правилам:

compare(level,b1,e1,b2,e2) == sign( transform(level,b1,e1).compare(transform(level,b2,e2)) );

Звонки do_transform

template<typename CharType >
string_type boost::locale::collator< CharType >::transform ( level_type  level,
string_type const &  s 
) конст
inline

Создайте двоичную строку из строкиs, которую можно сравнить с другой, полезной для сопоставления нескольких строк.

Трансформация осуществляется по следующим правилам:

compare(level,s1,s2) == sign( transform(level,s1).compare(transform(level,s2)) );

The documentation for this class was generated from the following file:

Статья Boost.Locale: boost::locale::collator< CharType > Class Template Reference раздела может быть полезна для разработчиков на c++ и boost.




Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



:: Главная :: ::


реклама


©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
Top.Mail.Ru

Время компиляции файла: 2024-08-30 11:47:00
2025-05-20 07:34:11/0.0091948509216309/1