Implement toString

This commit is contained in:
fbraem 2013-02-14 22:50:55 +01:00
parent 7818a6c046
commit b8e9cc1e23

View File

@ -34,6 +34,7 @@
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
#include <sstream>
#include "Poco/MongoDB/Array.h"
@ -49,4 +50,22 @@ Array::~Array()
{
}
std::string Array::toString() const
{
std::ostringstream oss;
oss << "[" << std::endl;
for(ElementSet::const_iterator it = _elements.begin(); it != _elements.end(); ++it)
{
if ( it != _elements.begin() )
{
oss << ", ";
}
oss << (*it)->toString();
}
oss << "]" << std::endl;
return oss.str();
}
}} // Namespace Poco::Mongo