EvtGen
2.2.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
Toggle main menu visibility
Loading...
Searching...
No Matches
EvtGenBase
EvtParserXml.hh
Go to the documentation of this file.
1
2
/***********************************************************************
3
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4
* *
5
* This file is part of EvtGen. *
6
* *
7
* EvtGen is free software: you can redistribute it and/or modify *
8
* it under the terms of the GNU General Public License as published by *
9
* the Free Software Foundation, either version 3 of the License, or *
10
* (at your option) any later version. *
11
* *
12
* EvtGen is distributed in the hope that it will be useful, *
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15
* GNU General Public License for more details. *
16
* *
17
* You should have received a copy of the GNU General Public License *
18
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19
***********************************************************************/
20
21
#ifndef EVTPARSERXML_HH
22
#define EVTPARSERXML_HH
23
24
#include <fstream>
25
#include <string>
26
#include <vector>
27
28
class
EvtParserXml
final {
29
public
:
30
bool
open
( std::string filename );
31
bool
close
();
32
33
bool
readNextTag
();
34
35
std::string
getTagTitle
() {
return
m_tagTitle
; }
36
std::string
getParentTagTitle
();
37
int
getLineNumber
() {
return
m_lineNo
; }
38
bool
isTagInline
() {
return
m_inLineTag
; }
39
40
std::string
readAttribute
( std::string attribute,
41
std::string defaultValue =
""
);
42
bool
readAttributeBool
( std::string attribute,
bool
defaultValue =
false
);
43
int
readAttributeInt
( std::string attribute,
int
defaultValue = -1 );
44
double
readAttributeDouble
( std::string attribute,
double
defaultValue = -1. );
45
46
private
:
47
std::ifstream
m_fin
;
48
std::string
m_line
;
49
int
m_lineNo
= 0;
50
51
std::string
m_tag
;
52
std::string
m_tagTitle
;
53
bool
m_inLineTag
;
54
std::vector<std::string>
m_tagTree
;
55
56
bool
processTagTree
();
57
58
bool
expandEnvVars
( std::string& str );
59
bool
isAlphaNum
(
char
c );
60
};
61
62
#endif
EvtParserXml
Definition
EvtParserXml.hh:28
EvtParserXml::readAttribute
std::string readAttribute(std::string attribute, std::string defaultValue="")
Definition
EvtParserXml.cpp:159
EvtParserXml::processTagTree
bool processTagTree()
Definition
EvtParserXml.cpp:210
EvtParserXml::m_lineNo
int m_lineNo
Definition
EvtParserXml.hh:49
EvtParserXml::open
bool open(std::string filename)
Definition
EvtParserXml.cpp:32
EvtParserXml::close
bool close()
Definition
EvtParserXml.cpp:51
EvtParserXml::getLineNumber
int getLineNumber()
Definition
EvtParserXml.hh:37
EvtParserXml::m_inLineTag
bool m_inLineTag
Definition
EvtParserXml.hh:53
EvtParserXml::isAlphaNum
bool isAlphaNum(char c)
Definition
EvtParserXml.cpp:282
EvtParserXml::readAttributeDouble
double readAttributeDouble(std::string attribute, double defaultValue=-1.)
Definition
EvtParserXml.cpp:198
EvtParserXml::readAttributeBool
bool readAttributeBool(std::string attribute, bool defaultValue=false)
Definition
EvtParserXml.cpp:176
EvtParserXml::m_line
std::string m_line
Definition
EvtParserXml.hh:48
EvtParserXml::m_tag
std::string m_tag
Definition
EvtParserXml.hh:51
EvtParserXml::getParentTagTitle
std::string getParentTagTitle()
Definition
EvtParserXml.cpp:151
EvtParserXml::getTagTitle
std::string getTagTitle()
Definition
EvtParserXml.hh:35
EvtParserXml::m_tagTitle
std::string m_tagTitle
Definition
EvtParserXml.hh:52
EvtParserXml::m_tagTree
std::vector< std::string > m_tagTree
Definition
EvtParserXml.hh:54
EvtParserXml::readAttributeInt
int readAttributeInt(std::string attribute, int defaultValue=-1)
Definition
EvtParserXml.cpp:187
EvtParserXml::expandEnvVars
bool expandEnvVars(std::string &str)
Definition
EvtParserXml.cpp:226
EvtParserXml::readNextTag
bool readNextTag()
Definition
EvtParserXml.cpp:57
EvtParserXml::m_fin
std::ifstream m_fin
Definition
EvtParserXml.hh:47
EvtParserXml::isTagInline
bool isTagInline()
Definition
EvtParserXml.hh:38
Generated by
1.17.0