1 /* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. 2 3 This program is free software; you can redistribute it and/or modify 4 it under the terms of the GNU General Public License, version 2.0, 5 as published by the Free Software Foundation. 6 7 This program is also distributed with certain software (including 8 but not limited to OpenSSL) that is licensed under separate terms, 9 as designated in a particular file or component or in included license 10 documentation. The authors of MySQL hereby grant you an additional 11 permission to link the program and your derivative works with the 12 separately licensed software that they have included with MySQL. 13 14 This program is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License, version 2.0, for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 22 23 #ifndef DD_SDI_FWD_H_INCLUDED 24 #define DD_SDI_FWD_H_INCLUDED 25 26 #include <rapidjson/fwd.h> 27 /** 28 @file 29 @ingroup sdi 30 This header provides @ref dd_rj_type_alias 31 */ 32 33 /** 34 @defgroup dd_rj_type_alias Rapidjson Type Aliases 35 @ingroup sdi 36 37 Create type aliases for rapidjson template instantiations which will 38 be used by (de)serialization code. 39 40 @{ 41 */ 42 namespace dd { 43 typedef rapidjson::UTF8<char> RJ_Encoding; 44 typedef rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> RJ_Allocator; 45 typedef rapidjson::GenericDocument<RJ_Encoding, RJ_Allocator, 46 rapidjson::CrtAllocator> 47 RJ_Document; 48 typedef rapidjson::GenericValue<RJ_Encoding, RJ_Allocator> RJ_Value; 49 typedef rapidjson::GenericStringBuffer<RJ_Encoding, rapidjson::CrtAllocator> 50 RJ_StringBuffer; 51 typedef rapidjson::PrettyWriter<RJ_StringBuffer, RJ_Encoding, RJ_Encoding, 52 RJ_Allocator, 0> 53 RJ_PrettyWriter; 54 55 using RJ_Writer = rapidjson::Writer<RJ_StringBuffer, RJ_Encoding, RJ_Encoding, 56 RJ_Allocator, 0>; 57 58 /** 59 Alias for the rapidjson Writer type to use in serialization. 60 Can be changeed to RJ_PrettyWriter to get human-readable (but 61 significatly larger) sdis. 62 */ 63 using Sdi_writer = RJ_Writer; 64 65 class Sdi_rcontext; 66 class Sdi_wcontext; 67 } // namespace dd 68 /** @} */ // dd_rj_type_alias 69 70 #endif /* DD_SDI_FWD_H_INCLUDED */ 71