本文整理汇总了C++中TLocale::SetTimeSeparator方法的典型用法代码示例。如果您正苦于以下问题:C++ TLocale::SetTimeSeparator方法的具体用法?C++ TLocale::SetTimeSeparator怎么用?C++ TLocale::SetTimeSeparator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TLocale
的用法示例。
在下文中一共展示了TLocale::SetTimeSeparator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setTimeSeparator
/*!
*/
void SettingsUtility::setTimeSeparator(const QString &separator)
{
OstTraceFunctionEntry0( SETTINGSUTILITY_SETTIMESEPARATOR_ENTRY );
if (mTimeSeparatorList.contains(separator)) {
TLocale locale;
locale.SetTimeSeparator(TChar(separator.unicode()->unicode()), 1);
locale.SetTimeSeparator(TChar(separator.unicode()->unicode()), 2);
locale.Set();
}
OstTraceFunctionExit0( SETTINGSUTILITY_SETTIMESEPARATOR_EXIT );
}
示例2: new
/**
@SYMTestCaseID SYSLIB-LOGENG-CT-0883
@SYMTestCaseDesc Tests for CLogClient::ClearLog() function
@SYMTestPriority High
@SYMTestActions Change locale settings,call up ClearLog and try to retrieve event,test for count of number of events in the view.
@SYMTestExpectedResults Test must not fail
@SYMREQ REQ0000
*/
LOCAL_C void TestClearLog2L(CLogClient& aClient)
{
TheTest.Next(_L(" @SYMTestCaseID:SYSLIB-LOGENG-CT-0883 "));
CLogEvent* event = CLogEvent::NewL();
CleanupStack::PushL(event);
event->SetEventType(KLogCallEventTypeUid);
CTestActive* active = new(ELeave)CTestActive();
CleanupStack::PushL(active);
CLogViewEvent* view = CLogViewEvent::NewL(aClient);
CleanupStack::PushL(view);
// change Locale
TLocale locale;
locale.SetCountryCode(47);//Norway
locale.SetDateFormat(EDateEuropean);
locale.SetTimeFormat(ETime12);
for (int i=0; i<4; i++)
{
locale.SetTimeSeparator(TChar('.'),i);
locale.SetDateSeparator(TChar(':'),i);
}
locale.Set();
// change the log duration settings to 1 day
TLogConfig config;
active->StartL();
aClient.GetConfig(config, active->iStatus);
CActiveScheduler::Start();
TEST2(active->iStatus.Int(), KErrNone);
config.iMaxLogSize = KTestEventAge * 2;
config.iMaxEventAge = 86400;
active->StartL();
aClient.ChangeConfig(config, active->iStatus);
CActiveScheduler::Start();
TEST2(active->iStatus.Int(), KErrNone);
// add a call event
active->StartL();
aClient.AddEvent(*event, active->iStatus);
CActiveScheduler::Start();
TEST2(active->iStatus.Int(), KErrNone);
User::After(1000000);
TTime now;
now.HomeTime();
event->SetTime(now);
active->StartL();
aClient.ChangeEvent(*event, active->iStatus);
CActiveScheduler::Start();
TEST2(active->iStatus.Int(), KErrNone);
// forward two days
now+=(TTimeIntervalDays )2;
User::SetHomeTime(now);
active->StartL();
aClient.ClearLog(now, active->iStatus);
CActiveScheduler::Start();
TEST2(active->iStatus.Int(), KErrNone);
// try to retrieve event
active->StartL();
aClient.GetEvent(*event, active->iStatus);
CActiveScheduler::Start();
TEST2(active->iStatus.Int(), KErrNotFound);;
TEST(view->CountL() == 0);
CleanupStack::PopAndDestroy(3); // view, active, event
}