| 110 | } |
| 111 | |
| 112 | bool copyFileContent(const MMKVPath_t &srcPath, const MMKVPath_t &dstPath) { |
| 113 | File dstFile(dstPath, OpenFlag::WriteOnly | OpenFlag::Create | OpenFlag::Truncate); |
| 114 | if (!dstFile.isFileValid()) { |
| 115 | return false; |
| 116 | } |
| 117 | if (copyFileContent(srcPath, dstFile.getFd())) { |
| 118 | MMKVInfo("copy content from %s to fd[%s] finish", srcPath.c_str(), dstPath.c_str()); |
| 119 | return true; |
| 120 | } |
| 121 | MMKVError("fail to copyfile(): target file %s", dstPath.c_str()); |
| 122 | return false; |
| 123 | } |
| 124 | |
| 125 | bool copyFileContent(const MMKVPath_t &srcPath, MMKVFileHandle_t dstFD) { |
| 126 | if (dstFD < 0) { |
no test coverage detected