mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 08:20:05 +00:00
Use HH date library when not using MSVC
This commit is contained in:
parent
e78dc9b3db
commit
593010acc2
10 changed files with 98 additions and 14 deletions
|
|
@ -8,6 +8,10 @@
|
|||
|
||||
#include <sstream>
|
||||
|
||||
#if !defined(_MSC_VER)
|
||||
# include <date/date.h>
|
||||
#endif
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace awips
|
||||
|
|
@ -98,6 +102,10 @@ bool CodedTimeMotionLocation::Parse(const StringRange& lines,
|
|||
{
|
||||
using namespace std::chrono;
|
||||
|
||||
#if !defined(_MSC_VER)
|
||||
using namespace date;
|
||||
#endif
|
||||
|
||||
static const std::string timeFormat {"%H%MZ"};
|
||||
|
||||
std::istringstream in {time};
|
||||
|
|
@ -106,12 +114,12 @@ bool CodedTimeMotionLocation::Parse(const StringRange& lines,
|
|||
|
||||
if (time.size() == 5 && !in.fail())
|
||||
{
|
||||
p->time_ = hh_mm_ss {tp};
|
||||
p->time_ = std::chrono::hh_mm_ss {tp};
|
||||
}
|
||||
else
|
||||
{
|
||||
logger_->warn("Invalid time: \"{}\"", time);
|
||||
p->time_ = hh_mm_ss<minutes> {};
|
||||
p->time_ = std::chrono::hh_mm_ss<minutes> {};
|
||||
dataValid = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue