mirror of
https://github.com/pocoproject/poco.git
synced 2025-04-19 07:47:09 +02:00
#3505: JSON::PrintHandler.value(bool) prints incorrect value
This commit is contained in:
parent
516eebad72
commit
00d5e7171a
@ -71,7 +71,7 @@ bool PrintHandler::printFlat() const
|
|||||||
unsigned PrintHandler::indent()
|
unsigned PrintHandler::indent()
|
||||||
{
|
{
|
||||||
if (!printFlat()) return _indent;
|
if (!printFlat()) return _indent;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,9 +119,9 @@ void PrintHandler::endArray()
|
|||||||
void PrintHandler::key(const std::string& k)
|
void PrintHandler::key(const std::string& k)
|
||||||
{
|
{
|
||||||
if (!_objStart) comma();
|
if (!_objStart) comma();
|
||||||
|
|
||||||
_objStart = true;
|
_objStart = true;
|
||||||
|
|
||||||
_out << _tab;
|
_out << _tab;
|
||||||
Stringifier::formatString(k, _out, _options);
|
Stringifier::formatString(k, _out, _options);
|
||||||
if (!printFlat()) _out << ' ';
|
if (!printFlat()) _out << ' ';
|
||||||
@ -191,7 +191,7 @@ void PrintHandler::value(double d)
|
|||||||
void PrintHandler::value(bool b)
|
void PrintHandler::value(bool b)
|
||||||
{
|
{
|
||||||
arrayValue();
|
arrayValue();
|
||||||
_out << b;
|
_out << (b ? "true" : "false");
|
||||||
_objStart = false;
|
_objStart = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ void PrintHandler::comma()
|
|||||||
void PrintHandler::arrayValue()
|
void PrintHandler::arrayValue()
|
||||||
{
|
{
|
||||||
if (!_objStart) comma();
|
if (!_objStart) comma();
|
||||||
if (array())
|
if (array())
|
||||||
{
|
{
|
||||||
_out << _tab;
|
_out << _tab;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user