On 06/21/12 16:31, Adriano dos Santos Fernandes wrote:
> Hi!
>
> Current IBlob::getSegment is defined as:
>     unsigned IBlob::getSegment(IStatus* status, unsigned length, void*
> buffer) // return the read length
>
> While legacy API is:
>     ISC_STATUS isc_get_segment(
>         ISC_STATUS* status, FB_API_HANDLE* handle,
>         USHORT* returnLength, USHORT bufferLength, UCHAR* buffer)
>
> Trying to work with IBlob::getSegment in a C++ way is looking very
> confusing.
>
> It's sad that isc_segment and isc_segstr_eof are considered errors and
> goes to status vector and not only returned by isc_get_segment,
> different than isc_dsql_fetch and its 100 status.

Agreed.

> I don't consider isc_segment/isc_segstr_eof as really errors, and surely
> they should not be thrown when working with C++.
>

Certainly. It's completion conditions, not exceptions. Logically
absolutely no difference from isc_dsql_fetch.

> So I think getSegment must be adapted to return ISC_STATUS code and have
> the returnLength parameter.
>
> Also, one of these two things must be made:
> 1) Make IStatus::isSuccess (default impl.) to not consider
> isc_segment/isc_segstr_eof as errors.
> 2) Make getSegment not put isc_segment/isc_segstr_eof on the status, but
> only return it. Of course, isc_get_segment must continue work as now.
>
> (2) seems a much better option IMO.
>
> Comments?

Once again agreed.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to