This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Filtering in FindVisitor - take 2


On Mon, 17 Mar 2003, Igor Pechtchanski wrote:

> On 18 Mar 2003, Robert Collins wrote:
>
> > On Tue, 2003-03-18 at 05:23, Igor Pechtchanski wrote:
> > > This patch implements a FilterVisitor class that is a decorator on a
> > > FindVisitor and filters files according to the supplied Filter class (also
> > > implemented).  It also implements a particular filter, ExcludeNameFilter,
> > > that excludes any files with names matching a pattern.
> > > The two new files, FilterVisitor.cc and FilterVisitor.h, will have to be
> > > 'cvs add'ed.
> > >       Igor
> > > ==============================================================================
> > > ChangeLog:
> > > 2003-03-17  Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
> > >
> > >       * postinstall.cc (do_postinstall): Filter out '*.done'.
> > >       * FilterVisitor.h: New header file.  Declare the
> > >       FilterVisitor, Filter, and ExcludeNameFilter classes.
> > >       * FilterVisitor.cc: New file.  Implement FilterVisitor,
> > >       Filter, and ExcludeNameFilter.
> > >       * Makefile.am: Add FilterVisitor.cc and FilterVisitor.h
> > >       to inilint_SOURCES and setup_SOURCES.
> >
> > Looks nice.
> >
> > The strmatching logic should be a method of String++ IMO.
>
> I thought about it, but wasn't sure what the "right" way of putting it in
> was.  I'd guess
>
> bool String::matches(String const &pattern);
>
> i.e., the receiver is the string to match, rather than
>
> bool String::match(String const &filename);
>
> i.e., the receiver is the pattern...

Ok, included.

> I'll also move StringError to String.h/cc.

... in a later patch - it's irrelevant for this one.

> > Also FilterVisitor isn't needed for inilint.
> > Cheers,
> > Rob
>
> Is FindVisitor?  That's what I modeled it after.  What are the criteria?
>         Igor

Argh, noise...  I wasn't thinking.  Though you might consider using it for
inilint in the future. ;-)
	Igor
==============================================================================
ChangeLog:
2003-03-18  Igor Pechtchanski <pechtcha at cs dot nyu dot edu>

	* postinstall.cc (do_postinstall): Filter out '*.done'.
	* FilterVisitor.h: New header file.  Declare the
	FilterVisitor, Filter, and ExcludeNameFilter classes.
	* FilterVisitor.cc: New file.  Implement FilterVisitor,
	Filter, and ExcludeNameFilter.
	* String++.h (String::matches): New instance function.
	* String++.cc (String::matches): Implement.
	(strmatch) Import and adapt for <buf,len> strings.
	* Makefile.am (setup_SOURCES): Add FilterVisitor.cc and
	FilterVisitor.h to value.

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha at cs dot nyu dot edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor at watson dot ibm dot com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune

Attachment: setup-script-filter.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]