PageRenderTime 9ms CodeModel.GetById 4ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/indra/llui/lltextvalidate.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 59 lines | 26 code | 7 blank | 26 comment | 0 complexity | b1c0cbecc57845edcfb703370bea77a5 MD5 | raw file
 1/** 
 2 * @file lltextbase.h
 3 * @author Martin Reddy
 4 * @brief The base class of text box/editor, providing Url handling support
 5 *
 6 * $LicenseInfo:firstyear=2009&license=viewerlgpl$
 7 * Second Life Viewer Source Code
 8 * Copyright (C) 2010, Linden Research, Inc.
 9 * 
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation;
13 * version 2.1 of the License only.
14 * 
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 * Lesser General Public License for more details.
19 * 
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23 * 
24 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
25 * $/LicenseInfo$
26 */
27
28#ifndef LL_LLTEXTVALIDATE_H
29#define LL_LLTEXTVALIDATE_H
30
31#include "llstring.h"
32#include "llinitparam.h"
33#include <boost/function.hpp>
34
35namespace LLTextValidate
36{
37	typedef boost::function<BOOL (const LLWString &wstr)> validate_func_t;
38
39	struct ValidateTextNamedFuncs
40	:	public LLInitParam::TypeValuesHelper<validate_func_t, ValidateTextNamedFuncs>
41	{
42		static void declareValues();
43	};
44
45	bool	validateFloat(const LLWString &str );
46	bool	validateInt(const LLWString &str );
47	bool	validatePositiveS32(const LLWString &str);
48	bool	validateNonNegativeS32(const LLWString &str);
49	bool 	validateNonNegativeS32NoSpace(const LLWString &str);
50	bool	validateAlphaNum(const LLWString &str );
51	bool	validateAlphaNumSpace(const LLWString &str );
52	bool	validateASCIIPrintableNoPipe(const LLWString &str); 
53	bool	validateASCIIPrintableNoSpace(const LLWString &str);
54	bool	validateASCII(const LLWString &str);
55	bool	validateASCIIWithNewLine(const LLWString &str);
56}
57
58
59#endif