Statistics
| Branch: | Tag: | Revision:

dvbd / src / stringutil.h @ 59be6a47

History | View | Annotate | Download (1.48 KB)

1
// -*- c++ -*-
2
/*
3
  Copyright 2003 John Knottenbelt
4
  
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
7
  the Free Software Foundation; either version 2 of the License, or
8
  (at your option) any later version.
9
 
10
  This program is distributed in the hope that it will be useful,
11
  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
  GNU General Public License for more details.
14
 
15
  You should have received a copy of the GNU General Public License
16
  along with this program; if not, write to the Free Software
17
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
18
*/
19

    
20
#if !defined __STRING_UTIL_H
21
#define __STRING_UTIL_H
22

    
23
#include <string>
24
#include <vector>
25
#include <ctime>
26

    
27
std::string toString(bool b);
28
std::string toString(int n);
29
std::string toString(unsigned n);
30
std::string toString(double n);
31
std::string lowercase(const std::string &s);
32
int toInt(const std::string &s);
33
unsigned toUnsigned(const std::string &s);
34
unsigned long toUnsignedLong(const std::string &s);
35
double toDouble(const std::string &s);
36
bool toBool(const std::string &s);
37

    
38
void splitString(const std::string &s, char delim, std::vector<std::string> &v);
39
std::string stripLeadingWS(const std::string &s);
40
std::string stripLineComment(const std::string &s, char delim = '#');
41
std::string stripTrailingWS(const std::string &s);
42

    
43
#endif // __STRING_UTIL_H