Logo Pico-Framework A web-first embedded framework for C++
Loading...
Searching...
No Matches
LittleFsFileReader.h
Go to the documentation of this file.
1#pragma once
2
3#include "lfs.h"
5#include <memory>
6
11public:
12 explicit LittleFsFileReader(lfs_t* lfs);
13
14 ~LittleFsFileReader() override;
15
21 bool open(const std::string& path);
22
33 bool readLine(char* outLine, size_t maxLen);
34
38 void close() override;
39
40
41private:
42 lfs_t* lfs = nullptr;
43 lfs_file_t file{};
44 bool isOpen = false;
45};
Buffered line reader for LittleFS lfs_file_t files.
bool open(const std::string &path)
Opens a file for reading.
void close() override
Close the file and release resources.
bool readLine(char *outLine, size_t maxLen)
Reads a single line into the provided buffer.
Abstract interface for reading a file line-by-line.