2 ***************************************************************************
4 * 4F, No. 2 Technology 5th Rd.
5 * Science-based Industrial Park
6 * Hsin-chu, Taiwan, R.O.C.
8 * (c) Copyright 2002, Ralink Technology, Inc.
10 * All rights reserved. Ralink's source code is an unpublished work and the
11 * use of a copyright notice does not imply otherwise. This source code
12 * contains confidential trade secret material of Ralink Tech. Any attemp
13 * or participation in deciphering, decoding, reverse engineering or in any
14 * way altering the source code is stricitly prohibited, unless the prior
15 * written consent of Ralink Technology, Inc. is obtained.
16 ***************************************************************************
22 Implement hex validator for WEP security.
26 -------- ---------- ----------------------------------------------
27 Paul Wu 01-22-2003 created
32 #include <qvalidator.h>
36 #include "qhexvalidator.h"
38 QHexValidator::QHexValidator ( QWidget
* parent
, const char * name
)
39 : QValidator(parent
, name
)
44 QHexValidator::~QHexValidator()
47 QValidator::State
QHexValidator::validate ( QString
&str
, int &pos
) const
55 return QValidator::Acceptable
;
57 tmp
= (char *)malloc(str
.length()+1);
59 return QValidator::Invalid
;
60 strcpy(tmp
, str
.data());
61 for(i
=0; i
<str
.length(); i
++)
64 if( ((ch
>= 'a') && (ch
<= 'f')) || ((ch
>= 'A') && (ch
<= 'F')) ||
65 ((ch
>= '0') && (ch
<= '9')) )
79 return QValidator::Acceptable
;
83 return QValidator::Invalid
;
85 pos
=0; //avoid compile warning