Initial commit
This commit is contained in:
26
Ecran Lilygot-T-RGB/Code tests/SDCard/FileHandler.h
Normal file
26
Ecran Lilygot-T-RGB/Code tests/SDCard/FileHandler.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef FileHandler_h
|
||||
#define FileHandler_h
|
||||
|
||||
#include <Arduino.h> // Inclure Arduino.h pour utiliser String
|
||||
#include <FS.h> // Inclure la bibliothèque FS (ou la bibliothèque appropriée)
|
||||
|
||||
struct FileInfo {
|
||||
String name;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
class FileHandler {
|
||||
public:
|
||||
FileHandler();
|
||||
FileInfo* listDir(fs::FS &fs, const char *dirname, uint8_t levels, int &fileCount);
|
||||
void freeFileInfo(FileInfo* fileInfo);
|
||||
bool createDir(fs::FS &fs, const char *path);
|
||||
bool removeDir(fs::FS &fs, const char *path);
|
||||
bool readFile(fs::FS &fs, const char *path);
|
||||
bool writeFile(fs::FS &fs, const char *path, const char *message);
|
||||
bool appendFile(fs::FS &fs, const char *path, const char *message);
|
||||
bool renameFile(fs::FS &fs, const char *path1, const char *path2);
|
||||
bool deleteFile(fs::FS &fs, const char *path);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user