Main Page | User's Guide | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members

String.hxx

00001 // Copyright (C) 2004-2005 Vivien Mallet
00002 //
00003 // This file is part of Talos library.
00004 // Talos library provides miscellaneous tools to make up for C++
00005 // lacks and to ease C++ programming.
00006 // 
00007 // Talos is free software; you can redistribute it and/or modify
00008 // it under the terms of the GNU General Public License as published by
00009 // the Free Software Foundation; either version 2 of the License, or
00010 // (at your option) any later version.
00011 // 
00012 // Talos is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License (file "license") for more details.
00016 //
00017 // For more information, please see the Talos home page:
00018 //     http://spacetown.free.fr/lib/talos/
00019 
00020 
00021 #ifndef TALOS_FILE_STRING_HXX
00022 
00023 
00024 namespace Talos
00025 {
00026 
00027   template<typename T>
00028   string to_str(const T& input);
00029 
00030   string fill(const string& input, int l = 2, char c = ' ',
00031               ostringstream::fmtflags flags = ostringstream::left);
00032 
00033   template<typename T>
00034   string to_str_fill(const T& input, int l = 2, char c = ' ',
00035                      ostringstream::fmtflags flags = ostringstream::left);
00036 
00037   template <class T>
00038   void to_num(const string& s, T& num);
00039 
00040   template <class T>
00041   T to_num(const string& s);
00042 
00043   template <class T>
00044   void convert(const string& s, T& num);
00045   void convert(const string& s, string& num);
00046 
00047   template <class T>
00048   T convert(const string& s);
00049   
00050   string lower_case(string str);
00051   string upper_case(string str);
00052   
00053   bool is_num(const string& s);
00054 
00055   bool is_integer(const string& s);
00056 
00057   bool is_unsigned_integer(const string& s);
00058 
00059   string find_replace(string str, string old_str, string new_str = "");
00060 
00061   string trim(string str, string delimiters = " \n\t");
00062 
00063   string trim_beg(string str, string delimiters = " \n\t");
00064 
00065   string trim_end(string str, string delimiters = " \n\t");
00066 
00067   template <class T>
00068   void split(string str, vector<T>& vect, string delimiters = " \n\t");
00069   vector<string> split(string str, string delimiters = " \n\t");
00070 
00071   template <class T>
00072   void split_markup(string str, vector<T>& elements, vector<bool>& is_markup,
00073                     string delimiters = "$");
00074   
00075   template <class T>
00076   void print(const vector<T>& v);
00077   
00078 }  // namespace Talos.
00079 
00080 
00081 #define TALOS_FILE_STRING_HXX
00082 #endif

Generated on Tue Nov 7 14:47:09 2006 for Talos by  doxygen 1.4.2