本文整理汇总了C++中DOS_DTA::SetDirID方法的典型用法代码示例。如果您正苦于以下问题:C++ DOS_DTA::SetDirID方法的具体用法?C++ DOS_DTA::SetDirID怎么用?C++ DOS_DTA::SetDirID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOS_DTA
的用法示例。
在下文中一共展示了DOS_DTA::SetDirID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindFirst
bool isoDrive::FindFirst(char *dir, DOS_DTA &dta, bool fcb_findfirst) {
isoDirEntry de;
if (!lookup(&de, dir)) {
DOS_SetError(DOSERR_PATH_NOT_FOUND);
return false;
}
// get a directory iterator and save its id in the dta
int dirIterator = GetDirIterator(&de);
bool isRoot = (*dir == 0);
dirIterators[dirIterator].root = isRoot;
dta.SetDirID((Bit16u)dirIterator);
Bit8u attr;
char pattern[ISO_MAXPATHNAME];
dta.GetSearchParams(attr, pattern);
if (attr == DOS_ATTR_VOLUME) {
dta.SetResult(discLabel, 0, 0, 0, DOS_ATTR_VOLUME);
return true;
} else if ((attr & DOS_ATTR_VOLUME) && isRoot && !fcb_findfirst) {
if (WildFileCmp(discLabel,pattern)) {
// Get Volume Label (DOS_ATTR_VOLUME) and only in basedir and if it matches the searchstring
dta.SetResult(discLabel, 0, 0, 0, DOS_ATTR_VOLUME);
return true;
}
}
return FindNext(dta);
}
示例2: FindFirst
bool localDrive::FindFirst(char * _dir,DOS_DTA & dta,bool fcb_findfirst) {
char tempDir[CROSS_LEN];
strcpy(tempDir,basedir);
strcat(tempDir,_dir);
CROSS_FILENAME(tempDir);
if (allocation.mediaid==0xF0 ) {
EmptyCache(); //rescan floppie-content on each findfirst
}
char end[2]={CROSS_FILESPLIT,0};
if (tempDir[strlen(tempDir)-1]!=CROSS_FILESPLIT) strcat(tempDir,end);
Bit16u id;
if (!dirCache.FindFirst(tempDir,id)) {
DOS_SetError(DOSERR_PATH_NOT_FOUND);
return false;
}
strcpy(srchInfo[id].srch_dir,tempDir);
dta.SetDirID(id);
Bit8u sAttr;
dta.GetSearchParams(sAttr,tempDir);
if (this->isRemote() && this->isRemovable()) {
// cdroms behave a bit different than regular drives
if (sAttr == DOS_ATTR_VOLUME) {
dta.SetResult(dirCache.GetLabel(),0,0,0,DOS_ATTR_VOLUME);
return true;
}
} else {
if (sAttr == DOS_ATTR_VOLUME) {
if ( strcmp(dirCache.GetLabel(), "") == 0 ) {
// LOG(LOG_DOSMISC,LOG_ERROR)("DRIVELABEL REQUESTED: none present, returned NOLABEL");
// dta.SetResult("NO_LABEL",0,0,0,DOS_ATTR_VOLUME);
// return true;
DOS_SetError(DOSERR_NO_MORE_FILES);
return false;
}
dta.SetResult(dirCache.GetLabel(),0,0,0,DOS_ATTR_VOLUME);
return true;
} else if ((sAttr & DOS_ATTR_VOLUME) && (*_dir == 0) && !fcb_findfirst) {
//should check for a valid leading directory instead of 0
//exists==true if the volume label matches the searchmask and the path is valid
if (WildFileCmp(dirCache.GetLabel(),tempDir)) {
dta.SetResult(dirCache.GetLabel(),0,0,0,DOS_ATTR_VOLUME);
return true;
}
}
}
return FindNext(dta);
}
示例3: FindFirst
bool physfsDrive::FindFirst(const char * _dir,DOS_DTA & dta,bool fcb_findfirst) {
char tempDir[CROSS_LEN];
strcpy(tempDir,basedir);
strcat(tempDir,_dir);
CROSS_FILENAME(tempDir);
char end[2]={CROSS_FILESPLIT,0};
if (tempDir[strlen(tempDir)-1]!=CROSS_FILESPLIT) strcat(tempDir,end);
Bit16u id;
if (!dirCache.FindFirst(tempDir,id))
{
DOS_SetError(DOSERR_PATH_NOT_FOUND);
return false;
}
strcpy(srchInfo[id].srch_dir,tempDir);
dta.SetDirID(id);
Bit8u sAttr;
dta.GetSearchParams(sAttr,tempDir);
if (sAttr == DOS_ATTR_VOLUME) {
if ( strcmp(dirCache.GetLabel(), "") == 0 ) {
LOG(LOG_DOSMISC,LOG_ERROR)("DRIVELABEL REQUESTED: none present, returned NOLABEL");
dta.SetResult("NO_LABEL",0,0,0,DOS_ATTR_VOLUME);
return true;
}
dta.SetResult(dirCache.GetLabel(),0,0,0,DOS_ATTR_VOLUME);
return true;
} else if ((sAttr & DOS_ATTR_VOLUME) && (*_dir == 0) && !fcb_findfirst) {
//should check for a valid leading directory instead of 0
//exists==true if the volume label matches the searchmask and the path is valid
if ( strcmp(dirCache.GetLabel(), "") == 0 ) {
LOG(LOG_DOSMISC,LOG_ERROR)("DRIVELABEL REQUESTED: none present, returned NOLABEL");
dta.SetResult("NO_LABEL",0,0,0,DOS_ATTR_VOLUME);
return true;
}
if (WildFileCmp(dirCache.GetLabel(),tempDir)) {
dta.SetResult(dirCache.GetLabel(),0,0,0,DOS_ATTR_VOLUME);
return true;
}
}
return FindNext(dta);
}