pluto-src 0.1.1+0.10.4

Sources of Pluto (Lua 5.4 dialect) and logic to build it.
Documentation
#include "JsonFloat.hpp"

#include "string.hpp"
#include "Writer.hpp"

NAMESPACE_SOUP
{
	JsonFloat::JsonFloat(double value) noexcept
		: JsonNode(JSON_FLOAT), value(value)
	{
	}

	void JsonFloat::encodeAndAppendTo(std::string& str) const SOUP_EXCAL
	{
		str.append(string::fdecimal(value));
	}

	bool JsonFloat::binaryEncode(Writer& w) const
	{
		uint8_t b = JSON_FLOAT;
		uint64_t val;
		*reinterpret_cast<double*>(&val) = value;
		return w.u8(b)
			&& w.u64le(val)
			;
	}
}