Reapply clang-format.
$ clang-format -i -style=file \
$(find . | egrep '.*\.(h|cpp|inl)$')
diff --git a/include/json/assertions.h b/include/json/assertions.h
index 9bf076f..b722548 100644
--- a/include/json/assertions.h
+++ b/include/json/assertions.h
@@ -6,8 +6,8 @@
#ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED
#define CPPTL_JSON_ASSERTIONS_H_INCLUDED
-#include <sstream>
#include <cstdlib>
+#include <sstream>
#if !defined(JSON_IS_AMALGAMATION)
#include "config.h"
diff --git a/include/json/config.h b/include/json/config.h
index 8438428..f04d544 100644
--- a/include/json/config.h
+++ b/include/json/config.h
@@ -7,7 +7,7 @@
#define JSON_CONFIG_H_INCLUDED
#include <cstddef>
#include <cstdint> //typedef int64_t, uint64_t
-#include <string> //typedef String
+#include <string> //typedef String
/// If defined, indicates that json library is embedded in CppTL library.
//# define JSON_IN_CPPTL 1
@@ -55,15 +55,18 @@
#endif
#if defined(_MSC_VER) && _MSC_VER < 1800
- #error "ERROR: Visual Studio 12 (2013) with _MSC_VER=1800 is the oldest supported compiler with sufficient C++11 capabilities"
+#error \
+ "ERROR: Visual Studio 12 (2013) with _MSC_VER=1800 is the oldest supported compiler with sufficient C++11 capabilities"
#endif
#if defined(_MSC_VER) && _MSC_VER < 1900
-// As recommended at https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010
- extern JSON_API int msvc_pre1900_c99_snprintf(char *outBuf, size_t size, const char *format, ...);
-# define jsoncpp_snprintf msvc_pre1900_c99_snprintf
+// As recommended at
+// https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010
+extern JSON_API int
+msvc_pre1900_c99_snprintf(char* outBuf, size_t size, const char* format, ...);
+#define jsoncpp_snprintf msvc_pre1900_c99_snprintf
#else
-# define jsoncpp_snprintf std::snprintf
+#define jsoncpp_snprintf std::snprintf
#endif
// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for
@@ -75,10 +78,10 @@
#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
#endif // defined(_MSC_VER)
-// In c++11 the override keyword allows you to explicitly define that a function
-// is intended to override the base-class version. This makes the code more
-// manageable and fixes a set of common hard-to-find bugs.
-#define JSONCPP_OVERRIDE override // Define maintained for backwards compatibility of external tools. C++11 should be used directly in JSONCPP
+// JSONCPP_OVERRIDE is maintained for backwards compatibility of external tools.
+// C++11 should be used directly in JSONCPP.
+#define JSONCPP_OVERRIDE override
+
#if __cplusplus >= 201103L
#define JSONCPP_NOEXCEPT noexcept
#define JSONCPP_OP_EXPLICIT explicit
diff --git a/include/json/features.h b/include/json/features.h
index ba25e8d..8cbe172 100644
--- a/include/json/features.h
+++ b/include/json/features.h
@@ -41,17 +41,17 @@
Features();
/// \c true if comments are allowed. Default: \c true.
- bool allowComments_{true};
+ bool allowComments_{ true };
/// \c true if root must be either an array or an object value. Default: \c
/// false.
- bool strictRoot_{false};
+ bool strictRoot_{ false };
/// \c true if dropped null placeholders are allowed. Default: \c false.
- bool allowDroppedNullPlaceholders_{false};
+ bool allowDroppedNullPlaceholders_{ false };
/// \c true if numeric object key are allowed. Default: \c false.
- bool allowNumericKeys_{false};
+ bool allowNumericKeys_{ false };
};
} // namespace Json
diff --git a/include/json/reader.h b/include/json/reader.h
index ac8b7bd..bde5f3f 100644
--- a/include/json/reader.h
+++ b/include/json/reader.h
@@ -220,8 +220,9 @@
Location& current,
Location end,
unsigned int& unicode);
- bool
- addError(const JSONCPP_STRING& message, Token& token, Location extra = nullptr);
+ bool addError(const JSONCPP_STRING& message,
+ Token& token,
+ Location extra = nullptr);
bool recoverFromError(TokenType skipUntilToken);
bool addErrorAndRecover(const JSONCPP_STRING& message,
Token& token,
diff --git a/include/json/value.h b/include/json/value.h
index 8321de7..8e6b615 100644
--- a/include/json/value.h
+++ b/include/json/value.h
@@ -630,7 +630,7 @@
void setComment(const char* text, size_t len);
- char* comment_{nullptr};
+ char* comment_{ nullptr };
};
// struct MemberNamesTransform
@@ -679,7 +679,7 @@
enum Kind { kindNone = 0, kindIndex, kindKey };
JSONCPP_STRING key_;
ArrayIndex index_{};
- Kind kind_{kindNone};
+ Kind kind_{ kindNone };
};
/** \brief Experimental and untested: represents a "path" to access a node.
@@ -780,7 +780,7 @@
private:
Value::ObjectValues::iterator current_;
// Indicates that iterator is for a null value.
- bool isNull_{true};
+ bool isNull_{ true };
public:
// For some reason, BORLAND needs these at the end, rather
diff --git a/include/json/writer.h b/include/json/writer.h
index 10a1c8e..cf6f0c6 100644
--- a/include/json/writer.h
+++ b/include/json/writer.h
@@ -189,9 +189,9 @@
void writeValue(const Value& value);
JSONCPP_STRING document_;
- bool yamlCompatibilityEnabled_{false};
- bool dropNullPlaceholders_{false};
- bool omitEndingLineFeed_{false};
+ bool yamlCompatibilityEnabled_{ false };
+ bool dropNullPlaceholders_{ false };
+ bool omitEndingLineFeed_{ false };
};
#if defined(_MSC_VER)
#pragma warning(pop)
@@ -257,9 +257,9 @@
ChildValues childValues_;
JSONCPP_STRING document_;
JSONCPP_STRING indentString_;
- unsigned int rightMargin_{74};
- unsigned int indentSize_{3};
- bool addChildValues_{false};
+ unsigned int rightMargin_{ 74 };
+ unsigned int indentSize_{ 3 };
+ bool addChildValues_{ false };
};
#if defined(_MSC_VER)
#pragma warning(pop)
@@ -331,7 +331,7 @@
ChildValues childValues_;
JSONCPP_OSTREAM* document_;
JSONCPP_STRING indentString_;
- unsigned int rightMargin_{74};
+ unsigned int rightMargin_{ 74 };
JSONCPP_STRING indentation_;
bool addChildValues_ : 1;
bool indented_ : 1;