🎨 use Clang-Format

This commit is contained in:
Niels Lohmann committed 2023-11-29 18:01:57 +01:00
1 parent 9cca280a4d
commit 311ad0b877
123 files changed
+17729 -15754

No files matched your search

@@ -8,26 +8,26 @@
#pragma once
#include <algorithm> // copy
#include <cstddef> // size_t
#include <iterator> // back_inserter
#include <memory> // shared_ptr, make_shared
#include <string> // basic_string
#include <vector> // vector
#include <algorithm> // copy
#include <cstddef> // size_t
#include <iterator> // back_inserter
#include <memory> // shared_ptr, make_shared
#include <string> // basic_string
#include <vector> // vector
#ifndef JSON_NO_IO
#include <ios> // streamsize
#include <ostream> // basic_ostream
#endif // JSON_NO_IO
#endif // JSON_NO_IO
#include <nlohmann/detail/macro_scope.hpp>
NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail
{
namespace detail {
/// abstract output adapter interface
template<typename CharType> struct output_adapter_protocol
template<typename CharType>
struct output_adapter_protocol
{
virtual void write_character(CharType c) = 0;
virtual void write_characters(const CharType* s, std::size_t length) = 0;
@@ -50,7 +50,7 @@ class output_vector_adapter : public output_adapter_protocol<CharType>
{
public:
explicit output_vector_adapter(std::vector<CharType, AllocatorType>& vec) noexcept
: v(vec)
: v(vec)
{}
void write_character(CharType c) override
@@ -75,7 +75,7 @@ class output_stream_adapter : public output_adapter_protocol<CharType>
{
public:
explicit output_stream_adapter(std::basic_ostream<CharType>& s) noexcept
: stream(s)
: stream(s)
{}
void write_character(CharType c) override
@@ -100,7 +100,7 @@ class output_string_adapter : public output_adapter_protocol<CharType>
{
public:
explicit output_string_adapter(StringType& s) noexcept
: str(s)
: str(s)
{}
void write_character(CharType c) override
@@ -124,15 +124,18 @@ class output_adapter
public:
template<typename AllocatorType = std::allocator<CharType>>
output_adapter(std::vector<CharType, AllocatorType>& vec)
: oa(std::make_shared<output_vector_adapter<CharType, AllocatorType>>(vec)) {}
: oa(std::make_shared<output_vector_adapter<CharType, AllocatorType>>(vec))
{}
#ifndef JSON_NO_IO
output_adapter(std::basic_ostream<CharType>& s)
: oa(std::make_shared<output_stream_adapter<CharType>>(s)) {}
: oa(std::make_shared<output_stream_adapter<CharType>>(s))
{}
#endif // JSON_NO_IO
output_adapter(StringType& s)
: oa(std::make_shared<output_string_adapter<CharType, StringType>>(s)) {}
: oa(std::make_shared<output_string_adapter<CharType, StringType>>(s))
{}
operator output_adapter_t<CharType>()
{