|
| static std::string | get_name (const XMLCoreNode &node, int index) |
| static int | attribute_number (const XMLCoreNode &node) |
| 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 56 of file IdDictParser.cxx.
◆ attribute_number()
| int XMLCoreFactory::attribute_number |
( |
const XMLCoreNode & | node | ) |
|
|
staticinherited |
Definition at line 111 of file XMLCoreParser.cxx.
111 {
113 return (
attrs.size ());
114}
std::map< std::string, std::string > DOMNamedNodeMap
◆ check_double()
| bool XMLCoreFactory::check_double |
( |
const int | n, |
|
|
const XMLCoreNode & | node, |
|
|
const std::string & | name ) |
|
staticinherited |
Definition at line 239 of file XMLCoreParser.cxx.
239 {
240 std::string checkstring =
get_value (node, name);
242
243
244
245
246
247 std::string
t = checkstring +
" " + checkstring;
248 std::istringstream tmpstr (
t.c_str());
249 while (tmpstr.good ()) {
250 double ii{};
252 tmpstr >> ii;
253 }
254 if (counter/2 != n) {
255 std::cerr <<
"XMLCoreFactory::check_double error: (" <<
counter <<
") no " <<
n
256 << " doubles in \"" << checkstring << "\" for attribute " <<
257 name <<
". exit." << std::endl;
259 std::string volume =
get_value (node,
"volume");
260 if (name1 !=
"" ) std::cerr <<
"for name=" <<
name << std::endl;
261 if (volume != "" ) std::cerr << "for volume=" << volume << std::endl;
262 std::abort();
263 }
264 return true;
265}
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 207 of file XMLCoreParser.cxx.
207 {
208 std::string checkstring =
get_value (node, name);
210
211
212
213
214
215 std::string
t = checkstring +
" " + checkstring;
216 std::istringstream tmpstr (
t.c_str());
217 while (tmpstr.good ()) {
218 int ii;
220 tmpstr >> ii;
221 }
222 if (counter/2 != n) {
223 std::cerr <<
"XMLCoreFactory::check_int error: no " <<
n
224 << " ints in \"" << checkstring << "\" for attribute " <<
225 name <<
". exit." << std::endl;
226
227 std::string nodename =
get_value (node,
"name");
228 std::string volume =
get_value (node,
"volume");
229
230 if (nodename != "" ) std::cerr << "for name=" << nodename << std::endl;
231 if (volume != "" ) std::cerr << "for volume=" << volume << std::endl;
232
233 std::abort();
234 }
235 return true;
236}
◆ comment()
| void XMLCoreFactory::comment |
( |
XMLCoreParser & | parser, |
|
|
const std::string & | comment ) |
|
inherited |
Definition at line 82 of file XMLCoreParser.cxx.
82 {
83 if (XMLCoreParserDebugger::debug ()){
84 std::cout << "XMLCoreFactory::comment>" << std::endl;
85 }
87}
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 104 of file XMLCoreParser.cxx.
104 {
105 if (XMLCoreParserDebugger::debug ()){
106 std::cout << "XMLCoreFactory::do_comment>" << std::endl;
107 }
108}
◆ 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 74 of file XMLCoreParser.cxx.
74 {
75 if (XMLCoreParserDebugger::debug ()){
76 std::cout << "XMLCoreFactory::end>" << std::endl;
77 }
79}
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 141 of file XMLCoreParser.cxx.
141 {
144 if (s ==
"TRUE")
result =
true;
145 return (result);
146}
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 133 of file XMLCoreParser.cxx.
133 {
136 sscanf (
s.c_str (),
"%80lg", &result);
137 return (result);
138}
◆ 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 125 of file XMLCoreParser.cxx.
125 {
128 sscanf (
s.c_str (),
"%80d", &result);
129 return (result);
130}
◆ get_name() [1/2]
| std::string XMLCoreFactory::get_name |
( |
const XMLCoreNode & | node | ) |
|
|
inherited |
◆ get_name() [2/2]
| std::string XMLCoreFactory::get_name |
( |
const XMLCoreNode & | node, |
|
|
int | index ) |
|
staticinherited |
Definition at line 179 of file XMLCoreParser.cxx.
179 {
181 CoreParser::DOMNamedNodeMap::const_iterator
it;
182 for (it =
attrs.begin (); (index > 0) && (it !=
attrs.end ()); ++it){
184 }
185 if (it ==
attrs.end ())
return (
"");
187}
◆ get_token()
| std::string XMLCoreFactory::get_token |
( |
const XMLCoreNode & | node, |
|
|
const std::string & | name ) |
|
staticinherited |
Definition at line 190 of file XMLCoreParser.cxx.
190 {
192
193 while ((
result.length () > 0) &&
195
196 while ((
result.length () > 0) &&
198
199 for (std::string::size_type i = 0;
i <
result.length (); ++
i){
200 result[
i] = std::toupper (result[i]);
201 }
202 return (result);
203}
◆ get_value()
| std::string XMLCoreFactory::get_value |
( |
const XMLCoreNode & | node, |
|
|
const std::string & | name ) |
|
staticinherited |
Definition at line 154 of file XMLCoreParser.cxx.
154 {
155 if (XMLCoreParserDebugger::debug ()){
156 std::cout <<
"XMLCoreFactory::get_value> name=" <<
name << std::endl;
157 }
159 CoreParser::DOMNamedNodeMap::const_iterator
it =
attrs.find (name);
160 if (it ==
attrs.end ())
return (
"");
161 std::string
result = (*it).second;
162 if (XMLCoreParserDebugger::debug ()) {
163 std::cout <<
"XMLCoreFactory::get_value>2 value=" <<
result << std::endl;
164 }
165 return (result);
166}
◆ has_attribute()
| bool XMLCoreFactory::has_attribute |
( |
const XMLCoreNode & | node, |
|
|
const std::string & | name ) |
|
staticinherited |
Definition at line 117 of file XMLCoreParser.cxx.
117 {
119 CoreParser::DOMNamedNodeMap::const_iterator
it =
attrs.find (name);
120 if (it ==
attrs.end ())
return (
false);
121 return (true);
122}
◆ idd_end()
◆ idd_start()
◆ sibling_number()
| int XMLCoreFactory::sibling_number |
( |
const XMLCoreNode & | node | ) |
|
|
inherited |
◆ start()
Definition at line 66 of file XMLCoreParser.cxx.
66 {
67 if (XMLCoreParserDebugger::debug ()){
68 std::cout << "XMLCoreFactory::start> factory=" << this << std::endl;
69 }
71}
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: