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
5
#include "
roo_io/fs/filesystem.h
"
6
7
namespace
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.
12
class
BaseEsp32VfsFilesystem
:
public
Filesystem {
13
public
:
14
uint32_t
frequency
()
const
{
return
frequency_
; }
15
16
void
setFrequency
(
uint32_t
freq
) {
frequency_
=
freq
; }
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
24
void
setMaxOpenFiles
(
uint8_t
max_open_files
) {
25
max_open_files_
=
max_open_files
;
26
}
27
28
bool
formatIfMountFailed
()
const
{
return
format_if_mount_failed_
; }
29
30
void
setFormatIfMountFailed
(
bool
format_if_mount_failed
) {
31
format_if_mount_failed_
=
format_if_mount_failed
;
32
}
33
34
bool
readOnly
()
const
{
return
read_only_; }
35
36
void
setReadOnly
(
bool
read_only
) { read_only_ =
read_only
; }
37
38
protected
:
39
BaseEsp32VfsFilesystem
(
uint32_t
frequency
,
const
char
*
mount_point
)
40
:
frequency_
(
frequency
),
41
mount_point_
(
mount_point
),
42
max_open_files_
(5),
43
format_if_mount_failed_
(
false
),
44
read_only_(
false
) {}
45
46
private
:
47
uint32_t
frequency_
;
48
std::string
mount_point_
;
49
uint8_t
max_open_files_
;
50
bool
format_if_mount_failed_
;
51
bool
read_only_;
52
};
53
54
}
// namespace roo_io
55
56
#endif
// ESP_PLATFORM
filesystem.h
roo_io
Definition
byte.h:6
roo_io::basic_string_view
roo::basic_string_view< CharT, Traits > basic_string_view
Definition
string_view.h:8
temp_repos
roo_io
src
roo_io
fs
esp32
base_vfs_filesystem.h
Generated by
1.9.8