LibD/src/System/Filesystem/SCCopyFile.cpp
Rtch90 273fdaaf10 [Add] Added a conversion method. From strings to integers.
-- Apparantely I forgot a few files in my last commit too.
2012-09-04 22:16:59 +01:00

24 lines
545 B
C++

#include <fstream>
#include <string>
#include "InputStream.h"
#include "FilePackageManager.h"
#include "SCCopyFile.h"
namespace util {
void SCCopyFile::CopyFile(const std::string& from, const std::string& to) {
std::fstream out(to.c_str(), std::ios::out);
saracraft::filesystem::InputStream in = saracraft::filesystem::FilePackageManager::GetInstance().GetFile(from);
std::string temp;
temp.resize(in.GetSize());
in.Read((unsigned char*)&temp[0], in.GetSize());
out << temp << std::endl;
out.close();
}
} // Namespace util.