From 2e9ed0cc9fba1347fe04f32734543b4aa288aa6c Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Mon, 4 Jul 2011 22:32:29 +0200 Subject: [PATCH] feature #687: Removed unused ObjectXML method --- include/ObjectXML.h | 14 -------------- src/xml/ObjectXML.cc | 41 ----------------------------------------- 2 files changed, 55 deletions(-) diff --git a/include/ObjectXML.h b/include/ObjectXML.h index d370270226..9be989618b 100644 --- a/include/ObjectXML.h +++ b/include/ObjectXML.h @@ -94,20 +94,6 @@ public: int xpath(unsigned int& value, const char * xpath_expr, const unsigned int& def); - /** - * Gets and sets a xpath attribute, if the attribute is not found a default - * is used - * @param value to set - * @param xpath_expr of the xml element - * @param def default value if the element is not found - * @param hex if true, the contents of the element are expected to be in - * hexadecimal instead of decimal - * - * @return -1 if default was set - */ - long long xpath(long long& value, const char * xpath_expr, - const long long& def, bool hex=true); - /** * Gets and sets a xpath attribute, if the attribute is not found a default * is used diff --git a/src/xml/ObjectXML.cc b/src/xml/ObjectXML.cc index 8e30594b9f..d0704eb9aa 100644 --- a/src/xml/ObjectXML.cc +++ b/src/xml/ObjectXML.cc @@ -222,47 +222,6 @@ int ObjectXML::xpath(unsigned int& value, const char * xpath_expr, /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ -long long ObjectXML::xpath(long long& value, const char * xpath_expr, - const long long& def, bool hex) -{ - vector values; - int rc = 0; - - values = (*this)[xpath_expr]; - - if (values.empty() == true) - { - value = def; - rc = -1; - } - else - { - istringstream iss; - - iss.str(values[0]); - - if ( hex ) - { - iss >> hex >> value; - } - else - { - iss >> dec >> value; - } - - if (iss.fail() == true) - { - value = def; - rc = -1; - } - } - - return rc; -} - -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ - int ObjectXML::xpath(time_t& value, const char * xpath_expr, const time_t& def) { int int_val;