00001 00006 // Written by Bernie Bright, started 1998 00007 // 00008 // Copyright (C) 1998 Bernie Bright - bbright@bigpond.net.au 00009 // 00010 // This library is free software; you can redistribute it and/or 00011 // modify it under the terms of the GNU Library General Public 00012 // License as published by the Free Software Foundation; either 00013 // version 2 of the License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, 00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 // Library General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU General Public License 00021 // along with this program; if not, write to the Free Software 00022 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00023 // 00024 // $Id: strutils_8hxx_source.html,v 1.3 2010/02/23 22:10:17 curt Exp $ 00025 00026 00027 #ifndef STRUTILS_H 00028 #define STRUTILS_H 00029 00030 #include <simgear/compiler.h> 00031 00032 #include <string> 00033 #include <vector> 00034 #include <cstdlib> 00035 00036 00037 namespace simgear { 00038 namespace strutils { 00039 00040 // /** 00041 // * atof() wrapper for "string" type 00042 // */ 00043 // inline double 00044 // atof( const string& str ) 00045 // { 00046 // return ::atof( str.c_str() ); 00047 // } 00048 00049 // /** 00050 // * atoi() wrapper for "string" type 00051 // */ 00052 // inline int 00053 // atoi( const string& str ) 00054 // { 00055 // return ::atoi( str.c_str() ); 00056 // } 00057 00063 std::string lstrip( const std::string& s ); 00064 std::string rstrip( const std::string& s ); 00065 std::string strip( const std::string& s ); 00066 00078 std::vector<std::string> 00079 split( const std::string& s, 00080 const char* sep = 0, 00081 int maxsplit = 0 ); 00082 00083 } // end namespace strutils 00084 } // end namespace simgear 00085 00086 #endif // STRUTILS_H 00087