FormatStr changed to string

This commit is contained in:
James Turk 2003-11-24 02:02:25 +00:00
parent 7a4ba04e94
commit 6709e83d94
2 changed files with 139 additions and 138 deletions

View File

@ -14,7 +14,7 @@
Definition file for ZEngine Utilities which are used throughout the engine and can be used in
conjunction with ZEngine.
<br>$Id: ZE_Utility.h,v 1.9 2003/10/13 21:48:12 cozman Exp $<br>
<br>$Id: ZE_Utility.h,v 1.10 2003/11/24 02:02:25 cozman Exp $<br>
\author James Turk
**/
@ -36,7 +36,7 @@ namespace ZE
\param ... variable number of arguments after fmtstr
\return std::string of parsed and combined std::string
**/
std::string FormatStr(const char *fmtstr, ...);
std::string FormatStr(const std::string fmtstr, ...);
/*!
\brief Extracts a SDL_RWops memory structure from a zip archive.

View File

@ -13,7 +13,7 @@
\brief Source file for ZEngine utility functions.
Source file containing open utilities for use inside and alongside ZEngine.
<br>$Id: ZE_Utility.cpp,v 1.13 2003/10/13 21:48:13 cozman Exp $<br>
<br>$Id: ZE_Utility.cpp,v 1.14 2003/11/24 02:07:03 cozman Exp $<br>
\author James Turk
**/
@ -22,14 +22,15 @@
namespace ZE
{
std::string FormatStr(const char *fmtstr, ...)
std::string FormatStr(const std::string fmtstr, ...)
{
char buf[512];
va_list args;
//simply puts args into the buffer using standard parsing rules
va_start(args,fmtstr);
vsprintf(buf, fmtstr, args);
vsprintf(buf, fmtstr.c_str(), args);
va_end(args);
return buf;
}