Files
IoTManager/include/Utils/FileUtils.h

63 lines
1.3 KiB
C
Raw Normal View History

2020-09-02 22:34:49 +03:00
#pragma once
#include <Arduino.h>
2020-09-02 22:34:49 +03:00
#include "Consts.h"
2020-12-20 01:24:08 +03:00
#include "FileSystem.h"
2020-09-02 22:34:49 +03:00
/*
* Инициализация ФС
*/
bool fileSystemInit();
/*
* Удалить файл
*/
void removeFile(const String& filename);
/*
* Открыть файл на позиции
*/
File seekFile(const String& filename, size_t position = 0);
/*
* Чтение строки из файла
* возвращает стоку из файла в которой есть искомое слово found
*/
const String readFileString(const String& filename, const String& to_find);
/*
* Добовление строки в файл
*/
const String addFileLn(const String& filename, const String& str);
/*
* Добовление строки в файл
*/
const String addFile(const String& filename, const String& str);
/*
* Запись строки в файл
*/
const String writeFile(const String& filename, const String& str);
/*
* Чтение файла в строку
*/
const String readFile(const String& filename, size_t max_size);
/*
* Посчитать
*/
size_t countLines(const String filename);
2020-09-02 22:34:49 +03:00
/*
* Размер файла
*/
size_t getFileSize(const String filename);
2020-09-02 22:34:49 +03:00
bool copyFile(const String& src, const String& dst, bool overwrite = true);
const String getFSSizeInfo();
const String getConfigFile(uint8_t preset, ConfigType_t type);