| 131 | } |
| 132 | |
| 133 | static bool CopyDirectory(const std::string& source, const std::string& destination) |
| 134 | { |
| 135 | // SHFileOperation requires file names to be terminated with two \0s |
| 136 | std::string tmpSource = source + std::string(1, '\0'); |
| 137 | std::string tmpDestination = destination + std::string(1, '\0'); |
| 138 | |
| 139 | SHFILEOPSTRUCT fop; |
| 140 | fop.wFunc = FO_COPY; |
| 141 | fop.pFrom = tmpSource.c_str(); |
| 142 | fop.pTo = tmpDestination.c_str(); |
| 143 | fop.fFlags = FOF_NO_UI; |
| 144 | |
| 145 | return (SHFileOperation(&fop) == 0); |
| 146 | } |
| 147 | |
| 148 | static bool DeleteDirectory(const std::string& dir) |
| 149 | { |