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