mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
VCMIDirs update #5
- Minor fixes - string based paths -> boost::filesystem::path paths (I hope it's final) - New user data path on windows - New moving dir method on windows.
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
|
||||
#include "CFileInfo.h"
|
||||
|
||||
CFileInputStream::CFileInputStream(const std::string & file, si64 start, si64 size)
|
||||
CFileInputStream::CFileInputStream(const boost::filesystem::path & file, si64 start, si64 size)
|
||||
{
|
||||
open(file, start, size);
|
||||
}
|
||||
@ -18,14 +18,12 @@ CFileInputStream::~CFileInputStream()
|
||||
fileStream.close();
|
||||
}
|
||||
|
||||
void CFileInputStream::open(const std::string & file, si64 start, si64 size)
|
||||
void CFileInputStream::open(const boost::filesystem::path & file, si64 start, si64 size)
|
||||
{
|
||||
fileStream.open(file.c_str(), std::ios::in | std::ios::binary);
|
||||
fileStream.open(file, std::ios::in | std::ios::binary);
|
||||
|
||||
if (fileStream.fail())
|
||||
{
|
||||
throw std::runtime_error("File " + file + " isn't available.");
|
||||
}
|
||||
throw std::runtime_error("File " + file.string() + " isn't available.");
|
||||
|
||||
dataStart = start;
|
||||
dataSize = size;
|
||||
|
Reference in New Issue
Block a user