[FL-1401] Add Universal TV remote (#539)
* Remove excess headers * Add ButtonPanel * Add Popup * Move FileReader to standalone object * Universal remote (part 1) * Universal remote (part 2) * Global rename tranciever/file_parser * Compile assets * syntax fix * English: rename tranceiver to transceiver. Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
39
lib/file_reader/file_reader.hpp
Normal file
39
lib/file_reader/file_reader.hpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include "sd-card-api.h"
|
||||
#include "filesystem-api.h"
|
||||
|
||||
class FileReader {
|
||||
private:
|
||||
char file_buf[48];
|
||||
size_t file_buf_cnt = 0;
|
||||
SdCard_Api* sd_ex_api;
|
||||
FS_Api* fs_api;
|
||||
|
||||
public:
|
||||
FileReader() {
|
||||
sd_ex_api = static_cast<SdCard_Api*>(furi_record_open("sdcard-ex"));
|
||||
fs_api = static_cast<FS_Api*>(furi_record_open("sdcard"));
|
||||
reset();
|
||||
}
|
||||
~FileReader() {
|
||||
furi_record_close("sdcard");
|
||||
furi_record_close("sdcard-ex");
|
||||
}
|
||||
|
||||
std::string getline(File* file);
|
||||
|
||||
void reset(void) {
|
||||
file_buf_cnt = 0;
|
||||
}
|
||||
|
||||
SdCard_Api& get_sd_api() {
|
||||
return *sd_ex_api;
|
||||
}
|
||||
|
||||
FS_Api& get_fs_api() {
|
||||
return *fs_api;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user