Function

Valentpacket_check_field

unstable since: 1.0

Declaration [src]

gboolean
valent_packet_check_field (
  JsonNode* packet,
  const char* field
)

Description [src]

Check packet for field and return TRUE if present, with two exceptions:

  1. If field is a G_TYPE_BOOLEAN, its value is returned
  2. If field is a G_TYPE_STRING, FALSE is returned if the string is empty.

Available since: 1.0

Parameters

packet

Type: JsonNode

A KDE Connect packet.

The data is owned by the caller of the function.
field

Type: const char*

Field name.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.

Return value

Type: gboolean

TRUE, or FALSE on failure.