File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -152,6 +152,17 @@ REDFISH_EXPORT char* getPayloadStringValue(redfishPayload* payload);
152152 * @return int contained in the payload or 0 if not a string entity
153153 */
154154REDFISH_EXPORT int getPayloadIntValue (redfishPayload * payload );
155+ /**
156+ * @brief Get the boolean value for the payload
157+ *
158+ * If the value of the payload is not a boolean, is_boolean will be set to false and the return value should be considered invalid. Otherwise return
159+ * the boolean contained in the payload.
160+ *
161+ * @param payload The payload to get the bool value of
162+ * @param is_boolean Pointer whose value will be set to true if the value of the payload is a boolean
163+ * @return bool contained in the payload
164+ */
165+ REDFISH_EXPORT bool getPayloadBoolValue (redfishPayload * payload , bool * is_boolean );
155166
156167/**
157168 * @brief Obtain the node in the payload identified by the specified nodeName
Original file line number Diff line number Diff line change @@ -262,6 +262,13 @@ int getPayloadIntValue(redfishPayload* payload)
262262 return (int )json_integer_value (payload -> json );
263263}
264264
265+ bool getPayloadBoolValue (redfishPayload * payload , bool * is_boolean ) {
266+ if (is_boolean != NULL ) {
267+ * is_boolean = json_is_boolean (payload -> json );
268+ }
269+ return json_boolean_value (payload -> json );
270+ }
271+
265272redfishPayload * getPayloadByNodeName (redfishPayload * payload , const char * nodeName )
266273{
267274 json_t * value ;
You can’t perform that action at this time.
0 commit comments