-
Notifications
You must be signed in to change notification settings - Fork 76
/
format.cpp
51 lines (38 loc) · 969 Bytes
/
format.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Format.cpp - format CStrings on-the-fly
//
#include "stdafx.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFormat
CFormat::CFormat(LPCTSTR lpszFormat, ...)
{
ASSERT(AfxIsValidString(lpszFormat, FALSE));
va_list argList;
va_start(argList, lpszFormat);
FormatV(lpszFormat, argList);
va_end(argList);
}
CFormat::CFormat(UINT nFormatID, ...)
{
CString strFormat;
VERIFY(strFormat.LoadString(nFormatID) != 0);
va_list argList;
va_start(argList, nFormatID);
FormatV(strFormat, argList);
va_end(argList);
}
CFormat::CFormat (LPCTSTR lpszFormat, va_list argList)
{
ASSERT(AfxIsValidString(lpszFormat, FALSE));
FormatV(lpszFormat, argList);
}
CFormat::CFormat (UINT nFormatID, va_list argList)
{
CString strFormat;
VERIFY(strFormat.LoadString(nFormatID) != 0);
FormatV(strFormat, argList);
}