File indexing completed on 2024-05-12 05:06:13

0001 /*
0002     SPDX-FileCopyrightText: 2014 Christian Dávid <christian-david@web.de>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef VALIDATORS_H
0007 #define VALIDATORS_H
0008 
0009 #include <QString>
0010 
0011 namespace validators
0012 {
0013 enum lengthStatus {
0014     ok = 0,
0015     tooShort  = -1,
0016     tooLong = 1,
0017 };
0018 
0019 /** @brief checks if all lines in text are shorter than length */
0020 bool checkLineLength(const QString& text, const int& length);
0021 
0022 /** @brief checks if text uses only characters in allowedChars */
0023 bool checkCharset(const QString& text, const QString& allowedChars);
0024 
0025 };
0026 
0027 #endif // VALIDATORS_H