Standardize File handling with FsHelpers (#110)
## Summary * Standardize File handling with FsHelpers * Better central place to manage to logic of if files exist/open for reading/writing
This commit is contained in:
14
lib/FsHelpers/FsHelpers.h
Normal file
14
lib/FsHelpers/FsHelpers.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
#include <FS.h>
|
||||
|
||||
class FsHelpers {
|
||||
public:
|
||||
static bool openFileForRead(const char* moduleName, const char* path, File& file);
|
||||
static bool openFileForRead(const char* moduleName, const std::string& path, File& file);
|
||||
static bool openFileForRead(const char* moduleName, const String& path, File& file);
|
||||
static bool openFileForWrite(const char* moduleName, const char* path, File& file);
|
||||
static bool openFileForWrite(const char* moduleName, const std::string& path, File& file);
|
||||
static bool openFileForWrite(const char* moduleName, const String& path, File& file);
|
||||
static bool removeDir(const char* path);
|
||||
static std::string normalisePath(const std::string& path);
|
||||
};
|
||||
Reference in New Issue
Block a user