当前位置: 首页>>代码示例>>C++>>正文


C++ TFsPluginRequest::Request方法代码示例

本文整理汇总了C++中TFsPluginRequest::Request方法的典型用法代码示例。如果您正苦于以下问题:C++ TFsPluginRequest::Request方法的具体用法?C++ TFsPluginRequest::Request怎么用?C++ TFsPluginRequest::Request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TFsPluginRequest的用法示例。


在下文中一共展示了TFsPluginRequest::Request方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Deliver

/**
Delivers the request to the end of plugin thread's queue. 
In certain circumstances, where the request requires priority handling
it adds it to the front of the queue.

@param	aRequest: The request to be delivered
@return KErrNone
*/
EXPORT_C TInt CFsPlugin::Deliver(TFsPluginRequest& aRequest)
	{
	__ASSERT_ALWAYS(iThreadP != NULL, User::Panic(_L("CFsPlugin::Dispatch"),999));

	TInt function = aRequest.Function();

	if(function == EFsPluginOpen)
		{
		// Don't dispatch open requests to the plugin thread
		return KPluginMessageForward;
		}

	if(function == EFsPluginDoRequest ||
	   function == EFsPluginDoControl ||
	   function == EFsPluginDoCancel)
		{
		iThreadP->DeliverFront(aRequest.Request());
		}
	else
		{
		iThreadP->DeliverBack(aRequest.Request());
		}

	return KErrNone;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:33,代码来源:sf_plugin.cpp

示例2: FileRead

/** 
@prototype
@deprecated
@see RFilePlugin::Read
 */
EXPORT_C TInt CFsPlugin::FileRead(TFsPluginRequest& aRequest, TDes8& aDes, TInt64 aPos)
	{
	CFileShare* share;
	CFileCB* file;
	GetFileFromScratch((CFsMessageRequest*) aRequest.Request(), share, file);
	TInt64 fileSize = file->CachedSize64();
	if (aPos > fileSize)
		aPos = fileSize;
	TInt len = aDes.Length();
	if (aPos >= fileSize)
		len = 0;
	if (aPos + len > fileSize)
		// filesize - pos shall of TInt size
		// Hence to suppress warning
		len = (TInt)(fileSize - aPos);
	aDes.SetLength(len);

	return DispatchOperation(aRequest, aDes, aPos, EFsFileRead);
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:24,代码来源:sf_plugin.cpp

示例3: ClientRead

/** @prototype */
EXPORT_C TInt CFsPlugin::ClientRead(TFsPluginRequest& aRequest, TDes8& aDes, TInt aOffset)
	{
	CFsMessageRequest& msgRequest = * (CFsMessageRequest*) aRequest.Request();
	TMsgOperation& currentOperation = msgRequest.CurrentOperation();
	
	TInt r = KErrNone;
	if (currentOperation.iClientRequest)
		{
		r = msgRequest.Read(0, aDes, aOffset);
		}
	else
		{
		TInt len = aDes.Length();
		if (len > (currentOperation.iReadWriteArgs.iTotalLength - aOffset))
			return KErrArgument;
		aDes.Copy ( (TUint8*) currentOperation.iReadWriteArgs.iData + aOffset, len );
		currentOperation.iReadWriteArgs.iOffset = aOffset + len;
		}
	return r;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:21,代码来源:sf_plugin.cpp

示例4: DispatchOperation

/**
@internalTechnology
@prototype
@deprecated

Pushes a msgop, dispatches it and waits for it to complete
*/
TInt CFsPlugin::DispatchOperation(TFsPluginRequest& aRequest, TDes8& aDes, TInt64 aPos, TInt aFunction)
	{
	if (aRequest.Function() != EFsFileRead && aRequest.Function() != EFsFileWrite)
		return KErrNotSupported;
	if (aFunction != EFsFileRead && aFunction != EFsFileWrite)
		return KErrNotSupported;

	CFsMessageRequest& msgRequest = * (CFsMessageRequest*) aRequest.Request();


	TInt len = aDes.Length();
	if (len <= 0)
		return CFsRequest::EReqActionComplete;

	TUint8* ptr = (TUint8*) aDes.Ptr();

	TInt r = msgRequest.PushOperation(
		aPos, len, ptr,
		0,			// aOffset
		Complete,	// callback
		0,			// next state
		aFunction);
	if (r != KErrNone)
		return r;


	CFsPlugin* plugin = this;
	FsPluginManager::ReadLockChain();
	FsPluginManager::NextPlugin(plugin, &msgRequest);
	msgRequest.iCurrentPlugin = plugin;
	msgRequest.Dispatch();
	FsPluginManager::UnlockChain();
	iThreadP->OperationLockWait();

	aDes.SetLength(len);
	
	return msgRequest.LastError();	// KErrNone;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:45,代码来源:sf_plugin.cpp


注:本文中的TFsPluginRequest::Request方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。