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:
Jared Boone 2016-04-30 15:09:34 -07:00
parent 4d6fccd8ea
commit 0d6103916d
11 changed files with 59 additions and 88 deletions

View file

@ -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__*/