| 3571 | |
| 3572 | |
| 3573 | int 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 | |
| 3624 | int JAttachment::getSlice(CheckStatusWrapper* user_status, ITransaction* tra, ISC_QUAD* array_id, |
no test coverage detected