vil_image_list.h
Go to the documentation of this file.
1 // This is core/vil/vil_image_list.h
2 #ifndef vil_image_list_h_
3 #define vil_image_list_h_
4 //:
5 // \file
6 // \author J.L. Mundy March 22, 2006
7 // \brief An image resource list reader. Finds all resources of a type in the given directory.
8 // \verbatim
9 // Modifications
10 // <none>
11 // \endverbatim
12 //
13 #include <string>
14 #include <vector>
15 #ifdef _MSC_VER
16 # include <vcl_msvc_warnings.h>
17 #endif
19 
21 {
22  public:
23  vil_image_list(char const* directory):directory_(directory){}
24  ~vil_image_list()= default;
25 
26  //: finds all the files in the directory, regardless of extension
27  std::vector<std::string> files();
28 
29  //: finds all the image files in the directory, regardless of extension
30  std::vector<vil_image_resource_sptr> resources();
31 
32  //: finds all the blocked image files in the directory, regardless of extension
33  std::vector<vil_image_resource_sptr> blocked_resources();
34 
35  //: finds all the pyramid files in the directory, regardless of extension
36  std::vector<vil_image_resource_sptr> pyramids();
37 
38  //: utility functions
39 
40  //: checks if the path is a directory
41  static bool vil_is_directory(char const*);
42 
43  //:remove a file
44  bool remove_file(std::string& filename );
45 
46  //: cleans the directory, i.e. removes all the files
47  bool clean_directory();
48 
49  private:
50  std::string directory_;
51 };
52 
53 #endif // vil_image_list_h_
std::vector< vil_image_resource_sptr > resources()
finds all the image files in the directory, regardless of extension.
std::vector< vil_image_resource_sptr > blocked_resources()
finds all the blocked image files in the directory, regardless of extension.
static bool vil_is_directory(char const *)
utility functions.
bool clean_directory()
cleans the directory, i.e. removes all the files.
std::vector< vil_image_resource_sptr > pyramids()
finds all the pyramid files in the directory, regardless of extension.
vil_image_list(char const *directory)
std::vector< std::string > files()
finds all the files in the directory, regardless of extension.
~vil_image_list()=default
bool remove_file(std::string &filename)
remove a file.
std::string directory_
Smart pointer to an image resource.