InputLegacy: move functions to the input_stream class

This commit is contained in:
Max Kellermann
2013-09-05 00:06:31 +02:00
parent 52ffdb0a55
commit 7d0269d2ce
47 changed files with 461 additions and 608 deletions

View File

@@ -161,7 +161,7 @@ struct input_curl {
char *meta_name;
/** the tag object ready to be requested via
input_stream_tag() */
input_stream::ReadTag() */
Tag *tag;
Error postponed_error;

View File

@@ -66,7 +66,7 @@ struct RewindInputStream {
}
~RewindInputStream() {
input_stream_close(input);
input->Close();
}
/**
@@ -114,7 +114,7 @@ input_rewind_check(struct input_stream *is, Error &error)
{
RewindInputStream *r = (RewindInputStream *)is;
return input_stream_check(r->input, error);
return r->input->Check(error);
}
static void
@@ -131,7 +131,7 @@ input_rewind_tag(struct input_stream *is)
{
RewindInputStream *r = (RewindInputStream *)is;
return input_stream_tag(r->input);
return r->input->ReadTag();
}
static bool
@@ -139,7 +139,7 @@ input_rewind_available(struct input_stream *is)
{
RewindInputStream *r = (RewindInputStream *)is;
return input_stream_available(r->input);
return r->input->IsAvailable();
}
static size_t
@@ -165,7 +165,7 @@ input_rewind_read(struct input_stream *is, void *ptr, size_t size,
} else {
/* pass method call to underlying stream */
size_t nbytes = input_stream_read(r->input, ptr, size, error);
size_t nbytes = r->input->Read(ptr, size, error);
if (r->input->offset > (goffset)sizeof(r->buffer))
/* disable buffering */
@@ -190,7 +190,7 @@ input_rewind_eof(struct input_stream *is)
{
RewindInputStream *r = (RewindInputStream *)is;
return !r->ReadingFromBuffer() && input_stream_eof(r->input);
return !r->ReadingFromBuffer() && r->input->IsEOF();
}
static bool
@@ -213,8 +213,7 @@ input_rewind_seek(struct input_stream *is, goffset offset, int whence,
return true;
} else {
bool success = input_stream_seek(r->input, offset, whence,
error);
bool success = r->input->Seek(offset, whence, error);
r->CopyAttributes();
/* disable the buffer, because r->input has left the