Added overloaded write functions for MemBuffer.

committer: mfx <mfx> 1042576236 +0000
This commit is contained in:
Markus F.X.J. Oberhumer 2003-01-14 20:30:36 +00:00
parent 9511e3c9b1
commit ec5840fb2a
2 changed files with 17 additions and 2 deletions

View File

@ -260,13 +260,13 @@ int InputFile::readx(void *buf, int len)
int InputFile::read(MemBuffer *buf, int len)
{
assert((unsigned)len <= buf->getSize());
return super::read(buf->getVoidPtr(), len);
return read(buf->getVoidPtr(), len);
}
int InputFile::readx(MemBuffer *buf, int len)
{
assert((unsigned)len <= buf->getSize());
return super::readx(buf->getVoidPtr(), len);
return read(buf->getVoidPtr(), len);
}
@ -369,6 +369,19 @@ void OutputFile::write(const void *buf, int len)
}
void OutputFile::write(const MemBuffer *buf, int len)
{
assert((unsigned)len <= buf->getSize());
write(buf->getVoidPtr(), len);
}
void OutputFile::write(const MemBuffer &buf, int len)
{
write(&buf, len);
}
void OutputFile::dump(const char *name, const void *buf, int len, int flags)
{
if (flags < 0)

View File

@ -123,6 +123,8 @@ public:
virtual bool openStdout(int flags=0, bool force=false);
virtual void write(const void *buf, int len);
virtual void write(const MemBuffer *buf, int len);
virtual void write(const MemBuffer &buf, int len);
off_t getBytesWritten() const { return bytes_written; }