本文整理汇总了C++中SdBaseFile::getLongFilename方法的典型用法代码示例。如果您正苦于以下问题:C++ SdBaseFile::getLongFilename方法的具体用法?C++ SdBaseFile::getLongFilename怎么用?C++ SdBaseFile::getLongFilename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SdBaseFile
的用法示例。
在下文中一共展示了SdBaseFile::getLongFilename方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lsDive
/**
* Dive into a folder and recurse depth-first to perform a pre-set operation lsAction:
* LS_Count - Add +1 to nrFiles for every file within the parent
* LS_GetFilename - Get the filename of the file indexed by nrFiles
*/
void CardReader::lsDive(SdBaseFile parent, const char* const match/*=NULL*/) {
dir_t* p;
uint8_t cnt = 0;
// Read the next entry from a directory
while ((p = parent.getLongFilename(p, fullName, 0, NULL)) != NULL) {
char pn0 = p->name[0];
if (pn0 == DIR_NAME_FREE) break;
if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue;
if (fullName[0] == '.') continue;
if (!DIR_IS_FILE_OR_SUBDIR(p)) continue;
filenameIsDir = DIR_IS_SUBDIR(p);
if (!filenameIsDir && (p->name[8] != 'G' || p->name[9] == '~')) continue;
switch (lsAction) {
case LS_Count:
nrFiles++;
break;
case LS_GetFilename:
if (match != NULL) {
if (strcasecmp(match, fullName) == 0) return;
}
else if (cnt == nrFiles) return;
cnt++;
break;
}
} // while readDir
}