mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-21 15:30:58 +08:00
Reapply clang-format.
$ clang-format -i -style=file \ $(find . | egrep '.*\.(h|cpp|inl)$')
This commit is contained in:
@@ -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"
|
||||
|
@@ -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
|
||||
|
@@ -41,17 +41,17 @@ public:
|
||||
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
|
||||
|
@@ -220,8 +220,9 @@ private:
|
||||
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,
|
||||
|
@@ -630,7 +630,7 @@ private:
|
||||
|
||||
void setComment(const char* text, size_t len);
|
||||
|
||||
char* comment_{nullptr};
|
||||
char* comment_{ nullptr };
|
||||
};
|
||||
|
||||
// struct MemberNamesTransform
|
||||
@@ -679,7 +679,7 @@ private:
|
||||
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 @@ protected:
|
||||
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
|
||||
|
@@ -189,9 +189,9 @@ private:
|
||||
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 @@ private:
|
||||
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 @@ private:
|
||||
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;
|
||||
|
Reference in New Issue
Block a user