Added read() functions that take a MemBuffer as arg.
committer: mfx <mfx> 1035297017 +0000
This commit is contained in:
+25
-1
@@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include "conf.h"
|
#include "conf.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
|
#include "mem.h"
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
@@ -250,13 +251,36 @@ int InputFile::read(void *buf, int len)
|
|||||||
return super::read(buf, len);
|
return super::read(buf, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int InputFile::readx(void *buf, int len)
|
int InputFile::readx(void *buf, int len)
|
||||||
{
|
{
|
||||||
return super::readx(buf, len);
|
return super::readx(buf, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int InputFile::read(MemBuffer *buf, int len)
|
||||||
|
{
|
||||||
|
assert((unsigned)len <= buf->getSize());
|
||||||
|
return super::read(buf->getVoidPtr(), len);
|
||||||
|
}
|
||||||
|
|
||||||
|
int InputFile::readx(MemBuffer *buf, int len)
|
||||||
|
{
|
||||||
|
assert((unsigned)len <= buf->getSize());
|
||||||
|
return super::readx(buf->getVoidPtr(), len);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int InputFile::read(MemBuffer &buf, int len)
|
||||||
|
{
|
||||||
|
return read(&buf, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
int InputFile::readx(MemBuffer &buf, int len)
|
||||||
|
{
|
||||||
|
return readx(&buf, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void InputFile::seek(off_t off, int whence)
|
void InputFile::seek(off_t off, int whence)
|
||||||
{
|
{
|
||||||
super::seek(off,whence);
|
super::seek(off,whence);
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
#ifndef __UPX_FILE_H
|
#ifndef __UPX_FILE_H
|
||||||
#define __UPX_FILE_H
|
#define __UPX_FILE_H
|
||||||
|
|
||||||
|
class MemBuffer;
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
//
|
//
|
||||||
@@ -92,6 +94,10 @@ public:
|
|||||||
|
|
||||||
virtual int read(void *buf, int len);
|
virtual int read(void *buf, int len);
|
||||||
virtual int readx(void *buf, int len);
|
virtual int readx(void *buf, int len);
|
||||||
|
virtual int read(MemBuffer *buf, int len);
|
||||||
|
virtual int readx(MemBuffer *buf, int len);
|
||||||
|
virtual int read(MemBuffer &buf, int len);
|
||||||
|
virtual int readx(MemBuffer &buf, int len);
|
||||||
|
|
||||||
virtual void seek(off_t off, int whence);
|
virtual void seek(off_t off, int whence);
|
||||||
virtual off_t tell() const;
|
virtual off_t tell() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user