uEspConfigLib
https://github.com/Naguissa/uEspConfigLib
uEspConfigLibFSLittlefs.h
Go to the documentation of this file.
1
21#pragma once
22
23#include <Arduino.h>
25#include "FS.h"
26#include "LittleFS.h"
27
28#ifdef ARDUINO_ARCH_ESP32
29 #define uEspConfigLibFSLittlefs_writeCasted(data) _dataFile.write((uint8_t *) data, strlen(data))
30 #define uEspConfigLibFSLittlefs_begin_param true
31#else
32 #define uEspConfigLibFSLittlefs_writeCasted(data) _dataFile.write(data, strlen(data))
33 #define uEspConfigLibFSLittlefs_begin_param
34#endif
35
36
38 public:
44 uEspConfigLibFSLittlefs(const bool=false);
45
52 uEspConfigLibFSLittlefs(const char*, const bool=false);
53
59 bool openToRead();
60
66 bool openToWrite();
67
74 bool readLine(String *);
75
82 bool write(const char *);
83
89 bool closeFile();
90
91 private:
92 uint8_t _status;
93 char * _path = 0;
94 fs::File _dataFile;
95};
96
The deffinitive ESP32 and ESP8266 configuration Arduino library, uEspConfigLib - FileSystem interface...
Definition: uEspConfigLibFSInterface.h:50
The deffinitive ESP32 and ESP8266 configuration Arduino library, uEspConfigLib - Littlefs FileSystem ...
Definition: uEspConfigLibFSLittlefs.h:37
bool openToWrite()
Opens the file for write.
Definition: uEspConfigLibFSLittlefs.cpp:98
bool readLine(String *)
Reads a whole line from current file.
Definition: uEspConfigLibFSLittlefs.cpp:125
uEspConfigLibFSLittlefs(const bool=false)
Constructor.
Definition: uEspConfigLibFSLittlefs.cpp:31
bool openToRead()
Opens the file for read.
Definition: uEspConfigLibFSLittlefs.cpp:72
bool write(const char *)
Writes content to current file.
Definition: uEspConfigLibFSLittlefs.cpp:144
bool closeFile()
Closes current file.
Definition: uEspConfigLibFSLittlefs.cpp:156