11767c5feSopenharmony_ci/* 21767c5feSopenharmony_ci * Copyright (C) 2014 The Libphonenumber Authors 31767c5feSopenharmony_ci * 41767c5feSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 51767c5feSopenharmony_ci * you may not use this file except in compliance with the License. 61767c5feSopenharmony_ci * You may obtain a copy of the License at 71767c5feSopenharmony_ci * 81767c5feSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 91767c5feSopenharmony_ci * 101767c5feSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 111767c5feSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 121767c5feSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 131767c5feSopenharmony_ci * See the License for the specific language governing permissions and 141767c5feSopenharmony_ci * limitations under the License. 151767c5feSopenharmony_ci */ 161767c5feSopenharmony_ci 171767c5feSopenharmony_ci#ifndef I18N_PHONENUMBERS_MATCHER_API_H_ 181767c5feSopenharmony_ci#define I18N_PHONENUMBERS_MATCHER_API_H_ 191767c5feSopenharmony_ci 201767c5feSopenharmony_ci#include <string> 211767c5feSopenharmony_ci 221767c5feSopenharmony_cinamespace i18n { 231767c5feSopenharmony_cinamespace phonenumbers { 241767c5feSopenharmony_ci 251767c5feSopenharmony_ciusing std::string; 261767c5feSopenharmony_ci 271767c5feSopenharmony_ciclass PhoneNumberDesc; 281767c5feSopenharmony_ci 291767c5feSopenharmony_ci// Internal phonenumber matching API used to isolate the underlying 301767c5feSopenharmony_ci// implementation of the matcher and allow different implementations to be 311767c5feSopenharmony_ci// swapped in easily. 321767c5feSopenharmony_ciclass MatcherApi { 331767c5feSopenharmony_ci public: 341767c5feSopenharmony_ci virtual ~MatcherApi() {} 351767c5feSopenharmony_ci 361767c5feSopenharmony_ci // Returns whether the given national number (a string containing only decimal 371767c5feSopenharmony_ci // digits) matches the national number pattern defined in the given 381767c5feSopenharmony_ci // PhoneNumberDesc message. 391767c5feSopenharmony_ci virtual bool MatchNationalNumber(const string& number, 401767c5feSopenharmony_ci const PhoneNumberDesc& number_desc, 411767c5feSopenharmony_ci bool allow_prefix_match) const = 0; 421767c5feSopenharmony_ci}; 431767c5feSopenharmony_ci 441767c5feSopenharmony_ci} // namespace phonenumbers 451767c5feSopenharmony_ci} // namespace i18n 461767c5feSopenharmony_ci 471767c5feSopenharmony_ci#endif // I18N_PHONENUMBERS_MATCHER_API_H_ 48