diff options
Diffstat (limited to 'xbmc/utils/StringValidation.h')
| -rw-r--r-- | xbmc/utils/StringValidation.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/xbmc/utils/StringValidation.h b/xbmc/utils/StringValidation.h new file mode 100644 index 0000000..34d54e8 --- /dev/null +++ b/xbmc/utils/StringValidation.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2013-2018 Team Kodi | ||
| 3 | * This file is part of Kodi - https://kodi.tv | ||
| 4 | * | ||
| 5 | * SPDX-License-Identifier: GPL-2.0-or-later | ||
| 6 | * See LICENSES/README.md for more information. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #pragma once | ||
| 10 | |||
| 11 | #include <string> | ||
| 12 | |||
| 13 | class StringValidation | ||
| 14 | { | ||
| 15 | public: | ||
| 16 | typedef bool (*Validator)(const std::string &input, void *data); | ||
| 17 | |||
| 18 | static bool NonEmpty(const std::string &input, void *data) { return !input.empty(); } | ||
| 19 | static bool IsInteger(const std::string &input, void *data); | ||
| 20 | static bool IsPositiveInteger(const std::string &input, void *data); | ||
| 21 | static bool IsTime(const std::string &input, void *data); | ||
| 22 | |||
| 23 | private: | ||
| 24 | StringValidation() = default; | ||
| 25 | }; | ||
