Re: [AD] file interface fopen

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On December 18, 2010, Peter Wang wrote:
> On 2010-12-18, Matthew Leverton <meffer@xxxxxxxxxx> wrote:
> > I've been working with A5's file interfaces, namely creating an A4
> > PACKFILE / DATAFILE loader, and the current setup of creating file
> > interfaces bugs me. I recently proposed al_fopen_f on a.cc, but after
> > playing around some more, that's not really what I want.
> > 
> > The problem in a nutshell is that the file interface is responsible
> > for creating its own structure and therefore must have access to the
> 
> > Allegro internals, which of course is bad. So my proposal is:
> ALLEGRO_FS_INTERFACE is public and documented.
> 
> ALLEGRO_FILE is documented as being opaque, but that could be considered
> a mistake from earlier in the development process.  If we change the
> documentation, would that solve the problem for you?

Personally I don't think making /any/ type opaque is a mistake. Rather the 
opposite in most cases.

The entire point of making it opaque is so things can be overridden so easily. 
If the structure is made public, you'll never be able to change the 
implementation if needed. Better to hide it behind a sane api (not that I'm 
claiming the api is entirely sane).

> Peter
> 
> ---------------------------------------------------------------------------
> --- Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d


-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/