-
Notifications
You must be signed in to change notification settings - Fork 0
/
FileSystem.h
45 lines (36 loc) · 1.2 KB
/
FileSystem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef FILESYSTEM_H
#define FILESYSTEM_H
#include "fatfs_config.h"
/** @brief virtual during unit testing, #undef in production to reduce code size */
#define TEST_VIRTUAL virtual
/** @brief FileSystem class wrapping C APIs provided by FatFs */
class FileSystem
{
public:
FileSystem() {}
TEST_VIRTUAL ~FileSystem() {}
/* apparently arduino doesn't support pure virtual, but make these empty
for now until we get the real FatFs implementation compiled in. Then
these will just delegate to the real C functions */
TEST_VIRTUAL FRESULT myf_open(FIL* file, const XCHAR* path, TBYTE modeFlags) const
{
//eventually just call f_open(file, path, modeFlags);
return FR_NOT_READY;
}
TEST_VIRTUAL FRESULT myf_read(FIL* file, void* buffer, UINT bytesToRead, UINT*bytesRead) const
{
//eventually just call f_read(file, buffer, bytesToRead, bytesRead);
return FR_NOT_READY;
}
TEST_VIRTUAL FRESULT myf_close(FIL* file) const
{
//eventually just call f_close(file);
return FR_NOT_READY;
}
TEST_VIRTUAL FRESULT myf_stat(const XCHAR* FileName, FILINFO* FileInfo) const
{
//eventually just call f_stat(FileName, FileInfo);
return FR_NOT_READY;
}
};
#endif