Added snprintf/vsnprintf helpers to ISourceMod, finally (bug 3530, r=pred).

This commit is contained in:
David Anderson
2009-02-01 19:57:09 -05:00
parent 0cf5f4ae2a
commit 2b97461f54
3 changed files with 45 additions and 1 deletions
+23 -1
View File
@@ -43,7 +43,7 @@
#include <time.h>
#define SMINTERFACE_SOURCEMOD_NAME "ISourceMod"
#define SMINTERFACE_SOURCEMOD_VERSION 7
#define SMINTERFACE_SOURCEMOD_VERSION 8
/**
* @brief Forward declaration of the KeyValues class.
@@ -248,6 +248,28 @@ namespace SourceMod
* @param hook Hook function.
*/
virtual void RemoveGameFrameHook(GAME_FRAME_HOOK hook) =0;
/**
* @brief Platform-safe wrapper around snprintf().
*
* @param buffer String buffer.
* @param maxlength Maximum length of buffer.
* @param fmt Format specifier string.
* @param ... Format arguments.
* @return Number of bytes (not including null terminator) written.
*/
virtual size_t Format(char *buffer, size_t maxlength, const char *fmt, ...) = 0;
/**
* @brief Platform-safe wrapper around vsnprintf().
*
* @param buffer String buffer.
* @param maxlength Maximum length of buffer.
* @param fmt Format specifier string.
* @param ap Format arguments.
* @return Number of bytes (not including null terminator) written.
*/
virtual size_t FormatArgs(char *buffer, size_t maxlength, const char *fmt, va_list ap) = 0;
};
}