presage  0.8.7
utility.h
Go to the documentation of this file.
00001 
00002 /******************************************************
00003  *  Presage, an extensible predictive text entry system
00004  *  ---------------------------------------------------
00005  *
00006  *  Copyright (C) 2008  Matteo Vescovi <matteo.vescovi@yahoo.co.uk>
00007 
00008     This program is free software; you can redistribute it and/or modify
00009     it under the terms of the GNU General Public License as published by
00010     the Free Software Foundation; either version 2 of the License, or
00011     (at your option) any later version.
00012 
00013     This program is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016     GNU General Public License for more details.
00017 
00018     You should have received a copy of the GNU General Public License along
00019     with this program; if not, write to the Free Software Foundation, Inc.,
00020     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00021                                                                              *
00022                                                                 **********(*)*/
00023 
00024 
00025 #ifndef PRESAGE_UTILITY
00026 #define PRESAGE_UTILITY
00027 
00028 #ifdef HAVE_CONFIG_H
00029 # include "config.h"
00030 #endif 
00031 
00032 #include <string>   // overload strtolower function
00033 
00034 class Utility {
00035     
00036 public:    
00037     static char*        strtolower( char*        );
00038     static std::string& strtolower( std::string& );
00039     static std::string  strtolower( const std::string& );
00040 
00041     static std::string  strtoupper( const std::string& );
00042 
00043     static bool isTrueFalse( const char* );
00044     static bool isTrueFalse( const std::string& );
00045 
00046     static bool isTrue( const char* );
00047     static bool isTrue( const std::string& );
00048 
00049     static bool isFalse( const char* );
00050     static bool isFalse( const std::string& );
00051 
00052     static bool isYesNo( const char* );
00053     static bool isYesNo( const std::string& );
00054 
00055     static bool isYes( const char* );
00056     static bool isYes( const std::string& );
00057 
00058     static bool isNo( const char* );
00059     static bool isNo( const std::string& );
00060 
00061     static double toDouble(const std::string);
00062     static int    toInt   (const std::string);
00063 
00064 };
00065 
00066 #endif // PRESAGE_UTILITY