lynx_value_set_named_property

Introduction

Set lynx_value property into map at the key specified.

Syntax

lynx_api_status
lynx_value_set_named_property(lynx_api_env env, lynx_value object,
                              const char* utf8name, lynx_value value);

Parameters

KeyDescription
[in] envThe environment in which lynx value runs, typically nullptr.
[in] objectThe lynx_value representing map.
[in] utf8nameThe name of the property to set.
[in] valueThe property value.

Return Value

Returns lynx_api_ok if the API succeeded. Returns lynx_api_map_expected if the types do not match.

Example

lynx_value map_value;
lynx_value_create_map(env, &map_value);
lynx_value v1;
lynx_value_create_int32(env, 10, &v1);
lynx_value_set_named_property(env, map_value, "v1", v1);
// do something
lynx_value_remove_reference(env, map_value, NULL);
Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.