summaryrefslogtreecommitdiff
path: root/tools/Tool.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/Tool.h')
-rw-r--r--tools/Tool.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/Tool.h b/tools/Tool.h
index 8f7b2fa76c6..a579ad9afd6 100644
--- a/tools/Tool.h
+++ b/tools/Tool.h
@@ -11,6 +11,7 @@
#endif
#include "client/dbclient.h"
+#include "db/instance.h"
using std::string;
@@ -48,17 +49,21 @@ namespace mongo {
}
virtual int run() = 0;
-
+
virtual void printExtraHelp( ostream & out );
protected:
string _name;
- mongo::DBClientConnection _conn;
string _db;
string _coll;
+ mongo::DBClientBase &conn() { return _useDirect ? (mongo::DBClientBase&)_direct : (mongo::DBClientBase&)_conn; };
+
private:
+ mongo::DBClientConnection _conn;
+ mongo::DBDirectClient _direct;
+ bool _useDirect;
boost::program_options::options_description * _options;
boost::program_options::positional_options_description _positonalOptions;