![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
45 other.m_node =
nullptr;
67 std::cout <<
"XMLCoreFactory::~XMLCoreFactory> factory=" <<
this << std::endl;
75 std::cout <<
"XMLCoreFactory::start> factory=" <<
this << std::endl;
85 std::cout <<
"XMLCoreFactory::end>" << std::endl;
95 std::cout <<
"XMLCoreFactory::comment>" << std::endl;
105 std::cout <<
"XMLCoreFactory::do_start>" << std::endl;
113 std::cout <<
"XMLCoreFactory::do_end>" << std::endl;
121 std::cout <<
"XMLCoreFactory::do_comment>" << std::endl;
129 return (
attrs.size ());
136 CoreParser::DOMNamedNodeMap::const_iterator
it =
attrs.find (
name);
138 if (
it ==
attrs.end ())
return (
false);
147 sscanf (
s.c_str (),
"%80d", &
result);
157 sscanf (
s.c_str (),
"%80lg", &
result);
168 if (
s ==
"TRUE")
result =
true;
184 std::cout <<
"XMLCoreFactory::get_value> name=" <<
name << std::endl;
189 CoreParser::DOMNamedNodeMap::const_iterator
it =
attrs.find (
name);
191 if (
it ==
attrs.end ())
return (
"");
193 std::string
result = (*it).second;
197 std::cout <<
"XMLCoreFactory::get_value>2 value=" <<
result << std::endl;
205 std::string
result =
node.get_node ().get_name ();
212 return (
node.get_node ().sibling_number ());
219 CoreParser::DOMNamedNodeMap::const_iterator
it;
226 if (
it ==
attrs.end ())
return (
"");
228 std::string
result = (*it).first;
239 while ((
result.length () > 0) &&
242 while ((
result.length () > 0) &&
247 for (std::string::size_type
i = 0;
i <
result.length (); ++
i)
249 static const std::string uc =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
250 static const std::string
lc =
"abcdefghijklmnopqrstuvwxyz";
252 std::string::size_type
p =
lc.find (
c);
270 std::string
t = checkstring +
" " + checkstring;
272 std::istringstream tmpstr (
t.c_str());
273 while (tmpstr.good ())
283 std::cerr <<
"XMLCoreFactory::check_int error: no " <<
n
284 <<
" ints in \"" << checkstring <<
"\" for attribute " <<
285 name <<
". exit." << std::endl;
290 if (nodename !=
"" ) std::cerr <<
"for name=" << nodename << std::endl;
291 if (volume !=
"" ) std::cerr <<
"for volume=" << volume << std::endl;
309 std::string
t = checkstring +
" " + checkstring;
311 std::istringstream tmpstr (
t.c_str());
312 while (tmpstr.good ())
323 std::cerr <<
"XMLCoreFactory::check_double error: (" <<
counter <<
") no " <<
n
324 <<
" doubles in \"" << checkstring <<
"\" for attribute " <<
325 name <<
". exit." << std::endl;
330 if (
name1 !=
"" ) std::cerr <<
"for name=" <<
name << std::endl;
331 if (volume !=
"" ) std::cerr <<
"for volume=" << volume << std::endl;
377 if (
doc != 0)
doc->print (
"============ ALL =============");
386 std::cout <<
"XMLCoreParser::visit file_name "
396 std::cout <<
"XMLCoreParser::visit node=" << nptr << std::endl;
409 const std::string& nodeName =
node.get_name();
410 const std::string& nodeValue =
node.get_value();
414 std::cout <<
"XMLCoreParser::visit node(" << nptr <<
") " << nodeName << std::endl;
421 std::cout <<
"XMLCoreParser::visit factory " << factory << std::endl;
424 switch (
node.get_type())
440 std::cout <<
"XMLCoreParser::visit ELEMENT_NODE "
441 <<
" factory=" << factory
445 if (factory != 0) factory->
start (*
this, core_node);
448 std::cerr <<
"XMLCoreParser> Cannot find factory for element "
449 << nodeName << std::endl;
459 if (factory != 0) factory->
end (*
this, core_node);
465 if (factory != 0) factory->
comment (*
this, nodeValue);
470 std::cout <<
"ENTITY_NODE " << nodeValue << std::endl;
475 std::cout <<
"ENTITY_REFERENCE_NODE " << nodeValue << std::endl;
479 std::cerr <<
"Unrecognized node type = "
480 << (long)
node.get_type() << std::endl;
486 std::cout <<
"XMLCoreParser::visit-2" << std::endl;
496 std::unique_ptr<XMLCoreFactory> factory)
500 std::cout <<
"XMLCoreFactory::register_factory> name=" <<
name
501 <<
" factory=" << factory.get() << std::endl;
511 std::cout <<
"XMLCoreParser::register_external_entity> name=" <<
name
512 <<
" file_name=" <<
file_name << std::endl;
522 std::cout <<
"XMLCoreParser::register_text_entity> name=" <<
name
535 return (*it).second.get();
XMLCoreFactory * find_factory(const std::string &name)
JetConstituentVector::iterator iterator
XMLCoreNode parse(const std::string &file_name)
virtual void do_comment(XMLCoreParser &parser, const std::string &comment)
XMLCoreNode & operator=(const XMLCoreNode &other)
std::vector< DOMNode * > DOMSiblings
static bool has_attribute(const XMLCoreNode &node, const std::string &name)
void start(XMLCoreParser &parser, const XMLCoreNode &node)
std::map< std::string, std::string > DOMNamedNodeMap
static int get_int(const XMLCoreNode &node, const std::string &name)
static bool get_boolean(const XMLCoreNode &node, const std::string &name)
static bool check_int(const int n, const XMLCoreNode &node, const std::string &name)
void register_text_entity(const std::string &name, const std::string &text)
void set_validation_scheme(const char *parm)
std::unique_ptr< XMLCoreFactory > m_default_factory
static void register_text_entity(const std::string &name, const std::string &text)
static std::string get_value(const XMLCoreNode &node, const std::string &name)
static int attribute_number(const XMLCoreNode &node)
virtual void do_start(XMLCoreParser &parser, const XMLCoreNode &node)
void register_factory(const std::string &name, std::unique_ptr< XMLCoreFactory > factory)
void end(XMLCoreParser &parser, const XMLCoreNode &node)
const CoreParser::DOMNode * m_node
static bool check_double(const int n, const XMLCoreNode &node, const std::string &name)
static std::string get_ID(const XMLCoreNode &node, const std::string &name)
void register_default_factory(std::unique_ptr< XMLCoreFactory > factory)
void set_validation_schema_full_checking()
static bool get_debug_state()
std::string getenv(const std::string &variableName)
get an environment variable
static std::unique_ptr< CoreParser::DOMNode > parse(const std::string &file_name)
void set_create_entity_reference_nodes()
virtual ~XMLCoreFactory()
const CoreParser::DOMNode & get_node() const
void register_external_entity(const std::string &name, const std::string &file_name)
static void register_external_entity(const std::string &name, const std::string &file_name)
static std::string get_token(const XMLCoreNode &node, const std::string &name)
int sibling_number(const XMLCoreNode &node)
std::string get_name(const XMLCoreNode &node)
void comment(XMLCoreParser &parser, const std::string &comment)
static double get_double(const XMLCoreNode &node, const std::string &name)
void visit(const std::string &file_name)
virtual void do_end(XMLCoreParser &parser, const XMLCoreNode &node)