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

Method LoadFile

Engine/source/persistence/taml/fsTinyXml.cpp:64–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64bool VfsXMLDocument::LoadFile(const char* pFilename)
65{
66 // Expand the file-path.
67 char filenameBuffer[1024];
68 Con::expandScriptFilename(filenameBuffer, sizeof(filenameBuffer), pFilename);
69
70 FileStream stream;
71
72#ifdef TORQUE_OS_ANDROID
73 if (strlen(pFilename) > strlen(filenameBuffer)) {
74 dStrcpy(filenameBuffer, pFilename, 1024);
75 }
76#endif
77
78 // File open for read?
79 if (!stream.open(filenameBuffer, Torque::FS::File::Read))
80 {
81 // No, so warn.
82 Con::warnf("TamlXmlParser::parse() - Could not open filename '%s' for parse.", filenameBuffer);
83 return false;
84 }
85
86 // Load document from stream.
87 if (!LoadFile(stream))
88 {
89 // Warn!
90 Con::warnf("TamlXmlParser: Could not load Taml XML file from stream.");
91 return false;
92 }
93
94 // Close the stream.
95 stream.close();
96 return true;
97}
98
99bool VfsXMLDocument::LoadFile(FileStream& stream)
100{

Callers 4

readFileFunction · 0.45
loadFileMethod · 0.45
acceptMethod · 0.45
readMethod · 0.45

Calls 9

expandScriptFilenameFunction · 0.85
dStrcpyFunction · 0.85
openMethod · 0.65
closeMethod · 0.65
warnfFunction · 0.50
ClearFunction · 0.50
ErrorEnum · 0.50
getStreamSizeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected