mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-13 10:32:57 +01:00
Implement toString
This commit is contained in:
parent
7818a6c046
commit
b8e9cc1e23
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user