feat: add structures for MTR arrival and station information handling
This commit is contained in:
26
main/external/mtr/station_info.h
vendored
Normal file
26
main/external/mtr/station_info.h
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
#include "esp_log.h"
|
||||
#include "external/mtr/line_info.h"
|
||||
|
||||
static const char* STATION_INFO_TAG = "StationInfo";
|
||||
|
||||
// Forward declaration
|
||||
struct LineInfo;
|
||||
|
||||
struct StationInfo {
|
||||
public:
|
||||
StationInfo(cJSON* station_json);
|
||||
|
||||
const char* name() const { return _name.c_str(); }
|
||||
const char* code() const { return _code.c_str(); }
|
||||
|
||||
friend class LineInfo;
|
||||
|
||||
private:
|
||||
// Caller transfers ownership of station_name and station_code to StationInfo
|
||||
StationInfo(std::string& station_name, std::string& station_code)
|
||||
: _name(station_name), _code(station_code) { }
|
||||
|
||||
std::string _name;
|
||||
std::string _code;
|
||||
};
|
||||
Reference in New Issue
Block a user