本文整理汇总了C++中TFileName::PtrZ方法的典型用法代码示例。如果您正苦于以下问题:C++ TFileName::PtrZ方法的具体用法?C++ TFileName::PtrZ怎么用?C++ TFileName::PtrZ使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TFileName
的用法示例。
在下文中一共展示了TFileName::PtrZ方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadDataL
void CTestUTCParse::ReadDataL(CImRecvConvert* aRecvConvert, TFileName aFileName)
{
// open the file
RFile file;
TInt error = file.Open(iTestUtils->FileSession(), aFileName, EFileShareAny);
if(error != KErrNone)
{
ERR_PRINTF2(TRefByValue<const TDesC>_L("\r\nFile open error %d"), error);
User::Leave(KErrNotFound);
}
INFO_PRINTF2(TRefByValue<const TDesC>_L("Data from %s...\r\n"), aFileName.PtrZ());
// read the file into the conversion object
HBufC8* lineBuffer = HBufC8::NewLC(1024);
TPtr8 line = lineBuffer->Des();
TBuf8<1> theChar;
TBool finished = EFalse;
aRecvConvert->ResetL();
// supply a new attachment path since previous one is discarded by call to Reset()
do {
line.FillZ();
line.SetLength(0);
// compile a line one char at a time
do {
file.Read(theChar, 1);
if(theChar.Length())
line.Append(theChar);
else
finished = ETrue;
// stop at the end of line or no more data
} while(theChar.Length() && theChar[0] != 0x0A);
if(!line.Length())
break;
aRecvConvert->ParseNextField(line); // This function doesnt actually leave, any leaves are relayed to the MessageCompleteL() function
} while(!finished);
TRAPD(err, aRecvConvert->MessageCompleteL());
if(err!=KErrNone)
{
// At this point the message should be deleted and CImRecvConvert should be Reset()
ERR_PRINTF3(TRefByValue<const TDesC>_L("\r\nError %d occured during the conversion of Message %d"), err, aRecvConvert->EntryId());
}
CleanupStack::PopAndDestroy(lineBuffer);
file.Close();
}
示例2: word
const wchar *C_dir::ScanGet(dword *atts, dword *size, S_date_time *dt){
if(!find_data)
return NULL;
S_scan_data *sd = (S_scan_data*)find_data;
if(sd->index >= sd->count)
return NULL;
const TEntry &e = (*sd->list)[sd->index++];
if(atts){
*atts = 0;
if(e.IsArchive()) *atts |= C_file::ATT_ARCHIVE;
if(e.IsHidden()) *atts |= C_file::ATT_HIDDEN;
if(e.IsReadOnly()) *atts |= C_file::ATT_READ_ONLY;
if(e.IsSystem()) *atts |= C_file::ATT_SYSTEM;
if(e.IsDir()) *atts |= C_file::ATT_DIRECTORY;
}
if(size)
*size = e.iSize;
if(dt){
const TDateTime st = e.iModified.DateTime();
dt->year = word(st.Year());
dt->month = word(st.Month());
dt->day = word(st.Day());
dt->hour = word(st.Hour());
dt->minute = word(st.Minute());
dt->second = word(st.Second());
dt->sort_value = dt->GetSeconds() + dt->GetTimeZoneMinuteShift()*60;
dt->SetFromSeconds(dt->sort_value);
dt->sort_value = dt->GetSeconds();
}
TFileName fn = e.iName;
sd->tmp = (const wchar*)fn.PtrZ();
return sd->tmp;
}