Logo Pico-Framework A web-first embedded framework for C++
Loading...
Searching...
No Matches
TimeOfDayJson.h File Reference
#include "time/TimeOfDay.h"
#include <nlohmann/json.hpp>
+ Include dependency graph for TimeOfDayJson.h:

Go to the source code of this file.

Functions

void to_json (nlohmann::json &j, const TimeOfDay &t)
 
void from_json (const nlohmann::json &j, TimeOfDay &t)
 

Function Documentation

◆ from_json()

void from_json ( const nlohmann::json j,
TimeOfDay t 
)
inline

Definition at line 9 of file TimeOfDayJson.h.

9 {
10 t = TimeOfDay::fromString(j.get<std::string>().c_str());
11}
static TimeOfDay fromString(const char *hhmm)
Parse a string in the form "HH:MM" or "HH:MM:SS".
Definition TimeOfDay.h:32

References TimeOfDay::fromString().

+ Here is the call graph for this function:

◆ to_json()

void to_json ( nlohmann::json j,
const TimeOfDay t 
)
inline

Definition at line 4 of file TimeOfDayJson.h.

4 {
5 j = TimeOfDay::toString(t); // Convert TimeOfDay to string
6}
static std::string toString(const TimeOfDay &time)
Format the time as a string.
Definition TimeOfDay.h:48

References TimeOfDay::toString().

+ Here is the call graph for this function: