本文整理汇总了C++中stringlist::const_iterator::ToUInt方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::ToUInt方法的具体用法?C++ const_iterator::ToUInt怎么用?C++ const_iterator::ToUInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stringlist::const_iterator
的用法示例。
在下文中一共展示了const_iterator::ToUInt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FromString
bool FileDataCacheItem::FromString( const String& s )
{
path.Clear();
lastUsed = 0;
time.year = 0;
StringList tokens;
s.Break( tokens, char16_type( '\n' ) );
for ( StringList::const_iterator i = tokens.Begin(); i != tokens.End(); )
{
if ( *i == "path" )
{
if ( ++i == tokens.End() )
return false;
path = i->Trimmed();
++i;
}
else if ( *i == "lastUsed" )
{
if ( ++i == tokens.End() )
return false;
lastUsed = i->ToUInt();
++i;
}
else if ( *i == "time" )
{
if ( tokens.End() - i < 3 )
return false;
int y, m, d; double f;
JDToComplexTime( y, m, d, f, i[1].ToUInt()+0.5 );
unsigned t = i[2].ToUInt();
time.year = y;
time.month = m;
time.day = d;
time.milliseconds = t - 86399000;
time.hour = TruncI( (t = TruncI( t/1000.0 ))/3600.0 );
time.minute = TruncI( (t -= time.hour*3600)/60.0 );
time.second = t - time.minute*60;
i += 3;
}
else if ( *i == "data" )
{
if ( !GetDataFromTokens( tokens ) )
return false;
++i;
}
else
{
++i;
}
}
return !path.IsEmpty() && lastUsed > 0 && time.year > 0 && ValidateData();
}