MCPcopy Create free account
hub / github.com/assimp/assimp / ReadData

Function ReadData

code/AssetLib/FBX/FBXBinaryTokenizer.cpp:183–301  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

181
182// ------------------------------------------------------------------------------------------------
183void ReadData(const char*& sbegin_out, const char*& send_out, const char* input, const char*& cursor, const char* end) {
184 if(Offset(cursor, end) < 1) {
185 TokenizeError("cannot ReadData, out of bounds reading length",input, cursor);
186 }
187
188 const char type = *cursor;
189 sbegin_out = cursor++;
190
191 switch(type)
192 {
193 // 16 bit int
194 case 'Y':
195 cursor += 2;
196 break;
197
198 // 1 bit bool flag (yes/no)
199 case 'C':
200 cursor += 1;
201 break;
202
203 // 32 bit int
204 case 'I':
205 // <- fall through
206
207 // float
208 case 'F':
209 cursor += 4;
210 break;
211
212 // double
213 case 'D':
214 cursor += 8;
215 break;
216
217 // 64 bit int
218 case 'L':
219 cursor += 8;
220 break;
221
222 // note: do not write cursor += ReadWord(...cursor) as this would be UB
223
224 // raw binary data
225 case 'R':
226 {
227 const uint32_t length = ReadWord(input, cursor, end);
228 cursor += length;
229 break;
230 }
231
232 case 'b':
233 // TODO: what is the 'b' type code? Right now we just skip over it /
234 // take the full range we could get
235 cursor = end;
236 break;
237
238 // array of *
239 case 'f':
240 case 'd':

Callers 1

ReadScopeFunction · 0.85

Calls 4

OffsetFunction · 0.85
ReadWordFunction · 0.85
TokenizeErrorFunction · 0.70
ReadStringFunction · 0.70

Tested by

no test coverage detected