diff --git a/simgear/environment/metar.cxx b/simgear/environment/metar.cxx index c9084730..7ebd3f7c 100644 --- a/simgear/environment/metar.cxx +++ b/simgear/environment/metar.cxx @@ -491,9 +491,17 @@ void SGMetar::useCurrentDate() _month = now.tm_mon + 1; } -const char* SGMetar::getRawDataPtr() +std::string SGMetar::getDataString() const { - return _data.data(); + return std::string{_data.data()}; +} + +std::string SGMetar::getUnparsedData() const +{ + if (!_m || (strlen(_m) < 1)) + return {}; + + return std::string{_m}; } /** * Replace any number of subsequent spaces by just one space, and add diff --git a/simgear/environment/metar.hxx b/simgear/environment/metar.hxx index 50880a10..df90c28c 100644 --- a/simgear/environment/metar.hxx +++ b/simgear/environment/metar.hxx @@ -186,7 +186,8 @@ public: std::vector phenomena; }; - const char* getRawDataPtr(); + std::string getDataString() const; + std::string getUnparsedData() const; inline bool getProxy() const { return _x_proxy; } inline const char *getId() const { return _icao; }