MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / ParseFlags

Method ParseFlags

extern/re2/re2/re2.cc:130–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130int RE2::Options::ParseFlags() const {
131 int flags = Regexp::ClassNL;
132 switch (encoding()) {
133 default:
134 if (log_errors())
135 LOG(ERROR) << "Unknown encoding " << encoding();
136 break;
137 case RE2::Options::EncodingUTF8:
138 break;
139 case RE2::Options::EncodingLatin1:
140 flags |= Regexp::Latin1;
141 break;
142 }
143
144 if (!posix_syntax())
145 flags |= Regexp::LikePerl;
146
147 if (literal())
148 flags |= Regexp::Literal;
149
150 if (never_nl())
151 flags |= Regexp::NeverNL;
152
153 if (dot_nl())
154 flags |= Regexp::DotNL;
155
156 if (never_capture())
157 flags |= Regexp::NeverCapture;
158
159 if (!case_sensitive())
160 flags |= Regexp::FoldCase;
161
162 if (perl_classes())
163 flags |= Regexp::PerlClasses;
164
165 if (word_boundary())
166 flags |= Regexp::PerlB;
167
168 if (one_line())
169 flags |= Regexp::OneLine;
170
171 return flags;
172}
173
174void RE2::Init(const StringPiece& pattern, const Options& options) {
175 static std::once_flag empty_once;

Callers 3

AddMethod · 0.80
CompileMethod · 0.80
InitMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected