📄 mguardstate.cpp
字号:
#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -