Vidalia  0.3.1
DomainValidator.cpp
Go to the documentation of this file.
1 /*
2 ** This file is part of Vidalia, and is subject to the license terms in the
3 ** LICENSE file, found in the top level directory of this distribution. If you
4 ** did not receive the LICENSE file with this file, you may obtain it from the
5 ** Vidalia source package distributed by the Vidalia Project at
6 ** http://www.torproject.org/projects/vidalia.html. No part of Vidalia,
7 ** including this file, may be copied, modified, propagated, or distributed
8 ** except according to the terms described in the LICENSE file.
9 */
10 
11 /*
12 ** \file DomainValidator.cpp
13 ** \brief Validates that a given domain name is (probably) valid
14 */
15 
16 #include "DomainValidator.h"
17 
18 
19 /** Regular expression to validate that input is a valid IP address. */
20 #define DOMAIN_REGEXP \
21 "^([a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,6}$"
22 
23 
24 /** Constructor. */
26 : QRegExpValidator(QRegExp(DOMAIN_REGEXP), parent)
27 {
28 }
29 
DomainValidator.h
DomainValidator::DomainValidator
DomainValidator(QObject *parent)
Definition: DomainValidator.cpp:25
DOMAIN_REGEXP
#define DOMAIN_REGEXP
Definition: DomainValidator.cpp:20