本文整理汇总了C++中Poco::toLower方法的典型用法代码示例。如果您正苦于以下问题:C++ Poco::toLower方法的具体用法?C++ Poco::toLower怎么用?C++ Poco::toLower使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Poco
的用法示例。
在下文中一共展示了Poco::toLower方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: devLog
XplDevice::XplDevice
(
string const& _vendorId,
string const& _deviceId,
string const& _version,
bool const _bFilterMsgs,
XplComms* _pComms
) :
m_version ( _version ),
m_bFilterMsgs ( _bFilterMsgs ),
m_pComms ( _pComms ),
m_bConfigRequired ( true ),
m_bInitialised ( false ),
m_heartbeatInterval ( 5 ),
m_nextHeartbeat ( 0 ),
m_bExitThread ( false ),
m_bWaitingForHub ( true ),
m_rapidHeartbeatCounter ( c_rapidHeartbeatTimeout/c_rapidHeartbeatFastInterval ),
devLog ( Logger::get ( "xplsdk.device" ) )
{
devLog.setLevel ("trace");
// Logger::setLevel("xplsdk.device", Message::PRIO_TRACE );
assert ( devLog.trace() );
m_vendorId = toLower ( _vendorId );
m_deviceId = toLower ( _deviceId );
m_instanceId = "default";
SetCompleteId();
m_hRxInterrupt = new Poco::Event ( false );
}
示例2: testToLower
void StringTest::testToLower()
{
{
std::string s = "ABC";
assert (toLower(s) == "abc");
}
{
std::string s = "aBC";
assert (toLower(s) == "abc");
}
{
std::string s = "ABC";
assert (toLowerInPlace(s) == "abc");
}
{
std::string s = "aBC";
assert (toLowerInPlace(s) == "abc");
}
}
示例3: SetCompleteId
void XplDevice::SetCompleteId()
{
m_completeId = toLower ( m_vendorId + string ( "-" ) + m_deviceId + string ( "." ) + m_instanceId );
}
示例4: if
bool XplDevice::HandleMsgForUs
(
XplMsg* _pMsg
)
{
if ( _pMsg->GetType() == XplMsg::c_xplCmnd )
{
if ( "config" == _pMsg->GetSchemaClass() )
{
poco_debug ( devLog, "config message");
if ( "current" == _pMsg->GetSchemaType() )
{
// Config values request
if ( "request" == toLower ( _pMsg->GetValue ( "command" ) ) )
{
SendConfigCurrent();
return true;
}
}
else if ( "list" == _pMsg->GetSchemaType() )
{
// Config list request
if ( string ( "request" ) == toLower ( _pMsg->GetValue ( "command" ) ) )
{
SendConfigList();
return true;
}
}
else if ( "response" == _pMsg->GetSchemaType() )
{
uint32 i;
for ( i=0; i<m_configItems.size(); ++i )
{
// Clear the existing config item values
XplConfigItem* pItem = m_configItems[i];
pItem->ClearValues();
// Copy all the new values from the message into the config item
XplMsgItem const* pValues = _pMsg->GetMsgItem ( pItem->GetName() );
if ( NULL != pValues )
{
for ( uint32 j=0; j<pValues->GetNumValues(); ++j )
{
string value = pValues->GetValue ( j );
if ( !value.empty() )
{
pItem->AddValue ( value );
}
}
}
}
// Configure the XplDevice
Configure();
// Save configuration
SaveConfig();
m_bConfigRequired = false;
// Set the config event
//SetEvent( m_hConfig );
// m_hConfig->set();
//configTaskManager.start(new SampleTask("ConfigTask"));
cout << "posted reconfig from thread " << Thread::currentTid() << "\n";
configNotificationCenter.postNotification ( new DeviceConfigNotification() );
cout << "posted reconfig from thread " << Thread::currentTid() << "\n";
// Send a heartbeat so everyone gets our latest status
m_pComms->SendHeartbeat ( m_completeId, m_heartbeatInterval, m_version );
SetNextHeartbeatTime();
return true;
}
}
else if ( "hbeat" == _pMsg->GetSchemaClass() )
{
if ( "request" == _pMsg->GetSchemaType() )
{
// We've been asked to send a heartbeat
if ( m_bConfigRequired )
{
// Send a config heartbeat
m_pComms->SendConfigHeartbeat ( m_completeId, m_heartbeatInterval, m_version );
}
else
{
// Send a heartbeat
m_pComms->SendHeartbeat ( m_completeId, m_heartbeatInterval, m_version );
}
// Calculate the time of the next heartbeat
SetNextHeartbeatTime();
}
}
}
return false;
}