roo_io
API Documentation for roo_io
Loading...
Searching...
No Matches
base_vfs_filesystem.h
Go to the documentation of this file.
1#pragma once
2
3#if (defined ESP_PLATFORM || defined ROO_TESTING)
4
6
7namespace roo_io {
8
9// Common base class for ESP32 filesystems using ESP-IDF VFS FAT APIs.
10// Allows setting common parameters like frequency, mount point, max open
11// files, format-if-mount-failed, read-only mode.
12class BaseEsp32VfsFilesystem : public Filesystem {
13 public:
14 uint32_t frequency() const { return frequency_; }
15
17
18 const char* mountPoint() const { return mount_point_.c_str(); }
19
20 void setMountPoint(const char* mount_point) { mount_point_ = mount_point; }
21
22 uint8_t maxOpenFiles() const { return max_open_files_; }
23
26 }
27
28 bool formatIfMountFailed() const { return format_if_mount_failed_; }
29
32 }
33
34 bool readOnly() const { return read_only_; }
35
36 void setReadOnly(bool read_only) { read_only_ = read_only; }
37
38 protected:
44 read_only_(false) {}
45
46 private:
48 std::string mount_point_;
51 bool read_only_;
52};
53
54} // namespace roo_io
55
56#endif // ESP_PLATFORM
Definition byte.h:6
roo::basic_string_view< CharT, Traits > basic_string_view
Definition string_view.h:8