29namespace serialization {
56template<
typename UnitTag>
92template<
typename UnitTag>
constexpr double value() const
Core quantity template and error translation utilities.
Quantity< typename ExtractTag< T >::type > from_json_value(std::string_view json)
Deserialize a JSON numeric value into a typed quantity.
std::string to_json(const Quantity< UnitTag > &q)
Serialize a typed quantity as JSON object with value and unit id.
std::string to_json_value(const Quantity< UnitTag > &q)
Serialize only the numeric value as JSON for a typed quantity.
UnitId unit_id_from_u32(uint32_t raw)
Quantity< typename ExtractTag< T >::type > from_json(std::string_view json)
Deserialize a JSON quantity object into a requested target type.
std::string from_owned_c(char *ptr)
Convert an owned C string from FFI into std::string and free it.
void check_status(int32_t status, const char *operation)
Convert qtty FFI status codes into typed C++ exceptions.
int32_t qtty_quantity_from_json_value(UnitId unit, const char *json, qtty_quantity_t *out)
void qtty_string_free(char *s)
int32_t qtty_quantity_from_json(const char *json, qtty_quantity_t *out)
int32_t qtty_quantity_to_json_value(qtty_quantity_t src, char **out_json)
int32_t qtty_quantity_to_json(qtty_quantity_t src, char **out_json)