39 lines
735 B
C++

#ifndef GERMANAIRLINESVA_GACONNECTOR_LOGBOOK_H
#define GERMANAIRLINESVA_GACONNECTOR_LOGBOOK_H
#include <cstdint>
#include <fstream>
#include <string>
#include <vector>
#include "constants.h"
#include "logbookEntry.h"
#include "util.hpp"
namespace germanairlinesva_logbook
{
/*
* Logbook Header (6)
* CHAR[5] | UINT8
* --------+--------
* VGAL | VERSION
*
* Logbook Entries (n)
* LOGBOOKENTRY[]
*/
class Logbook
{
private:
std::vector<std::uint8_t> file;
void fromFile(const std::string &file);
void readVersion1(std::ifstream &in);
public:
Logbook();
void addEntry(LogbookEntry entry);
void toFile();
};
} // namespace germanairlinesva_logbook
#endif