本文整理汇总了C++中TDesC::LocateReverse方法的典型用法代码示例。如果您正苦于以下问题:C++ TDesC::LocateReverse方法的具体用法?C++ TDesC::LocateReverse怎么用?C++ TDesC::LocateReverse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDesC
的用法示例。
在下文中一共展示了TDesC::LocateReverse方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveDataToFile
void CTangImageDataWriter::SaveDataToFile(const TDesC& aFileName)
{
GenerateElementsData();
int pos = aFileName.LocateReverse( '\\');
if (pos!=KErrNotFound)
{
TPtrC dirName = aFileName.Left(pos+1);
CCoeEnv::Static()->FsSession().MkDirAll(dirName);
}
RFile file;
TInt err = file.Replace(CCoeEnv::Static()->FsSession(), aFileName, EFileWrite);
CleanupClosePushL(file);
if (KErrNone != err)
{
CleanupStack::PopAndDestroy(1); // file
return;
}
RFileWriteStream outputFileStream(file);
CleanupClosePushL(outputFileStream);
outputFileStream.WriteL(iRequestXml->Des());
CleanupStack::PopAndDestroy(2); // outputFileStream, file
}
示例2: WriteFileL
TInt CFileOperate::WriteFileL(const TDesC& aFileName)
{
int pos = aFileName.LocateReverse( '\\');
if (pos!=KErrNotFound)
{
TPtrC dirName = aFileName.Left(pos+1);
CCoeEnv::Static()->FsSession().MkDirAll(dirName);
}
RFile file;
TInt err = file.Replace(CCoeEnv::Static()->FsSession(), aFileName, EFileWrite);
CleanupClosePushL(file);
if (KErrNone != err)
{
CleanupStack::PopAndDestroy(1); // file
return err;
}
RFileWriteStream outputFileStream(file);
CleanupClosePushL(outputFileStream);
iNotifier->FileWriteData(outputFileStream);
CleanupStack::PopAndDestroy(2); // outputFileStream, file
return KErrNone;
}
示例3: GetExtNameFromFileName
void GetExtNameFromFileName(const TDesC& aFileName, TDes& aExtName)
{
TInt order = aFileName.LocateReverse('.');
TInt sourceLength = aFileName.Length() - order -1;
aExtName = aFileName.Mid(order +1, sourceLength);
aExtName.LowerCase();
}
示例4: WriteToLogL
void CDebugLogPrint::WriteToLogL(const TDesC &aDes, const TDesC &aDes2)
{
TBuf<256> buf;
TInt pos=aDes.LocateReverse(' ');
if (pos<0)
pos=0;
buf.Copy(aDes.Mid(pos));
buf.Append(' ');
buf.Append(aDes2);
_LIT(KDebugFormatString, "%S");
RDebug::Print(KDebugFormatString, &buf);
}
示例5: ConstructL
// -----------------------------------------------------------------------------
void CFileLogger::ConstructL(const TDesC &logFileName, EWriteFileMode aMode)
{
iFileName.Copy(logFileName);
iMode = aMode;
int pos = logFileName.LocateReverse( '\\');
TPtrC dirName = logFileName.Left(pos+1);
User::LeaveIfError(iFsSession.Connect());
iFsSession.MkDirAll(dirName);
if (iMode == KModeAlwayOpen)
{
OpenFile();
}
}
示例6: GetiniPath
EXPORT_C TInt TEFparser::GetiniPath( TDesC& aBuf,
const TDesC& aScriptPath,
TDes& aIniFilePath)
{
TInt err = KErrNone;
TInt endPos = aScriptPath.LocateReverse('\\');
if (endPos == KErrNotFound)
{
err = KErrNotFound;
}
else
{
aIniFilePath.Copy(aBuf);
aIniFilePath.Insert(0, aScriptPath.Left(endPos+1));
}
return err;
}
示例7: GetFilePathByName
void GetFilePathByName(const TDesC& aFileName, TDes& aFilePath)
{
TInt filePathLength = aFileName.LocateReverse('\\') + 1;
aFilePath = aFileName.Mid(0, filePathLength);
}
示例8: GetFileNameByUrl
//从文件路径拆分出文件名
void GetFileNameByUrl(const TDesC& aUrl, TDes& aFileName)
{
TInt order = aUrl.LocateReverse('/');
TInt sourceLength = aUrl.Length() - order -1;
aFileName = aUrl.Mid(order + 1, sourceLength);
}