feat: add structures for MTR arrival and station information handling

This commit is contained in:
GW_MC
2026-01-20 20:11:29 +08:00
parent 4d19dd7294
commit 8f9f89cb32
4 changed files with 182 additions and 0 deletions

26
main/external/mtr/station_info.h vendored Normal file
View 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;
};