From ac0fc79c76fc92783d2a5267082a1f8f9c28df22 Mon Sep 17 00:00:00 2001
From: Gustav <sir.gustav.the.coder@gmail.com>
Date: Mon, 18 May 2020 14:06:39 +0200
Subject: [PATCH] Fixes issue #1718

diff -Naur ./include/rapidjson/writer.h.orig ./include/rapidjson/writer.h
--- ./include/rapidjson/writer.h.orig	2016-08-25 09:59:05.000000000 +0200
+++ ./include/rapidjson/writer.h	2021-07-25 12:28:55.287678300 +0200
@@ -251,6 +251,8 @@
     */
     bool RawValue(const Ch* json, size_t length, Type type) { Prefix(type); return EndValue(WriteRawValue(json, length)); }
 
+    static const size_t kDefaultLevelDepth = 32;
+
 protected:
     //! Information for each nested level
     struct Level {
@@ -259,8 +261,6 @@
         bool inArray;       //!< true if in array, otherwise in object
     };
 
-    static const size_t kDefaultLevelDepth = 32;
-
     bool WriteNull()  {
         PutReserve(*os_, 4);
         PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'u'); PutUnsafe(*os_, 'l'); PutUnsafe(*os_, 'l'); return true;


From d88be8ef1649eca4602348d1aab5c16c36f83d4f Mon Sep 17 00:00:00 2001
From: Milo Yip <miloyip@gmail.com>
Date: Mon, 27 Mar 2017 14:05:03 +0800
Subject: [PATCH] Fix #905 unable to set writeFlags for PrettyWriter

diff -Naur ./include/rapidjson/prettywriter.h.orig ./include/rapidjson/prettywriter.h
--- ./include/rapidjson/prettywriter.h.orig	2016-08-25 09:59:05.000000000 +0200
+++ ./include/rapidjson/prettywriter.h	2021-07-25 12:28:55.295703700 +0200
@@ -42,7 +42,7 @@
 template<typename OutputStream, typename SourceEncoding = UTF8<>, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator, unsigned writeFlags = kWriteDefaultFlags>
 class PrettyWriter : public Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> {
 public:
-    typedef Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator> Base;
+    typedef Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> Base;
     typedef typename Base::Ch Ch;
 
     //! Constructor
