MCPcopy Create free account
hub / github.com/XorTroll/Goldleaf / CopyDirectory

Method CopyDirectory

Goldleaf/source/fs/fs_Explorer.cpp:113–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111 }
112
113 void Explorer::CopyDirectory(const std::string &dir, const std::string &new_dir) {
114 const auto full_dir = this->MakeFull(dir);
115 auto exp = GetExplorerForPath(new_dir);
116 const auto full_new_dir = exp->MakeFull(new_dir);
117 exp->CreateDirectory(full_new_dir);
118 const auto dirs = this->GetDirectories(full_dir);
119 for(const auto &sub_dir: dirs) {
120 const auto from = full_dir + "/" + sub_dir;
121 const auto to = full_new_dir + "/" + sub_dir;
122 this->CopyDirectory(from, to);
123 }
124 const auto files = this->GetFiles(full_dir);
125 for(const auto &sub_file: files) {
126 const auto from = full_dir + "/" + sub_file;
127 const auto to = full_new_dir + "/" + sub_file;
128 this->CopyFile(from, to);
129 }
130 }
131
132 void Explorer::CopyFileProgress(const std::string &path, const std::string &new_path, CopyFileStartCallback start_cb, CopyFileProgressCallback prog_cb) {
133 const auto full_path = this->MakeFull(path);

Callers

nothing calls this directly

Calls 6

MakeFullMethod · 0.95
CopyFileMethod · 0.95
GetExplorerForPathFunction · 0.85
CreateDirectoryMethod · 0.45
GetDirectoriesMethod · 0.45
GetFilesMethod · 0.45

Tested by

no test coverage detected