Files
IoTManager/include/Utils/FileHelper.h
Dmitry Borisenko 2e8ea582d2 reverting version
2020-09-02 22:34:49 +03:00

55 lines
986 B
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#pragma once
#include <Arduino.h>
#include "FS.h"
#ifdef ESP32
#include "LITTLEFS.h"
#define LittleFS LITTLEFS
#endif
#ifdef ESP8266
#include <LittleFS.h>
#endif
class FileHelper {
public:
FileHelper(const String filename);
/*
* Проверить существование
*/
void exists();
/*
* Удалить файл
*/
void remove();
/*
* Открыть файл установить позицию @position
*/
File seek(size_t position = 0);
/*
* Чтение строки с содержащей @substr
*/
String readFileString(const String substr);
/*
* Добовление строки @str в файл
*/
String appendStr(const String str);
/*
* Запись строки
*/
String writeStr(const String);
/*
* Чтение в строку
*/
String readStr(size_t);
/*
* Размер в байтах
*/
size_t getSize();
};