|
| static bool | has_attribute (const XMLCoreNode &node, const std::string &name) |
| static int | get_int (const XMLCoreNode &node, const std::string &name) |
| static double | get_double (const XMLCoreNode &node, const std::string &name) |
| static bool | get_boolean (const XMLCoreNode &node, const std::string &name) |
| static std::string | get_ID (const XMLCoreNode &node, const std::string &name) |
| static std::string | get_value (const XMLCoreNode &node, const std::string &name) |
| static std::string | get_token (const XMLCoreNode &node, const std::string &name) |
| static bool | check_int (const int n, const XMLCoreNode &node, const std::string &name) |
| static bool | check_double (const int n, const XMLCoreNode &node, const std::string &name) |
Definition at line 92 of file IdDictParser.cxx.
◆ check_double()
| bool XMLCoreFactory::check_double |
( |
const int | n, |
|
|
const XMLCoreNode & | node, |
|
|
const std::string & | name ) |
|
staticinherited |
Definition at line 183 of file XMLCoreParser.cxx.
183 {
184 std::string checkstring =
get_value (node, name);
186
187
188
189
190
191 std::string
t = checkstring +
" " + checkstring;
192 std::istringstream tmpstr (
t.c_str());
193 while (tmpstr.good ()) {
194 double ii{};
196 tmpstr >> ii;
197 }
198 if (counter/2 != n) {
199 std::cerr <<
"XMLCoreFactory::check_double error: (" <<
counter <<
") no " <<
n
200 << " doubles in \"" << checkstring << "\" for attribute " <<
201 name <<
". exit." << std::endl;
203 std::string volume =
get_value (node,
"volume");
204 if (name1 !=
"" ) std::cerr <<
"for name=" <<
name << std::endl;
205 if (volume != "" ) std::cerr << "for volume=" << volume << std::endl;
206 std::abort();
207 }
208 return true;
209}
static std::string get_value(const XMLCoreNode &node, const std::string &name)
◆ check_int()
| bool XMLCoreFactory::check_int |
( |
const int | n, |
|
|
const XMLCoreNode & | node, |
|
|
const std::string & | name ) |
|
staticinherited |
Definition at line 151 of file XMLCoreParser.cxx.
151 {
152 std::string checkstring =
get_value (node, name);
154
155
156
157
158
159 std::string
t = checkstring +
" " + checkstring;
160 std::istringstream tmpstr (
t.c_str());
161 while (tmpstr.good ()) {
162 int ii;
164 tmpstr >> ii;
165 }
166 if (counter/2 != n) {
167 std::cerr <<
"XMLCoreFactory::check_int error: no " <<
n
168 << " ints in \"" << checkstring << "\" for attribute " <<
169 name <<
". exit." << std::endl;
170
171 std::string nodename =
get_value (node,
"name");
172 std::string volume =
get_value (node,
"volume");
173
174 if (nodename != "" ) std::cerr << "for name=" << nodename << std::endl;
175 if (volume != "" ) std::cerr << "for volume=" << volume << std::endl;
176
177 std::abort();
178 }
179 return true;
180}
◆ comment()
| void XMLCoreFactory::comment |
( |
XMLCoreParser & | parser, |
|
|
const std::string & | comment ) |
|
inherited |
Definition at line 57 of file XMLCoreParser.cxx.
57 {
58 if (XMLCoreParserDebugger::debug ()){
59 std::cout << "XMLCoreFactory::comment>" << std::endl;
60 }
62}
virtual void do_comment(XMLCoreParser &parser, const std::string &comment)
void comment(XMLCoreParser &parser, const std::string &comment)
◆ do_comment()
| void XMLCoreFactory::do_comment |
( |
XMLCoreParser & | parser, |
|
|
const std::string & | comment ) |
|
virtualinherited |
Definition at line 79 of file XMLCoreParser.cxx.
79 {
80 if (XMLCoreParserDebugger::debug ()){
81 std::cout << "XMLCoreFactory::do_comment>" << std::endl;
82 }
83}
◆ do_end()
Reimplemented from XMLCoreFactory.
Definition at line 157 of file IdDictParser.cxx.
157 {
158 idd_end (
static_cast<IdDictParser&
>(parser), node);
160}
virtual void idd_end(IdDictParser &parser, const XMLCoreNode &node)
◆ do_start()
Reimplemented from XMLCoreFactory.
Definition at line 150 of file IdDictParser.cxx.
151 {
153 idd_start (
static_cast<IdDictParser&
>(parser), node);
154}
virtual void idd_start(IdDictParser &parser, const XMLCoreNode &node)
◆ end()
Definition at line 49 of file XMLCoreParser.cxx.
49 {
50 if (XMLCoreParserDebugger::debug ()){
51 std::cout << "XMLCoreFactory::end>" << std::endl;
52 }
54}
virtual void do_end(XMLCoreParser &parser, const XMLCoreNode &node)
◆ get_boolean()
| bool XMLCoreFactory::get_boolean |
( |
const XMLCoreNode & | node, |
|
|
const std::string & | name ) |
|
staticinherited |
Definition at line 107 of file XMLCoreParser.cxx.
107 {
110 if (s ==
"TRUE")
result =
true;
111 return (result);
112}
static std::string get_token(const XMLCoreNode &node, const std::string &name)
◆ get_double()
| double XMLCoreFactory::get_double |
( |
const XMLCoreNode & | node, |
|
|
const std::string & | name ) |
|
staticinherited |
Definition at line 99 of file XMLCoreParser.cxx.
99 {
102 sscanf (
s.c_str (),
"%80lg", &result);
103 return (result);
104}
◆ get_ID()
| std::string XMLCoreFactory::get_ID |
( |
const XMLCoreNode & | node, |
|
|
const std::string & | name ) |
|
staticinherited |
◆ get_int()
| int XMLCoreFactory::get_int |
( |
const XMLCoreNode & | node, |
|
|
const std::string & | name ) |
|
staticinherited |
Definition at line 91 of file XMLCoreParser.cxx.
91 {
94 sscanf (
s.c_str (),
"%80d", &result);
95 return (result);
96}
◆ get_token()
| std::string XMLCoreFactory::get_token |
( |
const XMLCoreNode & | node, |
|
|
const std::string & | name ) |
|
staticinherited |
Definition at line 134 of file XMLCoreParser.cxx.
134 {
136
137 while ((
result.length () > 0) &&
139
140 while ((
result.length () > 0) &&
142
143 for (std::string::size_type i = 0;
i <
result.length (); ++
i){
144 result[
i] = std::toupper (result[i]);
145 }
146 return (result);
147}
◆ get_value()
| std::string XMLCoreFactory::get_value |
( |
const XMLCoreNode & | node, |
|
|
const std::string & | name ) |
|
staticinherited |
Definition at line 120 of file XMLCoreParser.cxx.
120 {
121 if (XMLCoreParserDebugger::debug ()){
122 std::cout <<
"XMLCoreFactory::get_value> name=" <<
name << std::endl;
123 }
127 if (XMLCoreParserDebugger::debug ()) {
128 std::cout <<
"XMLCoreFactory::get_value>2 value=" <<
result << std::endl;
129 }
130 return (result);
131}
const std::string & get_attrib(const std::string &name) const
Retrieve the value of an attribute.
bool has_attrib(const std::string &name) const
Test for presence of an attribute with a given name.
◆ has_attribute()
| bool XMLCoreFactory::has_attribute |
( |
const XMLCoreNode & | node, |
|
|
const std::string & | name ) |
|
staticinherited |
◆ idd_end()
◆ idd_start()
◆ start()
Definition at line 41 of file XMLCoreParser.cxx.
41 {
42 if (XMLCoreParserDebugger::debug ()){
43 std::cout << "XMLCoreFactory::start> factory=" << this << std::endl;
44 }
46}
virtual void do_start(XMLCoreParser &parser, const XMLCoreNode &node)
◆ m_xmlelementname
| std::string XMLCoreFactory::m_xmlelementname |
|
protectedinherited |
The documentation for this class was generated from the following file: