MCPcopy Create free account
hub / github.com/FoundationDB/fdb-document-layer / _append

Method _append

src/QLProjection.actor.cpp:250–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250void BOBObj::_append(std::string fn, DataValue dv) {
251 switch (dv.getBSONType()) {
252 case bson::BSONType::NumberInt:
253 bob->append(fn, dv.getInt());
254 break;
255 case bson::BSONType::NumberLong:
256 bob->append(fn, (long long)dv.getLong());
257 break;
258 case bson::BSONType::NumberDouble:
259 bob->append(fn, dv.getDouble());
260 break;
261 case bson::BSONType::String:
262 bob->append(fn, dv.getString());
263 break;
264 case bson::BSONType::BinData:
265 bob->appendBinData(fn, dv.getBinaryData().size() - 5, (bson::BinDataType) * (dv.getBinaryData().begin() + 4),
266 dv.getBinaryData().begin() + 5);
267 break;
268 case bson::BSONType::Bool:
269 bob->append(fn, dv.getBool());
270 break;
271 case bson::BSONType::jstOID:
272 bob->append(fn, dv.getId());
273 break;
274 case bson::BSONType::Date:
275 bob->append(fn, dv.getDate());
276 break;
277 case bson::BSONType::jstNULL:
278 bob->appendNull(fn);
279 break;
280 case bson::BSONType::Object:
281 bob->append(fn, dv.getPackedObject());
282 break;
283 case bson::BSONType::Array:
284 bob->appendArray(fn, dv.getPackedArray());
285 break;
286 case bson::BSONType::RegEx:
287 bob->appendAs(dv.getRegExObject(), fn);
288 break;
289 case bson::BSONType::MinKey:
290 bob->appendMinKey(fn);
291 break;
292 case bson::BSONType::MaxKey:
293 bob->appendMaxKey(fn);
294 break;
295 default:
296 throw internal_error();
297 }
298}
299
300bson::BSONObj BOBObj::build() {
301 if (isArrayLength >= 0) {

Callers

nothing calls this directly

Calls 15

getBSONTypeMethod · 0.80
appendMethod · 0.80
getIntMethod · 0.80
getLongMethod · 0.80
getDoubleMethod · 0.80
getStringMethod · 0.80
getBinaryDataMethod · 0.80
beginMethod · 0.80
getBoolMethod · 0.80
getIdMethod · 0.80
getDateMethod · 0.80
getPackedObjectMethod · 0.80

Tested by

no test coverage detected