|
DocWire SDK
DocWire SDK: Deterministic, auditable, and secure data processing in C++20. On-premise by default. No compromises on computational speed.
|
Namespace for type conversion utilities. More...
Classes | |
| struct | dest_type_tag |
| A tag type used for dispatching convert_impl overloads based on the destination type. More... | |
Concepts | |
| concept | conversion_implementation_exists |
| concept | is_from_chars_compatible |
| Concept checking if a type is compatible with std::from_chars. | |
Functions | |
| template<typename To, typename From> requires conversion_implementation_exists<To, From> | |
| constexpr std::optional< To > | try_to (const From &from) noexcept |
| Tries to convert a value of type From to type To. | |
| template<typename To, typename From> requires conversion_implementation_exists<To, From> | |
| To | to (const From &from) |
| Converts a value of type From to type To. | |
| std::optional< std::chrono::sys_seconds > | convert_impl (with::date_format::iso8601 s, dest_type_tag< std::chrono::sys_seconds >) noexcept |
| Converts an ISO 8601 date string to sys_seconds. | |
| std::optional< std::chrono::sys_seconds > | convert_impl (with::date_format::openoffice_legacy s, dest_type_tag< std::chrono::sys_seconds >) noexcept |
| Converts a legacy OpenOffice date string to sys_seconds. | |
| std::optional< std::chrono::sys_seconds > | convert_impl (with::date_format::asn1 s, dest_type_tag< std::chrono::sys_seconds >) noexcept |
| Converts an ASN.1 date string to sys_seconds. | |
| std::optional< std::string > | convert_impl (std::chrono::sys_seconds tp, dest_type_tag< std::string >) noexcept |
| Converts sys_seconds to a string representation. | |
| template<is_from_chars_compatible To, std::convertible_to< std::string_view > From> requires (noexcept(std::string_view(std::declval<const From&>())) && detail::std_from_chars_available<To>) | |
| std::optional< To > | convert_impl (const From &s, dest_type_tag< To >) noexcept |
| Converts a string-like value to a numeric type using std::from_chars. | |
| template<std::floating_point To, std::convertible_to< std::string_view > From> requires (noexcept(std::string_view(std::declval<const From&>())) && !detail::std_from_chars_available<To>) | |
| std::optional< To > | convert_impl (const From &s, dest_type_tag< To >) noexcept |
| Fallback conversion for floating point types when std::from_chars is not available. | |
Namespace for type conversion utilities.
|
noexcept |
Fallback conversion for floating point types when std::from_chars is not available.
Definition at line 128 of file convert_numeric.h.
|
noexcept |
Converts a string-like value to a numeric type using std::from_chars.
| To | The target numeric type. |
| From | The source string type (must be convertible to string_view). |
Definition at line 107 of file convert_numeric.h.
|
inlinenoexcept |
Converts sys_seconds to a string representation.
Definition at line 129 of file convert_chrono.h.
|
inlinenoexcept |
Converts an ASN.1 date string to sys_seconds.
Definition at line 119 of file convert_chrono.h.
|
inlinenoexcept |
Converts an ISO 8601 date string to sys_seconds.
Definition at line 103 of file convert_chrono.h.
|
inlinenoexcept |
Converts a legacy OpenOffice date string to sys_seconds.
Definition at line 111 of file convert_chrono.h.
| To docwire::convert::to | ( | const From & | from | ) |
Converts a value of type From to type To.
| To | The target type. |
| From | The source type. |
| from | The value to convert. |
| docwire::error | with docwire::errors::uninterpretable_data tag attached if the conversion fails. |
Definition at line 79 of file convert_base.h.
|
constexprnoexcept |
Tries to convert a value of type From to type To.
| To | The target type. |
| From | The source type. |
| from | The value to convert. |
Definition at line 65 of file convert_base.h.