00001 // ssprintf.h 00002 // 00003 // Copyright (C) 2005, 2007 Daniel Burrows 00004 // 00005 // This program is free software; you can redistribute it and/or 00006 // modify it under the terms of the GNU General Public License as 00007 // published by the Free Software Foundation; either version 2 of 00008 // the License, or (at your option) any later version. 00009 // 00010 // This program 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 // General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program; see the file COPYING. If not, write to 00017 // the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00018 // Boston, MA 02111-1307, USA. 00019 00020 #ifndef SSPRINTF_H 00021 #define SSPRINTF_H 00022 00023 #include <string> 00024 00025 namespace cwidget 00026 { 00027 namespace util 00028 { 00029 00030 // Printf for std::string. 00031 #ifdef __GNUG__ 00032 __attribute__ ((format (printf, 1, 2))) 00033 #endif 00034 std::string ssprintf(const char *format, ...); 00035 std::string vssprintf(const char *format, va_list ap); 00036 00037 std::wstring swsprintf(const wchar_t *format, ...); 00038 00039 std::wstring vswsprintf(const wchar_t *format, va_list ap); 00040 00044 std::string sstrerror(int errnum); 00045 } 00046 } 00047 00048 #endif // SSPRINTF_H