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

String.hxx

00001 // Copyright (C) 2004-2007, Vivien Mallet
00002 //
00003 // This file is part of Talos library, which provides miscellaneous tools to
00004 // make up for C++ lacks and to ease C++ programming.
00005 //
00006 // Talos is free software; you can redistribute it and/or modify it under the
00007 // terms of the GNU General Public License as published by the Free Software
00008 // Foundation; either version 2 of the License, or (at your option) any later
00009 // version.
00010 //
00011 // Talos is distributed in the hope that it will be useful, but WITHOUT ANY
00012 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00013 // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
00014 // details.
00015 //
00016 // For more information, visit the Talos home page:
00017 //     http://vivienmallet.net/lib/talos/
00018 
00019 
00020 #ifndef TALOS_FILE_STRING_HXX
00021 
00022 #include "Date.hxx"
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   bool is_date(const string& s);
00060 
00061   bool is_delta(const string& s);
00062 
00063   string find_replace(string str, string old_str, string new_str = "");
00064 
00065   string trim(string str, string delimiters = " \n\t");
00066 
00067   string trim_beg(string str, string delimiters = " \n\t");
00068 
00069   string trim_end(string str, string delimiters = " \n\t");
00070 
00071   template <class T>
00072   void split(string str, vector<T>& vect, string delimiters = " \n\t");
00073   vector<string> split(string str, string delimiters = " \n\t");
00074 
00075   template <class T>
00076   void split_markup(string str, vector<T>& elements, vector<bool>& is_markup,
00077                     string delimiters = "$");
00078   
00079   template <class T>
00080   void print(const vector<T>& v);
00081   
00082 }  // namespace Talos.
00083 
00084 
00085 #define TALOS_FILE_STRING_HXX
00086 #endif

Generated on Tue Oct 23 14:06:14 2007 for Talos by  doxygen 1.4.2