core/vil/vil_image_list.h
Go to the documentation of this file.
00001 // This is core/vil/vil_image_list.h
00002 #ifndef vil_image_list_h_
00003 #define vil_image_list_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \author J.L. Mundy  March 22, 2006
00010 // \brief An image resource list reader. Finds all resources of a type in the given directory.
00011 // \verbatim
00012 //  Modifications
00013 //   <none>
00014 // \endverbatim
00015 //
00016 #include <vcl_string.h>
00017 #include <vcl_vector.h>
00018 #include <vil/vil_image_resource_sptr.h>
00019 
00020 class vil_image_list
00021 {
00022  public:
00023   vil_image_list(char const* directory):directory_(directory){}
00024   ~vil_image_list(){}
00025 
00026   //: finds all the files in the directory, regardless of extension
00027   vcl_vector<vcl_string> files();
00028 
00029   //: finds all the image files in the directory, regardless of extension
00030   vcl_vector<vil_image_resource_sptr> resources();
00031 
00032   //: finds all the blocked image files in the directory, regardless of extension
00033   vcl_vector<vil_image_resource_sptr> blocked_resources();
00034 
00035   //: finds all the pyramid files in the directory, regardless of extension
00036   vcl_vector<vil_image_resource_sptr> pyramids();
00037 
00038   //: utility functions
00039 
00040   //: checks if the path is a directory
00041   static bool vil_is_directory(char const*);
00042 
00043   //:remove a file
00044   bool remove_file(vcl_string& filename );
00045 
00046   //: cleans the directory, i.e. removes all the files
00047   bool clean_directory();
00048 
00049  private:
00050   vcl_string directory_;
00051 };
00052 
00053 #endif // vil_image_list_h_