2021-06-25 13:52:27 +00:00
|
|
|
#pragma once
|
2021-07-16 16:43:54 +00:00
|
|
|
#include <file_reader/file_reader.h>
|
|
|
|
#include <irda.h>
|
|
|
|
#include "irda-app-remote-manager.hpp"
|
2021-06-25 13:52:27 +00:00
|
|
|
|
|
|
|
class IrdaAppFileParser : public FileReader {
|
|
|
|
public:
|
|
|
|
typedef struct {
|
|
|
|
char name[32];
|
2021-07-16 16:43:54 +00:00
|
|
|
IrdaAppSignal signal;
|
|
|
|
} IrdaFileSignal;
|
2021-06-25 13:52:27 +00:00
|
|
|
|
2021-07-16 16:43:54 +00:00
|
|
|
IrdaAppFileParser() {
|
|
|
|
/* Assume we can save max 512 samples */
|
|
|
|
set_max_line_length(max_line_length);
|
|
|
|
}
|
|
|
|
|
|
|
|
std::unique_ptr<IrdaAppFileParser::IrdaFileSignal> read_signal(File* file);
|
|
|
|
bool store_signal(File* file, const IrdaAppSignal& signal, const char* name);
|
2021-06-25 13:52:27 +00:00
|
|
|
|
|
|
|
private:
|
2021-07-16 16:43:54 +00:00
|
|
|
static const uint32_t max_line_length;
|
|
|
|
std::unique_ptr<IrdaFileSignal> parse_signal(const std::string& str) const;
|
|
|
|
std::unique_ptr<IrdaFileSignal> parse_signal_raw(const std::string& str) const;
|
2021-06-25 13:52:27 +00:00
|
|
|
};
|
|
|
|
|