From ddae4e6cacf7bbce86d0f6062e256a7b7b8054be Mon Sep 17 00:00:00 2001 From: fktn Date: Thu, 6 Feb 2025 01:36:03 +0900 Subject: [PATCH] improved migration guide from get_value_ref --- docs/docs/api/basic_node/get_value_ref.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/docs/api/basic_node/get_value_ref.md b/docs/docs/api/basic_node/get_value_ref.md index dd5243a2..33bc6a23 100644 --- a/docs/docs/api/basic_node/get_value_ref.md +++ b/docs/docs/api/basic_node/get_value_ref.md @@ -12,7 +12,7 @@ ReferenceType get_value_ref() const; !!! warning "Deprecation" - This function has been deprecated in version 0.4.3 and replaced with the following functions since it offers too verbose interface and that may confuse library users, given that only non-/const reference types to [`sequence_type`](sequence_type.md), [`mapping_type`](mapping_type.md), [`boolean_type`](boolean_type.md), [`integer_type`](integer_type.md), [`float_number_type`](float_number_type.md) and [`string_type`](string_type.md) are accepted. + This function has been deprecated in version 0.4.3 and replaced with the following functions since it offers too verbose interface and that may confuse library users, given that only non-/const reference types to [`sequence_type`](sequence_type.md), [`mapping_type`](mapping_type.md), [`boolean_type`](boolean_type.md), [`integer_type`](integer_type.md), [`float_number_type`](float_number_type.md) and [`string_type`](string_type.md) are accepted and that violating the limitation is not clear from error messages during compilation. * [as_seq](as_seq.md) * [as_map](as_map.md) @@ -21,7 +21,16 @@ ReferenceType get_value_ref() const; * [as_float](as_float.md) * [as_str](as_str.md) - It will be removed in a future version. Please replace usages with the above new functions. + It will be removed in a future version. Please replace usages according to the following table. + + | from | to | + | -------------------------------------------------------------------------------- | ---------- | + | get_value_ref(),
get_value_ref() | as_seq() | + | get_value_ref(),
get_value_ref() | as_map() | + | get_value_ref(),
get_value_ref() | as_bool() | + | get_value_ref(),
get_value_ref() | as_int() | + | get_value_ref(),
get_value_ref() | as_float() | + | get_value_ref(),
get_value_ref() | as_str() | Explicit reference access to the internally stored YAML node value. If the requested reference type does not match the current node value, a [`fkyaml::type_error`](../exception/type_error.md) will be thrown. @@ -63,3 +72,9 @@ Reference to the internally stored YAML node value. ## **See Also** * [basic_node](index.md) +* [as_seq](as_seq.md) +* [as_map](as_map.md) +* [as_bool](as_bool.md) +* [as_int](as_int.md) +* [as_float](as_float.md) +* [as_str](as_str.md)