I have a function that encapsulate the CString::FormatV function, and I need to be able to detect if an empty parameter list is passed to the function. What's the best way to do this?
My current code goes like this
CString ADString::Format(CString csFormat, ...)
{
//Code comes from CString::Format()
CString csReturn;
va_list argList;
va_start(argList, csFormat);
csReturn.FormatV(csFormat, argList);
va_end( argList );
return csReturn;
}
and I would like something like that
CString ADString::Format(CString csFormat, ...)
{
//Code comes from CString::Format()
CString csReturn;
va_list argList;
va_start(argList, csFormat);
//If it's empty, don't send to FormatV
if(!IsArgListEmpty(argList))
csReturn.FormatV(csFormat, argList);
va_end( argList );
return csReturn;
}