A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/replace__impl_8hpp_source.html below:

NCBI C++ ToolKit: include/util/regexp/ctre/replace_impl.hpp Source File

1 #ifndef UTIL__REGEXP_CTRE_REPLACE_IMPL_HPP 2 #define UTIL__REGEXP_CTRE_REPLACE_IMPL_HPP 41 #include <string_view> 42 #include <type_traits> 45 #if __cpp_nontype_template_args > 201411L 46  #define ct_fixed_string_input_param ::ct::fixed_string 48  #define ct_fixed_string_input_param const auto& 71 template

<

typename

_CharType,

size_t

N>

74 template

<

typename

_CharType,

size_t

N>

79 template

<

typename

_CharType,

size_t

N>

93 template

<

typename

_CharType,

size_t

N>

131  template

<

size_t

len>

132

constexpr

auto extract_string

(

size_t

begin, std::integral_constant<size_t, len>)

const 148  template

<

size_t

...Is>

152

std::array<_CharType,

sizeof

...(Is)>

arr

= {_CharType(

m_parsed

[begin + Is].detail) ... };

159  size_t

pos_output = 0;

160  size_t

pos_input = 0;

162  while

( pos_input <

input

.size() )

164

_CharType next_c =

input

[pos_input++];

165  if

(pos_input ==

input

.size() && (next_c ==

'$' or

next_c ==

'\\'

)) {

171  if

(next_c ==

'$'

) {

176  if

(next_c ==

'\\'

) {

188  for

(

size_t i

= 0;

i

<

len

; ++

i

) {

189

next_c =

input

[pos_input +

i

- 1];

201

_CharType current =

input

[dollar_pos];

203

_CharType need_braces = 0;

226  if

(current < '0' || current >

'9'

)

231  size_t

_begin = dollar_pos;

233  size_t

_end = _begin;

236  while

(_end <

input

.size() &&

input

[_end] != need_braces)

239  while

(_end <

input

.size() &&

input

[_end]>=

'0'

&&

input

[_end]<=

'9'

)

243  if

((_end ==

input

.size() && need_braces) || _begin == _end)

246  int

group_number = -1;

247  if

(need_braces == 0 || need_braces ==

'}'

)

250  if

(need_braces && group_number < 0) {

252  size_t

_len = _end - _begin;

259  if

(need_braces == 0)

270  if

(_end - _begin > 4)

275  while

(_begin != _end) {

276  int

c =

input

[_begin++];

278  if

(c < '0' || c >

'9'

)

301 template

<

typename

_CharType,

size_t

N>

303 template

<

typename

_CharType,

size_t

N>

306 template

<

typename

_CharType,

size_t

N>

312 template

<

typename

_CharType,

size_t

N, const compiled_regex<_CharType, N>& compiled>

317  if

constexpr (compiled.real_size() == 0) {

321  return

x_build_next_action<0>(std::make_tuple());

325  template

<

size_t

begin,

typename

...TArgs>

328  if

constexpr (begin >= compiled.real_size()) {

336 #if __cpp_nontype_template_args > 201411L 337

constexpr

size_t len

=

cmd

.detail;

340  auto

newcode = std::make_tuple(op);

341  auto

res = std::tuple_cat(tup, newcode);

342  return

x_build_next_action<begin+1+len>(res);

344

static_assert(__cpp_nontype_template_args <= 201411L,

"group names are only allowed with C++-20 enabled"

);

349

constexpr

size_t

next_end = compiled.find_end_string(begin);

350  auto

newcode = std::make_tuple(compiled.extract_string(begin, std::integral_constant<size_t, next_end-begin>{}));

351  auto

res = std::tuple_cat(tup, newcode);

352  return

x_build_next_action<next_end>(res);

356  auto

res = std::tuple_cat(tup, newcode);

357  return

x_build_next_action<begin+1>(res);

359  if

constexpr (ct::inline_bitset<

364  auto

newcode = std::make_tuple(

cmd

.cmd);

365  auto

res = std::tuple_cat(tup, newcode);

366  return

x_build_next_action<begin+1>(res);

375 template

<ct_fixed_

string

_input_param input>

380

static_assert (

compiled

.error_pos() == 0);

384 template

<ct_fixed_

string

_input_param input>

402 template

<ct_fixed_

string

_input_param input>

421  static

constexpr

auto runtime

= build_replace_runtime_actions<input>();

425

static_assert(

size

>0);

430  return

build_replace_runtime_actions<input>();

436  template

<

typename

_Context,

typename

...TArgs>

439

x_apply_all<0>(

ctx

,

out

);

442  template

<

typename

_Context,

size_t

N = 0>

445

std::basic_string_view subst = x_get_substitute<N>(

ctx

,

runtime

);

451  template

<

size_t N

,

typename

_Context,

typename

...TArgs>

454  if

constexpr (

N

<

size

)

456

constexpr

const auto

& op = std::get<N>(

runtime

);

457

std::basic_string_view<char_type> subst = x_get_substitute<N>(

ctx

, op);

459

x_apply_all<N+1>(

ctx

,

out

);

463  template

<

size_t

pos,

typename

_Context,

typename

...TArgs>

466

constexpr

const auto

&

cmd

= std::get<pos>(

runtime

);

467  return

x_get_substitute<pos>(

ctx

,

cmd

);

470  template

<

size_t

pos,

size_t

N,

typename

_Context>

476  template

<

size_t

pos,

size_t

N,

typename

_Context>

479

constexpr

const auto

&

cmd

= std::get<pos>(

runtime

);

482  return ctx

.template get<

cmd

.m_name>();

485  template

<

size_t

pos,

typename

_Context>

491  return ctx

.template get<

cmd

.m_number>();

494  template

<

size_t

pos,

typename

_Context>

500  return

std::basic_string_view<char_type>(

ctx

.begin,

ctx

.matched.begin());

503  return

std::basic_string_view<char_type>(

ctx

.matched.end(),

ctx

.end);

506  return

std::basic_string_view<char_type>(

ctx

.begin,

ctx

.end);

509  return

std::basic_string_view<char_type>{};

512  return

std::basic_string_view<char_type>{};

517 template

<

typename

_Input,

typename

= _Input>

520 template

<

typename

...TArgs>

526 template

<

typename

_T>

529 template

<

typename

...TArgs>

535 template

<

typename

_Input>

549  using view_type

= std::basic_string_view<typename output_type::value_type, typename output_type::traits_type>;

551

static_assert(std::is_same_v<_Input, output_type> || std::is_constructible_v<output_type, _Input>);

574  template

<

typename

_T=_Input,

typename

= std::enable_if_t<std::is_constructible_v<output_type, const _T&>, _T>>

600  template

<

typename

_Change,

typename

= std::enable_if_t<std::is_assignable_v<output_type, _Change>>>

603  m_modified

= std::forward<_Change>(new_value);

612 template

<

typename

...TArgs>

615 template

<

typename

...TArgs>

618 template

<

typename

...TArgs>

621 template

<

typename

_CharType>

typename std::decay_t< decltype(input)>::char_type char_type

static void apply_all(_Context &ctx, std::basic_string< char_type, TArgs... > &out)

static auto x_get_substitute(_Context &, const ct::fixed_string< char_type, N > &s)

static auto x_get_substitute(const _Context &ctx, const e_action &)

static auto x_get_substitute(_Context &ctx, const std::tuple< TArgs... > &)

static void x_apply_all(_Context &ctx, std::basic_string< char_type, TArgs... > &out)

static auto x_get_substitute(_Context &ctx, const group_name_op< char_type, N > &)

static constexpr size_t size

static auto x_get_substitute(const _Context &ctx, const group_number_op &)

static auto get_substitute(_Context &ctx)

static constexpr auto runtime

static constexpr bool is_single_action

constexpr const parsed_str_type & parsed() const

static constexpr int x_try_parse_number(const input_array_type &input, size_t _begin, size_t _end)

constexpr size_t error_pos() const

constexpr size_t find_end_string(size_t begin) const

constexpr size_t real_size() const

static constexpr action_type x_parse_slash(_CharType c)

constexpr const action_type & operator[](size_t i) const

std::array< action_type, N > parsed_str_type

constexpr compiled_regex()=default

constexpr compiled_regex(const input_array_type &input)

constexpr auto x_extract_string(size_t begin, std::index_sequence< Is... >) const -> ct::fixed_string< _CharType, sizeof...(Is)>

constexpr void x_parse(const input_array_type &input)

static constexpr action_type x_parse_dollar(const input_array_type &input, size_t &dollar_pos)

constexpr auto extract_string(size_t begin, std::integral_constant< size_t, len >) const -> ct::fixed_string< _CharType, len >

compiled_regex(int, const _CharType(&input)[N+1])

const output_type & cref_type

mutable_string(mutable_string &&)=default

std::optional< output_type > m_modified

typename DeduceMutableString< _Input >::output_type output_type

mutable_string & operator=(mutable_string &&)=default

bool operator==(const _T &v) const

std::basic_string_view< typename output_type::value_type, typename output_type::traits_type > view_type

mutable_string(const mutable_string &)=default

mutable_string & operator=(const mutable_string &)=default

view_type to_view() const

mutable_string(input_type orig)

mutable_string & operator=(_Change &&new_value)

static vector< string > arr

std::ofstream out("events_result.xml")

main entry point for tests

#define test(a, b, c, d, e)

static DLIST_TYPE *DLIST_NAME() next(DLIST_LIST_TYPE *list, DLIST_TYPE *item)

where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is orig

constexpr auto build_replace_runtime_actions()

mutable_string(const std::basic_string_view< TArgs... > &) -> mutable_string< std::basic_string_view< TArgs... >>

group_name_op(ct::fixed_string< _CharType, N >) -> group_name_op< _CharType, N >

compiled_regex(const _CharType(&)[N]) -> compiled_regex< _CharType, N-1 >

string_type::value_type char_type

The character type used by the parser.

const GenericPointer< typename T::ValueType > T2 value

static SLJIT_INLINE sljit_ins or(sljit_gpr dst, sljit_gpr src)

constexpr auto to_view() const -> std::basic_string_view< _CharType >

std::basic_string< TArgs... > output_type

std::basic_string< TArgs... > output_type

static constexpr auto build()

static constexpr auto x_build_next_action(const std::tuple< TArgs... > &tup)

static constexpr auto compiled

ct::fixed_string< _CharType, N > m_name


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4