Skip to content
Permalink
Browse files
Merge pull request #5941 from delroth/wfs
WFS updates
  • Loading branch information
delroth committed Aug 23, 2017
2 parents 24e919a + ef888ef commit 187e65f
Show file tree
Hide file tree
Showing 6 changed files with 518 additions and 53 deletions.
@@ -521,7 +521,7 @@ bool DeleteDirRecursively(const std::string& directory)
}

// Create directory and copy contents (does not overwrite existing files)
void CopyDir(const std::string& source_path, const std::string& dest_path)
void CopyDir(const std::string& source_path, const std::string& dest_path, bool destructive)
{
if (source_path == dest_path)
return;
@@ -562,10 +562,16 @@ void CopyDir(const std::string& source_path, const std::string& dest_path)
{
if (!Exists(dest))
File::CreateFullPath(dest + DIR_SEP);
CopyDir(source, dest);
CopyDir(source, dest, destructive);
}
else if (!Exists(dest) && !destructive)
{
Copy(source, dest);
}
else
{
Rename(source, dest);
}
else if (!Exists(dest))
File::Copy(source, dest);
#ifdef _WIN32
} while (FindNextFile(hFind, &ffd) != 0);
FindClose(hFind);
@@ -156,8 +156,9 @@ bool DeleteDirRecursively(const std::string& directory);
// Returns the current directory
std::string GetCurrentDir();

// Create directory and copy contents (does not overwrite existing files)
void CopyDir(const std::string& source_path, const std::string& dest_path);
// Create directory and copy contents (optionally overwrites existing files)
void CopyDir(const std::string& source_path, const std::string& dest_path,
bool destructive = false);

// Set the current directory to given directory
bool SetCurrentDir(const std::string& directory);

0 comments on commit 187e65f

Please sign in to comment.