Implement String::ToDouble().

Fixes #3544.
This commit is contained in:
Gunnar Beutner 2013-01-21 13:44:17 +01:00
parent d4a6d68ef0
commit 9c74bfd5be
2 changed files with 7 additions and 0 deletions

View File

@ -159,6 +159,11 @@ String::ConstIterator String::End(void) const
return m_Data.end(); return m_Data.end();
} }
double String::ToDouble(void) const
{
return strtod(CStr(), NULL);
}
ostream& icinga::operator<<(ostream& stream, const String& str) ostream& icinga::operator<<(ostream& stream, const String& str)
{ {
stream << static_cast<std::string>(str); stream << static_cast<std::string>(str);

View File

@ -87,6 +87,8 @@ public:
Iterator End(void); Iterator End(void);
ConstIterator End(void) const; ConstIterator End(void) const;
double ToDouble(void) const;
static const size_t NPos; static const size_t NPos;
private: private: