PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/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
Possible License(s): LGPL-2.1
  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. #ifndef LL_LLTEXTVALIDATE_H
  28. #define LL_LLTEXTVALIDATE_H
  29. #include "llstring.h"
  30. #include "llinitparam.h"
  31. #include <boost/function.hpp>
  32. namespace LLTextValidate
  33. {
  34. typedef boost::function<BOOL (const LLWString &wstr)> validate_func_t;
  35. struct ValidateTextNamedFuncs
  36. : public LLInitParam::TypeValuesHelper<validate_func_t, ValidateTextNamedFuncs>
  37. {
  38. static void declareValues();
  39. };
  40. bool validateFloat(const LLWString &str );
  41. bool validateInt(const LLWString &str );
  42. bool validatePositiveS32(const LLWString &str);
  43. bool validateNonNegativeS32(const LLWString &str);
  44. bool validateNonNegativeS32NoSpace(const LLWString &str);
  45. bool validateAlphaNum(const LLWString &str );
  46. bool validateAlphaNumSpace(const LLWString &str );
  47. bool validateASCIIPrintableNoPipe(const LLWString &str);
  48. bool validateASCIIPrintableNoSpace(const LLWString &str);
  49. bool validateASCII(const LLWString &str);
  50. bool validateASCIIWithNewLine(const LLWString &str);
  51. }
  52. #endif