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

Method LoadFile

Engine/source/persistence/taml/fsTinyXml.cpp:26–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24#include "console/console.h"
25
26bool fsTiXmlDocument::LoadFile( const char * pFilename, TiXmlEncoding encoding )
27{
28 // Expand the file-path.
29 char filenameBuffer[1024];
30 Con::expandToolScriptFilename( filenameBuffer, sizeof(filenameBuffer), pFilename );
31
32 FileStream stream;
33
34#ifdef TORQUE_OS_ANDROID
35 if (strlen(pFilename) > strlen(filenameBuffer)) {
36 strcpy(filenameBuffer, pFilename);
37 }
38#endif
39
40 // File open for read?
41 if ( !stream.open( filenameBuffer, Torque::FS::File::Read ) )
42 {
43 // No, so warn.
44 Con::warnf("TamlXmlParser::parse() - Could not open filename '%s' for parse.", filenameBuffer );
45 return false;
46 }
47
48 // Load document from stream.
49 if ( !LoadFile( stream ) )
50 {
51 // Warn!
52 Con::warnf("TamlXmlParser: Could not load Taml XML file from stream.");
53 return false;
54 }
55
56 // Close the stream.
57 stream.close();
58 return true;
59}
60
61bool fsTiXmlDocument::SaveFile( const char * pFilename ) const
62{

Callers 3

loadFileMethod · 0.45
acceptMethod · 0.45
readMethod · 0.45

Calls 7

expandToolScriptFilenameFunction · 0.85
warnfFunction · 0.85
ErrorEnum · 0.50
openMethod · 0.45
closeMethod · 0.45
getStreamSizeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected