MCPcopy Create free account
hub / github.com/JSBSim-Team/jsbsim / LoadXMLDocument

Method LoadXMLDocument

src/input_output/FGXMLFileRead.cpp:41–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40
41Element* FGXMLFileRead::LoadXMLDocument(const SGPath& XML_filename,
42 FGXMLParse& fparse, bool verbose)
43{
44 sg_ifstream infile;
45 SGPath filename(XML_filename);
46 if (!filename.isNull()) {
47 if (filename.extension().empty())
48 filename.concat(".xml");
49 infile.open(filename);
50 if ( !infile.is_open()) {
51 if (verbose) {
52 FGLogging log(LogLevel::ERROR);
53 log << "Could not open file: " << filename << "\n";
54 }
55 return nullptr;
56 }
57 } else {
58 FGLogging log(LogLevel::ERROR);
59 log << "No filename given.\n";
60 return nullptr;
61 }
62 readXML(infile, fparse, filename.utf8Str());
63 Element* document = fparse.GetDocument();
64 infile.close();
65 return document;
66}
67
68} // end namespace JSBSim

Callers 10

LoadPlanetMethod · 0.80
LoadModelMethod · 0.80
OpenMethod · 0.80
LoadScriptMethod · 0.80
LoadMethod · 0.80
LoadMethod · 0.80
SetDirectivesFileMethod · 0.80
SetDirectivesFileMethod · 0.80
mdlProcessParametersFunction · 0.80
mdlInitializeConditionsFunction · 0.80

Calls 6

readXMLFunction · 0.85
isNullMethod · 0.80
emptyMethod · 0.80
extensionMethod · 0.80
concatMethod · 0.80
openMethod · 0.80

Tested by

no test coverage detected