50 lines
973 B
C++
50 lines
973 B
C++
#ifndef GERMANAIRLINESVA_FILE_LOGBOOK_H
|
|
#define GERMANAIRLINESVA_FILE_LOGBOOK_H
|
|
|
|
#include <cstdint>
|
|
#include <fstream>
|
|
#include <string>
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
#include "constants.h"
|
|
#include "helpers.hpp"
|
|
#include "logbookEntry.h"
|
|
#include "util.hpp"
|
|
|
|
namespace germanairlinesva
|
|
{
|
|
namespace file
|
|
{
|
|
namespace logbook
|
|
{
|
|
/*
|
|
* Logbook Header (6)
|
|
* CHAR[5] | UINT8
|
|
* --------+--------
|
|
* VGAL | VERSION
|
|
*
|
|
* Logbook Entries (n)
|
|
* LOGBOOKENTRY[]
|
|
*/
|
|
class Logbook
|
|
{
|
|
private:
|
|
std::vector<LogbookEntry> entries;
|
|
|
|
void fromFile();
|
|
void readVersion1(std::ifstream &in);
|
|
|
|
public:
|
|
Logbook();
|
|
|
|
template <class... Args> inline void addEntry(Args &&...args)
|
|
{
|
|
this->entries.emplace_back(std::forward<Args>(args)...);
|
|
}
|
|
void toFile() const;
|
|
};
|
|
} // namespace logbook
|
|
} // namespace file
|
|
} // namespace germanairlinesva
|
|
#endif |