Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
FATDirHandle.cpp
00001 /* mbed Microcontroller Library - FATDirHandle 00002 Copyright (c) 2008, sford */ 00003 00004 //Modified by Thomas Hamilton, Copyright 2010 00005 00006 #include "FATDirHandle.h" 00007 00008 FATDirHandle::FATDirHandle(FAT_DIR InputDirStr) 00009 { 00010 DirectoryObject = InputDirStr; 00011 } 00012 00013 int FATDirHandle::closedir() 00014 { 00015 delete this; 00016 return 0; 00017 } 00018 00019 struct dirent* FATDirHandle::readdir() 00020 { 00021 FILINFO FileInfo; 00022 FRESULT Result = f_readdir(&DirectoryObject, &FileInfo); 00023 if (Result || !FileInfo.fname[0]) 00024 { 00025 return NULL; 00026 } 00027 else 00028 { 00029 for (unsigned char i = 0; i < 13; i++) 00030 { 00031 CurrentEntry.d_name[i] = ((char*)FileInfo.fname)[i]; 00032 } 00033 return &CurrentEntry; 00034 } 00035 } 00036 00037 void FATDirHandle::rewinddir() 00038 { 00039 DirectoryObject.index = 0; 00040 } 00041 00042 off_t FATDirHandle::telldir() 00043 { 00044 return (off_t)DirectoryObject.index; 00045 } 00046 00047 void FATDirHandle::seekdir(off_t location) 00048 { 00049 DirectoryObject.index = (WORD)location; 00050 }
Generated on Wed Jul 13 2022 08:04:37 by
1.7.2