Hi, Craig, I completly agree. It is really bad design to use exception for anything else than reporting errors. When parsing a stream we expect to EOF sometime, so it is no exception. So the bool is definitly the better design desicion. If you are in the mood of fixing it, go ahead as I won't have time today anymore (spending a Sunday with fixing Maxicode rastering code does really suck!).
best regards,
Dom
Am Sunday 11 November 2007 schrieb Craig Ringer:
> Hi folks
>
> Dom, great to see that you've updated that PdfContentsTokenizer code and
> moved it into the main sources. I suspect it'll be really handy, and I
> like the code too.
>
> One thing I've been wondering though is whether ReadNext(...) should
> return bool, with true meaning "output valid" and false being "nothing
> to read, output undefined". It'd return false if it detected a normal
> EOF in a sensible place.
>
> That'd let a user of the API just write:
>
> while ( contentsTokenizer.ReadNext( &type, &kw, &var ) )
> {
> // do stuff
> }
>
> without worrying about catching exceptions if all they care about is
> detecting EOF.
>
> I'm also not 100% clear about the meaning of UnexpectedEOF from a user's
> point of view. Clearly at present it doesn't indicate an error since
> there's no other way to detect EOF using PdfContentsTokenizer, so in
> every stream read we expect an UnexpectedEOF at the end. That's somewhat
> counter-intuitive IMO, and I personally think a bool return would be
> clearer.
>
> Am I missing something obvious?
>
> --
> Craig Ringer
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Podofo-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/podofo-users
--
**********************************************************************
Dominik Seichter - [EMAIL PROTECTED]
KRename - http://www.krename.net - Powerful batch renamer for KDE
KBarcode - http://www.kbarcode.net - Barcode and label printing
PoDoFo - http://podofo.sf.net - PDF generation and parsing library
SchafKopf - http://schafkopf.berlios.de - Schafkopf, a card game, for KDE
Alan - http://alan.sf.net - A Turing Machine in Java
**********************************************************************
pgpgJvpZhkuaM.pgp
Description: PGP signature
------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________ Podofo-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/podofo-users
