24 #include <IceUtil/UUID.h>
28 #include <mongo/client/dbclient.h>
33 gridFile(new
mongo::GridFile(gridFile)),
35 accessGridFSFilesMutex(accessGridFSFilesMutex)
37 iceId.name = IceUtil::generateUUID();
45 return gridFile->getFileField(
"_id").OID().toString();
50 return gridFile->getFilename();
55 return gridFile->getMD5();
60 return gridFile->getContentLength();
65 return gridFile->getUploadDate();
73 std::unique_lock l(*accessGridFSFilesMutex);
77 if (nextChunkNo < gridFile->getNumChunks())
79 mongo::GridFSChunk chunk = gridFile->getChunk(nextChunkNo++);
81 const char*
data = chunk.data(datalen);
82 buffer.resize(datalen);
83 memcpy(buffer.data(),
data, datalen);
94 <<
VAROUT(gridFile) <<
"\n"
95 <<
VAROUT(gridFile->getFilename()) <<
"\n"
96 <<
VAROUT(gridFile->exists()) <<
"\n"
97 <<
VAROUT(gridFile->getChunkSize()) <<
"\n"
98 <<
VAROUT(gridFile->getNumChunks()) <<
"\n"
99 <<
VAROUT(gridFile->getContentLength()) <<
"\n"
100 <<
VAROUT(gridFile->getContentType()) <<
"\n"
101 <<
VAROUT(gridFile->getMD5()) <<
"\n"
102 <<
VAROUT(gridFile->getMetadata().jsonString()) <<
"\n"