Skip to content
Snippets Groups Projects

Minor cleaning of the XMLHandler

Merged Johannes Junggeburth requested to merge MinorXMLHandlerClean into main
2 files
+ 140
147
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -17,59 +17,68 @@ class XMLHandlerStore;
class XMLHandler {
public:
XMLHandler(std::string n);
virtual ~XMLHandler() {}
std::string GetName() {return m_name;}
virtual void ElementHandle()=0;
virtual void Handle(xercesc::DOMNode *t)
{
SetCurrentElement(t);
ElementHandle();
}
void StopLoop(bool);
bool IsLoopToBeStopped();
virtual void postLoopHandling() {;}
XMLHandler(const std::string& n);
virtual ~XMLHandler() {}
const std::string& GetName() const {return m_name;}
virtual void ElementHandle()=0;
virtual void Handle(xercesc::DOMNode *t)
{
SetCurrentElement(t);
ElementHandle();
}
void StopLoop(bool);
bool IsLoopToBeStopped() const;
virtual void postLoopHandling() {;}
protected:
std::string m_name;
bool m_stopLoop;
std::string m_name;
bool m_stopLoop{false};
static xercesc::DOMNode *s_currentElement;
static void SetCurrentElement(xercesc::DOMNode *t) {s_currentElement=t;}
static xercesc::DOMNode *GetCurrentElement() {return s_currentElement;}
static xercesc::DOMNode *s_currentElement;
static void SetCurrentElement(xercesc::DOMNode *t) {s_currentElement=t;}
static xercesc::DOMNode *GetCurrentElement() {return s_currentElement;}
bool isAttribute(const std::string) const;
bool isAttribute(const std::string& attributeName) const;
std::string getAttribute(const std::string, bool&) const;
std::string getAttributeAsString(const std::string) const;
double getAttributeAsDouble(const std::string) const;
float getAttributeAsFloat(const std::string) const;
int getAttributeAsInt(const std::string) const;
long getAttributeAsLong(const std::string) const;
std::vector<double> getAttributeAsVector(const std::string) const;
std::vector<int> getAttributeAsIntVector(const std::string) const;
std::string getAttributeAsString(const std::string, bool&) const;
double getAttributeAsDouble(const std::string, bool&) const;
float getAttributeAsFloat(const std::string, bool&) const;
int getAttributeAsInt(const std::string, bool&) const;
long getAttributeAsLong(const std::string, bool&) const;
std::vector<double> getAttributeAsVector(const std::string, bool&) const;
std::vector<int> getAttributeAsIntVector(const std::string, bool&) const;
std::string getAttributeAsString(const std::string, const std::string) const;
double getAttributeAsDouble(const std::string, const double) const;
float getAttributeAsFloat(const std::string, const float) const;
int getAttributeAsInt(const std::string, const int) const;
long getAttributeAsLong(const std::string, const long) const;
std::vector<double> getAttributeAsVector(const std::string, const std::vector<double>) const;
std::vector<int> getAttributeAsIntVector(const std::string, const std::vector<int>) const;
static bool s_printFlag;
std::string getAttribute(const std::string& attributeName, bool& attrIsPresent) const;
std::string getAttributeAsString(const std::string& attributeName) const;
double getAttributeAsDouble(const std::string& attributeName) const;
float getAttributeAsFloat(const std::string& attributeName) const;
int getAttributeAsInt(const std::string& attributeName) const;
long getAttributeAsLong(const std::string& attributeName) const;
std::vector<double> getAttributeAsVector(const std::string& attributeName) const;
std::vector<int> getAttributeAsIntVector(const std::string& attributeName) const;
std::string getAttributeAsString(const std::string& attributeName, bool& attrIsPresent) const;
double getAttributeAsDouble(const std::string& attributeName, bool& attrIsPresent) const;
float getAttributeAsFloat(const std::string& attributeName, bool& attrIsPresent) const;
int getAttributeAsInt(const std::string& attributeName, bool& attrIsPresent) const;
long getAttributeAsLong(const std::string& attributeName, bool& attrIsPresent) const;
std::vector<double> getAttributeAsVector(const std::string& attributeName, bool& attrIsPresent) const;
std::vector<int> getAttributeAsIntVector(const std::string& attributeName, bool& attrIsPresent) const;
std::string getAttributeAsString(const std::string& attributeName, const std::string& fallBackVal) const;
double getAttributeAsDouble(const std::string& attributeName, const double fallBackVal) const;
float getAttributeAsFloat(const std::string& attributeName, const float fallBackVal) const;
int getAttributeAsInt(const std::string& attributeName, const int fallBackVal) const;
long getAttributeAsLong(const std::string& attributeName, const long fallBackVal) const;
std::vector<double> getAttributeAsVector(const std::string& attributeName,
const std::vector<double>& fallBackVal) const;
std::vector<int> getAttributeAsIntVector(const std::string& attributeName,
const std::vector<int>& fallBackVal) const;
static bool s_printFlag;
ExpressionEvaluator* Evaluator() const {
static ExpressionEvaluator* eval=ExpressionEvaluator::GetEvaluator();
return eval;
}
ExpressionEvaluator* Evaluator() const
{
static ExpressionEvaluator* eval=ExpressionEvaluator::GetEvaluator();
return eval;
}
private:
void RegisterToStore();
};
} // end namespace
Loading