MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / FileCopy

Method FileCopy

cpp/src/platform/winRT/FileOpsImpl.cpp:143–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141
142
143bool FileOpsImpl::FileCopy
144(
145 const string _sourcefile,
146 const string _destfile
147 )
148{
149
150 if (!FileExists(_sourcefile)) {
151 Log::Write(LogLevel_Warning, "Source File %s doesn't exist in FileCopy", _sourcefile.c_str());
152 return false;
153 }
154 if (FileExists(_destfile)) {
155 Log::Write(LogLevel_Warning, "Destination File %s exists in FileCopy", _destfile.c_str());
156 return false;
157 }
158
159 /* make sure the Destination Folder Exists */
160 if (!FolderExists(ozwdirname(_destfile))) {
161 Log::Write(LogLevel_Warning, "Destination Folder %s Doesn't Exist", ozwdirname(_destfile));
162 return false;
163 }
164 wstring wSrcFileName(_sourcefile.begin(), _sourcefile.end());
165 wstring wDstFileName(_destfile.begin(), _destfile.end());
166
167 if (CopyFile2(wSrcFileName.c_str(), wDstFileName.c_str(), FALSE) == 0) {
168 Log::Write(LogLevel_Warning, "CopyFile Failed %s - %s", _sourcefile.c_str(), _destfile.c_str());
169 return false;
170 }
171 return true;
172}
173
174bool FileOpsImpl::FolderCreate
175(

Callers

nothing calls this directly

Calls 4

WriteFunction · 0.85
c_strMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected