Get a segment from a blob opened for reading.
| 3028 | |
| 3029 | // Get a segment from a blob opened for reading. |
| 3030 | ISC_STATUS API_ROUTINE isc_get_segment(ISC_STATUS* userStatus, isc_blob_handle* blobHandle, |
| 3031 | USHORT* returnLength, USHORT bufferLength, SCHAR* buffer) |
| 3032 | { |
| 3033 | StatusVector status(userStatus); |
| 3034 | CheckStatusWrapper statusWrapper(&status); |
| 3035 | |
| 3036 | try |
| 3037 | { |
| 3038 | RefPtr<YBlob> blob(translateHandle(blobs, blobHandle)); |
| 3039 | unsigned int length; |
| 3040 | int cc = blob->getSegment(&statusWrapper, bufferLength, reinterpret_cast<UCHAR*>(buffer), &length); |
| 3041 | |
| 3042 | if (!(status.getState() & IStatus::STATE_ERRORS)) |
| 3043 | *returnLength = length; |
| 3044 | |
| 3045 | // Raise pseudo errors |
| 3046 | switch (cc) |
| 3047 | { |
| 3048 | case IStatus::RESULT_NO_DATA: |
| 3049 | Arg::Gds(isc_segstr_eof).raise(); |
| 3050 | break; |
| 3051 | case IStatus::RESULT_SEGMENT: |
| 3052 | Arg::Gds(isc_segment).raise(); |
| 3053 | break; |
| 3054 | } |
| 3055 | } |
| 3056 | catch (const Exception& e) |
| 3057 | { |
| 3058 | e.stuffException(&statusWrapper); |
| 3059 | } |
| 3060 | |
| 3061 | return status[1]; |
| 3062 | } |
| 3063 | |
| 3064 | |
| 3065 | // Snatch a slice of an array. |
nothing calls this directly
no test coverage detected