本文整理汇总了C++中TLex::Val方法的典型用法代码示例。如果您正苦于以下问题:C++ TLex::Val方法的具体用法?C++ TLex::Val怎么用?C++ TLex::Val使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TLex
的用法示例。
在下文中一共展示了TLex::Val方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadIniFileL
void TSimpleSettings::ReadIniFileL( RFs& aFs )
{
// Set few values without reading them from ini file
CSimpleSettingFile* configFile = CSimpleSettingFile::NewL( aFs );
CleanupStack::PushL( configFile ); // *****
// Search current drive
TFileName path;
Dll::FileName( path );
TDriveName drive( TParsePtrC( path ).Drive( ) );
// In emulator we try to find from c drive
// in hardware we try to find from current drive and then from RAM.
#ifdef __WINS__
TFileName fileN( KSimpleIniFile);
#else
TFileName fileN( drive );
fileN.Append( KSimpleIniFile );
#endif
TInt err = 0;
// Open temporary config file
TRAP( err, configFile->OpenL( fileN ));
if ( err && drive.CompareF( _L("c:") ))
{
err = KErrNone;
fileN = _L("c:");
fileN.Append( KSimpleIniFile );
TRAP( err, configFile->OpenL( fileN ));
}
if ( err )
{
err = KErrNone;
TSimpleLogger::Log(_L("Config file not found ***"));
User::Leave( KErrNotFound );
}
else
{
TSimpleLogger::Log(_L("Config file found ***"));
}
TUint32 myUint = 0;
TPtrC8 myPtr;
TBuf<8> myBuffer;
// read expiry times
TRAP( err, myPtr.Set( configFile->KeyValueL(KSimpleExpiryPuhlish)));
if ( !err )
{
myBuffer.Copy( myPtr );
TLex lex;
lex.Assign( myBuffer );
lex.Val(myUint, EDecimal);
iExpiryPuhlish = (TInt) myUint;
}
TRAP( err, myPtr.Set( configFile->KeyValueL(KSimpleExpiryWatcher)));
if ( !err )
{
myBuffer.Copy( myPtr );
TLex lex;
lex.Assign( myBuffer );
lex.Val(myUint, EDecimal);
iExpiryWatcher = (TInt) myUint;
}
TRAP( err, myPtr.Set( configFile->KeyValueL(KSimpleExpiryWinfo)));
if ( !err )
{
myBuffer.Copy( myPtr );
TLex lex;
lex.Assign( myBuffer );
lex.Val(myUint, EDecimal);
iExpiryWinfo = (TInt) myUint;
}
TRAP( err, myPtr.Set( configFile->KeyValueL(KSimpleExpiryAPI)));
if ( !err )
{
myBuffer.Copy( myPtr );
TLex lex;
lex.Assign( myBuffer );
lex.Val(myUint, EDecimal);
iExpiryApi = (TInt) myUint;
}
TRAP( err, myPtr.Set( configFile->KeyValueL(KSimpleObjLimit)));
if ( !err )
{
myBuffer.Copy( myPtr );
TLex lex;
lex.Assign( myBuffer );
lex.Val(myUint, EDecimal);
iObjLimit = (TInt) myUint;
}
TRAP( err, myPtr.Set( configFile->KeyValueL(KSimpleThrottle)));
if ( !err )
{
myBuffer.Copy( myPtr );
//.........这里部分代码省略.........