本文整理汇总了C++中TFsPluginRequest::Dest方法的典型用法代码示例。如果您正苦于以下问题:C++ TFsPluginRequest::Dest方法的具体用法?C++ TFsPluginRequest::Dest怎么用?C++ TFsPluginRequest::Dest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TFsPluginRequest
的用法示例。
在下文中一共展示了TFsPluginRequest::Dest方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FsRenameL
void CPreModifierPlugin::FsRenameL(TFsPluginRequest& aRequest)
{
TInt err = KErrNone;
TFileName oldfilename;
TFileName newfilename;
oldfilename = aRequest.Src().FullName();
newfilename = aRequest.Dest().FullName();
TBuf<256> testfilename1;
//setting up test files
testfilename1.Append(iDriveToTest);
testfilename1.Append(_L(":\\Data\\test.txt"));
if (aRequest.IsPostOperation())
{
_LOG(_L("CPreModifierPlugin::FsRenameL, post intercept"));
RFilePlugin fileplugin2(aRequest);
//open a second file
err = fileplugin2.Open(testfilename1, EFileWrite);
_LOG3(_L("CPreModifierPlugin::FsRenameL, RFilePlugin::Open for %S returned %d"), &testfilename1, err);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
TInt64 size=0;
err = fileplugin2.Size(size);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
//close the second file
fileplugin2.Close();
_LOG2(_L("CPreModifierPlugin::FsRenameL, RFilePlugin::Close to the second file returned %d"), err);
}
else
{
User::Invariant();
}
}
示例2: FsFileRenameL
/**
@internalComponent
*/
void CPreModifierPlugin::FsFileRenameL(TFsPluginRequest& aRequest)
{
TFileName oldfilename, newfilename;
TParse parse;
oldfilename = aRequest.Src().FullName();
newfilename = aRequest.Dest().FullName();
parse.Set(oldfilename, NULL, NULL);
TPtrC extension(parse.Ext());
_LOG3(_L("CPreModifierPlugin::FsFileRenameL, old name: %S, new name: %S"), &oldfilename, &newfilename);
if (aRequest.IsPostOperation())
{
_LOG(_L("CPreModifierPlugin::FsFileRenameL, post intercept"));
if (extension.CompareF(_L(".tst")) == 0)
{
TBuf8<32> tempBuf = (_L8("Rename Post Intercept"));
RFilePlugin fileplugin(aRequest);
TInt err = fileplugin.AdoptFromClient();
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
err = fileplugin.Write(20, tempBuf);
_LOG2(_L("CPreModifierPlugin::FsFileRenameL, FileWrite returned %d"), err);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
fileplugin.Close();
}
}
else
{
User::Invariant();
}
}
示例3: FsReplaceL
void CPreModifierPlugin::FsReplaceL(TFsPluginRequest& aRequest)
{
TFileName oldfilename;
TFileName newfilename;
oldfilename = aRequest.Src().FullName();
newfilename = aRequest.Dest().FullName();
TBuf<256> testfilename1;
//setting up test files
testfilename1.Append(iDriveToTest);
testfilename1.Append(_L(":\\Data\\test.txt"));
if (aRequest.IsPostOperation())
{
//STF: Is this code going to get called - the pre-operation completes early?
_LOG(_L("CPreModifierPlugin::FsReplaceL, post intercept"));
//We should check that the name has changed here.
RFilePlugin file(aRequest);
TInt err = file.AdoptFromClient();
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
TInt compare = oldfilename.Compare(newfilename);
if(compare != 0) //is equal
{
//User::Leave(compare);
//It wont be equal as the name is coming from the request aint it.
//Pointless comparison then eh?
}
file.Close();
RFilePlugin fileplugin2(aRequest);
//open a second file
err = fileplugin2.Open(testfilename1, EFileWrite);
_LOG3(_L("CPreModifierPlugin::FsReplaceL, RFilePlugin::Open for %S returned %d"), &testfilename1, err);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
TInt64 size=0;
err =fileplugin2.Size(size);
iLastError = err;
iLineNumber = __LINE__;
if(err!=KErrNone)
User::Leave(err); //trapped in DoRequestL
//close the second file
fileplugin2.Close();
_LOG2(_L("CPreModifierPlugin::FsReplaceL, RFilePlugin::Close to the second file returned %d"), err);
}
else
{
User::Invariant();
}
}