22 #include "mongo/bson/bsonelement.h"
26 int getGtLtOp(
const BSONElement& e);
40 BSONObj order()
const {
return _order; }
45 typedef std::set<BSONObj,BSONObjCmp> BSONObjSet;
47 enum FieldCompareResult {
56 FieldCompareResult compareDottedFieldNames(
const std::string& l ,
const std::string& r ,
57 const LexNumCmp& cmp );
72 #define BSON(x) (( mongo::BSONObjBuilder(64) << x ).obj())
79 #define BSON_ARRAY(x) (( mongo::BSONArrayBuilder() << x ).arr())
116 explicit Label(
const char *l ) : l_( l ) {}
136 explicit BSONSymbol(
const StringData& sym) :symbol(sym) {}
142 explicit BSONCode(
const StringData& str) :code(str) {}
155 explicit BSONRegEx(
const StringData& pat,
const StringData& f=
"") :pattern(pat), flags(f) {}
162 BSONBinData(
const void* d,
int l, BinDataType t) :data(d), length(l), type(t) {}
170 BSONDBRef(
const StringData& nameSpace,
const OID& o) :ns(nameSpace), oid(o) {}
214 void endField(
const StringData& nextFieldName = StringData() );
215 bool subobjStarted()
const {
return _fieldName != 0; }
226 StringData _fieldName;
229 bool haveSubobj()
const {
return _subobj.get() != 0; }
231 std::auto_ptr< BSONObjBuilder > _subobj;
241 for (
int i=0; i<SIZE; i++ )
248 void got(
int size ) {
250 _pos = (_pos + 1) % SIZE;
258 for (
int i=0; i<SIZE; i++ ) {
272 bool fieldsMatch(
const BSONObj& lhs,
const BSONObj& rhs);