1
0
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:
Karol
2014-08-21 22:26:28 +02:00
parent 2da6d9e7dd
commit 958839668c
25 changed files with 359 additions and 191 deletions

View File

@ -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;