Add double conversion for PropertyStream map items

This commit is contained in:
Vinnie Falco
2013-11-30 17:23:43 -08:00
parent 89aa2c7a6a
commit 0f2a657196
4 changed files with 12 additions and 0 deletions

View File

@@ -62,6 +62,7 @@ protected:
virtual void add (std::string const& key, uint32 value);
virtual void add (std::string const& key, int64 value);
virtual void add (std::string const& key, uint64 value);
virtual void add (std::string const& key, double value);
virtual void array_begin () = 0;
virtual void array_begin (std::string const& key) = 0;

View File

@@ -390,6 +390,11 @@ void PropertyStream::add (std::string const& key, int64 value)
}
}
void PropertyStream::add (std::string const& key, double value)
{
lexical_add (key, value);
}
void PropertyStream::add (std::string const& key, uint64 value)
{
if (value <= std::numeric_limits <uint32>::max() &&

View File

@@ -40,6 +40,7 @@ protected:
void map_end ();
void add (std::string const& key, int32 v);
void add (std::string const& key, uint32 v);
void add (std::string const& key, double v);
void add (std::string const& key, std::string const& v);
void array_begin ();
void array_begin (std::string const& key);

View File

@@ -62,6 +62,11 @@ void JsonPropertyStream::add (std::string const& key, uint32 v)
(*m_stack.back())[key] = v;
}
void JsonPropertyStream::add (std::string const& key, double v)
{
(*m_stack.back())[key] = v;
}
void JsonPropertyStream::add (std::string const& key, std::string const& v)
{
(*m_stack.back())[key] = v;