16 _doc(NULL), _fileName( fileName ) {
32 str <<
"XMLFixCollTypes::parse error in file [" <<
_fileName
52 while( (section = root->
IterateChildren(
"processor", section ) ) != 0 ){
62 std::cout <<
" processor : " << procName <<
" ( type: " << type <<
" ) " ;
64 if( processor != 0 ) {
99 std::cout <<
" -- fixing wrong lcioInType : " << inType
107 collectionNames.
insert( name ) ;
129 std::cout <<
" -- fixing wrong lcioOutType : " << outType
137 collectionNames.
insert( name ) ;
142 typedef ProcParamMap::const_iterator PMI ;
150 collectionNames.
find( p->
name() ) == collectionNames.
end() ) {
174 std::cout <<
" --- adding new collection parameter '" << p->
name()
223 throw ParseException(
"XMLFixCollTypes::getAttribute not an XMLElement " ) ;
230 str <<
"XMLFixCollTypes::getAttribute missing attribute \"" << name
231 <<
"\" in element <" << el->
Value() <<
"/> in file " <<
_fileName ;
245 bool elementFound = false ;
250 elementFound = true ;
virtual const std::string type()=0
std::string getLCIOOutType(const std::string &colName)
Return the LCIO output type for the collection colName - empty string if colName is not a registered ...
virtual ~XMLFixCollTypes()
const TiXmlElement * RootElement() const
Get the root element – the only top level element – of the document.
static ProcessorMgr * instance()
Return the instance of this manager.
std::string getLCIOInType(const std::string &colName)
Return the LCIO input type for the collection colName - empty string if colName is not a registered c...
ParseException used for parse errors, e.g.
TiXmlNode * findElement(TiXmlNode *node, const std::string &type, const std::string &attribute, const std::string &value)
Helper method - finds child element of node with given type and attribute value.
bool LoadFile(TiXmlEncoding encoding=TIXML_DEFAULT_ENCODING)
Load a file using the current document value.
void SetValue(const char *_value)
Changes the value of the node.
int ErrorCol() const
The column where the error occured. See ErrorRow()
TiXmlNode * InsertEndChild(const TiXmlNode &addThis)
Add a new node related to this.
TiXmlNode * InsertBeforeChild(TiXmlNode *beforeThis, const TiXmlNode &addThis)
Add a new node related to this.
Processor * getProcessor(const std::string &type)
Return the processor that has been registered with the given type.
virtual const std::string & name()
bool isInputCollectionName(const std::string ¶meterName)
True if the given parameter defines an LCIO input collection, i.e.
int ErrorRow() const
Returns the location (if known) of the error.
const char * ErrorDesc() const
Contains a textual (english) description of the error if one occurs.
void SetAttribute(const char *name, const char *_value)
Sets an attribute of name to a given value.
bool SaveFile() const
Save a file using the current document value. Returns true if successful.
Always the top level node.
bool isOutputCollectionName(const std::string ¶meterName)
True if the given parameter defines an LCIO output collection.
virtual const TiXmlElement * ToElement() const
Cast to a more defined type. Will return null if not of the requested type.
virtual const std::string & description()
void parse(const std::string &filename)
Parse the input file and write the fixed outputfile to filename.
Class that holds a steering variable for a marlin processor - automatically created by Processor::reg...
virtual const std::string defaultValue()=0
const ProcParamMap & procMap()
Helper function for fixing old steering files.
The parent class for everything in the Document Object Model.
const char * getAttribute(TiXmlNode *node, const std::string &name)
Return named attribute - throws ParseException if attribute doesn't exist.
const TiXmlNode * IterateChildren(const TiXmlNode *previous) const
An alternate way to walk the children of a node.
Base class for Marlin processors.
const char * Value() const
The meaning of 'value' changes for the specific type of TiXmlNode.
const char * Attribute(const char *name) const
Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists.
The element is a container class.