mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-22 13:33:52 +03:00
feature #687: Removed unused ObjectXML method
This commit is contained in:
parent
01606d1768
commit
2e9ed0cc9f
@ -94,20 +94,6 @@ public:
|
|||||||
int xpath(unsigned int& value, const char * xpath_expr,
|
int xpath(unsigned int& value, const char * xpath_expr,
|
||||||
const unsigned int& def);
|
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
|
* Gets and sets a xpath attribute, if the attribute is not found a default
|
||||||
* is used
|
* is used
|
||||||
|
@ -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<string> 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 ObjectXML::xpath(time_t& value, const char * xpath_expr, const time_t& def)
|
||||||
{
|
{
|
||||||
int int_val;
|
int int_val;
|
||||||
|
Loading…
Reference in New Issue
Block a user