mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 23:06:00 +00:00
[ATL] Add CString::AppendFormat
This commit is contained in:
parent
28a305e26a
commit
9c8580a1e0
2 changed files with 50 additions and 14 deletions
|
@ -749,6 +749,23 @@ public:
|
|||
return CStringT(CThisSimpleString::GetString() + nLength - nCount, nCount);
|
||||
}
|
||||
|
||||
void __cdecl AppendFormat(UINT nFormatID, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, nFormatID);
|
||||
CStringT formatString;
|
||||
if (formatString.LoadString(nFormatID))
|
||||
AppendFormatV(formatString, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void __cdecl AppendFormat(PCXSTR pszFormat, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, pszFormat);
|
||||
AppendFormatV(pszFormat, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void __cdecl Format(UINT nFormatID, ...)
|
||||
{
|
||||
|
@ -768,6 +785,16 @@ public:
|
|||
va_end(args);
|
||||
}
|
||||
|
||||
void AppendFormatV(PCXSTR pszFormat, va_list args)
|
||||
{
|
||||
int nLength = StringTraits::FormatV(NULL, pszFormat, args);
|
||||
int nCurrent = CThisSimpleString::GetLength();
|
||||
|
||||
PXSTR pszBuffer = CThisSimpleString::GetBuffer(nLength + nCurrent);
|
||||
StringTraits::FormatV(pszBuffer + nCurrent, pszFormat, args);
|
||||
CThisSimpleString::ReleaseBufferSetLength(nLength + nCurrent);
|
||||
}
|
||||
|
||||
void FormatV(PCXSTR pszFormat, va_list args)
|
||||
{
|
||||
int nLength = StringTraits::FormatV(NULL, pszFormat, args);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue