Hi Patrick, hi Allen,
On Wed, 2005-05-25 at 23:47 +0200, Patrik Müller wrote:
> Hi Dirk,
>
> no - you often have this problem if you use 3rd party libs - one example is
> lib3ds. One solution would be using readFile API as Allen suggested - but
> would you use it if you know this call is deprecated?
No, I wouldn't do that, see below.
On Wed, 2005-05-25 at 17:13 -0500, Allen Bierbaum wrote:
>
> Actually, the API I used isn't the deprecated one. It is the read
> method that takes a stream and a filenameOrExtension. It is meant to
> work with streams, but in most use cases you can just pull the filename
> from the second argument and use the file directly. The problem (as I
> see it) is that using the second argument in this way is not guaranteed
> to work (ie. it is non-standard and based more on a side-effect then a
> documented use case).
I don't see a problem turning it into one. The norm for applications is
to use SceneFileHandler::read(const Char8 *fileName, GraphOpSeq
*graphOpSeq);, which then passes the filename to the SceneFileType,
together with the stream to the file. Unless the app tries to load data
from an unusual stream (like directly from the network) I don't expect
that to change. To in general SceneFileType::read can expect the
filename to be set and usable. Therefore it sounds like a reasonable
approach to try to open it and if that fails to print an error message
that explains the reason.
We could come up with a scheme that tries to use readFile if it knows
that it's a file, and read in the other cases, but I'm not sure that
would help much and it would be more complicated.
> That said, I still agree that this probably could happen a lot with 3rd
> party libs. Most of them that I have seen do not use istreams for
> reading data. :(
Probably true. Everybody's still mired in C-land...
Dirk
--
-- Dirk Reiners OpenSG Forum [EMAIL PROTECTED]
-- The OpenSG Open Source Scenegraph: http://www.opensg.org
-- Join the list at http://lists.sf.net/lists/listinfo/opensg-users
-------------------------------------------------------
SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate
online with coworkers and clients while avoiding the high cost of travel and
communications. There is no equipment to buy and you can meet as often as
you want. Try it free.http://ads.osdn.com/?ad_idt02&alloc_id135&op�ick
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users