Sourcemeta Core 0.0.0
Loading...
Searching...
No Matches
numeric_parse.h
1#ifndef SOURCEMETA_CORE_NUMERIC_PARSE_H
2#define SOURCEMETA_CORE_NUMERIC_PARSE_H
3
4#ifndef SOURCEMETA_CORE_NUMERIC_EXPORT
5#include <sourcemeta/core/numeric_export.h>
6#endif
7
8#include <cstdint> // std::int64_t, std::uint16_t, std::uint32_t, std::uint64_t
9#include <optional> // std::optional
10#include <string_view> // std::string_view
11
12namespace sourcemeta::core {
13
16SOURCEMETA_CORE_NUMERIC_EXPORT
17auto to_double(const std::string_view input) noexcept -> std::optional<double>;
18
35SOURCEMETA_CORE_NUMERIC_EXPORT
36auto to_double_exact(const std::string_view input) noexcept
37 -> std::optional<double>;
38
41SOURCEMETA_CORE_NUMERIC_EXPORT
42auto to_int64_t(const std::string_view input) noexcept
43 -> std::optional<std::int64_t>;
44
47SOURCEMETA_CORE_NUMERIC_EXPORT
48auto to_int64_t(const std::string_view input, const int base) noexcept
49 -> std::optional<std::int64_t>;
50
53SOURCEMETA_CORE_NUMERIC_EXPORT
54auto to_uint64_t(const std::string_view input) noexcept
55 -> std::optional<std::uint64_t>;
56
59SOURCEMETA_CORE_NUMERIC_EXPORT
60auto to_uint32_t(const std::string_view input) noexcept
61 -> std::optional<std::uint32_t>;
62
65SOURCEMETA_CORE_NUMERIC_EXPORT
66auto to_uint32_t(const std::string_view input, const int base) noexcept
67 -> std::optional<std::uint32_t>;
68
71SOURCEMETA_CORE_NUMERIC_EXPORT
72auto to_uint16_t(const std::string_view input) noexcept
73 -> std::optional<std::uint16_t>;
74
75} // namespace sourcemeta::core
76
77#endif
SOURCEMETA_CORE_NUMERIC_EXPORT auto to_int64_t(const std::string_view input) noexcept -> std::optional< std::int64_t >
SOURCEMETA_CORE_NUMERIC_EXPORT auto to_uint32_t(const std::string_view input) noexcept -> std::optional< std::uint32_t >
SOURCEMETA_CORE_NUMERIC_EXPORT auto to_uint64_t(const std::string_view input) noexcept -> std::optional< std::uint64_t >
SOURCEMETA_CORE_NUMERIC_EXPORT auto to_uint16_t(const std::string_view input) noexcept -> std::optional< std::uint16_t >
SOURCEMETA_CORE_NUMERIC_EXPORT auto to_double(const std::string_view input) noexcept -> std::optional< double >
SOURCEMETA_CORE_NUMERIC_EXPORT auto to_double_exact(const std::string_view input) noexcept -> std::optional< double >