stringutil.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *                                                                         *
00003  *                         Powersave Daemon                                *
00004  *                                                                         *
00005  *      Parts copyright 2003 John Knottenbelt, taken from dvbd-0.7.7       *
00006  *                      2005 Stefan Seyfried                               *
00007  *                                                                         *
00008  *               Author(s): John Knottenbelt                               *
00009  *                          Stefan Seyfried                                *
00010  *                                                                         *
00011  * This program is free software; you can redistribute it and/or modify it *
00012  * under the terms of the GNU General Public License as published by the   *
00013  * Free Software Foundation; either version 2 of the License, or (at you   *
00014  * option) any later version.                                              *
00015  *                                                                         *
00016  * This program is distributed in the hope that it will be useful, but     *
00017  * WITHOUT ANY WARRANTY; without even the implied warranty of              *
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU       *
00019  * General Public License for more details.                                *
00020  *                                                                         *
00021  * You should have received a copy of the GNU General Public License along *
00022  * with this program; if not, write to the Free Software Foundation, Inc., *
00023  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA                  *
00024  *                                                                         *
00025  ***************************************************************************/
00026 
00027 #if !defined __STRING_UTIL_H
00028 #define __STRING_UTIL_H
00029 
00030 #include <string>
00031 #include <vector>
00032 #include <ctime>
00033 
00034 std::string toString(bool b);
00035 std::string toString(int n);
00036 std::string toString(unsigned n);
00037 std::string toString(double n);
00038 std::string lowercase(const std::string & s);
00039 int toPosInt(const std::string & s);
00040 unsigned toUnsigned(const std::string & s);
00041 unsigned long toUnsignedLong(const std::string & s);
00042 double toDouble(const std::string & s);
00043 bool toBool(const std::string & s);
00044 
00045 void splitString(const std::string & s, char delim, std::vector < std::string > &v);
00046 std::string stripLeadingWS(const std::string & s);
00047 std::string stripLineComment(const std::string & s, char delim = '#');
00048 std::string stripTrailingWS(const std::string & s);
00049 std::string stripApostrophe(const std::string & s);
00050 
00051 #endif                          // __STRING_UTIL_H

Generated on Mon Mar 27 09:27:19 2006 for Powersave Daemon by  doxygen 1.4.6