Re: Request for Change: UT_FileSpec


Subject: Re: Request for Change: UT_FileSpec
From: Andrew Dunbar (hippietrail@yahoo.com)
Date: Fri Jul 20 2001 - 23:10:04 CDT


 --- Hubert Figuiere <hfiguiere@teaser.fr> wrote: >
Hello
>
> this is a call for discussion to a change request
> within the Abi framework.
> Since this change will be widespread all along the
> code on any platform I
> want to start discussing it first.
>
> The problem: currently AbiWord specifies every file
> thru file path. But
> system like MacOS discurage the use of file path to
> specify a file. Some
> other like BeOS recommend to not use them.
>
> Solution:
> Change any file referencing in AbiWord from a file
> path to a UT_FileSpec
> that will allow custom file specification that the
> platform use.
>
> here is a sample definition of the class.
>
>
> class UT_FileSpec
> {
> public:
> UT_FileSpec();
> virtual ~UT_FileSpec();
> void getPath (UT_String & path) = 0;
> void setPath (const UT_String & path) = 0;
> }
>
> Then platform will have:
>
> class UT_MacFileSpec
> : public UT_FileSpec
> {
> public:
> UT_MacFileSpec();
> virtual ~UT_MacFileSpec();
> void getPath (UT_String & path);
> void setPath (const UT_String & path);
>
> void getSpec (FSSpec & fss);
> void setSpec (const FSSpec & fss);
> }
>
> Then you change everything including PD_Document,
> XAP_Dialog_OpenSaveAs,
> etc. to take a UT_FileSpec and not a const char *
>
> If we agree on this I propose to change this for
> post-0.9
> Semantics does not really change. Only the
> abstraction level. Implementation
> for UINX and Win32 should be trivial.
>
> We can extend it later to handle IO (in another
> class).
>
> Any comment ?

I think this is an excellent idea. Cross-platform
software should avoid "lowest common denominator"
when possible. If we can hide paths on systems that
discourage them is a Good Thing. This may even help
implement a change I want for Windows NT/2K/XP where
the path should be UT_UCSChar * instead of char *

Andrew Dunbar.

=====
http://linguaphile.sourceforge.net

____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie



This archive was generated by hypermail 2b25 : Fri Jul 20 2001 - 23:10:06 CDT