MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / dump

Function dump

src/yvalve/utl.cpp:235–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235void dump(CheckStatusWrapper* status, ISC_QUAD* blobId, IAttachment* att, ITransaction* tra, FILE* file)
236{
237/**************************************
238 *
239 * d u m p
240 *
241 **************************************
242 *
243 * Functional description
244 * Dump a blob into a file.
245 *
246 **************************************/
247 // Open the blob. If it failed, what the hell -- just return failure
248
249 IBlob* blob = att->openBlob(status, tra, blobId, 0, NULL);
250 if (status->getState() & Firebird::IStatus::STATE_ERRORS)
251 return;
252
253 // Copy data from blob to scratch file
254
255 SCHAR buffer[256];
256 const SSHORT short_length = sizeof(buffer);
257
258 for (bool cond = true; cond; )
259 {
260 unsigned l = 0;
261 switch (blob->getSegment(status, short_length, buffer, &l))
262 {
263 case Firebird::IStatus::RESULT_ERROR:
264 case Firebird::IStatus::RESULT_NO_DATA:
265 cond = false;
266 break;
267 }
268
269 if (l)
270 FB_UNUSED(fwrite(buffer, 1, l, file));
271 }
272
273 // Close the blob
274
275 LocalStatus ls;
276 CheckStatusWrapper temp(&ls);
277 blob->close(&temp);
278}
279
280
281FB_BOOLEAN edit(CheckStatusWrapper* status, ISC_QUAD* blob_id, IAttachment* att, ITransaction* tra,

Callers 8

editFunction · 0.70
dumpBlobMethod · 0.70
API_ROUTINE BLOB_displayFunction · 0.70
getStatementMethod · 0.50
putStatementMethod · 0.50
shrinkMethod · 0.50
usage_mistakeMethod · 0.50
invalid_structureMethod · 0.50

Calls 4

openBlobMethod · 0.45
getStateMethod · 0.45
getSegmentMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected