FastLED 3.10.6
Loading...
Searching...
No Matches
backend.h
Go to the documentation of this file.
1#pragma once
2
18
19#include "fl/fs/file_handle.h" // IWYU pragma: export
20#include "fl/stl/noexcept.h"
21#include "fl/stl/shared_ptr.h"
22
23namespace fl {
24
26
29class FsImpl {
30 public:
31 struct Visitor {
33 virtual void accept(const char *path) = 0;
34 };
35
36 FsImpl() FL_NO_EXCEPT = default;
37 virtual ~FsImpl() FL_NO_EXCEPT {}
38
40 virtual bool begin() = 0;
41
43 virtual void end() = 0;
44
46 virtual filebuf_ptr openRead(const char *path) = 0;
47
50 virtual bool ls(Visitor &visitor) {
51 (void)visitor;
52 return false;
53 }
54};
55
56} // namespace fl
virtual bool begin()=0
Mount. False if the medium is absent, unformatted, or unreadable.
virtual void end()=0
Unmount. Must be safe to call on a backend that never mounted.
virtual filebuf_ptr openRead(const char *path)=0
Null handle if the file does not exist or cannot be opened.
virtual bool ls(Visitor &visitor)
Optional directory listing.
Definition backend.h:50
FsImpl() FL_NO_EXCEPT=default
A mounted storage medium.
Definition backend.h:29
fl::shared_ptr< filebuf > filebuf_ptr
Definition idecoder.h:15
InputGamut g FL_NO_EXCEPT
Definition rgbw.h:121
Base definition for an LED controller.
Definition crgb.hpp:179
#define FASTLED_SHARED_PTR(type)
Definition shared_ptr.h:565
virtual ~Visitor() FL_NO_EXCEPT
Definition backend.h:32
virtual void accept(const char *path)=0