Gjsify LogoGjsify Logo

Hierarchy

  • BoxedDeserializeFunc

Callable

  • BoxedDeserializeFunc(node: Json.Node): object
  • Deserializes the contents of the passed JsonNode into a GBoxed, for instance:

    static gpointer
    my_point_deserialize (JsonNode *node)
    {
    double x = 0.0, y = 0.0;

    if (JSON_NODE_HOLDS_ARRAY (node))
    {
    JsonArray *array = json_node_get_array (node);

    if (json_array_get_length (array) == 2)
    {
    x = json_array_get_double_element (array, 0);
    y = json_array_get_double_element (array, 1);
    }
    }
    else if (JSON_NODE_HOLDS_OBJECT (node))
    {
    JsonObject *obj = json_node_get_object (node);

    x = json_object_get_double_member_with_default (obj, "x", 0.0);
    y = json_object_get_double_member_with_default (obj, "y", 0.0);
    }

    // my_point_new() is defined elsewhere
    return my_point_new (x, y);
    }

    Parameters

    • node: Json.Node

      a node tree representing a boxed data

    Returns object

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method