Set class contents from JSON string.
Parses the provided JSON-formatted string and sets the class data. String should be formatted like the string returned from to_json()
3649 if(!parsed[
"name"].is_null()) { strcpy(
name, parsed[
"name"].string_value().c_str()); }
3650 if(!parsed[
"lastevent"].is_null()) { strcpy(
lastevent, parsed[
"lastevent"].string_value().c_str()); }
3652 if(!parsed[
"type"].is_null()) {
type = parsed[
"type"].
int_value(); }
3653 if(!parsed[
"state"].is_null()) {
state = parsed[
"state"].
int_value(); }
3657 if(!parsed[
"face_cnt"].is_null()) {
face_cnt = parsed[
"face_cnt"].
int_value(); }
3660 if(!parsed[
"port_cnt"].is_null()) {
port_cnt = parsed[
"port_cnt"].
int_value(); }
3664 if(!parsed[
"user_cnt"].is_null()) {
user_cnt = parsed[
"user_cnt"].
int_value(); }
3665 if(!parsed[
"tle_cnt"].is_null()) {
tle_cnt = parsed[
"tle_cnt"].
int_value(); }
3667 if(!parsed[
"flags"].is_null()) {
flags = parsed[
"flags"].
int_value(); }
3668 if(!parsed[
"powmode"].is_null()) {
powmode = parsed[
"powmode"].
int_value(); }
3669 if(!parsed[
"downtime"].is_null()) {
downtime = parsed[
"downtime"].
int_value(); }
3675 if(!parsed[
"utcoffset"].is_null()) {
utc = parsed[
"utcoffset"].
number_value(); }
3677 if(!parsed[
"utcstart"].is_null()) {
utc = parsed[
"utcstart"].
number_value(); }
3681 cerr<<
"ERROR = "<<error<<endl;
uint16_t target_cnt
Definition: jsondef.h:3575
uint16_t agent_cnt
Definition: jsondef.h:3573
int16_t powmode
Definition: jsondef.h:3580
uint16_t device_cnt
Definition: jsondef.h:3571
Definition: json11.hpp:79
uint16_t normal_cnt
Definition: jsondef.h:3568
uint16_t event_cnt
Definition: jsondef.h:3574
uint16_t piece_cnt
Definition: jsondef.h:3570
float range
Definition: jsondef.h:3588
char lastevent[40+1]
Last event.
Definition: jsondef.h:3558
double utc
Overall Node time.
Definition: jsondef.h:3592
void from_json(const string &js)
Set class contents from JSON string.
Definition: convertdef.h:903
uint16_t flags
Definition: jsondef.h:3579
uint16_t port_cnt
Definition: jsondef.h:3572
static Json parse(const std::string &in, std::string &err, JsonParse strategy=JsonParse::STANDARD)
uint32_t downtime
Seconds Node will be down.
Definition: jsondef.h:3582
static void dump(NullStruct, string &out)
Definition: json11.cpp:53
uint16_t user_cnt
Definition: jsondef.h:3576
void from_json(const string &js)
Set class contents from JSON string.
Definition: jsondef.h:3501
char name[40+1]
Node Name.
Definition: jsondef.h:3556
uint16_t state
Operational state.
Definition: jsondef.h:3564
double lasteventutc
Last event UTC.
Definition: jsondef.h:3560
uint16_t tle_cnt
Definition: jsondef.h:3577
locstruc loc
Location structure.
Definition: jsondef.h:3596
uint16_t vertex_cnt
Definition: jsondef.h:3567
float elto
Definition: jsondef.h:3587
uint16_t face_cnt
Definition: jsondef.h:3569
float azfrom
Alt/Az/Range info.
Definition: jsondef.h:3584
float azto
Definition: jsondef.h:3586
uint16_t type
Node Type as listed in NODE_TYPE.
Definition: jsondef.h:3562
int int_value() const
Definition: json11.cpp:281
physicsstruc phys
Definition: jsondef.h:3597
float elfrom
Definition: jsondef.h:3585
double number_value() const
Definition: json11.cpp:280