strutils.cc

00001 /* 
00002    EyeDB Object Database Management System
00003    Copyright (C) 1994-2008 SYSRA
00004    
00005    EyeDB is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009    
00010    EyeDB is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014    
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with this library; if not, write to the Free Software
00017    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA 
00018 */
00019 
00020 /*
00021    Author: Eric Viara <viara@sysra.com>
00022 */
00023 
00024 #include <eyedbconfig.h>
00025 
00026 #include <eyedblib/strutils.h>
00027 
00028 std::string str_convert(char c, const char *fmt)
00029 {
00030   char tok[32];
00031   sprintf(tok, fmt, c);
00032   return tok;
00033 }
00034 
00035 std::string str_convert(int l, const char *fmt)
00036 {
00037   char tok[32];
00038   sprintf(tok, fmt, l);
00039   return tok;
00040 }
00041 
00042 std::string str_convert(short l, const char *fmt)
00043 {
00044   char tok[32];
00045   sprintf(tok, fmt, l);
00046   return tok;
00047 }
00048 
00049 std::string str_convert(long l, const char *fmt)
00050 {
00051   char tok[32];
00052   sprintf(tok, fmt, l);
00053   return tok;
00054 }
00055 
00056 std::string str_convert(long long l, const char *fmt)
00057 {
00058   char tok[32];
00059   sprintf(tok, fmt, l);
00060   return tok;
00061 }
00062 
00063 std::string str_convert(unsigned long l, const char *fmt)
00064 {
00065   char tok[32];
00066   sprintf(tok, fmt, l);
00067   return tok;
00068 }
00069 
00070 std::string str_convert(unsigned long long l, const char *fmt)
00071 {
00072   char tok[32];
00073   sprintf(tok, fmt, l);
00074   return tok;
00075 }
00076 
00077 std::string str_convert(double d, const char *fmt)
00078 {
00079   char tok[512];
00080   sprintf(tok, fmt, d);
00081   return tok;
00082 }
00083 

Generated on Mon Dec 22 18:16:08 2008 for eyedb by  doxygen 1.5.3