| 603 | } |
| 604 | |
| 605 | ExtMsgInsert::ExtMsgInsert(ExtMsgHeader* header, const uint8_t* body) : header(header) { |
| 606 | const uint8_t* ptr = body; |
| 607 | const uint8_t* eom = (const uint8_t*)header + header->messageLength; |
| 608 | |
| 609 | flags = *(int32_t*)ptr; |
| 610 | ptr += sizeof(int32_t); |
| 611 | |
| 612 | const char* collName = (const char*)ptr; |
| 613 | ptr += strlen(collName) + 1; |
| 614 | ns = getDBCollectionPair(collName, std::make_pair("msgType", "OP_INSERT")); |
| 615 | |
| 616 | while (ptr < eom) { |
| 617 | bson::BSONObj doc = bson::BSONObj((const char*)ptr); |
| 618 | ptr += doc.objsize(); |
| 619 | documents.push_back(doc); |
| 620 | } |
| 621 | |
| 622 | ASSERT(ptr == eom); |
| 623 | } |
| 624 | |
| 625 | std::string ExtMsgInsert::toString() { |
| 626 | std::string buf = "INSERT: documents=[ "; |
nothing calls this directly
no test coverage detected