|
rapidyaml
0.13.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 3617 of file quickstart.cpp.
| bool from_chars | ( | ryml::csubstr | buf, |
| vec3< T > * | v | ||
| ) |
Definition at line 3618 of file quickstart.cpp.
| bool from_chars | ( | ryml::csubstr | buf, |
| vec4< T > * | v | ||
| ) |
Definition at line 3619 of file quickstart.cpp.
| bool from_chars | ( | ryml::csubstr | buf, |
| parse_only_vec2< T > * | v | ||
| ) |
Definition at line 3621 of file quickstart.cpp.
| bool from_chars | ( | ryml::csubstr | buf, |
| parse_only_vec3< T > * | v | ||
| ) |
Definition at line 3622 of file quickstart.cpp.
| bool from_chars | ( | ryml::csubstr | buf, |
| parse_only_vec4< T > * | v | ||
| ) |
Definition at line 3623 of file quickstart.cpp.