1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

some modernization of CFileInputStream implementation code

This commit is contained in:
Zyx-2000
2016-01-12 23:40:24 +01:00
parent f9b255c896
commit 933b7c1f5e
4 changed files with 14 additions and 41 deletions

View File

@@ -24,22 +24,21 @@ public:
/**
* C-tor. Opens the specified file.
*
* @see CFileInputStream::open
* @param file Path to the file.
* @param start - offset from file start where real data starts (e.g file on archive)
* @param size - size of real data in file (e.g file on archive) or 0 to use whole file
*
* @throws std::runtime_error if file wasn't found
*/
CFileInputStream(const boost::filesystem::path & file, si64 start = 0, si64 size = 0);
/**
* C-tor. Opens the specified file.
*
* @see CFileInputStream::open
* @see CFileInputStream::CFileInputStream(const boost::filesystem::path &, si64, si64)
*/
CFileInputStream(const CFileInfo & file, si64 start=0, si64 size=0);
/**
* D-tor. Calls the close method implicitely, if the file is still opened.
*/
~CFileInputStream();
/**
* Reads n bytes from the stream into the data buffer.
*
@@ -80,17 +79,6 @@ public:
si64 getSize() override;
private:
/**
* Opens a file. If a file is currently opened, it will be closed.
*
* @param file Path to the file.
* @param start - offset from file start where real data starts (e.g file on archive)
* @param size - size of real data in file (e.g file on archive) or 0 to use whole file
*
* @throws std::runtime_error if file wasn't found
*/
void open(const boost::filesystem::path & file, si64 start, si64 size);
si64 dataStart;
si64 dataSize;