/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 | 6.87k | inline void CopyValue(const glTFCommon::vec3 &v, aiColor4D &out) { |
139 | 6.87k | out.r = v[0]; |
140 | 6.87k | out.g = v[1]; |
141 | 6.87k | out.b = v[2]; |
142 | 6.87k | out.a = 1.0; |
143 | 6.87k | } |
144 | | |
145 | 13.7k | inline void CopyValue(const glTFCommon::vec4 &v, aiColor4D &out) { |
146 | 13.7k | out.r = v[0]; |
147 | 13.7k | out.g = v[1]; |
148 | 13.7k | out.b = v[2]; |
149 | 13.7k | out.a = v[3]; |
150 | 13.7k | } |
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 | 240 | inline void CopyValue(const glTFCommon::vec3 &v, aiVector3D &out) { |
165 | 240 | out.x = v[0]; |
166 | 240 | out.y = v[1]; |
167 | 240 | out.z = v[2]; |
168 | 240 | } |
169 | | |
170 | 221 | inline void CopyValue(const glTFCommon::vec4 &v, aiQuaternion &out) { |
171 | 221 | out.x = v[0]; |
172 | 221 | out.y = v[1]; |
173 | 221 | out.z = v[2]; |
174 | 221 | out.w = v[3]; |
175 | 221 | } |
176 | | |
177 | 19.5k | inline void CopyValue(const glTFCommon::mat4 &v, aiMatrix4x4 &o) { |
178 | 19.5k | o.a1 = v[0]; |
179 | 19.5k | o.b1 = v[1]; |
180 | 19.5k | o.c1 = v[2]; |
181 | 19.5k | o.d1 = v[3]; |
182 | 19.5k | o.a2 = v[4]; |
183 | 19.5k | o.b2 = v[5]; |
184 | 19.5k | o.c2 = v[6]; |
185 | 19.5k | o.d2 = v[7]; |
186 | 19.5k | o.a3 = v[8]; |
187 | 19.5k | o.b3 = v[9]; |
188 | 19.5k | o.c3 = v[10]; |
189 | 19.5k | o.d3 = v[11]; |
190 | 19.5k | o.a4 = v[12]; |
191 | 19.5k | o.b4 = v[13]; |
192 | 19.5k | o.c4 = v[14]; |
193 | 19.5k | o.d4 = v[15]; |
194 | 19.5k | } |
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 | 12.5k | 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 | 1.04M | isPresent(false) {}glTFCommon::Nullable<float [16]>::Nullable() Line | Count | Source | 246 | 26.6k | isPresent(false) {} |
glTFCommon::Nullable<float [3]>::Nullable() Line | Count | Source | 246 | 51.5k | isPresent(false) {} |
glTFCommon::Nullable<float [4]>::Nullable() Line | Count | Source | 246 | 25.7k | isPresent(false) {} |
glTFCommon::Nullable<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::Nullable() Line | Count | Source | 246 | 144k | isPresent(false) {} |
glTFCommon::Nullable<double>::Nullable() Line | Count | Source | 246 | 144k | isPresent(false) {} |
glTFCommon::Nullable<unsigned long>::Nullable() Line | Count | Source | 246 | 144k | isPresent(false) {} |
glTFCommon::Nullable<long>::Nullable() Line | Count | Source | 246 | 144k | isPresent(false) {} |
glTFCommon::Nullable<bool>::Nullable() Line | Count | Source | 246 | 144k | isPresent(false) {} |
glTFCommon::Nullable<std::__1::vector<glTF2::CustomExtension, std::__1::allocator<glTF2::CustomExtension> > >::Nullable() Line | Count | Source | 246 | 144k | isPresent(false) {} |
glTFCommon::Nullable<glTF2::PbrSpecularGlossiness>::Nullable() Line | Count | Source | 246 | 7.55k | isPresent(false) {} |
glTFCommon::Nullable<glTF2::MaterialSpecular>::Nullable() Line | Count | Source | 246 | 7.55k | isPresent(false) {} |
glTFCommon::Nullable<glTF2::MaterialSheen>::Nullable() Line | Count | Source | 246 | 7.55k | isPresent(false) {} |
glTFCommon::Nullable<glTF2::MaterialClearcoat>::Nullable() Line | Count | Source | 246 | 7.55k | isPresent(false) {} |
glTFCommon::Nullable<glTF2::MaterialTransmission>::Nullable() Line | Count | Source | 246 | 7.55k | isPresent(false) {} |
glTFCommon::Nullable<glTF2::MaterialVolume>::Nullable() Line | Count | Source | 246 | 7.55k | isPresent(false) {} |
glTFCommon::Nullable<glTF2::MaterialIOR>::Nullable() Line | Count | Source | 246 | 7.55k | isPresent(false) {} |
glTFCommon::Nullable<glTF2::MaterialEmissiveStrength>::Nullable() Line | Count | Source | 246 | 7.55k | isPresent(false) {} |
glTFCommon::Nullable<glTF2::MaterialAnisotropy>::Nullable() Line | Count | Source | 246 | 7.55k | isPresent(false) {} |
Unexecuted instantiation: glTFCommon::Nullable<float>::Nullable() |
247 | | Nullable(T &val) : |
248 | 0 | value(val), |
249 | 0 | isPresent(true) {}Unexecuted instantiation: glTFCommon::Nullable<glTF2::PbrSpecularGlossiness>::Nullable(glTF2::PbrSpecularGlossiness&) Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialSpecular>::Nullable(glTF2::MaterialSpecular&) Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialSheen>::Nullable(glTF2::MaterialSheen&) Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialClearcoat>::Nullable(glTF2::MaterialClearcoat&) Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialTransmission>::Nullable(glTF2::MaterialTransmission&) Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialVolume>::Nullable(glTF2::MaterialVolume&) Unexecuted instantiation: glTFCommon::Nullable<glTF2::MaterialIOR>::Nullable(glTF2::MaterialIOR&) 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 | 336k | vector(nullptr), |
262 | 336k | index(0) {}glTFCommon::Ref<glTF::Buffer>::Ref() Line | Count | Source | 261 | 8.20k | vector(nullptr), | 262 | 8.20k | index(0) {} |
glTFCommon::Ref<glTF::Scene>::Ref() Line | Count | Source | 261 | 7.90k | vector(nullptr), | 262 | 7.90k | index(0) {} |
glTFCommon::Ref<glTF::Camera>::Ref() Line | Count | Source | 261 | 982 | vector(nullptr), | 262 | 982 | index(0) {} |
glTFCommon::Ref<glTF::Light>::Ref() Line | Count | Source | 261 | 982 | vector(nullptr), | 262 | 982 | index(0) {} |
glTFCommon::Ref<glTF::Skin>::Ref() Line | Count | Source | 261 | 982 | vector(nullptr), | 262 | 982 | index(0) {} |
glTFCommon::Ref<glTF::Node>::Ref() Line | Count | Source | 261 | 982 | vector(nullptr), | 262 | 982 | index(0) {} |
glTFCommon::Ref<glTF::Accessor>::Ref() Line | Count | Source | 261 | 1.21k | vector(nullptr), | 262 | 1.21k | index(0) {} |
glTFCommon::Ref<glTF::Material>::Ref() Line | Count | Source | 261 | 594 | vector(nullptr), | 262 | 594 | index(0) {} |
glTFCommon::Ref<glTF::BufferView>::Ref() Line | Count | Source | 261 | 576 | vector(nullptr), | 262 | 576 | index(0) {} |
glTFCommon::Ref<glTF::Texture>::Ref() Line | Count | Source | 261 | 248 | vector(nullptr), | 262 | 248 | index(0) {} |
glTFCommon::Ref<glTF::Sampler>::Ref() Line | Count | Source | 261 | 52 | vector(nullptr), | 262 | 52 | index(0) {} |
glTFCommon::Ref<glTF::Image>::Ref() Line | Count | Source | 261 | 52 | vector(nullptr), | 262 | 52 | index(0) {} |
glTFCommon::Ref<glTF2::Scene>::Ref() Line | Count | Source | 261 | 12.2k | vector(nullptr), | 262 | 12.2k | index(0) {} |
glTFCommon::Ref<glTF2::Buffer>::Ref() Line | Count | Source | 261 | 27.1k | vector(nullptr), | 262 | 27.1k | index(0) {} |
glTFCommon::Ref<glTF2::Texture>::Ref() Line | Count | Source | 261 | 128k | vector(nullptr), | 262 | 128k | index(0) {} |
glTFCommon::Ref<glTF2::Camera>::Ref() Line | Count | Source | 261 | 24.7k | vector(nullptr), | 262 | 24.7k | index(0) {} |
glTFCommon::Ref<glTF2::Light>::Ref() Line | Count | Source | 261 | 24.7k | vector(nullptr), | 262 | 24.7k | index(0) {} |
glTFCommon::Ref<glTF2::Skin>::Ref() Line | Count | Source | 261 | 24.7k | vector(nullptr), | 262 | 24.7k | index(0) {} |
glTFCommon::Ref<glTF2::Node>::Ref() Line | Count | Source | 261 | 24.9k | vector(nullptr), | 262 | 24.9k | index(0) {} |
glTFCommon::Ref<glTF2::Accessor>::Ref() Line | Count | Source | 261 | 20.9k | vector(nullptr), | 262 | 20.9k | index(0) {} |
glTFCommon::Ref<glTF2::Material>::Ref() Line | Count | Source | 261 | 5.19k | vector(nullptr), | 262 | 5.19k | index(0) {} |
glTFCommon::Ref<glTF2::BufferView>::Ref() Line | Count | Source | 261 | 19.5k | vector(nullptr), | 262 | 19.5k | index(0) {} |
glTFCommon::Ref<glTF2::Sampler>::Ref() Line | Count | Source | 261 | 419 | vector(nullptr), | 262 | 419 | index(0) {} |
glTFCommon::Ref<glTF2::Image>::Ref() Line | Count | Source | 261 | 419 | vector(nullptr), | 262 | 419 | index(0) {} |
|
263 | | Ref(std::vector<T *> &vec, unsigned int idx) : |
264 | 109k | vector(&vec), |
265 | 109k | index(idx) {}glTFCommon::Ref<glTF::Buffer>::Ref(std::__1::vector<glTF::Buffer*, std::__1::allocator<glTF::Buffer*> >&, unsigned int) Line | Count | Source | 264 | 4.48k | vector(&vec), | 265 | 4.48k | index(idx) {} |
glTFCommon::Ref<glTF::Scene>::Ref(std::__1::vector<glTF::Scene*, std::__1::allocator<glTF::Scene*> >&, unsigned int) Line | Count | Source | 264 | 62 | vector(&vec), | 265 | 62 | index(idx) {} |
glTFCommon::Ref<glTF::Node>::Ref(std::__1::vector<glTF::Node*, std::__1::allocator<glTF::Node*> >&, unsigned int) Line | Count | Source | 264 | 724 | vector(&vec), | 265 | 724 | index(idx) {} |
glTFCommon::Ref<glTF::Mesh>::Ref(std::__1::vector<glTF::Mesh*, std::__1::allocator<glTF::Mesh*> >&, unsigned int) Line | Count | Source | 264 | 465 | vector(&vec), | 265 | 465 | index(idx) {} |
glTFCommon::Ref<glTF::Accessor>::Ref(std::__1::vector<glTF::Accessor*, std::__1::allocator<glTF::Accessor*> >&, unsigned int) Line | Count | Source | 264 | 552 | vector(&vec), | 265 | 552 | index(idx) {} |
glTFCommon::Ref<glTF::BufferView>::Ref(std::__1::vector<glTF::BufferView*, std::__1::allocator<glTF::BufferView*> >&, unsigned int) Line | Count | Source | 264 | 413 | vector(&vec), | 265 | 413 | index(idx) {} |
glTFCommon::Ref<glTF::Material>::Ref(std::__1::vector<glTF::Material*, std::__1::allocator<glTF::Material*> >&, unsigned int) Line | Count | Source | 264 | 35 | vector(&vec), | 265 | 35 | index(idx) {} |
glTFCommon::Ref<glTF::Texture>::Ref(std::__1::vector<glTF::Texture*, std::__1::allocator<glTF::Texture*> >&, unsigned int) Line | Count | Source | 264 | 31 | vector(&vec), | 265 | 31 | index(idx) {} |
glTFCommon::Ref<glTF::Image>::Ref(std::__1::vector<glTF::Image*, std::__1::allocator<glTF::Image*> >&, unsigned int) Line | Count | Source | 264 | 37 | vector(&vec), | 265 | 37 | index(idx) {} |
glTFCommon::Ref<glTF::Sampler>::Ref(std::__1::vector<glTF::Sampler*, std::__1::allocator<glTF::Sampler*> >&, unsigned int) Line | Count | Source | 264 | 29 | vector(&vec), | 265 | 29 | 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 | 22.3k | vector(&vec), | 265 | 22.3k | index(idx) {} |
glTFCommon::Ref<glTF2::Scene>::Ref(std::__1::vector<glTF2::Scene*, std::__1::allocator<glTF2::Scene*> >&, unsigned int) Line | Count | Source | 264 | 3.52k | vector(&vec), | 265 | 3.52k | index(idx) {} |
glTFCommon::Ref<glTF2::Node>::Ref(std::__1::vector<glTF2::Node*, std::__1::allocator<glTF2::Node*> >&, unsigned int) Line | Count | Source | 264 | 29.0k | vector(&vec), | 265 | 29.0k | index(idx) {} |
glTFCommon::Ref<glTF2::Mesh>::Ref(std::__1::vector<glTF2::Mesh*, std::__1::allocator<glTF2::Mesh*> >&, unsigned int) Line | Count | Source | 264 | 5.79k | vector(&vec), | 265 | 5.79k | index(idx) {} |
glTFCommon::Ref<glTF2::Accessor>::Ref(std::__1::vector<glTF2::Accessor*, std::__1::allocator<glTF2::Accessor*> >&, unsigned int) Line | Count | Source | 264 | 19.0k | vector(&vec), | 265 | 19.0k | index(idx) {} |
glTFCommon::Ref<glTF2::BufferView>::Ref(std::__1::vector<glTF2::BufferView*, std::__1::allocator<glTF2::BufferView*> >&, unsigned int) Line | Count | Source | 264 | 15.6k | vector(&vec), | 265 | 15.6k | index(idx) {} |
glTFCommon::Ref<glTF2::Material>::Ref(std::__1::vector<glTF2::Material*, std::__1::allocator<glTF2::Material*> >&, unsigned int) Line | Count | Source | 264 | 4.11k | vector(&vec), | 265 | 4.11k | index(idx) {} |
glTFCommon::Ref<glTF2::Texture>::Ref(std::__1::vector<glTF2::Texture*, std::__1::allocator<glTF2::Texture*> >&, unsigned int) Line | Count | Source | 264 | 433 | vector(&vec), | 265 | 433 | index(idx) {} |
glTFCommon::Ref<glTF2::Image>::Ref(std::__1::vector<glTF2::Image*, std::__1::allocator<glTF2::Image*> >&, unsigned int) Line | Count | Source | 264 | 387 | vector(&vec), | 265 | 387 | index(idx) {} |
glTFCommon::Ref<glTF2::Sampler>::Ref(std::__1::vector<glTF2::Sampler*, std::__1::allocator<glTF2::Sampler*> >&, unsigned int) Line | Count | Source | 264 | 374 | vector(&vec), | 265 | 374 | index(idx) {} |
glTFCommon::Ref<glTF2::Skin>::Ref(std::__1::vector<glTF2::Skin*, std::__1::allocator<glTF2::Skin*> >&, unsigned int) Line | Count | Source | 264 | 1.67k | vector(&vec), | 265 | 1.67k | index(idx) {} |
glTFCommon::Ref<glTF2::Camera>::Ref(std::__1::vector<glTF2::Camera*, std::__1::allocator<glTF2::Camera*> >&, unsigned int) Line | Count | Source | 264 | 53 | vector(&vec), | 265 | 53 | 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 | 206 | vector(&vec), | 265 | 206 | index(idx) {} |
Unexecuted instantiation: glTFCommon::Ref<glTF::Skin>::Ref(std::__1::vector<glTF::Skin*, std::__1::allocator<glTF::Skin*> >&, unsigned int) Unexecuted instantiation: glTFCommon::Ref<glTF::Animation>::Ref(std::__1::vector<glTF::Animation*, std::__1::allocator<glTF::Animation*> >&, unsigned int) |
266 | | |
267 | 6.11k | inline unsigned int GetIndex() const { return index; }glTFCommon::Ref<glTF::Image>::GetIndex() const Line | Count | Source | 267 | 4 | inline unsigned int GetIndex() const { return index; } |
glTFCommon::Ref<glTF::Material>::GetIndex() const Line | Count | Source | 267 | 4 | inline unsigned int GetIndex() const { return index; } |
glTFCommon::Ref<glTF::Mesh>::GetIndex() const Line | Count | Source | 267 | 68 | 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 | 754 | inline unsigned int GetIndex() const { return index; } |
glTFCommon::Ref<glTF2::Material>::GetIndex() const Line | Count | Source | 267 | 2.32k | inline unsigned int GetIndex() const { return index; } |
glTFCommon::Ref<glTF2::Mesh>::GetIndex() const Line | Count | Source | 267 | 2.80k | inline unsigned int GetIndex() const { return index; } |
glTFCommon::Ref<glTF2::Camera>::GetIndex() const Line | Count | Source | 267 | 39 | 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 | 122 | inline unsigned int GetIndex() const { return index; } |
Unexecuted instantiation: glTFCommon::Ref<glTF::Texture>::GetIndex() const Unexecuted instantiation: glTFCommon::Ref<glTF::Node>::GetIndex() const Unexecuted instantiation: glTFCommon::Ref<glTF2::Texture>::GetIndex() const |
268 | | |
269 | 318k | operator bool() const { return vector != nullptr && index < vector->size(); }glTFCommon::Ref<glTF2::Buffer>::operator bool() const Line | Count | Source | 269 | 34.8k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::BufferView>::operator bool() const Line | Count | Source | 269 | 119k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Node>::operator bool() const Line | Count | Source | 269 | 28.8k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Mesh>::operator bool() const Line | Count | Source | 269 | 5.79k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Camera>::operator bool() const Line | Count | Source | 269 | 14.8k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Light>::operator bool() const Line | Count | Source | 269 | 14.7k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::BufferView>::operator bool() const Line | Count | Source | 269 | 32 | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::Texture>::operator bool() const Line | Count | Source | 269 | 16 | operator bool() const { return vector != nullptr && index < vector->size(); } |
Unexecuted instantiation: glTFCommon::Ref<glTF::Skin>::operator bool() const glTFCommon::Ref<glTF::Image>::operator bool() const Line | Count | Source | 269 | 4 | operator bool() const { return vector != nullptr && index < vector->size(); } |
Unexecuted instantiation: glTFCommon::Ref<glTF::Sampler>::operator bool() const glTFCommon::Ref<glTF::Mesh>::operator bool() const Line | Count | Source | 269 | 465 | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::Node>::operator bool() const Line | Count | Source | 269 | 724 | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::Buffer>::operator bool() const Line | Count | Source | 269 | 16 | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::Camera>::operator bool() const Line | Count | Source | 269 | 83 | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::Accessor>::operator bool() const Line | Count | Source | 269 | 31 | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::Material>::operator bool() const Line | Count | Source | 269 | 14 | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::Scene>::operator bool() const Line | Count | Source | 269 | 46 | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF::Light>::operator bool() const Line | Count | Source | 269 | 83 | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Texture>::operator bool() const Line | Count | Source | 269 | 68.7k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Image>::operator bool() const Line | Count | Source | 269 | 772 | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Sampler>::operator bool() const Line | Count | Source | 269 | 754 | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Material>::operator bool() const Line | Count | Source | 269 | 2.71k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Accessor>::operator bool() const Line | Count | Source | 269 | 13.8k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Skin>::operator bool() const Line | Count | Source | 269 | 2.80k | operator bool() const { return vector != nullptr && index < vector->size(); } |
glTFCommon::Ref<glTF2::Scene>::operator bool() const Line | Count | Source | 269 | 8.96k | operator bool() const { return vector != nullptr && index < vector->size(); } |
|
270 | | |
271 | 324k | T *operator->() { return (*vector)[index]; }glTFCommon::Ref<glTF2::Buffer>::operator->() Line | Count | Source | 271 | 66.2k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF2::BufferView>::operator->() Line | Count | Source | 271 | 188k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF2::Camera>::operator->() Line | Count | Source | 271 | 53 | T *operator->() { return (*vector)[index]; } |
Unexecuted instantiation: glTFCommon::Ref<glTF2::Light>::operator->() glTFCommon::Ref<glTF2::Scene>::operator->() Line | Count | Source | 271 | 15.0k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF::BufferView>::operator->() Line | Count | Source | 271 | 241 | T *operator->() { return (*vector)[index]; } |
Unexecuted instantiation: glTFCommon::Ref<glTF::Node>::operator->() glTFCommon::Ref<glTF::Texture>::operator->() Line | Count | Source | 271 | 12 | T *operator->() { return (*vector)[index]; } |
Unexecuted instantiation: glTFCommon::Ref<glTF::Material>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF::Mesh>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF::Skin>::operator->() glTFCommon::Ref<glTF::Image>::operator->() Line | Count | Source | 271 | 4 | T *operator->() { return (*vector)[index]; } |
Unexecuted instantiation: glTFCommon::Ref<glTF::Sampler>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF::Camera>::operator->() glTFCommon::Ref<glTF::Buffer>::operator->() Line | Count | Source | 271 | 4.32k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF::Accessor>::operator->() Line | Count | Source | 271 | 37 | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF::Scene>::operator->() Line | Count | Source | 271 | 31 | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF2::Texture>::operator->() Line | Count | Source | 271 | 3.76k | T *operator->() { return (*vector)[index]; } |
Unexecuted instantiation: glTFCommon::Ref<glTF2::Material>::operator->() glTFCommon::Ref<glTF2::Image>::operator->() Line | Count | Source | 271 | 754 | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF2::Sampler>::operator->() Line | Count | Source | 271 | 5.46k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF2::Node>::operator->() Line | Count | Source | 271 | 8.23k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF2::Accessor>::operator->() Line | Count | Source | 271 | 26.0k | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF2::Mesh>::operator->() Line | Count | Source | 271 | 595 | T *operator->() { return (*vector)[index]; } |
glTFCommon::Ref<glTF2::Skin>::operator->() Line | Count | Source | 271 | 5.20k | T *operator->() { return (*vector)[index]; } |
Unexecuted instantiation: glTFCommon::Ref<glTF::Animation>::operator->() Unexecuted instantiation: glTFCommon::Ref<glTF2::Animation>::operator->() |
272 | | |
273 | 19.1k | T &operator*() { return *((*vector)[index]); }glTFCommon::Ref<glTF::Node>::operator*() Line | Count | Source | 273 | 83 | T &operator*() { return *((*vector)[index]); } |
glTFCommon::Ref<glTF2::Node>::operator*() Line | Count | Source | 273 | 19.1k | T &operator*() { return *((*vector)[index]); } |
|
274 | | }; |
275 | | |
276 | | // |
277 | | // JSON Value reading helpers |
278 | | // |
279 | | |
280 | | template <class T> |
281 | | struct ReadHelper { |
282 | 29.4k | static bool Read(Value &val, T &out) { |
283 | 29.4k | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; |
284 | 29.4k | } glTFCommon::ReadHelper<unsigned int>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, unsigned int&) Line | Count | Source | 282 | 5.93k | static bool Read(Value &val, T &out) { | 283 | 5.93k | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 5.93k | } |
glTFCommon::ReadHelper<glTF2::ComponentType>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF2::ComponentType&) Line | Count | Source | 282 | 16.8k | static bool Read(Value &val, T &out) { | 283 | 16.8k | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 16.8k | } |
glTFCommon::ReadHelper<glTF2::SamplerMagFilter>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF2::SamplerMagFilter&) Line | Count | Source | 282 | 277 | static bool Read(Value &val, T &out) { | 283 | 277 | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 277 | } |
glTFCommon::ReadHelper<glTF2::SamplerMinFilter>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF2::SamplerMinFilter&) Line | Count | Source | 282 | 315 | static bool Read(Value &val, T &out) { | 283 | 315 | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 315 | } |
glTFCommon::ReadHelper<glTF2::SamplerWrap>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF2::SamplerWrap&) Line | Count | Source | 282 | 639 | static bool Read(Value &val, T &out) { | 283 | 639 | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 639 | } |
glTFCommon::ReadHelper<glTF2::PrimitiveMode>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF2::PrimitiveMode&) Line | Count | Source | 282 | 4.34k | static bool Read(Value &val, T &out) { | 283 | 4.34k | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 4.34k | } |
glTFCommon::ReadHelper<glTF::PrimitiveMode>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF::PrimitiveMode&) Line | Count | Source | 282 | 548 | static bool Read(Value &val, T &out) { | 283 | 548 | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 548 | } |
glTFCommon::ReadHelper<int>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, int&) Line | Count | Source | 282 | 14 | static bool Read(Value &val, T &out) { | 283 | 14 | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 14 | } |
glTFCommon::ReadHelper<glTF::SamplerMagFilter>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF::SamplerMagFilter&) Line | Count | Source | 282 | 29 | static bool Read(Value &val, T &out) { | 283 | 29 | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 29 | } |
glTFCommon::ReadHelper<glTF::SamplerMinFilter>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF::SamplerMinFilter&) Line | Count | Source | 282 | 29 | static bool Read(Value &val, T &out) { | 283 | 29 | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 29 | } |
glTFCommon::ReadHelper<glTF::SamplerWrap>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF::SamplerWrap&) Line | Count | Source | 282 | 58 | static bool Read(Value &val, T &out) { | 283 | 58 | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 58 | } |
glTFCommon::ReadHelper<glTF::ComponentType>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTF::ComponentType&) Line | Count | Source | 282 | 442 | static bool Read(Value &val, T &out) { | 283 | 442 | return val.IsInt() ? out = static_cast<T>(val.GetInt()), true : false; | 284 | 442 | } |
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.22k | static bool Read(Value &val, bool &out) { |
290 | 3.22k | return val.IsBool() ? out = val.GetBool(), true : false; |
291 | 3.22k | } |
292 | | }; |
293 | | |
294 | | template <> |
295 | | struct ReadHelper<float> { |
296 | 6.09k | static bool Read(Value &val, float &out) { |
297 | 6.09k | return val.IsNumber() ? out = static_cast<float>(val.GetDouble()), true : false; |
298 | 6.09k | } |
299 | | }; |
300 | | |
301 | | template <unsigned int N> |
302 | | struct ReadHelper<float[N]> { |
303 | 25.9k | static bool Read(Value &val, float (&out)[N]) { |
304 | 25.9k | if (!val.IsArray() || val.Size() != N) return false; |
305 | 346k | for (unsigned int i = 0; i < N; ++i) { |
306 | 320k | if (val[i].IsNumber()) |
307 | 320k | out[i] = static_cast<float>(val[i].GetDouble()); |
308 | 320k | } |
309 | 25.7k | return true; |
310 | 25.9k | } glTFCommon::ReadHelper<float [4]>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, float (&) [4]) Line | Count | Source | 303 | 3.74k | static bool Read(Value &val, float (&out)[N]) { | 304 | 3.74k | if (!val.IsArray() || val.Size() != N) return false; | 305 | 18.6k | for (unsigned int i = 0; i < N; ++i) { | 306 | 14.9k | if (val[i].IsNumber()) | 307 | 14.9k | out[i] = static_cast<float>(val[i].GetDouble()); | 308 | 14.9k | } | 309 | 3.72k | return true; | 310 | 3.74k | } |
glTFCommon::ReadHelper<float [3]>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, float (&) [3]) Line | Count | Source | 303 | 3.59k | static bool Read(Value &val, float (&out)[N]) { | 304 | 3.59k | if (!val.IsArray() || val.Size() != N) return false; | 305 | 14.3k | for (unsigned int i = 0; i < N; ++i) { | 306 | 10.7k | if (val[i].IsNumber()) | 307 | 10.7k | out[i] = static_cast<float>(val[i].GetDouble()); | 308 | 10.7k | } | 309 | 3.57k | return true; | 310 | 3.59k | } |
glTFCommon::ReadHelper<float [16]>::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, float (&) [16]) Line | Count | Source | 303 | 18.6k | static bool Read(Value &val, float (&out)[N]) { | 304 | 18.6k | if (!val.IsArray() || val.Size() != N) return false; | 305 | 313k | for (unsigned int i = 0; i < N; ++i) { | 306 | 294k | if (val[i].IsNumber()) | 307 | 294k | out[i] = static_cast<float>(val[i].GetDouble()); | 308 | 294k | } | 309 | 18.4k | return true; | 310 | 18.6k | } |
|
311 | | }; |
312 | | |
313 | | template <> |
314 | | struct ReadHelper<const char *> { |
315 | 19.5k | static bool Read(Value &val, const char *&out) { |
316 | 19.5k | return val.IsString() ? (out = val.GetString(), true) : false; |
317 | 19.5k | } |
318 | | }; |
319 | | |
320 | | template <> |
321 | | struct ReadHelper<std::string> { |
322 | 53.1k | static bool Read(Value &val, std::string &out) { |
323 | 53.1k | return val.IsString() ? (out = std::string(val.GetString(), val.GetStringLength()), true) : false; |
324 | 53.1k | } |
325 | | }; |
326 | | |
327 | | template <class T> |
328 | | struct ReadHelper<Nullable<T>> { |
329 | 33.4k | static bool Read(Value &val, Nullable<T> &out) { |
330 | 33.4k | return out.isPresent = ReadHelper<T>::Read(val, out.value); |
331 | 33.4k | } 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 | 13.2k | static bool Read(Value &val, Nullable<T> &out) { | 330 | 13.2k | return out.isPresent = ReadHelper<T>::Read(val, out.value); | 331 | 13.2k | } |
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 | 18.6k | static bool Read(Value &val, Nullable<T> &out) { | 330 | 18.6k | return out.isPresent = ReadHelper<T>::Read(val, out.value); | 331 | 18.6k | } |
glTFCommon::ReadHelper<glTFCommon::Nullable<float [3]> >::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<float [3]>&) Line | Count | Source | 329 | 986 | static bool Read(Value &val, Nullable<T> &out) { | 330 | 986 | return out.isPresent = ReadHelper<T>::Read(val, out.value); | 331 | 986 | } |
glTFCommon::ReadHelper<glTFCommon::Nullable<float [4]> >::Read(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, glTFCommon::Nullable<float [4]>&) Line | Count | Source | 329 | 579 | static bool Read(Value &val, Nullable<T> &out) { | 330 | 579 | return out.isPresent = ReadHelper<T>::Read(val, out.value); | 331 | 579 | } |
|
332 | | }; |
333 | | |
334 | | template <> |
335 | | struct ReadHelper<uint64_t> { |
336 | 43.6k | static bool Read(Value &val, uint64_t &out) { |
337 | 43.6k | return val.IsUint64() ? out = val.GetUint64(), true : false; |
338 | 43.6k | } |
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 | 31.9k | inline static bool ReadValue(Value &val, T &out) { |
365 | 31.9k | return ReadHelper<T>::Read(val, out); |
366 | 31.9k | } 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 | 256 | inline static bool ReadValue(Value &val, T &out) { | 365 | 256 | return ReadHelper<T>::Read(val, out); | 366 | 256 | } |
glTFImporter.cpp:bool glTFCommon::ReadValue<float [4]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, float (&) [4]) Line | Count | Source | 364 | 18 | inline static bool ReadValue(Value &val, T &out) { | 365 | 18 | return ReadHelper<T>::Read(val, out); | 366 | 18 | } |
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 | 13.2k | inline static bool ReadValue(Value &val, T &out) { | 365 | 13.2k | return ReadHelper<T>::Read(val, out); | 366 | 13.2k | } |
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 | 18.3k | inline static bool ReadValue(Value &val, T &out) { | 365 | 18.3k | return ReadHelper<T>::Read(val, out); | 366 | 18.3k | } |
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 | 35 | inline static bool ReadValue(Value &val, T &out) { | 365 | 35 | return ReadHelper<T>::Read(val, out); | 366 | 35 | } |
glTFExporter.cpp:bool glTFCommon::ReadValue<float [4]>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, float (&) [4]) Line | Count | Source | 364 | 9 | inline static bool ReadValue(Value &val, T &out) { | 365 | 9 | return ReadHelper<T>::Read(val, out); | 366 | 9 | } |
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 | 262k | inline static bool ReadMember(Value &obj, const char *id, T &out) { |
370 | 262k | if (!obj.IsObject()) { |
371 | 35 | return false; |
372 | 35 | } |
373 | 262k | Value::MemberIterator it = obj.FindMember(id); |
374 | 262k | if (it != obj.MemberEnd()) { |
375 | 149k | return ReadHelper<T>::Read(it->value, out); |
376 | 149k | } |
377 | 113k | return false; |
378 | 262k | } 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 | 6.26k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 6.26k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 6.26k | Value::MemberIterator it = obj.FindMember(id); | 374 | 6.26k | if (it != obj.MemberEnd()) { | 375 | 2.83k | return ReadHelper<T>::Read(it->value, out); | 376 | 2.83k | } | 377 | 3.42k | return false; | 378 | 6.26k | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<bool>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, bool&) Line | Count | Source | 369 | 1.46k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 1.46k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 1.46k | Value::MemberIterator it = obj.FindMember(id); | 374 | 1.46k | if (it != obj.MemberEnd()) { | 375 | 210 | return ReadHelper<T>::Read(it->value, out); | 376 | 210 | } | 377 | 1.25k | return false; | 378 | 1.46k | } |
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 | 1.16k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 1.16k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 1.16k | Value::MemberIterator it = obj.FindMember(id); | 374 | 1.16k | if (it != obj.MemberEnd()) { | 375 | 538 | return ReadHelper<T>::Read(it->value, out); | 376 | 538 | } | 377 | 622 | return false; | 378 | 1.16k | } |
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 | 580 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 580 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 580 | Value::MemberIterator it = obj.FindMember(id); | 374 | 580 | if (it != obj.MemberEnd()) { | 375 | 112 | return ReadHelper<T>::Read(it->value, out); | 376 | 112 | } | 377 | 468 | return false; | 378 | 580 | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<glTF::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::PrimitiveMode&) Line | Count | Source | 369 | 538 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 538 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 538 | Value::MemberIterator it = obj.FindMember(id); | 374 | 538 | if (it != obj.MemberEnd()) { | 375 | 536 | return ReadHelper<T>::Read(it->value, out); | 376 | 536 | } | 377 | 2 | return false; | 378 | 538 | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int&) Line | Count | Source | 369 | 1.77k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 1.77k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 1.77k | Value::MemberIterator it = obj.FindMember(id); | 374 | 1.77k | if (it != obj.MemberEnd()) { | 375 | 1.54k | return ReadHelper<T>::Read(it->value, out); | 376 | 1.54k | } | 377 | 234 | return false; | 378 | 1.77k | } |
Unexecuted instantiation: glTFImporter.cpp:bool glTFCommon::ReadMember<int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, int&) glTFImporter.cpp:bool glTFCommon::ReadMember<glTF::SamplerMagFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::SamplerMagFilter&) Line | Count | Source | 369 | 20 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 20 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 20 | Value::MemberIterator it = obj.FindMember(id); | 374 | 20 | if (it != obj.MemberEnd()) { | 375 | 20 | return ReadHelper<T>::Read(it->value, out); | 376 | 20 | } | 377 | 0 | return false; | 378 | 20 | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<glTF::SamplerMinFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::SamplerMinFilter&) Line | Count | Source | 369 | 20 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 20 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 20 | Value::MemberIterator it = obj.FindMember(id); | 374 | 20 | if (it != obj.MemberEnd()) { | 375 | 20 | return ReadHelper<T>::Read(it->value, out); | 376 | 20 | } | 377 | 0 | return false; | 378 | 20 | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<glTF::SamplerWrap>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::SamplerWrap&) Line | Count | Source | 369 | 40 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 40 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 40 | Value::MemberIterator it = obj.FindMember(id); | 374 | 40 | if (it != obj.MemberEnd()) { | 375 | 40 | return ReadHelper<T>::Read(it->value, out); | 376 | 40 | } | 377 | 0 | return false; | 378 | 40 | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float&) Line | Count | Source | 369 | 48 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 48 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 48 | Value::MemberIterator it = obj.FindMember(id); | 374 | 48 | if (it != obj.MemberEnd()) { | 375 | 22 | return ReadHelper<T>::Read(it->value, out); | 376 | 22 | } | 377 | 26 | return false; | 378 | 48 | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long&) Line | Count | Source | 369 | 150 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 150 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 150 | Value::MemberIterator it = obj.FindMember(id); | 374 | 150 | if (it != obj.MemberEnd()) { | 375 | 76 | return ReadHelper<T>::Read(it->value, out); | 376 | 76 | } | 377 | 74 | return false; | 378 | 150 | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<glTF::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::ComponentType&) Line | Count | Source | 369 | 442 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 442 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 442 | Value::MemberIterator it = obj.FindMember(id); | 374 | 442 | if (it != obj.MemberEnd()) { | 375 | 404 | return ReadHelper<T>::Read(it->value, out); | 376 | 404 | } | 377 | 38 | return false; | 378 | 442 | } |
glTFImporter.cpp:bool glTFCommon::ReadMember<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*&) Line | Count | Source | 369 | 1.28k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 1.28k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 1.28k | Value::MemberIterator it = obj.FindMember(id); | 374 | 1.28k | if (it != obj.MemberEnd()) { | 375 | 1.15k | return ReadHelper<T>::Read(it->value, out); | 376 | 1.15k | } | 377 | 128 | return false; | 378 | 1.28k | } |
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 | 98.7k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 98.7k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 98.7k | Value::MemberIterator it = obj.FindMember(id); | 374 | 98.7k | if (it != obj.MemberEnd()) { | 375 | 36.9k | return ReadHelper<T>::Read(it->value, out); | 376 | 36.9k | } | 377 | 61.7k | return false; | 378 | 98.7k | } |
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 | 11.7k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 11.7k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 11.7k | Value::MemberIterator it = obj.FindMember(id); | 374 | 11.7k | if (it != obj.MemberEnd()) { | 375 | 446 | return ReadHelper<T>::Read(it->value, out); | 376 | 446 | } | 377 | 11.2k | return false; | 378 | 11.7k | } |
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 | 5.85k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 5.85k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 5.85k | Value::MemberIterator it = obj.FindMember(id); | 374 | 5.85k | if (it != obj.MemberEnd()) { | 375 | 466 | return ReadHelper<T>::Read(it->value, out); | 376 | 466 | } | 377 | 5.39k | return false; | 378 | 5.85k | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<glTF2::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::PrimitiveMode&) Line | Count | Source | 369 | 5.13k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 5.13k | if (!obj.IsObject()) { | 371 | 35 | return false; | 372 | 35 | } | 373 | 5.10k | Value::MemberIterator it = obj.FindMember(id); | 374 | 5.10k | if (it != obj.MemberEnd()) { | 375 | 4.34k | return ReadHelper<T>::Read(it->value, out); | 376 | 4.34k | } | 377 | 762 | return false; | 378 | 5.10k | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int&) Line | Count | Source | 369 | 14.6k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 14.6k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 14.6k | Value::MemberIterator it = obj.FindMember(id); | 374 | 14.6k | if (it != obj.MemberEnd()) { | 375 | 4.21k | return ReadHelper<T>::Read(it->value, out); | 376 | 4.21k | } | 377 | 10.3k | return false; | 378 | 14.6k | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<glTF2::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::ComponentType&) Line | Count | Source | 369 | 18.7k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 18.7k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 18.7k | Value::MemberIterator it = obj.FindMember(id); | 374 | 18.7k | if (it != obj.MemberEnd()) { | 375 | 16.8k | return ReadHelper<T>::Read(it->value, out); | 376 | 16.8k | } | 377 | 1.95k | return false; | 378 | 18.7k | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*&) Line | Count | Source | 369 | 18.7k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 18.7k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 18.7k | Value::MemberIterator it = obj.FindMember(id); | 374 | 18.7k | if (it != obj.MemberEnd()) { | 375 | 18.2k | return ReadHelper<T>::Read(it->value, out); | 376 | 18.2k | } | 377 | 539 | return false; | 378 | 18.7k | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long&) Line | Count | Source | 369 | 49.1k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 49.1k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 49.1k | Value::MemberIterator it = obj.FindMember(id); | 374 | 49.1k | if (it != obj.MemberEnd()) { | 375 | 43.5k | return ReadHelper<T>::Read(it->value, out); | 376 | 43.5k | } | 377 | 5.55k | return false; | 378 | 49.1k | } |
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.83k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 3.83k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 3.83k | Value::MemberIterator it = obj.FindMember(id); | 374 | 3.83k | if (it != obj.MemberEnd()) { | 375 | 3.13k | return ReadHelper<T>::Read(it->value, out); | 376 | 3.13k | } | 377 | 700 | return false; | 378 | 3.83k | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<glTF2::SamplerMagFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerMagFilter&) Line | Count | Source | 369 | 374 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 374 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 374 | Value::MemberIterator it = obj.FindMember(id); | 374 | 374 | if (it != obj.MemberEnd()) { | 375 | 277 | return ReadHelper<T>::Read(it->value, out); | 376 | 277 | } | 377 | 97 | return false; | 378 | 374 | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<glTF2::SamplerMinFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerMinFilter&) Line | Count | Source | 369 | 374 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 374 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 374 | Value::MemberIterator it = obj.FindMember(id); | 374 | 374 | if (it != obj.MemberEnd()) { | 375 | 315 | return ReadHelper<T>::Read(it->value, out); | 376 | 315 | } | 377 | 59 | return false; | 378 | 374 | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<glTF2::SamplerWrap>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF2::SamplerWrap&) Line | Count | Source | 369 | 748 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 748 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 748 | Value::MemberIterator it = obj.FindMember(id); | 374 | 748 | if (it != obj.MemberEnd()) { | 375 | 639 | return ReadHelper<T>::Read(it->value, out); | 376 | 639 | } | 377 | 109 | return false; | 378 | 748 | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float&) Line | Count | Source | 369 | 11.8k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 11.8k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 11.8k | Value::MemberIterator it = obj.FindMember(id); | 374 | 11.8k | if (it != obj.MemberEnd()) { | 375 | 6.06k | return ReadHelper<T>::Read(it->value, out); | 376 | 6.06k | } | 377 | 5.81k | return false; | 378 | 11.8k | } |
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.08k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 4.08k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 4.08k | Value::MemberIterator it = obj.FindMember(id); | 374 | 4.08k | if (it != obj.MemberEnd()) { | 375 | 2.60k | return ReadHelper<T>::Read(it->value, out); | 376 | 2.60k | } | 377 | 1.47k | return false; | 378 | 4.08k | } |
glTF2Importer.cpp:bool glTFCommon::ReadMember<bool>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, bool&) Line | Count | Source | 369 | 4.08k | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 4.08k | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 4.08k | Value::MemberIterator it = obj.FindMember(id); | 374 | 4.08k | if (it != obj.MemberEnd()) { | 375 | 3.01k | return ReadHelper<T>::Read(it->value, out); | 376 | 3.01k | } | 377 | 1.07k | return false; | 378 | 4.08k | } |
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 | 173 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 173 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 173 | Value::MemberIterator it = obj.FindMember(id); | 374 | 173 | if (it != obj.MemberEnd()) { | 375 | 82 | return ReadHelper<T>::Read(it->value, out); | 376 | 82 | } | 377 | 91 | return false; | 378 | 173 | } |
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 | 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 | 2 | return ReadHelper<T>::Read(it->value, out); | 376 | 2 | } | 377 | 4 | return false; | 378 | 6 | } |
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 | 3 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 3 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 3 | Value::MemberIterator it = obj.FindMember(id); | 374 | 3 | if (it != obj.MemberEnd()) { | 375 | 1 | return ReadHelper<T>::Read(it->value, out); | 376 | 1 | } | 377 | 2 | return false; | 378 | 3 | } |
glTFExporter.cpp:bool glTFCommon::ReadMember<glTF::PrimitiveMode>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::PrimitiveMode&) Line | Count | Source | 369 | 12 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 12 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 12 | Value::MemberIterator it = obj.FindMember(id); | 374 | 12 | if (it != obj.MemberEnd()) { | 375 | 12 | return ReadHelper<T>::Read(it->value, out); | 376 | 12 | } | 377 | 0 | return false; | 378 | 12 | } |
glTFExporter.cpp:bool glTFCommon::ReadMember<unsigned int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned int&) Line | Count | Source | 369 | 174 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 174 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 174 | Value::MemberIterator it = obj.FindMember(id); | 374 | 174 | if (it != obj.MemberEnd()) { | 375 | 172 | return ReadHelper<T>::Read(it->value, out); | 376 | 172 | } | 377 | 2 | return false; | 378 | 174 | } |
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 | 9 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 9 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 9 | Value::MemberIterator it = obj.FindMember(id); | 374 | 9 | if (it != obj.MemberEnd()) { | 375 | 9 | return ReadHelper<T>::Read(it->value, out); | 376 | 9 | } | 377 | 0 | return false; | 378 | 9 | } |
glTFExporter.cpp:bool glTFCommon::ReadMember<glTF::SamplerMinFilter>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::SamplerMinFilter&) Line | Count | Source | 369 | 9 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 9 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 9 | Value::MemberIterator it = obj.FindMember(id); | 374 | 9 | if (it != obj.MemberEnd()) { | 375 | 9 | return ReadHelper<T>::Read(it->value, out); | 376 | 9 | } | 377 | 0 | return false; | 378 | 9 | } |
glTFExporter.cpp:bool glTFCommon::ReadMember<glTF::SamplerWrap>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::SamplerWrap&) Line | Count | Source | 369 | 18 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 18 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 18 | Value::MemberIterator it = obj.FindMember(id); | 374 | 18 | if (it != obj.MemberEnd()) { | 375 | 18 | return ReadHelper<T>::Read(it->value, out); | 376 | 18 | } | 377 | 0 | return false; | 378 | 18 | } |
glTFExporter.cpp:bool glTFCommon::ReadMember<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float&) Line | Count | Source | 369 | 18 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 18 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 18 | Value::MemberIterator it = obj.FindMember(id); | 374 | 18 | if (it != obj.MemberEnd()) { | 375 | 9 | return ReadHelper<T>::Read(it->value, out); | 376 | 9 | } | 377 | 9 | return false; | 378 | 18 | } |
Unexecuted instantiation: glTFExporter.cpp:bool glTFCommon::ReadMember<bool>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, bool&) glTFExporter.cpp:bool glTFCommon::ReadMember<unsigned long>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, unsigned long&) Line | Count | Source | 369 | 3 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 3 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 3 | Value::MemberIterator it = obj.FindMember(id); | 374 | 3 | if (it != obj.MemberEnd()) { | 375 | 3 | return ReadHelper<T>::Read(it->value, out); | 376 | 3 | } | 377 | 0 | return false; | 378 | 3 | } |
glTFExporter.cpp:bool glTFCommon::ReadMember<glTF::ComponentType>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, glTF::ComponentType&) Line | Count | Source | 369 | 40 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 40 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 40 | Value::MemberIterator it = obj.FindMember(id); | 374 | 40 | if (it != obj.MemberEnd()) { | 375 | 38 | return ReadHelper<T>::Read(it->value, out); | 376 | 38 | } | 377 | 2 | return false; | 378 | 40 | } |
glTFExporter.cpp:bool glTFCommon::ReadMember<char const*>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, char const*&) Line | Count | Source | 369 | 135 | inline static bool ReadMember(Value &obj, const char *id, T &out) { | 370 | 135 | if (!obj.IsObject()) { | 371 | 0 | return false; | 372 | 0 | } | 373 | 135 | Value::MemberIterator it = obj.FindMember(id); | 374 | 135 | if (it != obj.MemberEnd()) { | 375 | 135 | return ReadHelper<T>::Read(it->value, out); | 376 | 135 | } | 377 | 0 | return false; | 378 | 135 | } |
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 | 93.3k | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { |
382 | 93.3k | T out; |
383 | 93.3k | return ReadMember(obj, id, out) ? out : defaultValue; |
384 | 93.3k | } 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: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 | 1.46k | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 1.46k | T out; | 383 | 1.46k | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 1.46k | } |
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 | 538 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 538 | T out; | 383 | 538 | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 538 | } |
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 | 768 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 768 | T out; | 383 | 768 | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 768 | } |
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 | 150 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 150 | T out; | 383 | 150 | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 150 | } |
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 | 1.77k | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 1.77k | T out; | 383 | 1.77k | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 1.77k | } |
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 | 442 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 442 | T out; | 383 | 442 | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 442 | } |
Unexecuted instantiation: glTFImporter.cpp:int glTFCommon::MemberOrDefault<int>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, int) 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 | 5.13k | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 5.13k | T out; | 383 | 5.13k | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 5.13k | } |
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 | 14.6k | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 14.6k | T out; | 383 | 14.6k | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 14.6k | } |
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 | 49.1k | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 49.1k | T out; | 383 | 49.1k | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 49.1k | } |
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 | 18.7k | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 18.7k | T out; | 383 | 18.7k | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 18.7k | } |
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 | 61 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 61 | T out; | 383 | 61 | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 61 | } |
glTF2Importer.cpp:float glTFCommon::MemberOrDefault<float>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator> >&, char const*, float) Line | Count | Source | 381 | 204 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 204 | T out; | 383 | 204 | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 204 | } |
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 | 12 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 12 | T out; | 383 | 12 | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 12 | } |
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 | 69 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 69 | T out; | 383 | 69 | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 69 | } |
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 | 3 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 3 | T out; | 383 | 3 | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 3 | } |
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 | 174 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 174 | T out; | 383 | 174 | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 174 | } |
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 | 40 | inline static T MemberOrDefault(Value &obj, const char *id, T defaultValue) { | 382 | 40 | T out; | 383 | 40 | return ReadMember(obj, id, out) ? out : defaultValue; | 384 | 40 | } |
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: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 | 25.2k | inline Value *FindMember(Value &val, const char *id) { |
387 | 25.2k | if (!val.IsObject()) { |
388 | 0 | return nullptr; |
389 | 0 | } |
390 | 25.2k | Value::MemberIterator it = val.FindMember(id); |
391 | 25.2k | return (it != val.MemberEnd()) ? &it->value : nullptr; |
392 | 25.2k | } |
393 | | |
394 | | template <int N> |
395 | 171 | inline void throwUnexpectedTypeError(const char (&expectedTypeName)[N], const char *memberId, const char *context, const char *extraContext) { |
396 | 171 | std::string fullContext = context; |
397 | 171 | if (extraContext && (strlen(extraContext) > 0)) { |
398 | 30 | fullContext = fullContext + " (" + extraContext + ")"; |
399 | 30 | } |
400 | 171 | throw DeadlyImportError("Member \"", memberId, "\" was not of type \"", expectedTypeName, "\" when reading ", fullContext); |
401 | 171 | } void glTFCommon::throwUnexpectedTypeError<7>(char const (&) [7], char const*, char const*, char const*) Line | Count | Source | 395 | 106 | inline void throwUnexpectedTypeError(const char (&expectedTypeName)[N], const char *memberId, const char *context, const char *extraContext) { | 396 | 106 | std::string fullContext = context; | 397 | 106 | if (extraContext && (strlen(extraContext) > 0)) { | 398 | 0 | fullContext = fullContext + " (" + extraContext + ")"; | 399 | 0 | } | 400 | 106 | throw DeadlyImportError("Member \"", memberId, "\" was not of type \"", expectedTypeName, "\" when reading ", fullContext); | 401 | 106 | } |
void glTFCommon::throwUnexpectedTypeError<5>(char const (&) [5], char const*, char const*, char const*) Line | Count | Source | 395 | 42 | inline void throwUnexpectedTypeError(const char (&expectedTypeName)[N], const char *memberId, const char *context, const char *extraContext) { | 396 | 42 | std::string fullContext = context; | 397 | 42 | if (extraContext && (strlen(extraContext) > 0)) { | 398 | 22 | fullContext = fullContext + " (" + extraContext + ")"; | 399 | 22 | } | 400 | 42 | throw DeadlyImportError("Member \"", memberId, "\" was not of type \"", expectedTypeName, "\" when reading ", fullContext); | 401 | 42 | } |
void glTFCommon::throwUnexpectedTypeError<6>(char const (&) [6], char const*, char const*, char const*) Line | Count | Source | 395 | 23 | inline void throwUnexpectedTypeError(const char (&expectedTypeName)[N], const char *memberId, const char *context, const char *extraContext) { | 396 | 23 | std::string fullContext = context; | 397 | 23 | if (extraContext && (strlen(extraContext) > 0)) { | 398 | 8 | fullContext = fullContext + " (" + extraContext + ")"; | 399 | 8 | } | 400 | 23 | throw DeadlyImportError("Member \"", memberId, "\" was not of type \"", expectedTypeName, "\" when reading ", fullContext); | 401 | 23 | } |
|
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 | 15.9k | inline Value *FindStringInContext(Value &val, const char *memberId, const char *context, const char *extraContext = nullptr) { |
406 | 15.9k | if (!val.IsObject()) { |
407 | 20 | return nullptr; |
408 | 20 | } |
409 | 15.9k | Value::MemberIterator it = val.FindMember(memberId); |
410 | 15.9k | if (it == val.MemberEnd()) { |
411 | 4.87k | return nullptr; |
412 | 4.87k | } |
413 | 11.0k | if (!it->value.IsString()) { |
414 | 106 | throwUnexpectedTypeError("string", memberId, context, extraContext); |
415 | 106 | } |
416 | 11.0k | return &it->value; |
417 | 15.9k | } |
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 | 142k | inline Value *FindUIntInContext(Value &val, const char *memberId, const char *context, const char *extraContext = nullptr) { |
434 | 142k | if (!val.IsObject()) { |
435 | 118 | return nullptr; |
436 | 118 | } |
437 | 142k | Value::MemberIterator it = val.FindMember(memberId); |
438 | 142k | if (it == val.MemberEnd()) { |
439 | 70.4k | return nullptr; |
440 | 70.4k | } |
441 | 71.6k | if (!it->value.IsUint()) { |
442 | 42 | throwUnexpectedTypeError("uint", memberId, context, extraContext); |
443 | 42 | } |
444 | 71.6k | return &it->value; |
445 | 142k | } |
446 | | |
447 | 145k | inline Value *FindArrayInContext(Value &val, const char *memberId, const char *context, const char *extraContext = nullptr) { |
448 | 145k | if (!val.IsObject()) { |
449 | 35 | return nullptr; |
450 | 35 | } |
451 | 145k | Value::MemberIterator it = val.FindMember(memberId); |
452 | 145k | if (it == val.MemberEnd()) { |
453 | 66.2k | return nullptr; |
454 | 66.2k | } |
455 | 79.6k | if (!it->value.IsArray()) { |
456 | 23 | throwUnexpectedTypeError("array", memberId, context, extraContext); |
457 | 23 | } |
458 | 79.6k | return &it->value; |
459 | 145k | } |
460 | | |
461 | 238k | inline Value *FindObjectInContext(Value &val, const char * memberId, const char *context, const char *extraContext = nullptr) { |
462 | 238k | if (!val.IsObject()) { |
463 | 72 | return nullptr; |
464 | 72 | } |
465 | 238k | Value::MemberIterator it = val.FindMember(memberId); |
466 | 238k | if (it == val.MemberEnd()) { |
467 | 205k | return nullptr; |
468 | 205k | } |
469 | 32.7k | if (!it->value.IsObject()) { |
470 | 45 | ASSIMP_LOG_ERROR("Member \"", memberId, "\" was not of type \"", context, "\" when reading ", extraContext); |
471 | 45 | return nullptr; |
472 | 45 | } |
473 | 32.6k | return &it->value; |
474 | 32.7k | } |
475 | | |
476 | 4 | inline Value *FindExtensionInContext(Value &val, const char *extensionId, const char *context, const char *extraContext = nullptr) { |
477 | 4 | if (Value *extensionList = FindObjectInContext(val, "extensions", context, extraContext)) { |
478 | 2 | if (Value *extension = FindObjectInContext(*extensionList, extensionId, context, extraContext)) { |
479 | 0 | return extension; |
480 | 0 | } |
481 | 2 | } |
482 | 4 | return nullptr; |
483 | 4 | } |
484 | | |
485 | | // Overloads when the value is the document. |
486 | | |
487 | 398 | inline Value *FindString(Document &doc, const char *memberId) { |
488 | 398 | return FindStringInContext(doc, memberId, "the document"); |
489 | 398 | } |
490 | | |
491 | 0 | inline Value *FindNumber(Document &doc, const char *memberId) { |
492 | 0 | return FindNumberInContext(doc, memberId, "the document"); |
493 | 0 | } |
494 | | |
495 | 4.33k | inline Value *FindUInt(Document &doc, const char *memberId) { |
496 | 4.33k | return FindUIntInContext(doc, memberId, "the document"); |
497 | 4.33k | } |
498 | | |
499 | 20.4k | inline Value *FindArray(Document &val, const char *memberId) { |
500 | 20.4k | return FindArrayInContext(val, memberId, "the document"); |
501 | 20.4k | } |
502 | | |
503 | 19.8k | inline Value *FindObject(Document &doc, const char *memberId) { |
504 | 19.8k | return FindObjectInContext(doc, memberId, "the document"); |
505 | 19.8k | } |
506 | | |
507 | 0 | inline Value *FindExtension(Value &val, const char *extensionId) { |
508 | 0 | return FindExtensionInContext(val, extensionId, "the document"); |
509 | 0 | } |
510 | | |
511 | 3.16k | inline Value *FindString(Value &val, const char *id) { |
512 | 3.16k | Value::MemberIterator it = val.FindMember(id); |
513 | 3.16k | return (it != val.MemberEnd() && it->value.IsString()) ? &it->value : nullptr; |
514 | 3.16k | } |
515 | | |
516 | 8.40k | inline Value *FindObject(Value &val, const char *id) { |
517 | 8.40k | Value::MemberIterator it = val.FindMember(id); |
518 | 8.40k | return (it != val.MemberEnd() && it->value.IsObject()) ? &it->value : nullptr; |
519 | 8.40k | } |
520 | | |
521 | 3.66k | inline Value *FindArray(Value &val, const char *id) { |
522 | 3.66k | Value::MemberIterator it = val.FindMember(id); |
523 | 3.66k | return (it != val.MemberEnd() && it->value.IsArray()) ? &it->value : nullptr; |
524 | 3.66k | } |
525 | | |
526 | 97 | inline Value *FindNumber(Value &val, const char *id) { |
527 | 97 | Value::MemberIterator it = val.FindMember(id); |
528 | 97 | return (it != val.MemberEnd() && it->value.IsNumber()) ? &it->value : nullptr; |
529 | 97 | } |
530 | | |
531 | | } // namespace glTFCommon |
532 | | |
533 | | #endif // AI_GLFTCOMMON_H_INC |