utility.h
Go to the documentation of this file.
/******************************************************
* Presage, an extensible predictive text entry system
* ---------------------------------------------------
*
* Copyright (C) 2008 Matteo Vescovi <matteo.vescovi@yahoo.co.uk>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
**********(*)*/
#ifndef PRESAGE_UTILITY
#define PRESAGE_UTILITY
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <string> // overload strtolower function
class Utility {
public:
static char* strtolower( char* );
static std::string& strtolower( std::string& );
static std::string strtolower( const std::string& );
static std::string strtoupper( const std::string& );
static bool isTrueFalse( const char* );
static bool isTrueFalse( const std::string& );
static bool isTrue( const char* );
static bool isTrue( const std::string& );
static bool isFalse( const char* );
static bool isFalse( const std::string& );
static bool isYesNo( const char* );
static bool isYesNo( const std::string& );
static bool isYes( const char* );
static bool isYes( const std::string& );
static bool isNo( const char* );
static bool isNo( const std::string& );
static double toDouble(const std::string);
static int toInt (const std::string);
static std::string dirname (const std::string&);
static std::string filename (const std::string&);
static bool is_directory_usable (const std::string& dir);
static void create_directory (const std::string& dir);
};
#endif // PRESAGE_UTILITY
Utility::create_directory
static void create_directory(const std::string &dir)
Definition: utility.cpp:329
Utility::strtoupper
static std::string strtoupper(const std::string &)
Definition: utility.cpp:81
Utility::filename
static std::string filename(const std::string &)
Definition: utility.cpp:290
Utility::is_directory_usable
static bool is_directory_usable(const std::string &dir)
Definition: utility.cpp:306
Utility::toDouble
static double toDouble(const std::string)
Definition: utility.cpp:257
Utility::isYesNo
static bool isYesNo(const char *)
Definition: utility.cpp:175
Utility::isYes
static bool isYes(const char *)
Definition: utility.cpp:184
Utility::isTrue
static bool isTrue(const char *)
Definition: utility.cpp:106
Utility::dirname
static std::string dirname(const std::string &)
Definition: utility.cpp:274
Utility::isFalse
static bool isFalse(const char *)
Definition: utility.cpp:127
Utility::isTrueFalse
static bool isTrueFalse(const char *)
Definition: utility.cpp:96
Utility::toInt
static int toInt(const std::string)
Definition: utility.cpp:265
Utility::strtolower
static char * strtolower(char *)
Definition: utility.cpp:41
Utility
Definition: utility.h:33
Utility::isNo
static bool isNo(const char *)
Definition: utility.cpp:207