本文整理汇总了C++中TFsPluginRequest::FileName方法的典型用法代码示例。如果您正苦于以下问题:C++ TFsPluginRequest::FileName方法的具体用法?C++ TFsPluginRequest::FileName怎么用?C++ TFsPluginRequest::FileName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TFsPluginRequest
的用法示例。
在下文中一共展示了TFsPluginRequest::FileName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FsFileWriteL
/**
@internalComponent
*/
void CPreModifierPlugin::FsFileWriteL(TFsPluginRequest& aRequest)
{
TInt err = KErrNone;
TInt length = 0;
TInt64 pos = 0;
TFileName filename;
TParse parse;
TBuf<256> testfilename1;
TBuf<256> testfilename2;
//setting up test files
testfilename1.Append(iDriveToTest);
testfilename1.Append(_L(":\\Data\\test.txt"));
testfilename2.Append(iDriveToTest);
testfilename2.Append(_L(":\\Data\\createcreate3.txt"));
err = aRequest.FileName(filename);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
err = aRequest.Read(TFsPluginRequest::ELength, length);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
err = aRequest.Read(TFsPluginRequest::EPosition, pos);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
parse.Set(filename, NULL, NULL);
_LOG4(_L("CPreModifierPlugin::FsFileWriteL, file: %S, pos: %d, length: %d"), &filename, pos, length);
if (aRequest.IsPostOperation())
{
_LOG(_L("CPreModifierPlugin::FsFileWriteL, post intercept"));
}
else
{
User::Invariant();
}
}
示例2: FsDirReadOneL
void CPreModifierPlugin::FsDirReadOneL(TFsPluginRequest& aRequest)
{
TFileName name;
TInt err = aRequest.FileName(name);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
if (aRequest.IsPostOperation())
{
_LOG(_L("CPreModifierPlugin::FsDirReadOneL, post intercept"));
}
else
{
User::Invariant();
}
}
示例3: FsFileUnLockL
/**
@internalComponent
*/
void CPreModifierPlugin::FsFileUnLockL(TFsPluginRequest& aRequest)
{
TInt length = 0;
TInt64 pos = 0;
TFileName filename;
TParse parse;
TInt err = aRequest.FileName(filename);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
err = aRequest.Read(TFsPluginRequest::ELength, length);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
err = aRequest.Read(TFsPluginRequest::EPosition, pos);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
parse.Set(filename, NULL, NULL);
//TPtrC extension(parse.Ext());
_LOG4(_L("CPreModifierPlugin::FsFileUnLockL, file: %S, pos: %d, length: %d"), &filename, pos, length);
if (aRequest.IsPostOperation())
{
_LOG(_L("CPreModifierPlugin::FsFileUnLockL, post intercept"));
}
else
{
User::Invariant();
}
}
示例4: FsFileSetSizeL
/**
@internalComponent
*/
void CPreModifierPlugin::FsFileSetSizeL(TFsPluginRequest& aRequest)
{
TFileName filename;
TParse parse;
TInt err = aRequest.FileName(filename);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
parse.Set(filename, NULL, NULL);
_LOG2(_L("CPreModifierPlugin::FsFileSetSizeL, file: %S"), &filename);
if (aRequest.IsPostOperation())
{
_LOG(_L("CPreModifierPlugin::FsFileSetSizeL, post intercept"));
}
else
{
User::Invariant();
}
}
示例5: FsFileLockL
/**
@internalComponent
*/
void CPreModifierPlugin::FsFileLockL(TFsPluginRequest& aRequest)
{
TInt length = 0;
TInt64 pos = 0;
TFileName filename;
TParse parse;
TInt err = aRequest.FileName(filename);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
err = aRequest.Read(TFsPluginRequest::ELength, length);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
err = aRequest.Read(TFsPluginRequest::EPosition, pos);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
parse.Set(filename, NULL, NULL);
TPtrC extension(parse.Ext());
_LOG4(_L("CPreModifierPlugin::FsFileLockL, file: %S, pos: %d, length: %d"), &filename, pos, length);
if (aRequest.IsPostOperation())
{
_LOG(_L("CPreModifierPlugin::FsFileLockL, post intercept"));
// Request read from post interception
if (extension.CompareF(_L(".lockread")) == 0)
{
length = 10;
HBufC8* tempBuf = HBufC8::NewMaxLC(length);
TPtr8 tempBufPtr((TUint8 *)tempBuf->Des().Ptr(), length, length);
_LOG(_L("CPreModifierPlugin::FsFileLockL , calling AdoptFromClient in post intercept"));
RFilePlugin fileplugin(aRequest);
TInt err = fileplugin.AdoptFromClient();
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
_LOG2(_L("CPreModifierPlugin::FsFileLockL, Adopt returned %d"), err);
err = fileplugin.Read(pos, tempBufPtr, length);
_LOG2(_L("CPreModifierPlugin::FsFileLockL, FileRead returned %d"), err);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
fileplugin.Close();
CleanupStack::PopAndDestroy();
}
// Request close from post interception
if(extension.CompareF(_L(".lockclose")) == 0)
{
_LOG(_L("CPreModifierPlugin::FsFileLockL, file = *.lockclose post intercept "));
RFilePlugin fileplugin(aRequest);
TInt err = fileplugin.AdoptFromClient();
_LOG2(_L("CPreModifierPlugin::FsFileLockL ,Open %d"), err);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
fileplugin.Close();
_LOG(_L("CPreModifierPlugin::FsFileLockL, Close"));
}
}
else
{
User::Invariant();
}
}
示例6: tempBufPtr
/**
@internalComponent
*/
void CStacked3Plugin::FsFileWriteL(TFsPluginRequest& aRequest)
{
TInt length = 0;
TInt64 pos = 0;
TFileName filename;
TParse parse;
TInt err = aRequest.FileName(filename);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
err = aRequest.Read(TFsPluginRequest::ELength, length);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
err = aRequest.Read(TFsPluginRequest::EPosition, pos);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
parse.Set(filename, NULL, NULL);
_LOG4(_L("CStacked3Plugin::FsFileWriteL, file: %S, pos: %d, length: %d"), &filename, pos, length);
if (aRequest.IsPostOperation())
{
_LOG(_L("CStacked3Plugin::FsFileWriteL, post intercept"));
}
else
{
_LOG(_L("CStacked3Plugin::FsFileWriteL, pre intercept"));
//set up test data for plugin
TBuf8<20> wbuffer;
wbuffer.Copy(_L8("HELLO WORLD SYMBIAN"));
TInt length = wbuffer.Length();
HBufC8* tempBuf = HBufC8::NewMaxLC(length);
TPtr8 tempBufPtr((TUint8 *)tempBuf->Des().Ptr(), length, length);
RFilePlugin fileplugin(aRequest);
err = fileplugin.AdoptFromClient();
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
//write to file
err = fileplugin.Write(pos, wbuffer);
_LOG2(_L("CStacked3Plugin::FsFileWriteL, RFilePlugin::Write returned %d"), err);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
//read from file
err = fileplugin.Read(pos, tempBufPtr);
_LOG2(_L("CStackedPlugin::FsFileWriteL, RFilePlugin::Read returned %d"), err);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
//testing the correct thing has been written to the drive
err = wbuffer.Compare(tempBufPtr);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
fileplugin.Close();
CleanupStack::PopAndDestroy();
// send request down the stack
User::Leave(KErrCompletion);
}
}