diff --git a/include/ArduinoJson/Internals/JsonWriter.hpp b/include/ArduinoJson/Internals/JsonWriter.hpp index 47d944cd..63f79445 100644 --- a/include/ArduinoJson/Internals/JsonWriter.hpp +++ b/include/ArduinoJson/Internals/JsonWriter.hpp @@ -56,6 +56,9 @@ class JsonWriter { Print &_sink; size_t _length; + + private: + JsonWriter &operator=(const JsonWriter &); // cannot be assigned }; } } diff --git a/include/ArduinoJson/Internals/Prettyfier.hpp b/include/ArduinoJson/Internals/Prettyfier.hpp index 96c90515..7203e23b 100644 --- a/include/ArduinoJson/Internals/Prettyfier.hpp +++ b/include/ArduinoJson/Internals/Prettyfier.hpp @@ -22,9 +22,7 @@ class Prettyfier : public Print { virtual size_t write(uint8_t); private: - uint8_t _previousChar; - IndentedPrint& _sink; - bool _inString; + Prettyfier& operator=(const Prettyfier&); // cannot be assigned bool inEmptyBlock() { return _previousChar == '{' || _previousChar == '['; } @@ -39,6 +37,10 @@ class Prettyfier : public Print { size_t handleNormalChar(uint8_t); size_t indentIfNeeded(); size_t unindentIfNeeded(); + + uint8_t _previousChar; + IndentedPrint& _sink; + bool _inString; }; } } diff --git a/test/Printers.cpp b/test/Printers.cpp index 0837b5d1..caa3766d 100644 --- a/test/Printers.cpp +++ b/test/Printers.cpp @@ -17,6 +17,9 @@ class StreamPrintAdapter : public Print { } private: + // cannot be assigned + StreamPrintAdapter& operator=(const StreamPrintAdapter&); + std::ostream& _os; };