mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-13 18:45:10 +01:00
Put quotes around string in toString, boolean is an unsigned value
This commit is contained in:
parent
2475bebb30
commit
7818a6c046
@ -137,7 +137,7 @@ struct ElementTraits<std::string>
|
|||||||
|
|
||||||
static std::string toString(const std::string& value)
|
static std::string toString(const std::string& value)
|
||||||
{
|
{
|
||||||
return value;
|
return '"' + value + '"';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -175,7 +175,7 @@ struct ElementTraits<bool>
|
|||||||
template<>
|
template<>
|
||||||
inline void BSONReader::read<bool>(bool& to)
|
inline void BSONReader::read<bool>(bool& to)
|
||||||
{
|
{
|
||||||
Int32 b;
|
unsigned char b;
|
||||||
_reader >> b;
|
_reader >> b;
|
||||||
to = b != 0;
|
to = b != 0;
|
||||||
}
|
}
|
||||||
@ -183,7 +183,8 @@ inline void BSONReader::read<bool>(bool& to)
|
|||||||
template<>
|
template<>
|
||||||
inline void BSONWriter::write<bool>(bool& from)
|
inline void BSONWriter::write<bool>(bool& from)
|
||||||
{
|
{
|
||||||
_writer << (from ? 0x01 : 0x00);
|
unsigned char b = from ? 0x01 : 0x00;
|
||||||
|
_writer << b;
|
||||||
}
|
}
|
||||||
|
|
||||||
// BSON 32-bit integer
|
// BSON 32-bit integer
|
||||||
|
Loading…
Reference in New Issue
Block a user