musrfit  1.9.2
PStartupHandler.h
Go to the documentation of this file.
1 /***************************************************************************
2 
3  PStartupHandler.h
4 
5  Author: Andreas Suter
6  e-mail: andreas.suter@psi.ch
7 
8 ***************************************************************************/
9 
10 /***************************************************************************
11  * Copyright (C) 2007-2023 by Andreas Suter *
12  * andreas.suter@psi.ch *
13  * *
14  * This program is free software; you can redistribute it and/or modify *
15  * it under the terms of the GNU General Public License as published by *
16  * the Free Software Foundation; either version 2 of the License, or *
17  * (at your option) any later version. *
18  * *
19  * This program is distributed in the hope that it will be useful, *
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22  * GNU General Public License for more details. *
23  * *
24  * You should have received a copy of the GNU General Public License *
25  * along with this program; if not, write to the *
26  * Free Software Foundation, Inc., *
27  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
28  ***************************************************************************/
29 
30 #ifndef _PSTARTUPHANDLER_H_
31 #define _PSTARTUPHANDLER_H_
32 
33 #include <TObject.h>
34 #include <TQObject.h>
35 #include <TList.h>
36 #include <TString.h>
37 #include <TSAXParser.h>
38 
39 #include "PMusr.h"
40 
41 //--------------------------------------------------------------------------
42 // This function is a replacement for the ParseFile method of TSAXParser.
43 //--------------------------------------------------------------------------
44 int parseXmlFile(TSAXParser*, const char*);
45 
54 class PStartupHandler : public TObject, public TQObject
55 {
56  public:
58  virtual ~PStartupHandler();
59 
60  virtual void OnStartDocument(); // SLOT
61  virtual void OnEndDocument(); // SLOT
62  virtual void OnStartElement(const Char_t*, const TList*); // SLOT
63  virtual void OnEndElement(const Char_t*); // SLOT
64  virtual void OnCharacters(const Char_t*); // SLOT
65  virtual void OnComment(const Char_t*); // SLOT
66  virtual void OnWarning(const Char_t*); // SLOT
67  virtual void OnError(const Char_t*); // SLOT
68  virtual void OnFatalError(const Char_t*); // SLOT
69  virtual void OnCdataBlock(const Char_t*, Int_t); // SLOT
70 
71  virtual Bool_t StartupFileFound() { return fStartupFileFound; }
72  virtual TString GetStartupFilePath() { return fStartupFilePath; }
73 
74  virtual void CheckLists();
75 
78  virtual const PStringVector GetDataPathList() const { return fDataPathList; }
79  virtual const PIntVector GetMarkerList() const { return fMarkerList; }
80  virtual const PIntVector GetColorList() const { return fColorList; }
81 
82  private:
89 
91  TString fStartupFilePath;
98 
99  Bool_t StartupFileExists(Char_t *fln);
100  Bool_t WriteDefaultStartupFile();
101 
102  ClassDef(PStartupHandler, 1)
103 };
104 
105 #endif // _PSTARTUPHANDLER_H_
106 
virtual void OnEndElement(const Char_t *)
TString fStartupFilePath
full musrfit_startup.xml startup file paths
PRunNameTemplateList fRunNameTemplate
run name template vector
virtual void OnFatalError(const Char_t *)
Bool_t WriteDefaultStartupFile()
Bool_t StartupFileExists(Char_t *fln)
virtual const PStringVector GetDataPathList() const
returns the search data path list
virtual void OnComment(const Char_t *)
virtual TString GetStartupFilePath()
returns FULLPATH/musrfit_startup.xml, where FULLPATH=path were the musrfit_startup.xml is found
virtual Bool_t StartupFileFound()
true = musrfit_startup.xml found
int parseXmlFile(TSAXParser *, const char *)
virtual void OnCharacters(const Char_t *)
std::vector< Int_t > PIntVector
Definition: PMusr.h:178
PIntVector fMarkerList
marker list
virtual const PIntVector GetMarkerList() const
returns the marker list
virtual void OnEndDocument()
virtual const PRunNameTemplateList GetRunNameTemplateList()
PIntVector fColorList
color list
PMsrFourierStructure fFourierDefaults
Fourier defaults.
PStringVector fDataPathList
search data path list
virtual void OnError(const Char_t *)
TString fCurrentInstrumentName
current instrument name
Bool_t fStartupFileFound
startup file found flag
virtual void OnStartDocument()
virtual PMsrFourierStructure GetFourierDefaults()
returns the Fourier defaults
virtual void CheckLists()
virtual void OnStartElement(const Char_t *, const TList *)
std::vector< TString > PStringVector
Definition: PMusr.h:214
EKeyWords fKey
xml filter key
virtual ~PStartupHandler()
virtual void OnWarning(const Char_t *)
virtual const PIntVector GetColorList() const
returns the color list
virtual void OnCdataBlock(const Char_t *, Int_t)
std::vector< PRunNameTemplate > PRunNameTemplateList
Definition: PMusr.h:891