Пространства имён
Варианты
Действия

std::match_results::format

Материал из cppreference.com

 
 
Библиотеки регулярных выражений
Классы
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_regex(C++11)
sub_match(C++11)
match_results(C++11)
Алгоритмы
Original:
Algorithms
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_match(C++11)
regex_search(C++11)
regex_replace(C++11)
Итераторы
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_iterator(C++11)
regex_token_iterator(C++11)
Исключения
Original:
Exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_error(C++11)
Черты
Original:
Traits
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_traits(C++11)
Константы
Original:
Constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
syntax_option_type(C++11)
match_flag_type(C++11)
error_type(C++11)
 
std::match_results
Член функций
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.
match_results::match_results
match_results::~match_results
match_results::operator=
match_results::get_allocator
Государство
Original:
State
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
match_results::ready
Элемент доступа
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.
match_results::size
match_results::max_size
match_results::empty
match_results::length
match_results::position
match_results::str
match_results::operator_at
match_results::prefix
match_results::suffix
Итераторы
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
match_results::begin
match_results::cbegin
match_results::end
match_results::cend
Формат
Original:
Format
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
match_results::format
Модификаторы
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
match_results::swap
 
template< class OutputIt >

OutputIter format( OutputIt out,
                   const char_type* fmt_first, const char_type* fmt_last,
                   std::regex_constants::match_flag_type flags =

                       std::regex_constants::format_default ) const;
(1) (начиная с C++11)
template< class OutputIt, class ST, class SA >

OutputIter format( OutputIt out,
                   const basic_string<char_type,ST,SA>& fmt,
                   std::regex_constants::match_flag_type flags =

                       std::regex_constants::format_default ) const;
(2) (начиная с C++11)
template< class ST, class SA >

std::basic_string<char_type,ST,SA>
    format( const std::basic_string<char_type,ST,SA>& fmt,
            std::regex_constants::match_flag_type flags =

                std::regex_constants::format_default ) const;
(3) (начиная с C++11)
string_type format( const char_type* fmt_s,

                    std::regex_constants::match_flag_type flags =

                        std::regex_constants::format_default ) const;
(4) (начиная с C++11)
Копирует заданную последовательность символов формата заменяя каждый спецификатор формата или последовательности бежать, либо с символами она представляет или символов в *this, к которому она относится. Битмаски указанные flags определить, какие описатели формата и управляющие последовательности признаются.
Original:
Copies the given format character sequence replacing each format specifier or escape sequence with either the characters it represents or characters within *this to which it refers to. The bitmasks specified by flags determine which format specifiers and escape sequences are recognized.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Поведение неопределено, если ready() != true.
Original:
The behavior is undefined if ready() != true.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
Последовательность формате характер определяется диапазон [fmt_first, fmt_last). В результате последовательность символов копируется в out.
Original:
The format character sequence is defined by the range [fmt_first, fmt_last). The resulting character sequence is copied to out.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
Последовательность формате характер определяется символов в fmt. В результате последовательность символов копируется в out.
Original:
The format character sequence is defined by the characters in fmt. The resulting character sequence is copied to out.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3-4)
Последовательность формате характер определяется символов в fmt и fmt_s соответственно. В результате последовательность символов копируется в недавно построенном строку, которая возвращается.
Original:
The format character sequence is defined by the characters in fmt and fmt_s respectively. The resulting character sequence is copied to a newly constructed string, which is returned.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Содержание

[править] Параметры

fmt_begin, fmt_end -
указатели на диапазон символов, определяющая последовательность формате характер
Original:
pointers to a range of characters defining the format character sequence
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
fmt -
строка, определяющая последовательность формате характер
Original:
string defining the format character sequence
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
fmt_s -
Указатель на завершающуюся нулем строку символов определении последовательности формате характер
Original:
pointer to a null-terminated character string defining the format character sequence
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
out -
Итератор куда копировать полученную последовательность символов в
Original:
iterator where to copy the resulting character sequence to
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
flags -
битовой маски типа указав, какие описатели формата и управляющие последовательности признается
Original:
bitmask type specifying which format specifiers and escape sequences are recognized
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Требования, накладываемые на типы
-
OutputIt должен соответствовать требованиям OutputIterator.

[править] Возвращаемое значение

1-2) out
3-4)
Недавно построенный строку, содержащую полученную последовательность символов.
Original:
The newly constructed string containing resulting character sequence.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[править] Исключения

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

[править] Пример