|
musrfit 1.10.0
|
#include <sys/types.h>#include <sys/stat.h>#include <cstdlib>#include <iostream>#include <fstream>#include <TObjArray.h>#include <TObjString.h>#include <TColor.h>#include <TList.h>#include <TXMLAttr.h>#include "PStartupHandler.h"
Go to the source code of this file.
Functions | |
| ClassImpQ (PStartupHandler) int parseXmlFile(TSAXParser *saxParser | |
| Replacement for TSAXParser::ParseFile() that uses buffer-based parsing. | |
| xmlFile | open (startup_path_name, std::ios::in|std::ios::ate) |
| if (xmlFile.is_open()) | |
| if (!xmlBuffer) | |
Variables | |
| const char * | startup_path_name |
| std::fstream | xmlFile |
| unsigned int | xmlSize = 0 |
| char * | xmlBuffer = nullptr |
| else | |
| return | status |
| ClassImpQ | ( | PStartupHandler | ) |
Replacement for TSAXParser::ParseFile() that uses buffer-based parsing.
This function provides a workaround for environments where the standard TSAXParser::ParseFile() method fails but ParseBuffer() works correctly. It reads the entire XML file into memory and then parses it as a buffer.
Algorithm:
Memory Management: The function allocates a buffer equal to the file size, which is freed after parsing completes. For very large XML files, this may consume significant memory temporarily.
| saxParser | Pointer to an initialized TSAXParser object. The parser should have its signal slots connected to a handler object (e.g., PStartupHandler) before calling this function. |
| startup_path_name | Full filesystem path to the XML file to be parsed. |
| if | ( | ! | xmlBuffer | ) |
Definition at line 98 of file PStartupHandler.cpp.
| if | ( | xmlFile. | is_open() | ) |
Definition at line 91 of file PStartupHandler.cpp.
References xmlFile.
Referenced by if(), PMusrT0::PMusrT0(), PRunAsymmetry::PRunAsymmetry(), PRunAsymmetryBNMR::PRunAsymmetryBNMR(), PRunAsymmetryRRF::PRunAsymmetryRRF(), PRunBase::PRunBase(), PRunNonMusr::PRunNonMusr(), and PRunSingleHistoRRF::PRunSingleHistoRRF().
| xmlFile open | ( | startup_path_name | , |
| std::ios::in|std::ios::ate | ) |
References startup_path_name, and xmlFile.
| else |
Definition at line 100 of file PStartupHandler.cpp.
| const char* startup_path_name |
Definition at line 83 of file PStartupHandler.cpp.
Referenced by main(), main(), open(), PMsr2Data::ParseXmlStartupFile(), PStartupHandler::PStartupHandler(), and PStartupHandler::WriteDefaultStartupFile().
| return status |
Definition at line 106 of file PStartupHandler.cpp.
Referenced by addRun_filter_t0(), addRun_readInputFiles(), ClassImp(), PFitter::DoFit(), PFourierCanvas::Done(), PMusrCanvas::Done(), PMusrT0::Done(), dump_header_psi_bin(), PMsrHandler::GetNoOfFitParameters(), PMsr2Data::GetSingleRunMsrFile(), PMsrHandler::HandleStatisticEntry(), if(), main(), main(), msr2msr_statistic(), PMsr2Data::ParseXmlStartupFile(), PFourierCanvas::PFourierCanvas(), nxH5::PNeXus::PNeXus(), nxH5::PNeXus::PNeXus(), PRunAsymmetry::PrepareData(), PRunAsymmetryBNMR::PrepareData(), PRunAsymmetryRRF::PrepareData(), PMsr2Data::PrepareGlobalInputFile(), PMsr2Data::PrepareNewSortedInputFile(), PTheory::PTheory(), PMsr2Data::ReadMsrFile(), PRunDataHandler::ReadPsiBinFile(), PRunDataHandler::ToDouble(), PRunDataHandler::ToInt(), MuSR_td_PSI_bin::Write(), and PRunDataHandler::WritePsiBinFile().
| xmlBuffer = nullptr |
Definition at line 88 of file PStartupHandler.cpp.
Referenced by if().
| std::fstream xmlFile |
Definition at line 86 of file PStartupHandler.cpp.
| unsigned int xmlSize = 0 |
Definition at line 87 of file PStartupHandler.cpp.