Initial Patch of Auction House bot rev. 135
[auctionmangos.git] / dep / include / g3dlite / G3D / format.h
blobb031300ab1ab1551b1bca396a063e3713054a7fd
1 /**
2 @file format.h
4 @maintainer Morgan McGuire, matrix@graphics3d.com
6 @author 2000-09-09
7 @edited 2005-11-03
9 Copyright 2000-2005, Morgan McGuire.
10 All rights reserved.
13 #ifndef G3D_FORMAT_H
14 #define G3D_FORMAT_H
16 #include "G3D/platform.h"
17 #include <string>
18 #include <stdio.h>
19 #include <cstdarg>
20 #include <assert.h>
21 #ifndef G3D_WIN32
22 // Don't include varargs.h for some random
23 // gcc reason
24 //#include <varargs.h>
25 #include <stdarg.h>
26 #endif
28 #ifndef _MSC_VER
29 #ifndef __cdecl
30 #define __cdecl __attribute__((cdecl))
31 #endif
32 #endif
34 namespace G3D {
36 /**
37 Produces a string from arguments of the style of printf. This avoids
38 problems with buffer overflows when using sprintf and makes it easy
39 to use the result functionally. This function is fast when the resulting
40 string is under 160 characters (not including terminator) and slower
41 when the string is longer.
43 std::string format(
44 const char* fmt
45 ...) G3D_CHECK_PRINTF_ARGS;
47 /**
48 Like format, but can be called with the argument list from a ... function.
50 std::string vformat(
51 const char* fmt,
52 va_list argPtr) G3D_CHECK_VPRINTF_ARGS;
55 }; // namespace
57 #endif