本文整理汇总了C++中SdFile::getFilename方法的典型用法代码示例。如果您正苦于以下问题:C++ SdFile::getFilename方法的具体用法?C++ SdFile::getFilename怎么用?C++ SdFile::getFilename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SdFile
的用法示例。
在下文中一共展示了SdFile::getFilename方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mas_sdfat_get_nth_file
/*
Description:
Requrest for a specific file at a specified position within the directory
The path argument is identical to the path which was provided to last
call to "mas_sdfat_move_to_pwd"
*/
uint8_t mas_sdfat_get_nth_file(const char *path, uint16_t n, char *buf, uint8_t *is_dir)
{
uint16_t c = 0;
if ( mas_sdfat_move_to_pwd(path) == 0 )
return 0;
if ( mas_sdfat_file_is_open != 0 )
{
mas_sdfat_file.close();
mas_sdfat_file_is_open = 0;
}
mas_sdfat_sd->vwd()->rewind();
while (mas_sdfat_file.openNext(mas_sdfat_sd->vwd(), O_READ))
{
if ( n == c )
{
mas_sdfat_file.getFilename(buf);
buf[12] = '\0';
*is_dir = mas_sdfat_file.isDir();
mas_sdfat_file.close();
return 1;
}
c++;
mas_sdfat_file.close();
}
return 0;
}