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

Method openFile

Engine/source/core/tokenizer.cpp:54–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54bool Tokenizer::openFile(const char* pFileName)
55{
56 AssertFatal(mFileName[0] == '\0', "Reuse of Tokenizers not allowed!");
57
58 FileStream* pStream = new FileStream;
59 if (pStream->open(pFileName, Torque::FS::File::Read) == false)
60 {
61 delete pStream;
62 return false;
63 }
64 dStrcpy(mFileName, pFileName, 1024);
65
66 mBufferSize = pStream->getStreamSize();
67 mpBuffer = new char[mBufferSize];
68 pStream->read(mBufferSize, mpBuffer);
69 pStream->close();
70 delete pStream;
71
72 reset();
73
74 buildLinePositions();
75
76 return true;
77}
78
79bool Tokenizer::openFile(Stream* pStream)
80{

Callers

nothing calls this directly

Calls 6

dStrcpyFunction · 0.85
resetFunction · 0.85
openMethod · 0.65
closeMethod · 0.65
getStreamSizeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected