• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef FLUTTER_SHELL_PLATFORM_COMMON_CPP_CLIENT_WRAPPER_INCLUDE_FLUTTER_JSON_TYPE_H_
6 #define FLUTTER_SHELL_PLATFORM_COMMON_CPP_CLIENT_WRAPPER_INCLUDE_FLUTTER_JSON_TYPE_H_
7 
8 // By default, the Json codecs use jsoncpp, but a version using RapidJSON is
9 // implemented as well. To use the latter, set USE_RAPID_JSON.
10 //
11 // When writing code using the JSON codec classes, do not use JsonValueType;
12 // instead use the underlying type for the library you have selected directly.
13 
14 #ifdef USE_RAPID_JSON
15 #include <rapidjson/document.h>
16 
17 // The APIs often pass owning references, which in RapidJSON must include the
18 // allocator, so the value type for the APIs is Document rather than Value.
19 using JsonValueType = rapidjson::Document;
20 #else
21 #include <json/json.h>
22 
23 using JsonValueType = Json::Value;
24 #endif
25 
26 #endif  // FLUTTER_SHELL_PLATFORM_COMMON_CPP_CLIENT_WRAPPER_INCLUDE_FLUTTER_JSON_TYPE_H_