/*
- * Copyright (c) 2000, 2001, 2002 Red Hat, Inc.
+ * Copyright (c) 2002 Robert Collins.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* http://www.gnu.org/
*
* Written by DJ Delorie <dj@cygnus.com>
+ * Written by Robert Collins <rbtcollins@hotmail.com>
*
*/
-/* The for_each function is called once for each file found in the
- starting_dir or any subdir (recursively), passing the relative path
- (i.e. it doesn't include "starting_dir") and the size of the file
- (bytes). find() returns the number of files found. Directories
- are scanned but not included in the "found" files. */
+#ifndef _FIND_H_
+#define _FIND_H_
-class String;
-extern int find (String const &starting_dir,
- void (*for_each) (char *, unsigned int));
+class FindVisitor;
+#include "String++.h"
+/* TODO: make h conditional on the target platform */
+#include "win32.h"
+
+/* An aggregate representing all the files and folders in a given directory */
+class Find
+{
+public:
+ Find (String const &starting_dir);
+ ~Find ();
+ void accept (FindVisitor &);
+private:
+ String const _start_dir;
+ HANDLE h;
+};
+
+#endif // _FIND_H_