SpiecsEngine
 
Loading...
Searching...
No Matches

◆ FileLibrary_CopyFile()

bool Spices::FileLibrary::FileLibrary_CopyFile ( std::string srcFilePath,
std::string dstFilePath )
static

Copy a file to dst path.

Parameters
[in]srcFilePathThe src file.
[in]dstFilePathThe dst file.
Returns
Returns true if copy succeed.

Definition at line 222 of file FileLibrary.cpp.

223 {
225
226 if (!FileLibrary_Exists(srcFilePath.c_str()))
227 {
228 std::stringstream ss;
229 ss << "File path: " << srcFilePath << " was not found.";
230
231 SPICES_CORE_WARN(ss.str())
232 return false;
233 }
234
235 std::ifstream src(srcFilePath, std::ios::binary);
236 std::ofstream dst(dstFilePath, std::ios::binary);
237
238 dst << src.rdbuf();
239
240 return true;
241 }
#define SPICES_PROFILE_ZONE
static bool FileLibrary_Exists(const char *path)
Determine whether the given string is existing a file.
STL namespace.

References FileLibrary_Exists().

Referenced by SpicesTest::TEST().