6 // Written by Bernie Bright, 1998
8 // Copyright (C) 1998 Bernie Bright - bbright@c031.aone.net.au
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Library General Public
12 // License as published by the Free Software Foundation; either
13 // version 2 of the License, or (at your option) any later version.
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Library General Public License for more details.
20 // You should have received a copy of the GNU Library General Public
21 // License along with this library; if not, write to the
22 // Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 // Boston, MA 02111-1307, USA.
31 #include <simgear/compiler.h>
35 #ifdef SG_HAVE_STD_INCLUDES
44 /** Default characters to remove. */
45 extern const string whitespace;
47 /** Returns a string with trailing characters removed. */
48 string trimleft( const string& s, const string& trimmings = whitespace );
50 /** Returns a string with leading characters removed. */
51 string trimright( const string& s, const string& trimmings = whitespace );
53 /** Returns a string with leading and trailing characters removed. */
54 string trim( const string& s, const string& trimmings = whitespace );
56 /** atof() wrapper for "string" type */
58 atof( const string& str )
60 return ::atof( str.c_str() );
63 /** atoi() wrapper for "string" type */
65 atoi( const string& str )
67 return ::atoi( str.c_str() );