mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-01-07 23:31:46 +00:00
Merge pull request #100 from mihaip/upstream-uint64_t
Switch ImgFile to using uint64_t explicitly
This commit is contained in:
commit
ebc618adea
@ -37,10 +37,10 @@ public:
|
||||
bool open(const std::string& img_path);
|
||||
void close();
|
||||
|
||||
size_t size() const;
|
||||
uint64_t size() const;
|
||||
|
||||
size_t read(void* buf, off_t offset, size_t length) const;
|
||||
size_t write(const void* buf, off_t offset, size_t length);
|
||||
uint64_t read(void* buf, uint64_t offset, uint64_t length) const;
|
||||
uint64_t write(const void* buf, uint64_t offset, uint64_t length);
|
||||
private:
|
||||
class Impl; // Holds private fields
|
||||
std::unique_ptr<Impl> impl;
|
||||
|
@ -46,20 +46,20 @@ void ImgFile::close()
|
||||
impl->stream.close();
|
||||
}
|
||||
|
||||
size_t ImgFile::size() const
|
||||
uint64_t ImgFile::size() const
|
||||
{
|
||||
impl->stream.seekg(0, impl->stream.end);
|
||||
return impl->stream.tellg();
|
||||
}
|
||||
|
||||
size_t ImgFile::read(void* buf, off_t offset, size_t length) const
|
||||
uint64_t ImgFile::read(void* buf, uint64_t offset, uint64_t length) const
|
||||
{
|
||||
impl->stream.seekg(offset, std::ios::beg);
|
||||
impl->stream.read((char *)buf, length);
|
||||
return impl->stream.gcount();
|
||||
}
|
||||
|
||||
size_t ImgFile::write(const void* buf, off_t offset, size_t length)
|
||||
uint64_t ImgFile::write(const void* buf, uint64_t offset, uint64_t length)
|
||||
{
|
||||
impl->stream.seekg(offset, std::ios::beg);
|
||||
impl->stream.write((const char *)buf, length);
|
||||
|
Loading…
Reference in New Issue
Block a user