Chromium Code Reviews| Index: third_party/WebKit/Source/modules/payments/PaymentsValidators.h |
| diff --git a/third_party/WebKit/Source/modules/payments/PaymentsValidators.h b/third_party/WebKit/Source/modules/payments/PaymentsValidators.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4112360dfab7151997b946d7abfbf344bdcfa34a |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/modules/payments/PaymentsValidators.h |
| @@ -0,0 +1,37 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef PaymentsValidators_h |
| +#define PaymentsValidators_h |
| + |
| +#include "modules/ModulesExport.h" |
| +#include "wtf/text/WTFString.h" |
| + |
| +namespace blink { |
| + |
| +class MODULES_EXPORT PaymentsValidators final { |
|
haraken
2016/03/31 02:19:34
Add STATIC_ONLY.
esprehn
2016/03/31 04:44:58
I'd prefer we just used namespaces tbh, but we can
please use gerrit instead
2016/03/31 20:43:08
Done.
please use gerrit instead
2016/03/31 20:43:09
Acknowledged.
|
| +public: |
| + // Returns true if |code| is a valid ISO 4217 currency code. |
| + static bool isValidCurrencyCodeFormat(const String& code, String* optionalErrorMessage); |
| + |
| + // Returns true if |amount| is a valid currency code as defined in ISO 20022 CurrencyAnd30Amount. |
| + static bool isValidAmountFormat(const String& amount, String* optionalErrorMessage); |
| + |
| + // Returns true if |code| is a valid ISO 3166 country code. |
| + static bool isValidRegionCodeFormat(const String& code, String* optionalErrorMessage); |
| + |
| + // Returns true if |code| is a valid ISO 639 language code. |
| + static bool isValidLanguageCodeFormat(const String& code, String* optionalErrorMessage); |
| + |
| + // Returns true if |code| is a valid ISO 1524 script code. |
| + static bool isValidScriptCodeFormat(const String& code, String* optionalErrorMessage); |
| + |
| +private: |
| + PaymentsValidators() {} |
| + ~PaymentsValidators() {} |
|
haraken
2016/03/31 02:19:34
Remove the constructor and destructor.
please use gerrit instead
2016/03/31 20:43:08
Done.
|
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // PaymentsValidators_h |