diff options
| author | KyleMiles <krm504@nyu.edu> | 2022-01-27 22:43:28 -0500 |
|---|---|---|
| committer | KyleMiles <krm504@nyu.edu> | 2022-01-28 00:24:06 -0500 |
| commit | 6812c973c9fa9b4ad642ab81856c05f87bd6fcc4 (patch) | |
| tree | dace4156d03148bcaf02df138ab4e0d93e61bc6f /rapidjsonwrapper.h | |
| parent | 519c9db22367f2659d1a54599fab47e6313be06e (diff) | |
Format All Files
Diffstat (limited to 'rapidjsonwrapper.h')
| -rw-r--r-- | rapidjsonwrapper.h | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/rapidjsonwrapper.h b/rapidjsonwrapper.h index d1988b42..5b117413 100644 --- a/rapidjsonwrapper.h +++ b/rapidjsonwrapper.h @@ -4,33 +4,36 @@ #if defined(__GNUC__) && __GNUC__ >= 8 // Disable warnings from rapidjson performance optimizations -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wclass-memaccess" + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wclass-memaccess" #endif struct GenericException; struct ParseException; -struct GenericException: public std::exception +struct GenericException : public std::exception { GenericException() : std::exception() {} - virtual const char* what() const throw() - { - return "Exception while parsing json."; - } + virtual const char* what() const throw() { return "Exception while parsing json."; } }; -#define RAPIDJSON_HAS_STDSTRING 0 +#define RAPIDJSON_HAS_STDSTRING 0 #define RAPIDJSON_HAS_CXX11_NOEXCEPT 0 -#define RAPIDJSON_ASSERT(x) do {if (!(x)) throw GenericException(); } while(0); -#define RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode,offset) \ +#define RAPIDJSON_ASSERT(x) \ + do \ + { \ + if (!(x)) \ + throw GenericException(); \ + } while (0); +#define RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset) \ throw ParseException(parseErrorCode, #parseErrorCode, offset) #include "rapidjson/error/error.h" -struct ParseException: public std::runtime_error, public rapidjson::ParseResult +struct ParseException : public std::runtime_error, public rapidjson::ParseResult { - ParseException(rapidjson::ParseErrorCode code, const char* msg, size_t offset) : std::runtime_error(msg), - ParseResult(code, offset) {} + ParseException(rapidjson::ParseErrorCode code, const char* msg, size_t offset) : + std::runtime_error(msg), ParseResult(code, offset) + {} }; #include "rapidjson/error/en.h" @@ -41,5 +44,5 @@ struct ParseException: public std::runtime_error, public rapidjson::ParseResult #include "rapidjson/prettywriter.h" #if defined(__GNUC__) && __GNUC__ >= 8 -#pragma GCC diagnostic pop + #pragma GCC diagnostic pop #endif |
