mirror of https://github.com/OpenMW/openmw.git
Remove obsolete LowLevelFile
parent
d888eb84a5
commit
ce556ba0cc
@ -1,53 +0,0 @@
|
||||
#include "lowlevelfile.hpp"
|
||||
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <cassert>
|
||||
|
||||
namespace File = Platform::File;
|
||||
|
||||
LowLevelFile::~LowLevelFile()
|
||||
{
|
||||
if (mHandle != File::Handle::Invalid)
|
||||
File::close(mHandle);
|
||||
}
|
||||
|
||||
void LowLevelFile::open(char const* filename)
|
||||
{
|
||||
mHandle = File::open(filename);
|
||||
}
|
||||
|
||||
void LowLevelFile::close()
|
||||
{
|
||||
if (mHandle != File::Handle::Invalid)
|
||||
File::close(mHandle);
|
||||
mHandle = File::Handle::Invalid;
|
||||
}
|
||||
|
||||
size_t LowLevelFile::size()
|
||||
{
|
||||
assert(mHandle != File::Handle::Invalid);
|
||||
|
||||
return File::size(mHandle);
|
||||
}
|
||||
|
||||
void LowLevelFile::seek(size_t position)
|
||||
{
|
||||
assert(mHandle != File::Handle::Invalid);
|
||||
|
||||
return File::seek(mHandle, position);
|
||||
}
|
||||
|
||||
size_t LowLevelFile::tell()
|
||||
{
|
||||
assert(mHandle != File::Handle::Invalid);
|
||||
|
||||
return File::tell(mHandle);
|
||||
}
|
||||
|
||||
size_t LowLevelFile::read(void* data, size_t size)
|
||||
{
|
||||
assert(mHandle != File::Handle::Invalid);
|
||||
|
||||
return File::read(mHandle, data, size);
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
#ifndef COMPONENTS_FILES_LOWLEVELFILE_HPP
|
||||
#define COMPONENTS_FILES_LOWLEVELFILE_HPP
|
||||
|
||||
#include <cstdlib>
|
||||
#include <memory>
|
||||
|
||||
#include <components/platform/file.hpp>
|
||||
|
||||
class LowLevelFile
|
||||
{
|
||||
public:
|
||||
~LowLevelFile();
|
||||
|
||||
void open(char const* filename);
|
||||
void close();
|
||||
|
||||
size_t size();
|
||||
|
||||
void seek(size_t Position);
|
||||
size_t tell();
|
||||
|
||||
size_t read(void* data, size_t size);
|
||||
|
||||
private:
|
||||
Platform::File::Handle mHandle{ Platform::File::Handle::Invalid };
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue