⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mguardstate.cpp,v

📁 symbian s60手机上的短信拦截源代码。
💻 CPP,V
字号:
head     1.1;branch   1.1.1;access   ;symbols 	arelease:1.1.1.1	avendor:1.1.1;locks    ; strict;comment  @// @;1.1date     2007.07.24.10.59.30;  author administrator;  state Exp;branches 1.1.1.1;next     ;deltatype   text;permissions	644;1.1.1.1date     2007.07.24.10.59.30;  author administrator;  state Exp;branches ;next     ;permissions	644;desc@@1.1log@Initial revision@text@#include <e32base.h>#include <f32file.h>#include <s32stor.h>#include <s32file.h>#include <AknUtils.h>#include "MGuardState.h"CMGuardState* CMGuardState::NewLC(){	CMGuardState* self = new (ELeave)CMGuardState();	CleanupStack::PushL(self);	self->ConstructL();	return self;}CMGuardState* CMGuardState::NewL(){	CMGuardState* self=NewLC();	CleanupStack::Pop();	return self;}CMGuardState::~CMGuardState(){}void CMGuardState::ConstructL(){}TBool CMGuardState::SetLockState( TBool aLock ){		TFileName aAppIniPath;//	CompleteWithAppPath( aAppIniPath );	aAppIniPath.Append( _L("c:\\logs\\MGuard.ini") );	RFs aFsSession;	aFsSession.Connect();	CDictionaryStore* aDictStore = CDictionaryFileStore::OpenLC (aFsSession, aAppIniPath, TUid::Uid(0x0001) );		// Construct a TClass and put some data into it//	TBool aBool = EFalse;		// construct the dictionary write stream and	// associate the stream with the UID	// whose value is 0x0002	RDictionaryWriteStream out;	out.AssignLC( *aDictStore, TUid::Uid( EMGUARDLOCKED ) );		if ( aLock )	{		// write the TClass data to the stream		_LIT( KLOCKED, "LOCKED" );		out << KLOCKED();	}	else	{		// write the TClass data to the stream		_LIT( KLOOCKED, "LOOCKED" );		out << KLOOCKED();			}	 	// 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::GetLockState(){	//TFileName aAppIniPath;	//CompleteWithAppPath( aAppIniPath );	//aAppIniPath.Append( _L("MGuard.ini") );	TFileName aAppIniPath;	//	CompleteWithAppPath( aAppIniPath );	aAppIniPath.Append( _L("c:\\logs\\MGuard.ini") );//	TParse dictionaryname;	RFs aFsSession;	aFsSession.Connect();//	fsSession.Parse(KFileName,dictionaryname);	// 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( EMGUARDLOCKED ) );	//	//// Construct a TClass object ...	TBuf16<100> aLockedString;	aLockedString.Delete( 0, aLockedString.Length() );	//	//// ... and read data from the stream	in >> aLockedString;	//	// Cleanup the dictionary stream object	// and ...	// Close the dictionary store	// (closes the associated file and destroys the	// dictionary store object)	CleanupStack::PopAndDestroy(2);			if ( KErrNotFound != aLockedString.FindF( _L("LOCKED") ) )	{		return ETrue;	}	return EFalse;}@1.1.1.1log@no message@text@@

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -