MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / read

Method read

Engine/source/console/codeBlock.cpp:351–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349}
350
351bool CodeBlock::read(StringTableEntry fileName, Stream &st)
352{
353 const StringTableEntry exePath = Platform::getMainDotCsDir();
354 const StringTableEntry cwd = Platform::getCurrentDirectory();
355
356 name = fileName;
357
358 if (fileName)
359 {
360 fullPath = NULL;
361
362 if (Platform::isFullPath(fileName))
363 fullPath = fileName;
364
365 if (dStrnicmp(exePath, fileName, dStrlen(exePath)) == 0)
366 name = StringTable->insert(fileName + dStrlen(exePath) + 1, true);
367 else if (dStrnicmp(cwd, fileName, dStrlen(cwd)) == 0)
368 name = StringTable->insert(fileName + dStrlen(cwd) + 1, true);
369
370 if (fullPath == NULL)
371 {
372 char buf[1024];
373 fullPath = StringTable->insert(Platform::makeFullPathName(fileName, buf, sizeof(buf)), true);
374 }
375
376 modPath = Con::getModNameFromPath(fileName);
377 }
378
379 //
380 addToCodeList();
381
382 U32 globalSize, size, i;
383 st.read(&size);
384 if (size)
385 {
386 globalStrings = new char[size];
387 globalStringsMaxLen = size;
388 st.read(size, globalStrings);
389 }
390 globalSize = size;
391 st.read(&size);
392 if (size)
393 {
394 functionStrings = new char[size];
395 functionStringsMaxLen = size;
396 st.read(size, functionStrings);
397 }
398 st.read(&size);
399 if (size)
400 {
401 globalFloats = new F64[size];
402 for (i = 0; i < size; i++)
403 st.read(&globalFloats[i]);
404 }
405 st.read(&size);
406 if (size)
407 {
408 functionFloats = new F64[size];

Callers 3

readObjectMethod · 0.45
unpackDataMethod · 0.45
executeFileFunction · 0.45

Calls 7

dStrnicmpFunction · 0.85
getModNameFromPathFunction · 0.85
EmptyStringMethod · 0.80
dStrlenFunction · 0.50
insertMethod · 0.45
readSTStringMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected