本文整理汇总了C++中xbox::VString::Printf方法的典型用法代码示例。如果您正苦于以下问题:C++ VString::Printf方法的具体用法?C++ VString::Printf怎么用?C++ VString::Printf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xbox::VString
的用法示例。
在下文中一共展示了VString::Printf方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetFormatedDateTimeString
static
void GetFormatedDateTimeString (const XBOX::VTime& inTime, XBOX::VString &outDateTimeString)
{
sLONG8 ms = inTime.GetMilliseconds() - (inTime.GetJulianDay() * 24 * 60 * 60 * 1000);
outDateTimeString.Clear();
outDateTimeString.Printf ("D%04d%02d%02dT%08d",
inTime.GetLocalYear(),
inTime.GetLocalMonth(),
inTime.GetLocalDay(),
ms);
}
示例2: _GetCurrentFormatedTime
void VHTTPServerLog::_GetCurrentFormatedTime (XBOX::VString& outTimeString, bool inLocalTime)
{
sWORD year, month, day, hour, minute, seconds, milliseconds;
XBOX::VTime time;
time.FromSystemTime(); // GMT time
if (inLocalTime)
time.GetLocalTime (year, month, day, hour, minute, seconds, milliseconds);
else
time.GetUTCTime (year, month, day, hour, minute, seconds, milliseconds);
outTimeString.Clear();
outTimeString.Printf ("%02d:%02d:%02d", hour, minute, seconds);
}
示例3: _GetCurrentFormatedDate
void VHTTPServerLog::_GetCurrentFormatedDate (XBOX::VString& outDateString, bool inLocalTime, const char inDateSeparator)
{
sWORD year, month, day, hour, minute, seconds, milliseconds;
XBOX::VTime time;
time.FromSystemTime(); // GMT time
if (inLocalTime)
time.GetLocalTime (year, month, day, hour, minute, seconds, milliseconds);
else
time.GetUTCTime (year, month, day, hour, minute, seconds, milliseconds);
outDateString.Clear();
outDateString.Printf ("%04d%c%02d%c%02d %02d:%02d:%02d", year, inDateSeparator,
month, inDateSeparator, day,
hour, minute, seconds);
}
示例4: _MakeDateString
void VHTTPServerLog::_MakeDateString (const XBOX::VTime& inTime, XBOX::VString& outDateString)
{
/* See description: http://httpd.apache.org/docs/2.2/logs.html#common
[day/month/year:hour:minute:second zone]
day = 2*digit
month = 3*letter
year = 4*digit
hour = 2*digit
minute = 2*digit
second = 2*digit
zone = (`+' | `-') 4*digit
*/
sWORD year = 0, month = 0, day = 0, hour = 0, minute = 0, seconds = 0, milliseconds = 0;
static sLONG sGMTOffSet = 0;
static bool sGMTOffSetUndefined = true;
inTime.GetUTCTime (year, month, day, hour, minute, seconds, milliseconds);
if (sGMTOffSetUndefined)
{
sGMTOffSet = (XBOX::VSystem::GetGMTOffset (true) / (3600));
sGMTOffSetUndefined = false;
}
outDateString.Clear();
outDateString.Printf ( "%02d/%s/%04d:%02d:%02d:%02d %c%02ld00",
day,
CONST_ABBREVIATED_ENGLISH_MONTH_NAMES[month],
year,
hour,
minute,
seconds,
(sGMTOffSet >= 0) ? '+' : '-',
sGMTOffSet);
}