7 # include <vcl_msvc_warnings.h> 14 static bool il_verbose =
false;
18 return stat(fn, &fs) == 0 && (fs.st_mode & S_IFMT) == S_IFDIR;
21 #if defined(_WIN32) && !defined(__CYGWIN__) 25 std::vector<std::string> temp;
29 # if defined __MINGW32__ 30 typedef long handle_type;
32 typedef intptr_t handle_type;
36 struct _finddata_t data;
37 handle = _findfirst((
directory_+
"\\*").c_str(), &data);
40 std::string s = data.name;
44 temp.push_back(filename);
47 if (_findnext(handle, &data) != 0) {
54 temp.push_back(filename);
59 #else // !defined(_WIN32) || defined(__CYGWIN__) 64 std::vector<std::string> temp;
69 de = readdir(dir_handle);
72 std::string s = de->d_name;
77 std::cout <<
"Found File(0) " << filename <<
'\n';
79 temp.push_back(filename);
83 de = readdir(dir_handle);
93 std::cout <<
"Found File " << filename <<
'\n';
95 temp.push_back(filename);
101 #endif // !defined(_WIN32) || defined(__CYGWIN__) 104 std::vector<vil_image_resource_sptr> temp;
105 std::vector<std::string> fs = this->
files();
110 temp.push_back(resc);
117 std::vector<vil_image_resource_sptr> temp;
118 std::vector<std::string> fs = this->
files();
131 std::vector<vil_image_resource_sptr> temp;
132 std::vector<std::string> fs = this->
files();
138 temp.emplace_back(pyr.
ptr());
145 #if defined(_WIN32) && !defined(__CYGWIN__) 146 std::string command =
"del " + filename;
148 std::string command =
"rm " + filename;
150 return std::system(command.c_str())==0;
156 std::vector<std::string> filez = this->
files();
158 std::cout <<
"starting to remove ..\n";
159 for (
auto & fit : filez)
162 std::cout <<
"finished remove ..\n";
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.
vil_image_resource_sptr vil_load_image_resource(char const *filename, bool verbose)
Load an image resource object from a file.
read an image from a file
std::vector< vil_image_resource_sptr > pyramids()
finds all the pyramid files in the directory, regardless of extension.
A blocked representation of the image_resource.
vil_blocked_image_resource_sptr blocked_image_resource(const vil_image_resource_sptr &ir)
cast to blocked resource if possible.
Representation of a pyramid resolution hierarchy.
vil_pyramid_image_resource_sptr vil_load_pyramid_resource(char const *directory_or_file, bool verbose)
Load a pyramid image resource object from a file or directory.
An image resource list reader. Finds all resources of a type in the given directory.
std::vector< std::string > files()
finds all the files in the directory, regardless of extension.
Representation of a generic image source or destination.
bool remove_file(std::string &filename)
remove a file.
T * ptr() const
These methods all return the raw/dumb pointer.