9#ifndef ZYPP_CORE_PARSER_JSON_JSON_NUMBER_DEFINED
10#define ZYPP_CORE_PARSER_JSON_JSON_NUMBER_DEFINED
34 using zyppng::operators::operator|;
39 operator double()
const {
49 {
return std::to_string (
_value); }
78 operator std::int64_t()
const {
88 using zyppng::operators::operator|;
90 |
and_then([](std::int64_t res) {
return zyppng::make_expected_success(
Int(res)); } );
95 {
return std::to_string (
_value); }
125 using zyppng::operators::operator|;
127 |
and_then([](
unsigned long long res) {
return zyppng::make_expected_success(
UInt(res)); } );
130 operator std::uint64_t()
const {
140 {
return std::to_string (
_value); }
std::string asJSON() const
JSON representation.
std::ostream & dumpOn(std::ostream &str) const
Stream output.
Int & operator=(Int &&)=default
static zyppng::expected< Int > fromString(const std::string &str)
Int & operator=(const Int &)=default
std::int64_t value() const
std::ostream & dumpOn(std::ostream &str) const
Stream output.
Number(Number &&)=default
std::string asJSON() const
JSON representation.
Number & operator=(const Number &)=default
static zyppng::expected< Number > fromString(const std::string &str)
Number & operator=(Number &&)=default
Number(const Number &)=default
UInt(const UInt &)=default
std::string asJSON() const
JSON representation.
std::ostream & dumpOn(std::ostream &str) const
Stream output.
static zyppng::expected< UInt > fromString(const std::string &str)
UInt & operator=(UInt &&)=default
UInt & operator=(const UInt &)=default
std::uint64_t value() const
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const Bool &obj)
relates: Bool Stream output
auto and_then(Fun &&function)
auto mtry(F &&f, Args &&...args)