cwidget  0.5.16
ssprintf.h
00001 // ssprintf.h
00002 //
00003 //   Copyright (C) 2005, 2007, 2009 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 #include <stdarg.h>
00025 
00026 namespace cwidget
00027 {
00028   namespace util
00029   {
00030 
00031     // Printf for std::string.
00032 #ifdef __GNUG__
00033     __attribute__ ((format (printf, 1, 2)))
00034 #endif
00035     std::string ssprintf(const char *format, ...);
00036     std::string vssprintf(const char *format, va_list ap);
00037 
00038     std::wstring swsprintf(const wchar_t *format, ...);
00039 
00040     std::wstring vswsprintf(const wchar_t *format, va_list ap);
00041 
00045     std::string sstrerror(int errnum);
00046   }
00047 }
00048 
00049 #endif // SSPRINTF_H