use it for an option to keep pbl files when deleting directories
This commit is contained in:
parent
a99aa8532b
commit
751f710dec
2 changed files with 3 additions and 3 deletions
|
@ -361,13 +361,13 @@ bool looks_like_pbl(const std::string& file)
|
|||
|
||||
// This deletes a directory with no hidden files and subdirectories.
|
||||
// Also deletes a single file.
|
||||
bool delete_directory(const std::string& path)
|
||||
bool delete_directory(const std::string& path, const bool keep_pbl)
|
||||
{
|
||||
bool ret = true;
|
||||
std::vector<std::string> files;
|
||||
std::vector<std::string> dirs;
|
||||
|
||||
get_files_in_dir(path, &files, &dirs, ENTIRE_FILE_PATH);
|
||||
get_files_in_dir(path, &files, &dirs, ENTIRE_FILE_PATH, keep_pbl ? SKIP_PBL_FILES : NO_FILTER);
|
||||
|
||||
if(!files.empty()) {
|
||||
for(std::vector<std::string>::const_iterator i = files.begin(); i != files.end(); ++i) {
|
||||
|
|
|
@ -84,7 +84,7 @@ std::string get_cwd();
|
|||
std::string get_exe_dir();
|
||||
|
||||
bool make_directory(const std::string& dirname);
|
||||
bool delete_directory(const std::string& dirname);
|
||||
bool delete_directory(const std::string& dirname, const bool keep_pbl = false);
|
||||
|
||||
bool looks_like_pbl(const std::string& file);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue