1 #ifndef I18N_PHONENUMBERS_REGEX_BASED_MATCHER_H_
2 #define I18N_PHONENUMBERS_REGEX_BASED_MATCHER_H_
7 #include "phonenumbers/base/basictypes.h"
8 #include "phonenumbers/base/memory/scoped_ptr.h"
9 #include "phonenumbers/matcher_api.h"
12 namespace phonenumbers {
14 class AbstractRegExpFactory;
15 class PhoneNumberDesc;
18 // Implementation of the matcher API using the regular expressions in the
19 // PhoneNumberDesc proto message to match numbers.
20 class RegexBasedMatcher : public MatcherApi {
25 bool MatchesNationalNumber(const string& national_number,
26 const PhoneNumberDesc& number_desc,
27 bool allow_prefix_match) const;
29 bool MatchesPossibleNumber(const string& national_number,
30 const PhoneNumberDesc& number_desc) const;
33 bool Match(const string& national_number, const string& number_pattern,
34 bool allow_prefix_match) const;
36 const scoped_ptr<const AbstractRegExpFactory> regexp_factory_;
37 const scoped_ptr<RegExpCache> regexp_cache_;
39 DISALLOW_COPY_AND_ASSIGN(RegexBasedMatcher);
42 } // namespace phonenumbers
45 #endif // I18N_PHONENUMBERS_REGEX_BASED_MATCHER_H_