/src/assimp/code/AssetLib/glTFCommon/glTFCommon.h
Line | Count | Source |
1 | | /* |
2 | | Open Asset Import Library (assimp) |
3 | | ---------------------------------------------------------------------- |
4 | | |
5 | | Copyright (c) 2006-2026, assimp team |
6 | | |
7 | | All rights reserved. |
8 | | |
9 | | Redistribution and use of this software in source and binary forms, |
10 | | with or without modification, are permitted provided that the |
11 | | following conditions are met: |
12 | | |
13 | | * Redistributions of source code must retain the above |
14 | | copyright notice, this list of conditions and the |
15 | | following disclaimer. |
16 | | |
17 | | * Redistributions in binary form must reproduce the above |
18 | | copyright notice, this list of conditions and the |
19 | | following disclaimer in the documentation and/or other |
20 | | materials provided with the distribution. |
21 | | |
22 | | * Neither the name of the assimp team, nor the names of its |
23 | | contributors may be used to endorse or promote products |
24 | | derived from this software without specific prior |
25 | | written permission of the assimp team. |
26 | | |
27 | | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
28 | | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
29 | | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
30 | | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
31 | | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
32 | | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
33 | | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
34 | | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
35 | | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
36 | | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
37 | | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
38 | | |
39 | | ---------------------------------------------------------------------- |
40 | | */ |
41 | | #ifndef AI_GLFTCOMMON_H_INC |
42 | | #define AI_GLFTCOMMON_H_INC |
43 | | |
44 | | #include <assimp/Exceptional.h> |
45 | | #include <assimp/DefaultLogger.hpp> |
46 | | |
47 | | #include <algorithm> |
48 | | #include <list> |
49 | | #include <map> |
50 | | #include <stdexcept> |
51 | | #include <string> |
52 | | #include <vector> |
53 | | |
54 | | #include <rapidjson/document.h> |
55 | | #include <rapidjson/error/en.h> |
56 | | #include <rapidjson/rapidjson.h> |
57 | | |
58 | | // clang-format off |
59 | | |
60 | | #ifdef ASSIMP_API |
61 | | # include <assimp/ByteSwapper.h> |
62 | | # include <assimp/DefaultIOSystem.h> |
63 | | # include <memory> |
64 | | #else |
65 | | # include <memory> |
66 | | # define AI_SWAP4(p) |
67 | | # define ai_assert |
68 | | #endif |
69 | | |
70 | | #if _MSC_VER > 1500 || (defined __GNUC__) |
71 | | # define ASSIMP_GLTF_USE_UNORDERED_MULTIMAP |
72 | | #else |
73 | | # define gltf_unordered_map map |
74 | | #endif |
75 | | |
76 | | #ifdef ASSIMP_GLTF_USE_UNORDERED_MULTIMAP |
77 | | # include <unordered_map> |
78 | | # if defined(_MSC_VER) && _MSC_VER <= 1600 |
79 | | # define gltf_unordered_map tr1::unordered_map |
80 | | # else |
81 | | # define gltf_unordered_map unordered_map |
82 | | # endif |
83 | | #endif |
84 | | // clang-format on |
85 | | |
86 | | |
87 | | namespace glTFCommon { |
88 | | |
89 | | using rapidjson::Document; |
90 | | using rapidjson::Value; |
91 | | |
92 | | #ifdef ASSIMP_API |
93 | | using Assimp::IOStream; |
94 | | using Assimp::IOSystem; |
95 | | using std::shared_ptr; |
96 | | #else |
97 | | using std::shared_ptr; |
98 | | |
99 | | typedef std::runtime_error DeadlyImportError; |
100 | | typedef std::runtime_error DeadlyExportError; |
101 | | |
102 | | enum aiOrigin { |
103 | | aiOrigin_SET = 0, |
104 | | aiOrigin_CUR = 1, |
105 | | aiOrigin_END = 2 |
106 | | }; |
107 | | |
108 | | class IOSystem; |
109 | | |
110 | | class IOStream { |
111 | | public: |
112 | | IOStream(FILE *file) : |
113 | | f(file) {} |
114 | | ~IOStream() { |
115 | | fclose(f); |
116 | | } |
117 | | |
118 | | size_t Read(void *b, size_t sz, size_t n) { return fread(b, sz, n, f); } |
119 | | size_t Write(const void *b, size_t sz, size_t n) { return fwrite(b, sz, n, f); } |
120 | | int Seek(size_t off, aiOrigin orig) { return fseek(f, off, int(orig)); } |
121 | | size_t Tell() const { return ftell(f); } |
122 | | |
123 | | size_t FileSize() { |
124 | | long p = Tell(), len = (Seek(0, aiOrigin_END), Tell()); |
125 | | return size_t((Seek(p, aiOrigin_SET), len)); |
126 | | } |
127 | | |
128 | | private: |
129 | | FILE *f; |
130 | | }; |
131 | | #endif |
132 | | |
133 | | // Vec/matrix types, as raw float arrays |
134 | | typedef float(vec3)[3]; |
135 | | typedef float(vec4)[4]; |
136 | | typedef float(mat4)[16]; |
137 | | |
138 | 10.3k | inline void CopyValue(const glTFCommon::vec3 &v, aiColor4D &out) { |
139 | 10.3k | out.r = v[0]; |
140 | 10.3k | out.g = v[1]; |
141 | 10.3k | out.b = v[2]; |
142 | 10.3k | out.a = 1.0; |
143 | 10.3k | } |
144 | | |
145 | 20.8k | inline void CopyValue(const glTFCommon::vec4 &v, aiColor4D &out) { |
146 | 20.8k | out.r = v[0]; |
147 | 20.8k | out.g = v[1]; |
148 | 20.8k | out.b = v[2]; |
149 | 20.8k | out.a = v[3]; |
150 | 20.8k | } |
151 | | |
152 | 0 | inline void CopyValue(const glTFCommon::vec4 &v, aiColor3D &out) { |
153 | 0 | out.r = v[0]; |
154 | 0 | out.g = v[1]; |
155 | 0 | out.b = v[2]; |
156 | 0 | } |
157 | | |
158 | 0 | inline void CopyValue(const glTFCommon::vec3 &v, aiColor3D &out) { |
159 | 0 | out.r = v[0]; |
160 | 0 | out.g = v[1]; |
161 | 0 | out.b = v[2]; |
162 | 0 | } |
163 | | |
164 | 1.89k | inline void CopyValue(const glTFCommon::vec3 &v, aiVector3D &out) { |
165 | 1.89k | out.x = v[0]; |
166 | 1.89k | out.y = v[1]; |
167 | 1.89k | out.z = v[2]; |
168 | 1.89k | } |
169 | | |
170 | 157 | inline void CopyValue(const glTFCommon::vec4 &v, aiQuaternion &out) { |
171 | 157 | out.x = v[0]; |
172 | 157 | out.y = v[1]; |
173 | 157 | out.z = v[2]; |
174 | 157 | out.w = v[3]; |
175 | 157 | } |
176 | | |
177 | 14.9k | inline void CopyValue(const glTFCommon::mat4 &v, aiMatrix4x4 &o) { |
178 | 14.9k | o.a1 = v[0]; |
179 | 14.9k | o.b1 = v[1]; |
180 | 14.9k | o.c1 = v[2]; |
181 | 14.9k | o.d1 = v[3]; |
182 | 14.9k | o.a2 = v[4]; |
183 | 14.9k | o.b2 = v[5]; |
184 | 14.9k | o.c2 = v[6]; |
185 | 14.9k | o.d2 = v[7]; |
186 | 14.9k | o.a3 = v[8]; |
187 | 14.9k | o.b3 = v[9]; |
188 | 14.9k | o.c3 = v[10]; |
189 | 14.9k | o.d3 = v[11]; |
190 | 14.9k | o.a4 = v[12]; |
191 | 14.9k | o.b4 = v[13]; |
192 | 14.9k | o.c4 = v[14]; |
193 | 14.9k | o.d4 = v[15]; |
194 | 14.9k | } |
195 | | |
196 | | #if _MSC_VER |
197 | | # pragma warning(push) |
198 | | # pragma warning(disable : 4310) |
199 | | #endif // _MSC_VER |
200 | | |
201 | 0 | inline std::string getCurrentAssetDir(const std::string &pFile) { |
202 | 0 | int pos = std::max(int(pFile.rfind('/')), int(pFile.rfind('\\'))); |
203 | 0 | if (pos == int(std::string::npos)) { |
204 | 0 | return std::string(); |
205 | 0 | } |
206 | | |
207 | 0 | return pFile.substr(0, pos + 1); |
208 | 0 | } |
209 | | #if _MSC_VER |
210 | | # pragma warning(pop) |
211 | | #endif // _MSC_VER |
212 | | |
213 | | namespace Util { |
214 | | |
215 | | void EncodeBase64(const uint8_t *in, size_t inLength, std::string &out); |
216 | | |
217 | | size_t DecodeBase64(const char *in, size_t inLength, uint8_t *&out); |
218 | | |
219 | 0 | inline size_t DecodeBase64(const char *in, uint8_t *&out) { |
220 | 0 | return DecodeBase64(in, strlen(in), out); |
221 | 0 | } |
222 | | |
223 | | struct DataURI { |
224 | | const char *mediaType; |
225 | | const char *charset; |
226 | | bool base64; |
227 | | const char *data; |
228 | | size_t dataLength; |
229 | | }; |
230 | | |
231 | | //! Check if a uri is a data URI |
232 | | bool ParseDataURI(const char *const_uri, size_t uriLen, DataURI &out); |
233 | | |
234 | | } // namespace Util |
235 | | |
236 | | #define CHECK_EXT(EXT) \ |
237 | 21.3k | if (exts.find(#EXT) != exts.end()) extensionsUsed.EXT = true; |
238 | | |
239 | | //! Helper struct to represent values that might not be present |
240 | | template <class T> |
241 | | struct Nullable { |
242 | | T value; |
243 | | bool isPresent; |
244 | | |
245 | | Nullable() : |
246 | 11.1M | isPresent(false) {}glTFCommon::Nullable<float [16]>::Nullable() Line | Count | Source | 246 | 905k | isPresent(false) {} |
glTFCommon::Nullable<float [3]>::Nullable() Line | Count | Source | 246 | 1.01M | isPresent(false) {} |
glTFCommon::Nullable<float [4]>::Nullable() Line | Count | Source | 246 | 506k | isPresent(false) {} |
glTFCommon::Nullable<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::Nullable() Line | Count | Source | 246 | 1.42M | isPresent(false) {} |
glTFCommon::Nullable<double>::Nullable() Line | Count | Source | 246 | 1.42M | isPresent(false) {} |
glTFCommon::Nullable<unsigned long>::Nullable() Line | Count | Source | 246 | 1.42M | isPresent(false) {} |
glTFCommon::Nullable<long>::Nullable() Line | Count | Source | 246 | 1.42M | isPresent(false) {} |
glTFCommon::Nullable<bool>::Nullable() Line | Count | Source | 246 | 1.42M | isPresent(false) {} |
glTFCommon::Nullable<std::__1::vector<glTF2::CustomExtension, std::__1::allocator<glTF2::CustomExtension> > >::Nullable() Line | Count | Source | 246 | 1.42M | isPresent(false) {} |
glTFCommon::Nullable<glTF2::PbrSpecularGlossiness>::Nullable() Line | Count | Source | 246 | 22.0k | isPresent(false) {} |
glTFCommon::Nullable<glTF2::MaterialSpecular>::Nullable() Line | Count | Source | 246 | 22.0k | isPresent(false) {} |
glTFCommon::Nullable<glTF2::MaterialSheen>::Nullable() Line | Count | Source | 246 | 22.0k | isPresent(false) {} |
glTFCommon::Nullable<glTF2::MaterialClearcoat>::Nullable() Line | Count | Source | 246 | 22.0k | isPresent(false) {} |
glTFCommon::Nullable<glTF2::MaterialTransmission>::Nullable() Line | Count | Source | 246 | 22.0k | isPresent(false) {} |
glTFCommon::Nullable<glTF2::MaterialVolume>::Nullable() Line | Count | Source | 246 | 22.0k | isPresent(false) {} |
glTFCommon::Nullable<glTF2::MaterialIOR>::Nullable() Line | Count | Source | 246 | 22.0k | isPresent(false) {} |
glTFCommon::Nullable<glTF2::MaterialEmissiveStrength>::Nullable() Line | Count | Source | 246 | 22.0k | isPresent(false) {} |
glTFCommon::Nullable<glTF2::MaterialAnisotropy>::Nullable() Line | Count | Source | 246 | 22.0k | isPresent(false) {} |
Unexecuted instantiation: glTFCommon::Nullable<float>::Nullable() |
247 | | Nullable(T &val) : |
248 | 24.7k | value(val), |
249 | 24.7k | isPresent(true) {}glTFCommon::Nullable<glTF2::PbrSpecularGlossiness>::Nullable(glTF2::PbrSpecularGlossiness&) Line | Count | Source | 248 | 3 | value(val), | 249 | 3 | isPresent(true) {} |
glTFCommon::Nullable<glTF2::MaterialSpecular>::Nullable(glTF2::MaterialSpecular&) Line | Count | Source | 248 | 8.56k | value(val), | 249 | 8.56k | isPresent(true) {} |
glTFCommon::Nullable<glTF2::MaterialSheen>::Nullable(glTF2::MaterialSheen&) Line | Count | Source | 248 | 2 | value(val), | 249 | 2 | isPresent(true) {} |
Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialClearcoat>::Nullable(glTF2::MaterialClearcoat&) Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialTransmission>::Nullable(glTF2::MaterialTransmission&) glTFCommon::Nullable<glTF2::MaterialVolume>::Nullable(glTF2::MaterialVolume&) Line | Count | Source | 248 | 10.7k | value(val), | 249 | 10.7k | isPresent(true) {} |
glTFCommon::Nullable<glTF2::MaterialIOR>::Nullable(glTF2::MaterialIOR&) Line | Count | Source | 248 | 5.38k | value(val), | 249 | 5.38k | isPresent(true) {} |
Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialEmissiveStrength>::Nullable(glTF2::MaterialEmissiveStrength&) Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialAnisotropy>::Nullable(glTF2::MaterialAnisotropy&) |
250 | | }; |
251 | | |
252 | | //! A reference to one top-level object, which is valid |
253 | | //! until the Asset instance is destroyed |
254 | | template <class T> |
255 | | class Ref { |
256 | | std::vector<T *> *vector; |
257 | | unsigned int index; |
258 | | |
259 | | public: |
260 | | Ref() : |
261 | 4.19M | vector(nullptr), |
262 | 4.19M | index(0) {}glTFCommon::Ref<glTF::Buffer>::Ref() Line | Count | Source | 261 | 189k | vector(nullptr), | 262 | 189k | index(0) {} |
glTFCommon::Ref<glTF::Scene>::Ref() Line | Count | Source | 261 | 31.7k | vector(nullptr), | 262 | 31.7k | index(0) {} |
glTFCommon::Ref<glTF::Camera>::Ref() Line | Count | Source | 261 | 241k | vector(nullptr), | 262 | 241k | index(0) {} |
glTFCommon::Ref<glTF::Light>::Ref() Line | Count | Source | 261 | 241k | vector(nullptr), | 262 | 241k | index(0) {} |
glTFCommon::Ref<glTF::Skin>::Ref() Line | Count | Source | 261 | 251k | vector(nullptr), | 262 | 251k | index(0) {} |
glTFCommon::Ref<glTF::Node>::Ref() Line | Count | Source | 261 | 260k | vector(nullptr), | 262 | 260k | index(0) {} |
glTFCommon::Ref<glTF::Accessor>::Ref() Line | Count | Source | 261 | 73.5k | vector(nullptr), | 262 | 73.5k | index(0) {} |
glTFCommon::Ref<glTF::Material>::Ref() Line | Count | Source | 261 | 43.8k | vector(nullptr), | 262 | 43.8k | index(0) {} |
glTFCommon::Ref<glTF::BufferView>::Ref() Line | Count | Source | 261 | 160k | vector(nullptr), | 262 | 160k | index(0) {} |
glTFCommon::Ref<glTF::Texture>::Ref() Line | Count | Source | 261 | 43.9k | vector(nullptr), | 262 | 43.9k | index(0) {} |
glTFCommon::Ref<glTF::Sampler>::Ref() Line | Count | Source | 261 | 2.15k | vector(nullptr), | 262 | 2.15k | index(0) {} |
glTFCommon::Ref<glTF::Image>::Ref() Line | Count | Source | 261 | 2.15k | vector(nullptr), | 262 | 2.15k | index(0) {} |
glTFCommon::Ref<glTF2::Scene>::Ref() Line | Count | Source | 261 | 38.6k | vector(nullptr), | 262 | 38.6k | index(0) {} |
glTFCommon::Ref<glTF2::Buffer>::Ref() Line | Count | Source | 261 | 237k | vector(nullptr), | 262 | 237k | index(0) {} |
glTFCommon::Ref<glTF2::Texture>::Ref() Line | Count | Source | 261 | 481k | vector(nullptr), | 262 | 481k | index(0) {} |
glTFCommon::Ref<glTF2::Camera>::Ref() Line | Count | Source | 261 | 264k | vector(nullptr), | 262 | 264k | index(0) {} |
glTFCommon::Ref<glTF2::Light>::Ref() Line | Count | Source | 261 | 264k | vector(nullptr), | 262 | 264k | index(0) {} |
glTFCommon::Ref<glTF2::Skin>::Ref() Line | Count | Source | 261 | 274k | vector(nullptr), | 262 | 274k | index(0) {} |
glTFCommon::Ref<glTF2::Node>::Ref() Line | Count | Source | 261 | 287k | vector(nullptr), | 262 | 287k | index(0) {} |
glTFCommon::Ref<glTF2::Accessor>::Ref() Line | Count | Source | 261 | 518k | vector(nullptr), | 262 | 518k | index(0) {} |
glTFCommon::Ref<glTF2::Material>::Ref() Line | Count | Source | 261 | 68.6k | vector(nullptr), | 262 | 68.6k | index(0) {} |
glTFCommon::Ref<glTF2::BufferView>::Ref() Line | Count | Source | 261 | 206k | vector(nullptr), | 262 | 206k | index(0) {} |
glTFCommon::Ref<glTF2::Sampler>::Ref() Line | Count | Source | 261 | 5.14k | vector(nullptr), | 262 | 5.14k | index(0) {} |
glTFCommon::Ref<glTF2::Image>::Ref() Line | Count | Source | 261 | 2.85k | vector(nullptr), | 262 | 2.85k | index(0) {} |
|
263 | | Ref(std::vector<T *> &vec, unsigned int idx) : |
264 | 4.31M | vector(&vec), |
265 | 4.31M | index(idx) {}glTFCommon::Ref<glTF::Buffer>::Ref(std::__1::vector<glTF::Buffer*, std::__1::allocator<glTF::Buffer*> >&, unsigned int) Line | Count | Source | 264 | 30.8k | vector(&vec), | 265 | 30.8k | index(idx) {} |
glTFCommon::Ref<glTF::Scene>::Ref(std::__1::vector<glTF::Scene*, std::__1::allocator<glTF::Scene*> >&, unsigned int) Line | Count | Source | 264 | 10.2k | vector(&vec), | 265 | 10.2k | index(idx) {} |
glTFCommon::Ref<glTF::Node>::Ref(std::__1::vector<glTF::Node*, std::__1::allocator<glTF::Node*> >&, unsigned int) Line | Count | Source | 264 | 508k | vector(&vec), | 265 | 508k | index(idx) {} |
glTFCommon::Ref<glTF::Mesh>::Ref(std::__1::vector<glTF::Mesh*, std::__1::allocator<glTF::Mesh*> >&, unsigned int) Line | Count | Source | 264 | 86.9k | vector(&vec), | 265 | 86.9k | index(idx) {} |
glTFCommon::Ref<glTF::Accessor>::Ref(std::__1::vector<glTF::Accessor*, std::__1::allocator<glTF::Accessor*> >&, unsigned int) Line | Count | Source | 264 | 158k | vector(&vec), | 265 | 158k | index(idx) {} |
glTFCommon::Ref<glTF::BufferView>::Ref(std::__1::vector<glTF::BufferView*, std::__1::allocator<glTF::BufferView*> >&, unsigned int) Line | Count | Source | 264 | 158k | vector(&vec), | 265 | 158k | index(idx) {} |
glTFCommon::Ref<glTF::Material>::Ref(std::__1::vector<glTF::Material*, std::__1::allocator<glTF::Material*> >&, unsigned int) Line | Count | Source | 264 | 53.3k | vector(&vec), | 265 | 53.3k | index(idx) {} |
glTFCommon::Ref<glTF::Texture>::Ref(std::__1::vector<glTF::Texture*, std::__1::allocator<glTF::Texture*> >&, unsigned int) Line | Count | Source | 264 | 2.13k | vector(&vec), | 265 | 2.13k | index(idx) {} |
glTFCommon::Ref<glTF::Image>::Ref(std::__1::vector<glTF::Image*, std::__1::allocator<glTF::Image*> >&, unsigned int) Line | Count | Source | 264 | 2.05k | vector(&vec), | 265 | 2.05k | index(idx) {} |
glTFCommon::Ref<glTF::Sampler>::Ref(std::__1::vector<glTF::Sampler*, std::__1::allocator<glTF::Sampler*> >&, unsigned int) Line | Count | Source | 264 | 2.04k | vector(&vec), | 265 | 2.04k | index(idx) {} |
Unexecuted instantiation: glTFCommon::Ref<glTF::Camera>::Ref(std::__1::vector<glTF::Camera*, std::__1::allocator<glTF::Camera*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF::Light>::Ref(std::__1::vector<glTF::Light*, std::__1::allocator<glTF::Light*> >&, unsigned int) glTFCommon::Ref<glTF2::Buffer>::Ref(std::__1::vector<glTF2::Buffer*, std::__1::allocator<glTF2::Buffer*> >&, unsigned int) Line | Count | Source | 264 | 47.2k | vector(&vec), | 265 | 47.2k | index(idx) {} |
glTFCommon::Ref<glTF2::Scene>::Ref(std::__1::vector<glTF2::Scene*, std::__1::allocator<glTF2::Scene*> >&, unsigned int) Line | Count | Source | 264 | 15.4k | vector(&vec), | 265 | 15.4k | index(idx) {} |
glTFCommon::Ref<glTF2::Node>::Ref(std::__1::vector<glTF2::Node*, std::__1::allocator<glTF2::Node*> >&, unsigned int) Line | Count | Source | 264 | 2.07M | vector(&vec), | 265 | 2.07M | index(idx) {} |
glTFCommon::Ref<glTF2::Mesh>::Ref(std::__1::vector<glTF2::Mesh*, std::__1::allocator<glTF2::Mesh*> >&, unsigned int) Line | Count | Source | 264 | 280k | vector(&vec), | 265 | 280k | index(idx) {} |
glTFCommon::Ref<glTF2::Accessor>::Ref(std::__1::vector<glTF2::Accessor*, std::__1::allocator<glTF2::Accessor*> >&, unsigned int) Line | Count | Source | 264 | 204k | vector(&vec), | 265 | 204k | index(idx) {} |
glTFCommon::Ref<glTF2::BufferView>::Ref(std::__1::vector<glTF2::BufferView*, std::__1::allocator<glTF2::BufferView*> >&, unsigned int) Line | Count | Source | 264 | 198k | vector(&vec), | 265 | 198k | index(idx) {} |
glTFCommon::Ref<glTF2::Material>::Ref(std::__1::vector<glTF2::Material*, std::__1::allocator<glTF2::Material*> >&, unsigned int) Line | Count | Source | 264 | 58.0k | vector(&vec), | 265 | 58.0k | index(idx) {} |
glTFCommon::Ref<glTF2::Texture>::Ref(std::__1::vector<glTF2::Texture*, std::__1::allocator<glTF2::Texture*> >&, unsigned int) Line | Count | Source | 264 | 3.06k | vector(&vec), | 265 | 3.06k | index(idx) {} |
glTFCommon::Ref<glTF2::Image>::Ref(std::__1::vector<glTF2::Image*, std::__1::allocator<glTF2::Image*> >&, unsigned int) Line | Count | Source | 264 | 2.73k | vector(&vec), | 265 | 2.73k | index(idx) {} |
glTFCommon::Ref<glTF2::Sampler>::Ref(std::__1::vector<glTF2::Sampler*, std::__1::allocator<glTF2::Sampler*> >&, unsigned int) Line | Count | Source | 264 | 2.64k | vector(&vec), | 265 | 2.64k | index(idx) {} |
glTFCommon::Ref<glTF2::Skin>::Ref(std::__1::vector<glTF2::Skin*, std::__1::allocator<glTF2::Skin*> >&, unsigned int) Line | Count | Source | 264 | 398k | vector(&vec), | 265 | 398k | index(idx) {} |
glTFCommon::Ref<glTF2::Camera>::Ref(std::__1::vector<glTF2::Camera*, std::__1::allocator<glTF2::Camera*> >&, unsigned int) Line | Count | Source | 264 | 169 | vector(&vec), | 265 | 169 | index(idx) {} |
Unexecuted instantiation: glTFCommon::Ref<glTF2::Light>::Ref(std::__1::vector<glTF2::Light*, std::__1::allocator<glTF2::Light*> >&, unsigned int) glTFCommon::Ref<glTF2::Animation>::Ref(std::__1::vector<glTF2::Animation*, std::__1::allocator<glTF2::Animation*> >&, unsigned int) Line | Count | Source | 264 | 3.89k | vector(&vec), | 265 | 3.89k | index(idx) {} |
glTFCommon::Ref<glTF::Skin>::Ref(std::__1::vector<glTF::Skin*, std::__1::allocator<glTF::Skin*> >&, unsigned int) Line | Count | Source | 264 | 908 | vector(&vec), | 265 | 908 | index(idx) {} |
glTFCommon::Ref<glTF::Animation>::Ref(std::__1::vector<glTF::Animation*, std::__1::allocator<glTF::Animation*> >&, unsigned int) Line | Count | Source | 264 | 5.18k | vector(&vec), | 265 | 5.18k | index(idx) {} |
|
266 | | |
267 | 894k | inline unsigned int GetIndex() const { return index; }glTFCommon::Ref<glTF::Image>::GetIndex() const Line | Count | Source | 267 | 22 | inline unsigned int GetIndex() const { return index; } |
glTFCommon::Ref<glTF::Material>::GetIndex() const Line | Count | Source | 267 | 35 | inline unsigned int GetIndex() const { return index; } |
glTFCommon::Ref<glTF::Mesh>::GetIndex() const Line | Count | Source | 267 | 3.44k | inline unsigned int GetIndex() const { return index; } |
Unexecuted instantiation: glTFCommon::Ref<glTF::Camera>::GetIndex() const Unexecuted instantiation: glTFCommon::Ref<glTF::Light>::GetIndex() const glTFCommon::Ref<glTF2::Image>::GetIndex() const Line | Count | Source | 267 | 792 | inline unsigned int GetIndex() const { return index; } |
glTFCommon::Ref<glTF2::Material>::GetIndex() const Line | Count | Source | 267 | 2.58k | inline unsigned int GetIndex() const { return index; } |
glTFCommon::Ref<glTF2::Mesh>::GetIndex() const Line | Count | Source | 267 | 405k | inline unsigned int GetIndex() const { return index; } |
glTFCommon::Ref<glTF2::Camera>::GetIndex() const Line | Count | Source | 267 | 225 | inline unsigned int GetIndex() const { return index; } |
Unexecuted instantiation: glTFCommon::Ref<glTF2::Light>::GetIndex() const glTFCommon::Ref<glTF2::Node>::GetIndex() const Line | Count | Source | 267 | 238k | inline unsigned int GetIndex() const { return index; } |
glTFCommon::Ref<glTF::Texture>::GetIndex() const Line | Count | Source | 267 | 1.99k | inline unsigned int GetIndex() const { return index; } |
glTFCommon::Ref<glTF::Node>::GetIndex() const Line | Count | Source | 267 | 238k | inline unsigned int GetIndex() const { return index; } |
glTFCommon::Ref<glTF2::Texture>::GetIndex() const Line | Count | Source | 267 | 2.29k | inline unsigned int GetIndex() const { return index; } |
|
268 | | |
269 | 2.17M | operator bool() const { return vector != nullptr && index < vector->size(); }glTFCommon::Ref<glTF2::Buffer>::operator bool() const Line | Count | Source | 269 | 49.7k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::BufferView>::operator bool() const Line | Count | Source | 269 | 327k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Node>::operator bool() const Line | Count | Source | 269 | 38.1k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Mesh>::operator bool() const Line | Count | Source | 269 | 8.28k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Camera>::operator bool() const Line | Count | Source | 269 | 19.6k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Light>::operator bool() const Line | Count | Source | 269 | 19.5k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Accessor>::operator bool() const Line | Count | Source | 269 | 573k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::Texture>::operator bool() const Line | Count | Source | 269 | 45.2k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::Skin>::operator bool() const Line | Count | Source | 269 | 238k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::Image>::operator bool() const Line | Count | Source | 269 | 2.01k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::Sampler>::operator bool() const Line | Count | Source | 269 | 1.99k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::Mesh>::operator bool() const Line | Count | Source | 269 | 1.62k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::Node>::operator bool() const Line | Count | Source | 269 | 8.76k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::Buffer>::operator bool() const Line | Count | Source | 269 | 15.0k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::BufferView>::operator bool() const Line | Count | Source | 269 | 1.20k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::Camera>::operator bool() const Line | Count | Source | 269 | 2.98k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::Accessor>::operator bool() const Line | Count | Source | 269 | 185k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::Material>::operator bool() const Line | Count | Source | 269 | 42.6k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::Scene>::operator bool() const Line | Count | Source | 269 | 10.7k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::Light>::operator bool() const Line | Count | Source | 269 | 2.98k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Texture>::operator bool() const Line | Count | Source | 269 | 251k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Image>::operator bool() const Line | Count | Source | 269 | 3.20k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Sampler>::operator bool() const Line | Count | Source | 269 | 5.38k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Material>::operator bool() const Line | Count | Source | 269 | 45.8k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Skin>::operator bool() const Line | Count | Source | 269 | 245k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Scene>::operator bool() const Line | Count | Source | 269 | 26.1k | operator bool() const { return vector != nullptr && index < vector->size(); } |
|
270 | | |
271 | 159M | T *operator->() { return (*vector)[index]; }glTFCommon::Ref<glTF2::Buffer>::operator->() Line | Count | Source | 271 | 2.01M | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF2::BufferView>::operator->() Line | Count | Source | 271 | 1.96M | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF2::Camera>::operator->() Line | Count | Source | 271 | 169 | T *operator->() { return (*vector)[index]; } |
Unexecuted instantiation: glTFCommon::Ref<glTF2::Light>::operator->() glTFCommon::Ref<glTF2::Accessor>::operator->() Line | Count | Source | 271 | 77.4M | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF2::Scene>::operator->() Line | Count | Source | 271 | 43.9k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF::Node>::operator->() Line | Count | Source | 271 | 944k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF::Texture>::operator->() Line | Count | Source | 271 | 16.2k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF::Material>::operator->() Line | Count | Source | 271 | 125k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF::Mesh>::operator->() Line | Count | Source | 271 | 131k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF::Skin>::operator->() Line | Count | Source | 271 | 145k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF::Image>::operator->() Line | Count | Source | 271 | 4.21k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF::Sampler>::operator->() Line | Count | Source | 271 | 9.96k | T *operator->() { return (*vector)[index]; } |
Unexecuted instantiation: glTFCommon::Ref<glTF::Camera>::operator->() glTFCommon::Ref<glTF::BufferView>::operator->() Line | Count | Source | 271 | 1.26M | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF::Buffer>::operator->() Line | Count | Source | 271 | 871k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF::Accessor>::operator->() Line | Count | Source | 271 | 69.4M | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF::Scene>::operator->() Line | Count | Source | 271 | 20.0k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF2::Texture>::operator->() Line | Count | Source | 271 | 19.7k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF2::Material>::operator->() Line | Count | Source | 271 | 307k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF2::Image>::operator->() Line | Count | Source | 271 | 12.2k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF2::Sampler>::operator->() Line | Count | Source | 271 | 8.65k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF2::Node>::operator->() Line | Count | Source | 271 | 3.99M | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF2::Mesh>::operator->() Line | Count | Source | 271 | 262k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF2::Skin>::operator->() Line | Count | Source | 271 | 152k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF::Animation>::operator->() Line | Count | Source | 271 | 51.8k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF2::Animation>::operator->() Line | Count | Source | 271 | 48.4k | T *operator->() { return (*vector)[index]; } |
|
272 | | |
273 | 26.2k | T &operator*() { return *((*vector)[index]); }glTFCommon::Ref<glTF::Node>::operator*() Line | Count | Source | 273 | 2.98k | T &operator*() { return *((*vector)[index]); } |
glTFCommon::Ref<glTF2::Accessor>::operator*() Line | Count | Source | 273 | 1.39k | T &operator*() { return *((*vector)[index]); } |
glTFCommon::Ref<glTF2::Node>::operator*() Line | Count | Source | 273 | 21.8k | T &operator*() { return *((*vector)[index]); } |
|
274 | | }; |
275 | | |
276 | | // |
277 | | // JSON Value reading helpers |
278 | | // |
279 | | |
280 | | template <class T> |
281 | | struct ReadHelper { |
282 | 30.2k | static bool Read(Value &val, T &out) { |
283 | 30.2k | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; |
284 | 30.2k | } glTFCommon::ReadHelper<unsigned int>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, unsigned int&) Line | Count | Source | 282 | 7.50k | static bool Read(Value &val, T &out) { | 283 | 7.50k | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 7.50k | } |
glTFCommon::ReadHelper<glTF2::ComponentType>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF2::ComponentType&) Line | Count | Source | 282 | 14.4k | static bool Read(Value &val, T &out) { | 283 | 14.4k | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 14.4k | } |
glTFCommon::ReadHelper<glTF2::SamplerMagFilter>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF2::SamplerMagFilter&) Line | Count | Source | 282 | 162 | static bool Read(Value &val, T &out) { | 283 | 162 | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 162 | } |
glTFCommon::ReadHelper<glTF2::SamplerMinFilter>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF2::SamplerMinFilter&) Line | Count | Source | 282 | 204 | static bool Read(Value &val, T &out) { | 283 | 204 | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 204 | } |
glTFCommon::ReadHelper<glTF2::SamplerWrap>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF2::SamplerWrap&) Line | Count | Source | 282 | 412 | static bool Read(Value &val, T &out) { | 283 | 412 | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 412 | } |
glTFCommon::ReadHelper<glTF2::PrimitiveMode>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF2::PrimitiveMode&) Line | Count | Source | 282 | 4.70k | static bool Read(Value &val, T &out) { | 283 | 4.70k | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 4.70k | } |
glTFCommon::ReadHelper<glTF::PrimitiveMode>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF::PrimitiveMode&) Line | Count | Source | 282 | 1.29k | static bool Read(Value &val, T &out) { | 283 | 1.29k | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 1.29k | } |
glTFCommon::ReadHelper<int>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, int&) Line | Count | Source | 282 | 20 | static bool Read(Value &val, T &out) { | 283 | 20 | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 20 | } |
glTFCommon::ReadHelper<glTF::SamplerMagFilter>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF::SamplerMagFilter&) Line | Count | Source | 282 | 47 | static bool Read(Value &val, T &out) { | 283 | 47 | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 47 | } |
glTFCommon::ReadHelper<glTF::SamplerMinFilter>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF::SamplerMinFilter&) Line | Count | Source | 282 | 45 | static bool Read(Value &val, T &out) { | 283 | 45 | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 45 | } |
glTFCommon::ReadHelper<glTF::SamplerWrap>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF::SamplerWrap&) Line | Count | Source | 282 | 88 | static bool Read(Value &val, T &out) { | 283 | 88 | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 88 | } |
glTFCommon::ReadHelper<glTF::ComponentType>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF::ComponentType&) Line | Count | Source | 282 | 1.30k | static bool Read(Value &val, T &out) { | 283 | 1.30k | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 1.30k | } |
Unexecuted instantiation: glTFCommon::ReadHelper<glTF::Camera::Type>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF::Camera::Type&) |
285 | | }; |
286 | | |
287 | | template <> |
288 | | struct ReadHelper<bool> { |
289 | 3.44k | static bool Read(Value &val, bool &out) { |
290 | 3.44k | return val.IsBool() ? out = val.GetBool(), true : false; |
291 | 3.44k | } |
292 | | }; |
293 | | |
294 | | template <> |
295 | | struct ReadHelper<float> { |
296 | 5.30k | static bool Read(Value &val, float &out) { |
297 | 5.30k | return val.IsNumber() ? out = static_cast<float>(val.GetDouble()), true : false; |
298 | 5.30k | } |
299 | | }; |
300 | | |
301 | | template <unsigned int N> |
302 | | struct ReadHelper<float[N]> { |
303 | 26.0k | static bool Read(Value &val, float (&out)[N]) { |
304 | 26.0k | if (!val.IsArray() || val.Size() != N) return false; |
305 | 315k | for (unsigned int i = 0; i < N; ++i) { |
306 | 290k | if (val[i].IsNumber()) |
307 | 290k | out[i] = static_cast<float>(val[i].GetDouble()); |
308 | 290k | } |
309 | 24.4k | return true; |
310 | 26.0k | } glTFCommon::ReadHelper<float [4]>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, float (&) [4]) Line | Count | Source | 303 | 3.50k | static bool Read(Value &val, float (&out)[N]) { | 304 | 3.50k | if (!val.IsArray() || val.Size() != N) return false; | 305 | 16.8k | for (unsigned int i = 0; i < N; ++i) { | 306 | 13.5k | if (val[i].IsNumber()) | 307 | 13.4k | out[i] = static_cast<float>(val[i].GetDouble()); | 308 | 13.5k | } | 309 | 3.37k | return true; | 310 | 3.50k | } |
glTFCommon::ReadHelper<float [3]>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, float (&) [3]) Line | Count | Source | 303 | 5.06k | static bool Read(Value &val, float (&out)[N]) { | 304 | 5.06k | if (!val.IsArray() || val.Size() != N) return false; | 305 | 18.5k | for (unsigned int i = 0; i < N; ++i) { | 306 | 13.9k | if (val[i].IsNumber()) | 307 | 13.9k | out[i] = static_cast<float>(val[i].GetDouble()); | 308 | 13.9k | } | 309 | 4.64k | return true; | 310 | 5.06k | } |
glTFCommon::ReadHelper<float [16]>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, float (&) [16]) Line | Count | Source | 303 | 17.4k | static bool Read(Value &val, float (&out)[N]) { | 304 | 17.4k | if (!val.IsArray() || val.Size() != N) return false; | 305 | 279k | for (unsigned int i = 0; i < N; ++i) { | 306 | 263k | if (val[i].IsNumber()) | 307 | 263k | out[i] = static_cast<float>(val[i].GetDouble()); | 308 | 263k | } | 309 | 16.4k | return true; | 310 | 17.4k | } |
|
311 | | }; |
312 | | |
313 | | template <> |
314 | | struct ReadHelper<const char *> { |
315 | 20.3k | static bool Read(Value &val, const char *&out) { |
316 | 20.3k | return val.IsString() ? (out = val.GetString(), true) : false; |
317 | 20.3k | } |
318 | | }; |
319 | | |
320 | | template <> |
321 | | struct ReadHelper<std::string> { |
322 | 76.5k | static bool Read(Value &val, std::string &out) { |
323 | 76.5k | return val.IsString() ? (out = std::string(val.GetString(), val.GetStringLength()), true) : false; |
324 | 76.5k | } |
325 | | }; |
326 | | |
327 | | template <class T> |
328 | | struct ReadHelper<Nullable<T>> { |
329 | 46.3k | static bool Read(Value &val, Nullable<T> &out) { |
330 | 46.3k | return out.isPresent = ReadHelper<T>::Read(val, out.value); |
331 | 46.3k | } glTFCommon::ReadHelper<glTFCommon::Nullable<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&) Line | Count | Source | 329 | 25.8k | static bool Read(Value &val, Nullable<T> &out) { | 330 | 25.8k | return out.isPresent = ReadHelper<T>::Read(val, out.value); | 331 | 25.8k | } |
Unexecuted instantiation: glTFCommon::ReadHelper<glTFCommon::Nullable<float> >::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<float>&) glTFCommon::ReadHelper<glTFCommon::Nullable<float [16]> >::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<float [16]>&) Line | Count | Source | 329 | 17.4k | static bool Read(Value &val, Nullable<T> &out) { | 330 | 17.4k | return out.isPresent = ReadHelper<T>::Read(val, out.value); | 331 | 17.4k | } |
glTFCommon::ReadHelper<glTFCommon::Nullable<float [3]> >::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<float [3]>&) Line | Count | Source | 329 | 2.50k | static bool Read(Value &val, Nullable<T> &out) { | 330 | 2.50k | return out.isPresent = ReadHelper<T>::Read(val, out.value); | 331 | 2.50k | } |
glTFCommon::ReadHelper<glTFCommon::Nullable<float [4]> >::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<float [4]>&) Line | Count | Source | 329 | 632 | static bool Read(Value &val, Nullable<T> &out) { | 330 | 632 | return out.isPresent = ReadHelper<T>::Read(val, out.value); | 331 | 632 | } |
|
332 | | }; |
333 | | |
334 | | template <> |
335 | | struct ReadHelper<uint64_t> { |
336 | 36.1k | static bool Read(Value &val, uint64_t &out) { |
337 | 36.1k | return val.IsUint64() ? out = val.GetUint64(), true : false; |
338 | 36.1k | } |
339 | | }; |
340 | | |
341 | | template <> |
342 | | struct ReadHelper<int64_t> { |
343 | 0 | static bool Read(Value &val, int64_t &out) { |
344 | 0 | return val.IsInt64() ? out = val.GetInt64(), true : false; |
345 | 0 | } |
346 | | }; |
347 | | |
348 | | #ifdef __APPLE__ |
349 | | |
350 | | // On Mac size_t and uint64_t are not the same, so we need a specialized version |
351 | | // here to properly parse byteOffset and other parameters > 2^31 |
352 | | // On Windows and Linux the types match andno additional specialization is required |
353 | | |
354 | | template <> |
355 | | struct ReadHelper<size_t> { |
356 | | static bool Read(Value &val, size_t &out) { |
357 | | return val.IsInt64() ? out = val.GetInt64(), true : false; |
358 | | } |
359 | | }; |
360 | | |
361 | | #endif |
362 | | |
363 | | template <class T> |
364 | 43.3k | inline static bool ReadValue(Value &val, T &out) { |
365 | 43.3k | return ReadHelper<T>::Read(val, out); |
366 | 43.3k | } Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadValue<glTFCommon::Nullable<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadValue<glTFCommon::Nullable<float [16]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<float [16]>&) glTFImporter.cpp:bool glTFCommon::ReadValue<glTFCommon::Nullable<float [16]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<float [16]>&) Line | Count | Source | 364 | 590 | inline static bool ReadValue(Value &val, T &out) { | 365 | 590 | return ReadHelper<T>::Read(val, out); | 366 | 590 | } |
glTFImporter.cpp:bool glTFCommon::ReadValue<float [4]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, float (&) [4]) Line | Count | Source | 364 | 84 | inline static bool ReadValue(Value &val, T &out) { | 365 | 84 | return ReadHelper<T>::Read(val, out); | 366 | 84 | } |
glTF2Importer.cpp:bool glTFCommon::ReadValue<glTFCommon::Nullable<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&) Line | Count | Source | 364 | 25.8k | inline static bool ReadValue(Value &val, T &out) { | 365 | 25.8k | return ReadHelper<T>::Read(val, out); | 366 | 25.8k | } |
glTF2Importer.cpp:bool glTFCommon::ReadValue<glTFCommon::Nullable<float [16]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<float [16]>&) Line | Count | Source | 364 | 16.5k | inline static bool ReadValue(Value &val, T &out) { | 365 | 16.5k | return ReadHelper<T>::Read(val, out); | 366 | 16.5k | } |
glTFExporter.cpp:bool glTFCommon::ReadValue<glTFCommon::Nullable<float [16]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<float [16]>&) Line | Count | Source | 364 | 279 | inline static bool ReadValue(Value &val, T &out) { | 365 | 279 | return ReadHelper<T>::Read(val, out); | 366 | 279 | } |
glTFExporter.cpp:bool glTFCommon::ReadValue<float [4]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, float (&) [4]) Line | Count | Source | 364 | 43 | inline static bool ReadValue(Value &val, T &out) { | 365 | 43 | return ReadHelper<T>::Read(val, out); | 366 | 43 | } |
Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadValue<glTFCommon::Nullable<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadValue<glTFCommon::Nullable<float [16]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<float [16]>&) |
367 | | |
368 | | template <class T> |
369 | 765k | inline static bool ReadMember(Value &obj, const char *id, T &out) { |
370 | 765k | if (!obj.IsObject()) { |
371 | 160 | return false; |
372 | 160 | } |
373 | 765k | Value::MemberIterator it = obj.FindMember(id); |
374 | 765k | if (it != obj.MemberEnd()) { |
375 | 154k | return ReadHelper<T>::Read(it->value, out); |
376 | 154k | } |
377 | 610k | return false; |
378 | 765k | } Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<glTF2::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::ComponentType&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<glTF2::SamplerMagFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerMagFilter&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<glTF2::SamplerMinFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerMinFilter&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<glTF2::SamplerWrap>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerWrap&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<float [4]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float (&) [4]) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<float [3]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float (&) [3]) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<bool>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, bool&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<glTF2::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::PrimitiveMode&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float>&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float [3]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float [3]>&) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float [4]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float [4]>&) glTFImporter.cpp:bool glTFCommon::ReadMember<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 369 | 24.3k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 24.3k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 24.3k | Value::MemberIterator it = obj.FindMember(id); | 374 | 24.3k | if (it != obj.MemberEnd()) { | 375 | 7.84k | return ReadHelper<T>::Read(it->value, out); | 376 | 7.84k | } | 377 | 16.5k | return false; | 378 | 24.3k | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<bool>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, bool&) Line | Count | Source | 369 | 7.61k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 7.61k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 7.61k | Value::MemberIterator it = obj.FindMember(id); | 374 | 7.61k | if (it != obj.MemberEnd()) { | 375 | 518 | return ReadHelper<T>::Read(it->value, out); | 376 | 518 | } | 377 | 7.10k | return false; | 378 | 7.61k | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float [3]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float [3]>&) Line | Count | Source | 369 | 4.20k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 4.20k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 4.20k | Value::MemberIterator it = obj.FindMember(id); | 374 | 4.20k | if (it != obj.MemberEnd()) { | 375 | 1.53k | return ReadHelper<T>::Read(it->value, out); | 376 | 1.53k | } | 377 | 2.67k | return false; | 378 | 4.20k | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float [4]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float [4]>&) Line | Count | Source | 369 | 2.10k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 2.10k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 2.10k | Value::MemberIterator it = obj.FindMember(id); | 374 | 2.10k | if (it != obj.MemberEnd()) { | 375 | 184 | return ReadHelper<T>::Read(it->value, out); | 376 | 184 | } | 377 | 1.91k | return false; | 378 | 2.10k | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<glTF::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::PrimitiveMode&) Line | Count | Source | 369 | 1.29k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 1.29k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 1.29k | Value::MemberIterator it = obj.FindMember(id); | 374 | 1.29k | if (it != obj.MemberEnd()) { | 375 | 1.19k | return ReadHelper<T>::Read(it->value, out); | 376 | 1.19k | } | 377 | 97 | return false; | 378 | 1.29k | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int&) Line | Count | Source | 369 | 4.73k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 4.73k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 4.73k | Value::MemberIterator it = obj.FindMember(id); | 374 | 4.73k | if (it != obj.MemberEnd()) { | 375 | 3.91k | return ReadHelper<T>::Read(it->value, out); | 376 | 3.91k | } | 377 | 822 | return false; | 378 | 4.73k | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, int&) Line | Count | Source | 369 | 6 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 6 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 6 | Value::MemberIterator it = obj.FindMember(id); | 374 | 6 | if (it != obj.MemberEnd()) { | 375 | 6 | return ReadHelper<T>::Read(it->value, out); | 376 | 6 | } | 377 | 0 | return false; | 378 | 6 | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<glTF::SamplerMagFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::SamplerMagFilter&) Line | Count | Source | 369 | 16 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 16 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 16 | Value::MemberIterator it = obj.FindMember(id); | 374 | 16 | if (it != obj.MemberEnd()) { | 375 | 14 | return ReadHelper<T>::Read(it->value, out); | 376 | 14 | } | 377 | 2 | return false; | 378 | 16 | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<glTF::SamplerMinFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::SamplerMinFilter&) Line | Count | Source | 369 | 16 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 16 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 16 | Value::MemberIterator it = obj.FindMember(id); | 374 | 16 | if (it != obj.MemberEnd()) { | 375 | 12 | return ReadHelper<T>::Read(it->value, out); | 376 | 12 | } | 377 | 4 | return false; | 378 | 16 | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<glTF::SamplerWrap>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::SamplerWrap&) Line | Count | Source | 369 | 32 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 32 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 32 | Value::MemberIterator it = obj.FindMember(id); | 374 | 32 | if (it != obj.MemberEnd()) { | 375 | 20 | return ReadHelper<T>::Read(it->value, out); | 376 | 20 | } | 377 | 12 | return false; | 378 | 32 | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float&) Line | Count | Source | 369 | 148 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 148 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 148 | Value::MemberIterator it = obj.FindMember(id); | 374 | 148 | if (it != obj.MemberEnd()) { | 375 | 66 | return ReadHelper<T>::Read(it->value, out); | 376 | 66 | } | 377 | 82 | return false; | 378 | 148 | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long&) Line | Count | Source | 369 | 210 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 210 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 210 | Value::MemberIterator it = obj.FindMember(id); | 374 | 210 | if (it != obj.MemberEnd()) { | 375 | 94 | return ReadHelper<T>::Read(it->value, out); | 376 | 94 | } | 377 | 116 | return false; | 378 | 210 | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<glTF::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::ComponentType&) Line | Count | Source | 369 | 1.17k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 1.17k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 1.17k | Value::MemberIterator it = obj.FindMember(id); | 374 | 1.17k | if (it != obj.MemberEnd()) { | 375 | 1.03k | return ReadHelper<T>::Read(it->value, out); | 376 | 1.03k | } | 377 | 142 | return false; | 378 | 1.17k | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*&) Line | Count | Source | 369 | 3.24k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 3.24k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 3.24k | Value::MemberIterator it = obj.FindMember(id); | 374 | 3.24k | if (it != obj.MemberEnd()) { | 375 | 2.73k | return ReadHelper<T>::Read(it->value, out); | 376 | 2.73k | } | 377 | 515 | return false; | 378 | 3.24k | } |
Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadMember<glTF::Camera::Type>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::Camera::Type&) Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadMember<float [4]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float (&) [4]) glTF2Importer.cpp:bool glTFCommon::ReadMember<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 369 | 521k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 521k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 521k | Value::MemberIterator it = obj.FindMember(id); | 374 | 521k | if (it != obj.MemberEnd()) { | 375 | 42.3k | return ReadHelper<T>::Read(it->value, out); | 376 | 42.3k | } | 377 | 478k | return false; | 378 | 521k | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float [3]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float [3]>&) Line | Count | Source | 369 | 18.0k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 18.0k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 18.0k | Value::MemberIterator it = obj.FindMember(id); | 374 | 18.0k | if (it != obj.MemberEnd()) { | 375 | 952 | return ReadHelper<T>::Read(it->value, out); | 376 | 952 | } | 377 | 17.1k | return false; | 378 | 18.0k | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float [4]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float [4]>&) Line | Count | Source | 369 | 9.03k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 9.03k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 9.03k | Value::MemberIterator it = obj.FindMember(id); | 374 | 9.03k | if (it != obj.MemberEnd()) { | 375 | 439 | return ReadHelper<T>::Read(it->value, out); | 376 | 439 | } | 377 | 8.59k | return false; | 378 | 9.03k | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<glTF2::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::PrimitiveMode&) Line | Count | Source | 369 | 26.2k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 26.2k | if (!obj.IsObject()) { | 371 | 160 | return false; | 372 | 160 | } | 373 | 26.0k | Value::MemberIterator it = obj.FindMember(id); | 374 | 26.0k | if (it != obj.MemberEnd()) { | 375 | 4.70k | return ReadHelper<T>::Read(it->value, out); | 376 | 4.70k | } | 377 | 21.3k | return false; | 378 | 26.0k | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int&) Line | Count | Source | 369 | 12.9k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 12.9k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 12.9k | Value::MemberIterator it = obj.FindMember(id); | 374 | 12.9k | if (it != obj.MemberEnd()) { | 375 | 2.46k | return ReadHelper<T>::Read(it->value, out); | 376 | 2.46k | } | 377 | 10.5k | return false; | 378 | 12.9k | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<glTF2::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::ComponentType&) Line | Count | Source | 369 | 17.6k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 17.6k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 17.6k | Value::MemberIterator it = obj.FindMember(id); | 374 | 17.6k | if (it != obj.MemberEnd()) { | 375 | 14.4k | return ReadHelper<T>::Read(it->value, out); | 376 | 14.4k | } | 377 | 3.26k | return false; | 378 | 17.6k | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<bool>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, bool&) Line | Count | Source | 369 | 22.4k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 22.4k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 22.4k | Value::MemberIterator it = obj.FindMember(id); | 374 | 22.4k | if (it != obj.MemberEnd()) { | 375 | 2.92k | return ReadHelper<T>::Read(it->value, out); | 376 | 2.92k | } | 377 | 19.4k | return false; | 378 | 22.4k | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*&) Line | Count | Source | 369 | 17.8k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 17.8k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 17.8k | Value::MemberIterator it = obj.FindMember(id); | 374 | 17.8k | if (it != obj.MemberEnd()) { | 375 | 16.7k | return ReadHelper<T>::Read(it->value, out); | 376 | 16.7k | } | 377 | 1.03k | return false; | 378 | 17.8k | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long&) Line | Count | Source | 369 | 45.2k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 45.2k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 45.2k | Value::MemberIterator it = obj.FindMember(id); | 374 | 45.2k | if (it != obj.MemberEnd()) { | 375 | 35.9k | return ReadHelper<T>::Read(it->value, out); | 376 | 35.9k | } | 377 | 9.31k | return false; | 378 | 45.2k | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<float [4]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float (&) [4]) Line | Count | Source | 369 | 3.53k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 3.53k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 3.53k | Value::MemberIterator it = obj.FindMember(id); | 374 | 3.53k | if (it != obj.MemberEnd()) { | 375 | 2.74k | return ReadHelper<T>::Read(it->value, out); | 376 | 2.74k | } | 377 | 797 | return false; | 378 | 3.53k | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<glTF2::SamplerMagFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerMagFilter&) Line | Count | Source | 369 | 337 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 337 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 337 | Value::MemberIterator it = obj.FindMember(id); | 374 | 337 | if (it != obj.MemberEnd()) { | 375 | 162 | return ReadHelper<T>::Read(it->value, out); | 376 | 162 | } | 377 | 175 | return false; | 378 | 337 | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<glTF2::SamplerMinFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerMinFilter&) Line | Count | Source | 369 | 337 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 337 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 337 | Value::MemberIterator it = obj.FindMember(id); | 374 | 337 | if (it != obj.MemberEnd()) { | 375 | 204 | return ReadHelper<T>::Read(it->value, out); | 376 | 204 | } | 377 | 133 | return false; | 378 | 337 | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<glTF2::SamplerWrap>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerWrap&) Line | Count | Source | 369 | 674 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 674 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 674 | Value::MemberIterator it = obj.FindMember(id); | 374 | 674 | if (it != obj.MemberEnd()) { | 375 | 412 | return ReadHelper<T>::Read(it->value, out); | 376 | 412 | } | 377 | 262 | return false; | 378 | 674 | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float&) Line | Count | Source | 369 | 12.2k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 12.2k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 12.2k | Value::MemberIterator it = obj.FindMember(id); | 374 | 12.2k | if (it != obj.MemberEnd()) { | 375 | 5.20k | return ReadHelper<T>::Read(it->value, out); | 376 | 5.20k | } | 377 | 7.02k | return false; | 378 | 12.2k | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<float [3]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float (&) [3]) Line | Count | Source | 369 | 4.72k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 4.72k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 4.72k | Value::MemberIterator it = obj.FindMember(id); | 374 | 4.72k | if (it != obj.MemberEnd()) { | 375 | 2.56k | return ReadHelper<T>::Read(it->value, out); | 376 | 2.56k | } | 377 | 2.15k | return false; | 378 | 4.72k | } |
Unexecuted instantiation: glTF2Importer.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float>&) glTFExporter.cpp:bool glTFCommon::ReadMember<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 369 | 1.23k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 1.23k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 1.23k | Value::MemberIterator it = obj.FindMember(id); | 374 | 1.23k | if (it != obj.MemberEnd()) { | 375 | 583 | return ReadHelper<T>::Read(it->value, out); | 376 | 583 | } | 377 | 652 | return false; | 378 | 1.23k | } |
glTFExporter.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float [3]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float [3]>&) Line | Count | Source | 369 | 60 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 60 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 60 | Value::MemberIterator it = obj.FindMember(id); | 374 | 60 | if (it != obj.MemberEnd()) { | 375 | 21 | return ReadHelper<T>::Read(it->value, out); | 376 | 21 | } | 377 | 39 | return false; | 378 | 60 | } |
glTFExporter.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float [4]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float [4]>&) Line | Count | Source | 369 | 30 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 30 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 30 | Value::MemberIterator it = obj.FindMember(id); | 374 | 30 | if (it != obj.MemberEnd()) { | 375 | 9 | return ReadHelper<T>::Read(it->value, out); | 376 | 9 | } | 377 | 21 | return false; | 378 | 30 | } |
glTFExporter.cpp:bool glTFCommon::ReadMember<glTF::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::PrimitiveMode&) Line | Count | Source | 369 | 103 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 103 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 103 | Value::MemberIterator it = obj.FindMember(id); | 374 | 103 | if (it != obj.MemberEnd()) { | 375 | 99 | return ReadHelper<T>::Read(it->value, out); | 376 | 99 | } | 377 | 4 | return false; | 378 | 103 | } |
glTFExporter.cpp:bool glTFCommon::ReadMember<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int&) Line | Count | Source | 369 | 1.14k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 1.14k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 1.14k | Value::MemberIterator it = obj.FindMember(id); | 374 | 1.14k | if (it != obj.MemberEnd()) { | 375 | 1.12k | return ReadHelper<T>::Read(it->value, out); | 376 | 1.12k | } | 377 | 19 | return false; | 378 | 1.14k | } |
glTFExporter.cpp:bool glTFCommon::ReadMember<int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, int&) Line | Count | Source | 369 | 14 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 14 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 14 | Value::MemberIterator it = obj.FindMember(id); | 374 | 14 | if (it != obj.MemberEnd()) { | 375 | 14 | return ReadHelper<T>::Read(it->value, out); | 376 | 14 | } | 377 | 0 | return false; | 378 | 14 | } |
glTFExporter.cpp:bool glTFCommon::ReadMember<glTF::SamplerMagFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::SamplerMagFilter&) Line | Count | Source | 369 | 35 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 35 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 35 | Value::MemberIterator it = obj.FindMember(id); | 374 | 35 | if (it != obj.MemberEnd()) { | 375 | 33 | return ReadHelper<T>::Read(it->value, out); | 376 | 33 | } | 377 | 2 | return false; | 378 | 35 | } |
glTFExporter.cpp:bool glTFCommon::ReadMember<glTF::SamplerMinFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::SamplerMinFilter&) Line | Count | Source | 369 | 35 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 35 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 35 | Value::MemberIterator it = obj.FindMember(id); | 374 | 35 | if (it != obj.MemberEnd()) { | 375 | 33 | return ReadHelper<T>::Read(it->value, out); | 376 | 33 | } | 377 | 2 | return false; | 378 | 35 | } |
glTFExporter.cpp:bool glTFCommon::ReadMember<glTF::SamplerWrap>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::SamplerWrap&) Line | Count | Source | 369 | 70 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 70 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 70 | Value::MemberIterator it = obj.FindMember(id); | 374 | 70 | if (it != obj.MemberEnd()) { | 375 | 68 | return ReadHelper<T>::Read(it->value, out); | 376 | 68 | } | 377 | 2 | return false; | 378 | 70 | } |
glTFExporter.cpp:bool glTFCommon::ReadMember<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float&) Line | Count | Source | 369 | 86 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 86 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 86 | Value::MemberIterator it = obj.FindMember(id); | 374 | 86 | if (it != obj.MemberEnd()) { | 375 | 41 | return ReadHelper<T>::Read(it->value, out); | 376 | 41 | } | 377 | 45 | return false; | 378 | 86 | } |
glTFExporter.cpp:bool glTFCommon::ReadMember<bool>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, bool&) Line | Count | Source | 369 | 4 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 4 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 4 | Value::MemberIterator it = obj.FindMember(id); | 374 | 4 | if (it != obj.MemberEnd()) { | 375 | 0 | return ReadHelper<T>::Read(it->value, out); | 376 | 0 | } | 377 | 4 | return false; | 378 | 4 | } |
glTFExporter.cpp:bool glTFCommon::ReadMember<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long&) Line | Count | Source | 369 | 79 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 79 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 79 | Value::MemberIterator it = obj.FindMember(id); | 374 | 79 | if (it != obj.MemberEnd()) { | 375 | 67 | return ReadHelper<T>::Read(it->value, out); | 376 | 67 | } | 377 | 12 | return false; | 378 | 79 | } |
glTFExporter.cpp:bool glTFCommon::ReadMember<glTF::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::ComponentType&) Line | Count | Source | 369 | 282 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 282 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 282 | Value::MemberIterator it = obj.FindMember(id); | 374 | 282 | if (it != obj.MemberEnd()) { | 375 | 278 | return ReadHelper<T>::Read(it->value, out); | 376 | 278 | } | 377 | 4 | return false; | 378 | 282 | } |
glTFExporter.cpp:bool glTFCommon::ReadMember<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*&) Line | Count | Source | 369 | 853 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 853 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 853 | Value::MemberIterator it = obj.FindMember(id); | 374 | 853 | if (it != obj.MemberEnd()) { | 375 | 804 | return ReadHelper<T>::Read(it->value, out); | 376 | 804 | } | 377 | 49 | return false; | 378 | 853 | } |
Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadMember<glTF::Camera::Type>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::Camera::Type&) Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadMember<float [4]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float (&) [4]) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<glTF2::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::ComponentType&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<glTF2::SamplerMagFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerMagFilter&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<glTF2::SamplerMinFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerMinFilter&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<glTF2::SamplerWrap>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerWrap&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<float [4]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float (&) [4]) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<float [3]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float (&) [3]) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<bool>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, bool&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<glTF2::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::PrimitiveMode&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float>&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float [3]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float [3]>&) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::ReadMember<glTFCommon::Nullable<float [4]> >(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTFCommon::Nullable<float [4]>&) |
379 | | |
380 | | template <class T> |
381 | 139k | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { |
382 | 139k | T out; |
383 | 139k | return ReadMember(obj, id, out) ? out : defaultValue; |
384 | 139k | } Unexecuted instantiation: ImporterRegistry.cpp:unsigned long glTFCommon::MemberOrDefault<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long) Unexecuted instantiation: ImporterRegistry.cpp:unsigned int glTFCommon::MemberOrDefault<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int) Unexecuted instantiation: ImporterRegistry.cpp:glTF2::ComponentType glTFCommon::MemberOrDefault<glTF2::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::ComponentType) Unexecuted instantiation: ImporterRegistry.cpp:bool glTFCommon::MemberOrDefault<bool>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, bool) Unexecuted instantiation: ImporterRegistry.cpp:glTF2::PrimitiveMode glTFCommon::MemberOrDefault<glTF2::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::PrimitiveMode) Unexecuted instantiation: ImporterRegistry.cpp:char const* glTFCommon::MemberOrDefault<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*) Unexecuted instantiation: ImporterRegistry.cpp:float glTFCommon::MemberOrDefault<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float) glTFImporter.cpp:bool glTFCommon::MemberOrDefault<bool>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, bool) Line | Count | Source | 381 | 7.61k | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 7.61k | T out; | 383 | 7.61k | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 7.61k | } |
glTFImporter.cpp:glTF::PrimitiveMode glTFCommon::MemberOrDefault<glTF::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::PrimitiveMode) Line | Count | Source | 381 | 1.29k | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 1.29k | T out; | 383 | 1.29k | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 1.29k | } |
glTFImporter.cpp:char const* glTFCommon::MemberOrDefault<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*) Line | Count | Source | 381 | 1.91k | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 1.91k | T out; | 383 | 1.91k | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 1.91k | } |
glTFImporter.cpp:unsigned long glTFCommon::MemberOrDefault<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long) Line | Count | Source | 381 | 210 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 210 | T out; | 383 | 210 | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 210 | } |
glTFImporter.cpp:unsigned int glTFCommon::MemberOrDefault<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int) Line | Count | Source | 381 | 4.73k | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 4.73k | T out; | 383 | 4.73k | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 4.73k | } |
glTFImporter.cpp:glTF::ComponentType glTFCommon::MemberOrDefault<glTF::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::ComponentType) Line | Count | Source | 381 | 1.17k | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 1.17k | T out; | 383 | 1.17k | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 1.17k | } |
glTFImporter.cpp:int glTFCommon::MemberOrDefault<int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, int) Line | Count | Source | 381 | 6 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 6 | T out; | 383 | 6 | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 6 | } |
Unexecuted instantiation: glTFImporter.cpp:glTF::Camera::Type glTFCommon::MemberOrDefault<glTF::Camera::Type>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::Camera::Type) Unexecuted instantiation: glTFImporter.cpp:float glTFCommon::MemberOrDefault<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float) glTF2Importer.cpp:glTF2::PrimitiveMode glTFCommon::MemberOrDefault<glTF2::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::PrimitiveMode) Line | Count | Source | 381 | 26.2k | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 26.2k | T out; | 383 | 26.2k | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 26.2k | } |
glTF2Importer.cpp:unsigned int glTFCommon::MemberOrDefault<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int) Line | Count | Source | 381 | 12.9k | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 12.9k | T out; | 383 | 12.9k | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 12.9k | } |
glTF2Importer.cpp:unsigned long glTFCommon::MemberOrDefault<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long) Line | Count | Source | 381 | 45.2k | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 45.2k | T out; | 383 | 45.2k | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 45.2k | } |
glTF2Importer.cpp:glTF2::ComponentType glTFCommon::MemberOrDefault<glTF2::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::ComponentType) Line | Count | Source | 381 | 17.6k | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 17.6k | T out; | 383 | 17.6k | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 17.6k | } |
glTF2Importer.cpp:bool glTFCommon::MemberOrDefault<bool>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, bool) Line | Count | Source | 381 | 17.6k | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 17.6k | T out; | 383 | 17.6k | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 17.6k | } |
glTF2Importer.cpp:char const* glTFCommon::MemberOrDefault<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*) Line | Count | Source | 381 | 164 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 164 | T out; | 383 | 164 | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 164 | } |
glTF2Importer.cpp:float glTFCommon::MemberOrDefault<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float) Line | Count | Source | 381 | 572 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 572 | T out; | 383 | 572 | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 572 | } |
glTFExporter.cpp:glTF::PrimitiveMode glTFCommon::MemberOrDefault<glTF::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::PrimitiveMode) Line | Count | Source | 381 | 103 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 103 | T out; | 383 | 103 | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 103 | } |
glTFExporter.cpp:char const* glTFCommon::MemberOrDefault<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*) Line | Count | Source | 381 | 476 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 476 | T out; | 383 | 476 | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 476 | } |
glTFExporter.cpp:unsigned long glTFCommon::MemberOrDefault<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long) Line | Count | Source | 381 | 79 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 79 | T out; | 383 | 79 | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 79 | } |
glTFExporter.cpp:unsigned int glTFCommon::MemberOrDefault<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int) Line | Count | Source | 381 | 1.14k | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 1.14k | T out; | 383 | 1.14k | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 1.14k | } |
glTFExporter.cpp:glTF::ComponentType glTFCommon::MemberOrDefault<glTF::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::ComponentType) Line | Count | Source | 381 | 282 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 282 | T out; | 383 | 282 | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 282 | } |
glTFExporter.cpp:int glTFCommon::MemberOrDefault<int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, int) Line | Count | Source | 381 | 14 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 14 | T out; | 383 | 14 | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 14 | } |
Unexecuted instantiation: glTFExporter.cpp:glTF::Camera::Type glTFCommon::MemberOrDefault<glTF::Camera::Type>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::Camera::Type) Unexecuted instantiation: glTFExporter.cpp:float glTFCommon::MemberOrDefault<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float) Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::MemberOrDefault<bool>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, bool) Unexecuted instantiation: glTF2Exporter.cpp:unsigned long glTFCommon::MemberOrDefault<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long) Unexecuted instantiation: glTF2Exporter.cpp:unsigned int glTFCommon::MemberOrDefault<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int) Unexecuted instantiation: glTF2Exporter.cpp:glTF2::ComponentType glTFCommon::MemberOrDefault<glTF2::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::ComponentType) Unexecuted instantiation: glTF2Exporter.cpp:bool glTFCommon::MemberOrDefault<bool>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, bool) Unexecuted instantiation: glTF2Exporter.cpp:glTF2::PrimitiveMode glTFCommon::MemberOrDefault<glTF2::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::PrimitiveMode) Unexecuted instantiation: glTF2Exporter.cpp:char const* glTFCommon::MemberOrDefault<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*) Unexecuted instantiation: glTF2Exporter.cpp:float glTFCommon::MemberOrDefault<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float) |
385 | | |
386 | 29.1k | inline Value *FindMember(Value &val, const char *id) { |
387 | 29.1k | if (!val.IsObject()) { |
388 | 0 | return nullptr; |
389 | 0 | } |
390 | 29.1k | Value::MemberIterator it = val.FindMember(id); |
391 | 29.1k | return (it != val.MemberEnd()) ? &it->value : nullptr; |
392 | 29.1k | } |
393 | | |
394 | | template <int N> |
395 | 388 | inline void throwUnexpectedTypeError(const char (&expectedTypeName)[N], const char *memberId, const char *context, const char *extraContext) { |
396 | 388 | std::string fullContext = context; |
397 | 388 | if (extraContext && (strlen(extraContext) > 0)) { |
398 | 60 | fullContext = fullContext + " (" + extraContext + ")"; |
399 | 60 | } |
400 | 388 | throw DeadlyImportError("Member \"", memberId, "\" was not of type \"", expectedTypeName, "\" when reading ", fullContext); |
401 | 388 | } void glTFCommon::throwUnexpectedTypeError<7>(char const (&) [7], char const*, char const*, char const*) Line | Count | Source | 395 | 213 | inline void throwUnexpectedTypeError(const char (&expectedTypeName)[N], const char *memberId, const char *context, const char *extraContext) { | 396 | 213 | std::string fullContext = context; | 397 | 213 | if (extraContext && (strlen(extraContext) > 0)) { | 398 | 2 | fullContext = fullContext + " (" + extraContext + ")"; | 399 | 2 | } | 400 | 213 | throw DeadlyImportError("Member \"", memberId, "\" was not of type \"", expectedTypeName, "\" when reading ", fullContext); | 401 | 213 | } |
void glTFCommon::throwUnexpectedTypeError<5>(char const (&) [5], char const*, char const*, char const*) Line | Count | Source | 395 | 84 | inline void throwUnexpectedTypeError(const char (&expectedTypeName)[N], const char *memberId, const char *context, const char *extraContext) { | 396 | 84 | std::string fullContext = context; | 397 | 84 | if (extraContext && (strlen(extraContext) > 0)) { | 398 | 44 | fullContext = fullContext + " (" + extraContext + ")"; | 399 | 44 | } | 400 | 84 | throw DeadlyImportError("Member \"", memberId, "\" was not of type \"", expectedTypeName, "\" when reading ", fullContext); | 401 | 84 | } |
void glTFCommon::throwUnexpectedTypeError<6>(char const (&) [6], char const*, char const*, char const*) Line | Count | Source | 395 | 91 | inline void throwUnexpectedTypeError(const char (&expectedTypeName)[N], const char *memberId, const char *context, const char *extraContext) { | 396 | 91 | std::string fullContext = context; | 397 | 91 | if (extraContext && (strlen(extraContext) > 0)) { | 398 | 14 | fullContext = fullContext + " (" + extraContext + ")"; | 399 | 14 | } | 400 | 91 | throw DeadlyImportError("Member \"", memberId, "\" was not of type \"", expectedTypeName, "\" when reading ", fullContext); | 401 | 91 | } |
|
402 | | |
403 | | // Look-up functions with type checks. Context and extra context help the user identify the problem if there's an error. |
404 | | |
405 | 30.2k | inline Value *FindStringInContext(Value &val, const char *memberId, const char *context, const char *extraContext = nullptr) { |
406 | 30.2k | if (!val.IsObject()) { |
407 | 63 | return nullptr; |
408 | 63 | } |
409 | 30.2k | Value::MemberIterator it = val.FindMember(memberId); |
410 | 30.2k | if (it == val.MemberEnd()) { |
411 | 8.86k | return nullptr; |
412 | 8.86k | } |
413 | 21.3k | if (!it->value.IsString()) { |
414 | 213 | throwUnexpectedTypeError("string", memberId, context, extraContext); |
415 | 213 | } |
416 | 21.3k | return &it->value; |
417 | 30.2k | } |
418 | | |
419 | 0 | inline Value *FindNumberInContext(Value &val, const char *memberId, const char *context, const char *extraContext = nullptr) { |
420 | 0 | if (!val.IsObject()) { |
421 | 0 | return nullptr; |
422 | 0 | } |
423 | 0 | Value::MemberIterator it = val.FindMember(memberId); |
424 | 0 | if (it == val.MemberEnd()) { |
425 | 0 | return nullptr; |
426 | 0 | } |
427 | 0 | if (!it->value.IsNumber()) { |
428 | 0 | throwUnexpectedTypeError("number", memberId, context, extraContext); |
429 | 0 | } |
430 | 0 | return &it->value; |
431 | 0 | } |
432 | | |
433 | 586k | inline Value *FindUIntInContext(Value &val, const char *memberId, const char *context, const char *extraContext = nullptr) { |
434 | 586k | if (!val.IsObject()) { |
435 | 1.72k | return nullptr; |
436 | 1.72k | } |
437 | 584k | Value::MemberIterator it = val.FindMember(memberId); |
438 | 584k | if (it == val.MemberEnd()) { |
439 | 510k | return nullptr; |
440 | 510k | } |
441 | 74.3k | if (!it->value.IsUint()) { |
442 | 84 | throwUnexpectedTypeError("uint", memberId, context, extraContext); |
443 | 84 | } |
444 | 74.3k | return &it->value; |
445 | 584k | } |
446 | | |
447 | 791k | inline Value *FindArrayInContext(Value &val, const char *memberId, const char *context, const char *extraContext = nullptr) { |
448 | 791k | if (!val.IsObject()) { |
449 | 160 | return nullptr; |
450 | 160 | } |
451 | 790k | Value::MemberIterator it = val.FindMember(memberId); |
452 | 790k | if (it == val.MemberEnd()) { |
453 | 621k | return nullptr; |
454 | 621k | } |
455 | 169k | if (!it->value.IsArray()) { |
456 | 91 | throwUnexpectedTypeError("array", memberId, context, extraContext); |
457 | 91 | } |
458 | 169k | return &it->value; |
459 | 790k | } |
460 | | |
461 | 1.11M | inline Value *FindObjectInContext(Value &val, const char * memberId, const char *context, const char *extraContext = nullptr) { |
462 | 1.11M | if (!val.IsObject()) { |
463 | 1.58k | return nullptr; |
464 | 1.58k | } |
465 | 1.11M | Value::MemberIterator it = val.FindMember(memberId); |
466 | 1.11M | if (it == val.MemberEnd()) { |
467 | 1.06M | return nullptr; |
468 | 1.06M | } |
469 | 49.3k | if (!it->value.IsObject()) { |
470 | 172 | std::string fullContext = context; |
471 | 172 | if (extraContext && extraContext[0] != '\0') { |
472 | 15 | fullContext += " ("; |
473 | 15 | fullContext += extraContext; |
474 | 15 | fullContext += ")"; |
475 | 15 | } |
476 | 172 | ASSIMP_LOG_ERROR("Member \"", memberId, "\" was not of type \"object\" when reading ", fullContext); |
477 | 172 | return nullptr; |
478 | 172 | } |
479 | 49.1k | return &it->value; |
480 | 49.3k | } |
481 | | |
482 | 111 | inline Value *FindExtensionInContext(Value &val, const char *extensionId, const char *context, const char *extraContext = nullptr) { |
483 | 111 | if (Value *extensionList = FindObjectInContext(val, "extensions", context, extraContext)) { |
484 | 44 | if (Value *extension = FindObjectInContext(*extensionList, extensionId, context, extraContext)) { |
485 | 28 | return extension; |
486 | 28 | } |
487 | 44 | } |
488 | 83 | return nullptr; |
489 | 111 | } |
490 | | |
491 | | // Overloads when the value is the document. |
492 | | |
493 | 2.64k | inline Value *FindString(Document &doc, const char *memberId) { |
494 | 2.64k | return FindStringInContext(doc, memberId, "the document"); |
495 | 2.64k | } |
496 | | |
497 | 0 | inline Value *FindNumber(Document &doc, const char *memberId) { |
498 | 0 | return FindNumberInContext(doc, memberId, "the document"); |
499 | 0 | } |
500 | | |
501 | 8.39k | inline Value *FindUInt(Document &doc, const char *memberId) { |
502 | 8.39k | return FindUIntInContext(doc, memberId, "the document"); |
503 | 8.39k | } |
504 | | |
505 | 41.3k | inline Value *FindArray(Document &val, const char *memberId) { |
506 | 41.3k | return FindArrayInContext(val, memberId, "the document"); |
507 | 41.3k | } |
508 | | |
509 | 45.7k | inline Value *FindObject(Document &doc, const char *memberId) { |
510 | 45.7k | return FindObjectInContext(doc, memberId, "the document"); |
511 | 45.7k | } |
512 | | |
513 | 0 | inline Value *FindExtension(Value &val, const char *extensionId) { |
514 | 0 | return FindExtensionInContext(val, extensionId, "the document"); |
515 | 0 | } |
516 | | |
517 | 12.9k | inline Value *FindString(Value &val, const char *id) { |
518 | 12.9k | Value::MemberIterator it = val.FindMember(id); |
519 | 12.9k | return (it != val.MemberEnd() && it->value.IsString()) ? &it->value : nullptr; |
520 | 12.9k | } |
521 | | |
522 | 187k | inline Value *FindObject(Value &val, const char *id) { |
523 | 187k | Value::MemberIterator it = val.FindMember(id); |
524 | 187k | return (it != val.MemberEnd() && it->value.IsObject()) ? &it->value : nullptr; |
525 | 187k | } |
526 | | |
527 | 12.0k | inline Value *FindArray(Value &val, const char *id) { |
528 | 12.0k | Value::MemberIterator it = val.FindMember(id); |
529 | 12.0k | return (it != val.MemberEnd() && it->value.IsArray()) ? &it->value : nullptr; |
530 | 12.0k | } |
531 | | |
532 | 348 | inline Value *FindNumber(Value &val, const char *id) { |
533 | 348 | Value::MemberIterator it = val.FindMember(id); |
534 | 348 | return (it != val.MemberEnd() && it->value.IsNumber()) ? &it->value : nullptr; |
535 | 348 | } |
536 | | |
537 | | } // namespace glTFCommon |
538 | | |
539 | | #endif // AI_GLFTCOMMON_H_INC |