| 97 | } |
| 98 | |
| 99 | void CMP_FileCopy(std::string& source_file, std::string& destination_file) |
| 100 | { |
| 101 | #if defined _CMP_CPP17_ || defined _CMP_CPP14_ |
| 102 | sfs::copy(source_file, destination_file); |
| 103 | #else |
| 104 | FILE* src = fopen(source_file.c_str(), "rb"); |
| 105 | if (src == NULL) |
| 106 | return; |
| 107 | |
| 108 | FILE* dst = fopen(destination_file.c_str(), "wb"); |
| 109 | if (dst == NULL) |
| 110 | { |
| 111 | fclose(src); |
| 112 | return; |
| 113 | } |
| 114 | |
| 115 | for (int i = getc(src); i != EOF; i = getc(src)) |
| 116 | { |
| 117 | putc(i, dst); |
| 118 | } |
| 119 | |
| 120 | fclose(dst); |
| 121 | fclose(src); |
| 122 | #endif |
| 123 | } |
| 124 | |
| 125 | bool CMP_DirExists(const std::string& directory) |
| 126 | { |
no outgoing calls
no test coverage detected