diff --git a/client/clientOnly.cpp b/client/clientOnly.cpp index dd9597c4732..373af16786d 100644 --- a/client/clientOnly.cpp +++ b/client/clientOnly.cpp @@ -16,6 +16,9 @@ */ #include "../stdafx.h" +#include "../client/dbclient.h" +#include "../db/dbinfo.h" +#include "../db/dbhelpers.h" namespace mongo { @@ -47,4 +50,10 @@ namespace mongo { bool haveLocalShardingInfo( const string& ns ){ return false; } + + auto_ptr Helpers::find( const char *ns , BSONObj query , bool requireIndex ){ + uassert( "Helpers::find can't be used in client" , 0 ); + auto_ptr i; + return i; + } } diff --git a/db/dbhelpers.cpp b/db/dbhelpers.cpp index 0671152b73c..0671aa0368a 100644 --- a/db/dbhelpers.cpp +++ b/db/dbhelpers.cpp @@ -27,22 +27,6 @@ namespace mongo { - CursorIterator::CursorIterator( auto_ptr c ) - : _cursor( c ){ - } - - CursorIterator::~CursorIterator(){ - } - - BSONObj CursorIterator::next(){ - BSONObj o = _cursor->current(); - _cursor->advance(); - return o; - } - bool CursorIterator::hasNext(){ - return _cursor->ok(); - } - void Helpers::ensureIndex(const char *ns, BSONObj keyPattern, bool unique, const char *name) { NamespaceDetails *d = nsdetails(ns); if( d == 0 ) diff --git a/db/dbhelpers.h b/db/dbhelpers.h index 5054f0c49c4..0a08cac587d 100644 --- a/db/dbhelpers.h +++ b/db/dbhelpers.h @@ -34,11 +34,18 @@ namespace mongo { class CursorIterator { public: - CursorIterator( auto_ptr c ); - ~CursorIterator(); + CursorIterator( auto_ptr c ) + : _cursor( c ){ + } - BSONObj next(); - bool hasNext(); + BSONObj next(){ + BSONObj o = _cursor->current(); + _cursor->advance(); + return o; + } + bool hasNext(){ + return _cursor->ok(); + } private: auto_ptr _cursor; };