Initial Logbook read and write
This commit is contained in:
@@ -6,7 +6,9 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "constants.h"
|
||||
#include "logbookEntry.h"
|
||||
#include "util.hpp"
|
||||
|
||||
namespace germanairlinesva_logbook
|
||||
{
|
||||
@@ -22,16 +24,15 @@ namespace germanairlinesva_logbook
|
||||
class Logbook
|
||||
{
|
||||
private:
|
||||
std::ifstream fileStream;
|
||||
std::vector<std::uint8_t> file{'V', 'G', 'A', 'L', '\0', 1};
|
||||
std::vector<std::uint8_t> file;
|
||||
|
||||
void fromFile();
|
||||
void readVersion1();
|
||||
void fromFile(const std::string &file);
|
||||
void readVersion1(std::ifstream &in);
|
||||
|
||||
public:
|
||||
Logbook(std::ifstream &logbook);
|
||||
Logbook();
|
||||
void addEntry(LogbookEntry entry);
|
||||
void toFile(std::ofstream &logbook);
|
||||
void toFile();
|
||||
};
|
||||
} // namespace germanairlinesva_logbook
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef GERMANAIRLINESVA_GACONNECTOR_LOGBOOKENTRY_H
|
||||
#define GERMANAIRLINESVA_GACONNECTOR_LOHBOOKENTRY_H
|
||||
#define GERMANAIRLINESVA_GACONNECTOR_LOGBOOKENTRY_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
@@ -91,7 +91,7 @@ namespace germanairlinesva_logbook
|
||||
std::string departureGate;
|
||||
std::string departureRunway;
|
||||
std::string arrivalAirport;
|
||||
std::string arrivaleGate;
|
||||
std::string arrivalGate;
|
||||
std::string arrivalRunway;
|
||||
std::string offBlockTime;
|
||||
std::string outTime;
|
||||
@@ -123,7 +123,7 @@ namespace germanairlinesva_logbook
|
||||
std::string departureGate,
|
||||
std::string departureRunway,
|
||||
std::string arrivalAirport,
|
||||
std::string arrivaleGate,
|
||||
std::string arrivalGate,
|
||||
std::string arrivalRunway,
|
||||
std::string offBlockTime,
|
||||
std::string outTime,
|
||||
@@ -143,8 +143,7 @@ namespace germanairlinesva_logbook
|
||||
float maxLandingGees,
|
||||
std::string recordingFilename,
|
||||
float points,
|
||||
std::uint8_t flags,
|
||||
std::vector<std::uint8_t> file);
|
||||
std::uint8_t flags);
|
||||
|
||||
inline std::uint8_t *getBinaryData() { return file.data(); }
|
||||
inline std::size_t getBinaryLength() { return file.size(); }
|
||||
|
||||
Reference in New Issue
Block a user