aboutsummaryrefslogtreecommitdiff
path: root/src/InputStream.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-28 20:32:23 +0100
committerMax Kellermann <max@duempel.org>2013-01-28 23:29:43 +0100
commitdcf55c7e328578d435eb14277cb6ba9e072f7e9c (patch)
tree0488d2de5ecfd090cce2e00cfbc4cdcd342c8194 /src/InputStream.hxx
parente565cd440497d3b693e281046af485c667491441 (diff)
InputStream: add constructor/destructor
Eliminate input_stream_init() and input_stream_deinit().
Diffstat (limited to 'src/InputStream.hxx')
-rw-r--r--src/InputStream.hxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/InputStream.hxx b/src/InputStream.hxx
index 2c868725..62836af8 100644
--- a/src/InputStream.hxx
+++ b/src/InputStream.hxx
@@ -28,6 +28,8 @@
#include <glib.h>
+#include <assert.h>
+
struct input_stream {
/**
* the plugin which implements this input stream
@@ -85,6 +87,21 @@ struct input_stream {
* the MIME content type of the resource, or NULL if unknown
*/
char *mime;
+
+ input_stream(const input_plugin &_plugin,
+ const char *_uri, Mutex &_mutex, Cond &_cond)
+ :plugin(&_plugin), uri(g_strdup(_uri)),
+ mutex(&_mutex), cond(&_cond),
+ ready(false), seekable(false),
+ size(-1), offset(0),
+ mime(nullptr) {
+ assert(_uri != NULL);
+ }
+
+ ~input_stream() {
+ g_free(uri);
+ g_free(mime);
+ }
};
gcc_nonnull(1)