identifier.h
1/* This file is part of the KDE project
2 Copyright (C) 2003-2005 Jaroslaw Staniek <js@iidea.pl>
3 Copyright (C) 2005 Martin Ellis <martin.ellis@kdemail.net>
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this program; see the file COPYING. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KEXIUTILS_IDENTIFIER_H
22#define KEXIUTILS_IDENTIFIER_H
23
24#include "validator.h"
25#include <tqstring.h>
26
27namespace KexiUtils {
28
31 KEXIUTILS_EXPORT bool isIdentifier(const TQString& s);
32
37 KEXIUTILS_EXPORT TQString string2Identifier(const TQString &s);
38
41 KEXIUTILS_EXPORT TQString identifierExpectedMessage(const TQString &valueName,
42 const TQVariant& v);
43
45 KEXIUTILS_EXPORT TQString string2FileName(const TQString &s);
46
48 class KEXIUTILS_EXPORT IdentifierValidator : public Validator
49 {
50 public:
51 IdentifierValidator(TQObject * parent = 0, const char * name = 0);
52 virtual ~IdentifierValidator();
53 virtual State validate( TQString & input, int & pos) const;
54
55 protected:
56 virtual Validator::Result internalCheck(const TQString &valueName, const TQVariant& v,
57 TQString &message, TQString &details);
58 };
59}
60
61#endif
Validates input for identifier name.
Definition identifier.h:49
A validator extending TQValidator with offline-checking for value's validity.
Definition validator.h:46
General Utils.
Definition identifier.h:27
KEXIUTILS_EXPORT TQString string2FileName(const TQString &s)
type * findParent(TQObject *o, const char *className)
KEXIUTILS_EXPORT TQString identifierExpectedMessage(const TQString &valueName, const TQVariant &v)
KEXIUTILS_EXPORT TQString string2Identifier(const TQString &s)
KEXIUTILS_EXPORT bool isIdentifier(const TQString &s)