microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
json.hpp File Reference

Stream JSON objects and arrays directly to a microfmt sink. More...

#include "../microfmt.hpp"
#include <cstddef>
#include <cstdint>
#include <string_view>
#include <type_traits>
#include <utility>
Include dependency graph for json.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  microfmt::json::json_obj_view< Fn >
 
struct  microfmt::formatter< json::json_obj_view< Fn > >
 

Namespaces

namespace  microfmt
 
namespace  microfmt::json
 
namespace  microfmt::json::detail
 

Functions

template<typename T >
void microfmt::json::detail::write_integer (const sink &out, T value) noexcept
 
void microfmt::json::write_escaped_string (const sink &out, microfmt::string_view str) noexcept
 Writes a quoted, JSON-escaped string to out.
 
class MICROFMT_API_CLASS microfmt::json::RELOCO_CONSUMABLE (unconsumed) RELOCO_POINTER object_writer
 RAII writer for a streaming JSON object.
 
template<typename Fn >
constexpr auto microfmt::json::json_obj (Fn &&fn) noexcept
 Wraps an object-writing callable for use as a format argument.
 

Detailed Description

Stream JSON objects and arrays directly to a microfmt sink.

Use object_writer and array_writer for scoped JSON serialization, or json_obj to embed an object-writing lambda in a format string.