|
rapidyaml
0.12.0
parse and emit YAML, and do it fast
|
To deserialize user scalar types, implement the function bool from_chars(csubstr buf, T *val); see from_chars: generalized chars to value.
More...
Functions | |
| template<class T > | |
| bool | from_chars (ryml::csubstr buf, vec2< T > *v) |
| template<class T > | |
| bool | from_chars (ryml::csubstr buf, vec3< T > *v) |
| template<class T > | |
| bool | from_chars (ryml::csubstr buf, vec4< T > *v) |
| template<class T > | |
| bool | from_chars (ryml::csubstr buf, parse_only_vec2< T > *v) |
| template<class T > | |
| bool | from_chars (ryml::csubstr buf, parse_only_vec3< T > *v) |
| template<class T > | |
| bool | from_chars (ryml::csubstr buf, parse_only_vec4< T > *v) |
To deserialize user scalar types, implement the function bool from_chars(csubstr buf, T *val); see from_chars: generalized chars to value.
The implementation of from_chars must never read beyond the limit of the given buffer, and must return true/false to indicate success/failure in the deserialization. On failure, it is up to you whether the value is left unchanged; ryml itself does not care about the value when the deserialization failed.
In your implementation, you may be interested in using the reading facilities in Format utilities and Charconv utilities; refer to their documentation for further details. But this is not mandatory, and anything can be used, provided that the implemented from_chars fulfills its contract, described above.
from_chars() implementation before any other headers that use functions from it. See the include order at the top of this source file. This constraint also applies to the conversion functions for your types; just like with the STL's headers, they should be included prior to ryml's headers. Lately, some effort was directed to provide forward declarations to alleviate this problem, but it may still occur. | bool from_chars | ( | ryml::csubstr | buf, |
| vec2< T > * | v | ||
| ) |
Definition at line 3562 of file quickstart.cpp.
References c4::yml::npos, c4::unformat(), vec2< T >::x, and vec2< T >::y.
| bool from_chars | ( | ryml::csubstr | buf, |
| vec3< T > * | v | ||
| ) |
Definition at line 3563 of file quickstart.cpp.
References c4::yml::npos, c4::unformat(), vec3< T >::x, vec3< T >::y, and vec3< T >::z.
| bool from_chars | ( | ryml::csubstr | buf, |
| vec4< T > * | v | ||
| ) |
Definition at line 3564 of file quickstart.cpp.
References c4::yml::npos, c4::unformat(), vec4< T >::w, vec4< T >::x, vec4< T >::y, and vec4< T >::z.
| bool from_chars | ( | ryml::csubstr | buf, |
| parse_only_vec2< T > * | v | ||
| ) |
Definition at line 3566 of file quickstart.cpp.
References c4::yml::npos, c4::unformat(), parse_only_vec2< T >::x, and parse_only_vec2< T >::y.
| bool from_chars | ( | ryml::csubstr | buf, |
| parse_only_vec3< T > * | v | ||
| ) |
Definition at line 3567 of file quickstart.cpp.
References c4::yml::npos, c4::unformat(), parse_only_vec3< T >::x, parse_only_vec3< T >::y, and parse_only_vec3< T >::z.
| bool from_chars | ( | ryml::csubstr | buf, |
| parse_only_vec4< T > * | v | ||
| ) |
Definition at line 3568 of file quickstart.cpp.
References c4::yml::npos, c4::unformat(), parse_only_vec4< T >::w, parse_only_vec4< T >::x, parse_only_vec4< T >::y, and parse_only_vec4< T >::z.