From e793083a0a4f915229235daaf7c4165ef4cb35ca Mon Sep 17 00:00:00 2001 From: fbraem Date: Fri, 1 Mar 2013 21:59:50 +0100 Subject: [PATCH] Correct indentation --- MongoDB/src/Document.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/MongoDB/src/Document.cpp b/MongoDB/src/Document.cpp index 90aa18fbf..6d2c2d98a 100644 --- a/MongoDB/src/Document.cpp +++ b/MongoDB/src/Document.cpp @@ -150,7 +150,13 @@ void Document::read(BinaryReader& reader) std::string Document::toString(int indent) const { std::ostringstream oss; - oss << "{" << std::endl; + + oss << "{"; + if ( indent > 0 ) + { + oss << std::endl; + } + for(ElementSet::const_iterator it = _elements.begin(); it != _elements.end(); ++it) { if ( it != _elements.begin() ) @@ -189,7 +195,8 @@ std::string Document::toString(int indent) const } } - oss << "}" << std::endl; + oss << "}"; + return oss.str(); }