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 #include "Date.hxx"
00024 
00025 namespace Talos
00026 {
00027 
00028   template<typename T>
00029   string to_str(const T& input);
00030 
00031   string fill(const string& input, int l = 2, char c = ' ',
00032               ostringstream::fmtflags flags = ostringstream::left);
00033 
00034   template<typename T>
00035   string to_str_fill(const T& input, int l = 2, char c = ' ',
00036                      ostringstream::fmtflags flags = ostringstream::left);
00037 
00038   template <class T> 
00039   void to_num(const string& s, T& num);
00040 
00041   template <class T>
00042   T to_num(const string& s);
00043 
00044   template <class T>
00045   void convert(const string& s, T& num);
00046   void convert(const string& s, string& num);
00047 
00048   template <class T>
00049   T convert(const string& s);
00050   
00051   string lower_case(string str);
00052   string upper_case(string str);
00053   
00054   bool is_num(const string& s);
00055 
00056   bool is_integer(const string& s);
00057 
00058   bool is_unsigned_integer(const string& s);
00059 
00060   bool is_date(const string& s);
00061 
00062   bool is_delta(const string& s);
00063 
00064   string find_replace(string str, string old_str, string new_str = "");
00065 
00066   string trim(string str, string delimiters = " \n\t");
00067 
00068   string trim_beg(string str, string delimiters = " \n\t");
00069 
00070   string trim_end(string str, string delimiters = " \n\t");
00071 
00072   template <class T>
00073   void split(string str, vector<T>& vect, string delimiters = " \n\t");
00074   vector<string> split(string str, string delimiters = " \n\t");
00075 
00076   template <class T>
00077   void split_markup(string str, vector<T>& elements, vector<bool>& is_markup,
00078                     string delimiters = "$");
00079   
00080   template <class T>
00081   void print(const vector<T>& v);
00082   
00083 }  // namespace Talos.
00084 
00085 
00086 #define TALOS_FILE_STRING_HXX
00087 #endif

Generated on Wed Apr 25 11:18:06 2007 for Talos by  doxygen 1.4.2