mguardstate.cpp
来自「symbian s60手机上的短信拦截源代码。」· C++ 代码 · 共 76 行
CPP
76 行
#include <e32base.h>
#include <f32file.h>
#include <s32stor.h>
#include <s32file.h>
#include <AknUtils.h>
#include "MGuardState.h"
TBool CMGuardState::SetInstallDate( TTime aTime )
{
TFileName aAppIniPath;
aAppIniPath.Append( _L("c:\\MGuard.ini") );
RFs aFsSession;
aFsSession.Connect();
CDictionaryStore* aDictStore = CDictionaryFileStore::OpenLC (aFsSession, aAppIniPath, TUid::Uid(0x0001) );
// construct the dictionary write stream and
// associate the stream with the UID
// whose value is 0x0002
RDictionaryWriteStream out;
out.AssignLC( *aDictStore, TUid::Uid( 1 ) );
out << aTime.Int64();
// Commit changes to the stream
out.CommitL();
// Cleanup the dictionary stream object
CleanupStack::PopAndDestroy();
// Now commit all changes to the store
aDictStore->CommitL();
// Close the dictionary store (closes the
// associated file and destroys the
// dictionary store object)
CleanupStack::PopAndDestroy();
return ETrue;
}
TBool CMGuardState::GetInstallDate( TInt64& aLoggedTime )
{
TFileName aAppIniPath;
aAppIniPath.Append( _L("c:\\MGuard.ini") );
// TParse dictionaryname;
RFs aFsSession;
aFsSession.Connect();
// Open the dictionary store
CDictionaryStore* aDictstore=CDictionaryFileStore::OpenLC( aFsSession, aAppIniPath, TUid::Uid(0x0001) );
// construct the dictionary read stream.
// Prepare to read the stream associated with
// the unique identifier whose value is 0x0002
RDictionaryReadStream in;
in.OpenLC( *aDictstore, TUid::Uid( 1 ) );
//
//
//// ... and read data from the stream
in >> aLoggedTime;
//
// Cleanup the dictionary stream object
// and ...
// Close the dictionary store
// (closes the associated file and destroys the
// dictionary store object)
CleanupStack::PopAndDestroy(2);
return ETrue;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?