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

Method getSegment

src/jrd/jrd.cpp:3573–3621  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3571
3572
3573int JBlob::getSegment(CheckStatusWrapper* user_status, unsigned int buffer_length, void* buffer,
3574 unsigned int* segment_length)
3575{
3576/**************************************
3577 *
3578 * g d s _ $ g e t _ s e g m e n t
3579 *
3580 **************************************
3581 *
3582 * Functional description
3583 * Get a segment from a blob.
3584 *
3585 **************************************/
3586 unsigned int len = 0;
3587 int cc = IStatus::RESULT_ERROR;
3588
3589 try
3590 {
3591 EngineContextHolder tdbb(user_status, this, FB_FUNCTION);
3592 check_database(tdbb);
3593
3594 try
3595 {
3596 len = getHandle()->BLB_get_segment(tdbb, buffer, buffer_length);
3597 }
3598 catch (const Exception& ex)
3599 {
3600 transliterateException(tdbb, ex, user_status, "JBlob::getSegment");
3601 return cc;
3602 }
3603
3604 if (getHandle()->blb_flags & BLB_eof)
3605 cc = IStatus::RESULT_NO_DATA;
3606 else if (getHandle()->getFragmentSize())
3607 cc = IStatus::RESULT_SEGMENT;
3608 else
3609 cc = IStatus::RESULT_OK;
3610 }
3611 catch (const Exception& ex)
3612 {
3613 ex.stuffException(user_status);
3614 return cc;
3615 }
3616
3617 successful_completion(user_status);
3618 if (segment_length)
3619 *segment_length = len;
3620 return cc;
3621}
3622
3623
3624int JAttachment::getSlice(CheckStatusWrapper* user_status, ITransaction* tra, ISC_QUAD* array_id,

Callers 5

listFieldMethod · 0.45
getListMethod · 0.45
dumpDataMethod · 0.45
mainFunction · 0.45
printMethod · 0.45

Calls 6

check_databaseFunction · 0.85
transliterateExceptionFunction · 0.85
successful_completionFunction · 0.85
BLB_get_segmentMethod · 0.80
getFragmentSizeMethod · 0.80
stuffExceptionMethod · 0.45

Tested by

no test coverage detected