CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
JSONForward.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
11
15
16#include <nlohmann/json_fwd.hpp>
17
18namespace CeresEngine {
19
20 // template<typename T> struct JSONAllocator : public std::allocator<T> { };
21
22 template<typename RawAllocator> struct JSONAllocator {
23 template<typename T> using Allocator = StdAllocator<T, RawAllocator>;
24
25 // template<typename T> class Allocator : public StdAllocator<T, RawAllocator> {
26 // using super = StdAllocator<T, RawAllocator>;
27 // using super::super;
28 // };
29 };
30
31#if CE_PLATFORM_EMSCRIPTEN || 1
32 template<typename RawAllocator = DefaultAllocator>
33 using BasicJSON = nlohmann::json;
34#else
35 template<typename RawAllocator = DefaultAllocator>
36 using BasicJSON =
37 nlohmann::basic_json<std::map, std::vector, String, bool, Int64, UInt64, double, JSONAllocator, nlohmann::adl_serializer, std::vector<std::uint8_t>>;
38#endif
39
41
42} // namespace CeresEngine
Definition Application.hpp:19
foonathan::memory::std_allocator< T, RawAllocator > StdAllocator
Definition Allocator.hpp:225
BasicJSON<> JSON
Definition JSONForward.hpp:40
nlohmann::json BasicJSON
Definition JSONForward.hpp:33
Definition JSONForward.hpp:22
StdAllocator< T, RawAllocator > Allocator
Definition JSONForward.hpp:23