Cleaning up code, add docs, add getMore sample ...

This commit is contained in:
fbraem
2013-02-15 22:32:24 +01:00
parent 58958d2655
commit bf315df7a6
34 changed files with 801 additions and 402 deletions

View File

@@ -41,6 +41,8 @@
#include "Poco/MongoDB/Binary.h"
#include "Poco/MongoDB/ObjectId.h"
#include "Poco/MongoDB/Array.h"
#include "Poco/MongoDB/RegularExpression.h"
#include "Poco/MongoDB/JavaScriptCode.h"
namespace Poco
{
@@ -56,6 +58,21 @@ Document::~Document()
{
}
Element::Ptr Document::get(const std::string& name)
{
Element::Ptr element;
ElementSet::iterator it = std::find_if(_elements.begin(), _elements.end(), ElementFindByName(name));
if ( it != _elements.end() )
{
return *it;
}
return element;
}
void Document::read(BinaryReader& reader)
{
int size;
@@ -130,7 +147,7 @@ void Document::read(BinaryReader& reader)
}
std::string Document::toString() const
std::string Document::toString(int indent) const
{
std::ostringstream oss;
oss << "{" << std::endl;