Spicy
real.h
1 // Copyright (c) 2020-2021 by the Zeek Project. See LICENSE for details.
2 
3 #pragma once
4 
5 #include <string>
6 #include <tuple>
7 
8 #include <hilti/rt/extension-points.h>
9 #include <hilti/rt/types/bytes.h>
10 #include <hilti/rt/types/stream.h>
11 #include <hilti/rt/util.h>
12 
13 namespace hilti::rt {
14 
15 namespace real {
17 enum class Type { Undef, IEEE754_Single, IEEE754_Double };
18 
20 extern Result<std::tuple<double, Bytes>> unpack(const Bytes& data, Type type, ByteOrder fmt);
21 
23 extern Result<std::tuple<double, stream::View>> unpack(const stream::View& data, Type type, ByteOrder fmt);
24 
25 } // namespace real
26 
27 namespace detail::adl {
28 std::string to_string(double x, tag /*unused*/);
29 std::string to_string(const real::Type& x, tag /*unused*/);
30 } // namespace detail::adl
31 
32 } // namespace hilti::rt
ByteOrder
Definition: util.h:503
std::string to_string(T &&x)
Definition: extension-points.h:26
Definition: any.h:7
std::string fmt(const char *fmt, const Args &... args)
Definition: fmt.h:13