mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 15:14:07 +02:00
parent
2484016c54
commit
e92b7beeb4
@ -203,6 +203,16 @@ public:
|
|||||||
return m_Data.find_first_not_of(ch, pos);
|
return m_Data.find_first_not_of(ch, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline SizeType FindLastOf(const char *s, SizeType pos = NPos) const
|
||||||
|
{
|
||||||
|
return m_Data.find_last_of(s, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline SizeType FindLastOf(char ch, SizeType pos = NPos) const
|
||||||
|
{
|
||||||
|
return m_Data.find_last_of(ch, pos);
|
||||||
|
}
|
||||||
|
|
||||||
inline String SubStr(SizeType first, SizeType len = NPos) const
|
inline String SubStr(SizeType first, SizeType len = NPos) const
|
||||||
{
|
{
|
||||||
return m_Data.substr(first, len);
|
return m_Data.substr(first, len);
|
||||||
|
@ -51,7 +51,7 @@ PerfdataValue::PerfdataValue(String label, double value, bool counter,
|
|||||||
|
|
||||||
PerfdataValue::Ptr PerfdataValue::Parse(const String& perfdata)
|
PerfdataValue::Ptr PerfdataValue::Parse(const String& perfdata)
|
||||||
{
|
{
|
||||||
size_t eqp = perfdata.FindFirstOf('=');
|
size_t eqp = perfdata.FindLastOf('=');
|
||||||
|
|
||||||
if (eqp == String::NPos)
|
if (eqp == String::NPos)
|
||||||
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid performance data value: " + perfdata));
|
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid performance data value: " + perfdata));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user