- added seeking capabilities to FileWriter class.

This commit is contained in:
Christoph Oelckers 2017-12-02 11:51:37 +01:00
parent 0d05b41f22
commit cbd2fd34a0
2 changed files with 26 additions and 0 deletions

View file

@ -634,6 +634,30 @@ size_t FileWriter::Write(const void *buffer, size_t len)
}
}
long FileWriter::Tell()
{
if (File != NULL)
{
return ftell(File);
}
else
{
return 0;
}
}
long FileWriter::Seek(long offset, int mode)
{
if (File != NULL)
{
return fseek(File, offset, mode);
}
else
{
return 0;
}
}
size_t FileWriter::Printf(const char *fmt, ...)
{

View file

@ -409,6 +409,8 @@ public:
static FileWriter *Open(const char *filename);
virtual size_t Write(const void *buffer, size_t len);
virtual long Tell();
virtual long Seek(long offset, int mode);
size_t Printf(const char *fmt, ...) GCCPRINTF(2,3);
protected: