Re: GNOME::Editor; new try



On Sun, Mar 21, 1999 at 04:33:49PM -0500, Elliot Lee wrote:
> On Sun, 21 Mar 1999, Martijn van Beers wrote:
> 
> This part is definitely incorrect.
Oops, must read better. Should be 

typedef unsigned long SearchOption
const SearchOption REG_REGEX = 1;
const SearchOption REG_ICASE = 2;
const SearchOption REG_NOSUB = 4;
const SearchOption REG_NEWLINE = 8;

like in your example. The first one might need some extra explaining,
it's a flag whether to use regex's or not. The rest is from regex(3)

> 
> >    interface EditorFactory : GNOME::FileFactory {
> >       Object new ();
> >    };
> 
> Why do you need an EditorFactory with just this operation? You should
> inherit from GNOME::GenericFactory instead.

hmm, so like?:

interface FileFactory : GNOME::GenericFactory {
	exception NotFound {};

	Object open (in string path) raises (NotFound);
}
interface EditorFactory : GNOME::FileFactory {
};

That would allow GNOME::File to have an empty file, which isn't what
I want, since that's supposed to do no editing whatsoever.
 
> Rather than raising an exception, it would probably be better to just
> return the number of occurrences found/replaced. Exceptions are usually
> used to indicate error conditions, not for returning processing results.

Okie

Martijn


-- 
Martijn van Beers
martijn@earthling.net



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]