// @ZBS { // *MODULE_NAME Simple Inline String Constructor // *MASTER_FILE 1 // +DESCRIPTION { // This is a convenient class for creating inline // strings using the familiar printf style without // having to declare a separate buffer. Originally written by Ken Demarest // } // +EXAMPLE { // new File( ZTmpStr( "%s.dat", filename ) ); // } // *PORTABILITY win32 unix // *REQUIRED_FILES ztmpstr.cpp ztmpstr.h // *VERSION 2.0 // +HISTORY { // 1.0 KLD original idea implemented in NetStorm // 2.0 ZBS isolated, simplified, made portable // } // +TODO { // } // *SELF_TEST yes console // *PUBLISH yes // } // OPERATING SYSTEM specific includes: // SDK includes: // STDLIB includes: #include "string.h" #include "ctype.h" #include "stdarg.h" #include "stdio.h" #include "assert.h" // MODULE includes: #include "ztmpstr.h" // ZBSLIB includes: #define assembleTo(dest,fmt,maxlen) { va_list argptr; if (fmt != (dest)) { va_start (argptr, fmt); vsprintf((dest), fmt, argptr); va_end (argptr); } assert(strlen(dest)