Crazy Eddie's GUI System  0.8.4
TextUtils.h
00001 /***********************************************************************
00002     created:    30/5/2004
00003     author:     Paul D Turner
00004 
00005     purpose:    Interface to a static class containing some utility
00006                 functions for text / string operations
00007 *************************************************************************/
00008 /***************************************************************************
00009  *   Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
00010  *
00011  *   Permission is hereby granted, free of charge, to any person obtaining
00012  *   a copy of this software and associated documentation files (the
00013  *   "Software"), to deal in the Software without restriction, including
00014  *   without limitation the rights to use, copy, modify, merge, publish,
00015  *   distribute, sublicense, and/or sell copies of the Software, and to
00016  *   permit persons to whom the Software is furnished to do so, subject to
00017  *   the following conditions:
00018  *
00019  *   The above copyright notice and this permission notice shall be
00020  *   included in all copies or substantial portions of the Software.
00021  *
00022  *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00023  *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00024  *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00025  *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
00026  *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00027  *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00028  *   OTHER DEALINGS IN THE SOFTWARE.
00029  ***************************************************************************/
00030 #ifndef _CEGUITextUtils_h_
00031 #define _CEGUITextUtils_h_
00032 
00033 #include "CEGUI/Base.h"
00034 #include "CEGUI/String.h"
00035 #include <vector>
00036 
00037 // Start of CEGUI namespace section
00038 namespace CEGUI
00039 {
00044 class CEGUIEXPORT TextUtils
00045 {
00046 public:
00047     /*************************************************************************
00048         Constants
00049     *************************************************************************/
00050     static const String DefaultWhitespace;      
00051     static const String DefaultAlphanumerical;  
00052     static const String DefaultWrapDelimiters;  
00053 
00054 
00055     /*************************************************************************
00056         Methods
00057     *************************************************************************/
00078     static  String  getNextWord(const String& str, String::size_type start_idx = 0, const String& delimiters = DefaultWhitespace);
00079 
00080 
00097     static  String::size_type   getWordStartIdx(const String& str, String::size_type idx);
00098 
00099 
00117     static  String::size_type   getNextWordStartIdx(const String& str, String::size_type idx);
00118 
00119 
00130     static  void    trimLeadingChars(String& str, const String& chars);
00131 
00132 
00143     static  void    trimTrailingChars(String& str, const String& chars);
00144 
00145 private:
00146     /*************************************************************************
00147         Data
00148     *************************************************************************/
00149     static  String      d_delimiters;           
00150     static  String      d_whitespace;           
00151 
00152 
00153     /*************************************************************************
00154         Construction / Destruction
00155     *************************************************************************/
00160     TextUtils(void);
00161     ~TextUtils(void);
00162 };
00163 
00164 } // End of  CEGUI namespace section
00165 
00166 
00167 #endif  // end of guard _CEGUITextUtils_h_
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends