0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 09:06:21 +01:00
mongodb/db/introspect.cpp
2007-11-04 20:47:12 -05:00

27 lines
671 B
C++

// introspect.cpp
#include "stdafx.h"
#include "introspect.h"
#include "../util/builder.h"
#include "pdfile.h"
#include "jsobj.h"
#include "pdfile.h"
typedef map<string,Cursor*> StringToCursor;
StringToCursor *specialNamespaces;
auto_ptr<Cursor> getSpecialCursor(const char *ns) {
StringToCursor::iterator it = specialNamespaces->find(ns);
return auto_ptr<Cursor>
(it == specialNamespaces->end() ?
0 : it->second->clone());
}
void SingleResultObjCursor::reg(const char *as) {
if( specialNamespaces == 0 )
specialNamespaces = new StringToCursor();
if( specialNamespaces->count(as) == 0 ) {
(*specialNamespaces)[as] = this;
}
}