On Wednesday 15 November 2000 16:39, Lars Gullik Bjønnes wrote:
> Angus Leeming <[EMAIL PROTECTED]> writes:
> | Note that the new functions are more sophisticated than the old ones. In
> | particular, they can tell you WHY the dir/file isn't read/writeable.
>
> I feel that this is a bit too much of hand holding. And they are not
> core support functions... I'd say move them to frontends.
> (I'd really hate to see code like:
>  string dummy;
>  if (ReadableFile(file, dummy)) { ... } )

well we could easily overcome that by creating a class to hold them

class ReadWriteInfo {
public:
        static bool ReadableFile(string const & file);
        static string const & ErrorMessage() { return error_message; }
private:
        static string error_message;
};

bool ReadWriteInfo::ReadableFile( string const & file )
{
        error_message.erase();

        if( file is not readable ) {
                error_message = " some error message ";
                return false;
        }
        return true;
}

if( !ReadWriteInfo::ReadableFile(file) )
        std::cerr << ReadWriteInfo::ErrorMessage() << std::endl;

I'll do this anyway and put it into xform_helpers.[Ch]. If you like it, we 
can always move it into support.

Does this mean that you aren't going to apply this patch? Please do, because 
I'd like feedback/help!!!!

> | Note also, that a writeable file need not yet exist but the directory
> | should be writeable.
> |
> | Allan wrote them because he wanted the feedback for the "idiot
> | user". I
>
> We don't have idiot users.

Sure we do. Look at all the dumn questions I ask! I use LyX therefore LyX has 
an idiot user!

A.

Reply via email to