uEspConfigLib
https://github.com/Naguissa/uEspConfigLib
uEspConfigLibFSSpiffs.h
Go to the documentation of this file.
1
21#pragma once
22
23#include <Arduino.h>
25#include "FS.h"
26
27
28#ifdef ARDUINO_ARCH_ESP32
29 #include "SPIFFS.h"
30 #define uEspConfigLibFSSpiffs_writeCasted(data) _dataFile.write((uint8_t *) data, strlen(data))
31#else
32 #define uEspConfigLibFSSpiffs_writeCasted(data) _dataFile.write(data, strlen(data))
33#endif
34
36 public:
42 uEspConfigLibFSSpiffs(const bool=false);
43
50 uEspConfigLibFSSpiffs(const char*, const bool=false);
51
57 bool openToRead();
58
64 bool openToWrite();
65
72 bool readLine(String *);
73
80 bool write(const char *);
81
87 bool closeFile();
88
89 private:
90 uint8_t _status;
91 char * _path = 0;
92 fs::File _dataFile;
93};
94
The deffinitive ESP32 and ESP8266 configuration Arduino library, uEspConfigLib - FileSystem interface...
Definition: uEspConfigLibFSInterface.h:50
The deffinitive ESP32 and ESP8266 configuration Arduino library, uEspConfigLib - SPIFFS FileSystem in...
Definition: uEspConfigLibFSSpiffs.h:35
uEspConfigLibFSSpiffs(const bool=false)
Constructor.
Definition: uEspConfigLibFSSpiffs.cpp:30
bool openToWrite()
Opens the file for write.
Definition: uEspConfigLibFSSpiffs.cpp:97
bool closeFile()
Closes current file.
Definition: uEspConfigLibFSSpiffs.cpp:155
bool openToRead()
Opens the file for read.
Definition: uEspConfigLibFSSpiffs.cpp:71
bool write(const char *)
Writes content to current file.
Definition: uEspConfigLibFSSpiffs.cpp:143
bool readLine(String *)
Reads a whole line from current file.
Definition: uEspConfigLibFSSpiffs.cpp:124