mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-28 11:12:26 -04:00
Converge File object with std::fstream. Simplify LogFile.
LogFile no longer watches SD card presence and tries to open/close files dynamically.
This commit is contained in:
parent
4d6fccd8ea
commit
0d6103916d
11 changed files with 59 additions and 88 deletions
|
@ -25,7 +25,6 @@
|
|||
#include <string>
|
||||
|
||||
#include "file.hpp"
|
||||
#include "sd_card.hpp"
|
||||
|
||||
#include "lpc43xx_cpp.hpp"
|
||||
using namespace lpc43xx;
|
||||
|
@ -33,22 +32,15 @@ using namespace lpc43xx;
|
|||
class LogFile {
|
||||
public:
|
||||
LogFile(const std::string& file_path);
|
||||
~LogFile();
|
||||
|
||||
bool is_ready();
|
||||
bool is_open() const;
|
||||
|
||||
bool write_entry(const rtc::RTC& datetime, const std::string& entry);
|
||||
|
||||
private:
|
||||
const std::string file_path;
|
||||
|
||||
File file;
|
||||
|
||||
SignalToken sd_card_status_signal_token;
|
||||
|
||||
bool write(const std::string& message);
|
||||
|
||||
void on_sd_card_status(const sd_card::Status status);
|
||||
};
|
||||
|
||||
#endif/*__LOG_FILE_H__*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue