Files
IoTManager/include/Utils/FileUtils.h

65 lines
1.4 KiB
C
Raw Normal View History

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