Merge pull request #26166 from ksooo/improve-plugin-ctx-menus
[xbmc.git] / xbmc / utils / StringValidation.h
blob34d54e81f174e91d46e2661db548990a93453c06
1 /*
2 * Copyright (C) 2013-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include <string>
13 class StringValidation
15 public:
16 typedef bool (*Validator)(const std::string &input, void *data);
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);
23 private:
24 StringValidation() = default;