xref: /aosp_15_r20/external/cronet/third_party/libc++/src/modules/std/regex.cppm (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10module;
11#include <__config>
12#ifndef _LIBCPP_HAS_NO_LOCALIZATION
13#  include <regex>
14#endif
15
16export module std:regex;
17#ifndef _LIBCPP_HAS_NO_LOCALIZATION
18export namespace std {
19  // [re.const], regex constants
20  namespace regex_constants {
21    using std::regex_constants::error_type;
22    using std::regex_constants::match_flag_type;
23    using std::regex_constants::syntax_option_type;
24
25    // regex_constants is a bitmask type.
26    // [bitmask.types] specified operators
27    using std::regex_constants::operator&;
28    using std::regex_constants::operator&=;
29    using std::regex_constants::operator^;
30    using std::regex_constants::operator^=;
31    using std::regex_constants::operator|;
32    using std::regex_constants::operator|=;
33    using std::regex_constants::operator~;
34
35  } // namespace regex_constants
36
37  // [re.badexp], class regex_error
38  using std::regex_error;
39
40  // [re.traits], class template regex_traits
41  using std::regex_traits;
42
43  // [re.regex], class template basic_regex
44  using std::basic_regex;
45
46  using std::regex;
47#  ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
48  using std::wregex;
49#  endif
50
51  // [re.regex.swap], basic_regex swap
52  using std::swap;
53
54  // [re.submatch], class template sub_match
55  using std::sub_match;
56
57  using std::csub_match;
58  using std::ssub_match;
59#  ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
60  using std::wcsub_match;
61  using std::wssub_match;
62#  endif
63
64  // [re.submatch.op], sub_match non-member operators
65  using std::operator==;
66  using std::operator<=>;
67
68  using std::operator<<;
69
70  // [re.results], class template match_results
71  using std::match_results;
72
73  using std::cmatch;
74  using std::smatch;
75#  ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
76  using std::wcmatch;
77  using std::wsmatch;
78#  endif
79
80  // match_results comparisons
81
82  // [re.results.swap], match_results swap
83
84  // [re.alg.match], function template regex_match
85  using std::regex_match;
86
87  // [re.alg.search], function template regex_search
88  using std::regex_search;
89
90  // [re.alg.replace], function template regex_replace
91  using std::regex_replace;
92
93  // [re.regiter], class template regex_iterator
94  using std::regex_iterator;
95
96  using std::cregex_iterator;
97  using std::sregex_iterator;
98#  ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
99  using std::wcregex_iterator;
100  using std::wsregex_iterator;
101#  endif
102
103  // [re.tokiter], class template regex_token_iterator
104  using std::regex_token_iterator;
105
106  using std::cregex_token_iterator;
107  using std::sregex_token_iterator;
108#  ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
109  using std::wcregex_token_iterator;
110  using std::wsregex_token_iterator;
111#  endif
112
113  namespace pmr {
114    using std::pmr::match_results;
115
116    using std::pmr::cmatch;
117    using std::pmr::smatch;
118#  ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
119    using std::pmr::wcmatch;
120    using std::pmr::wsmatch;
121#  endif
122  } // namespace pmr
123} // namespace std
124#endif // _LIBCPP_HAS_NO_LOCALIZATION
125