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

Method read

Engine/source/console/codeBlock.cpp:344–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

readObjectMethod · 0.45
executeFileFunction · 0.45

Calls 5

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

Tested by

no test coverage detected