From 76417d44464248949e7843eee0d5338a8e0a22ac Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 28 Jan 2013 23:41:45 +0100 Subject: InputStream: use std::string --- src/InputStream.hxx | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'src/InputStream.hxx') diff --git a/src/InputStream.hxx b/src/InputStream.hxx index 32940fd96..96172723a 100644 --- a/src/InputStream.hxx +++ b/src/InputStream.hxx @@ -26,7 +26,7 @@ #include "thread/Cond.hxx" #include "gcc.h" -#include +#include #include @@ -37,10 +37,9 @@ struct input_stream { const struct input_plugin &plugin; /** - * The absolute URI which was used to open this stream. May - * be NULL if this is unknown. + * The absolute URI which was used to open this stream. */ - char *uri; + std::string uri; /** * A mutex that protects the mutable attributes of this object @@ -84,24 +83,18 @@ struct input_stream { goffset offset; /** - * the MIME content type of the resource, or NULL if unknown + * the MIME content type of the resource, or empty if unknown. */ - char *mime; + std::string mime; input_stream(const input_plugin &_plugin, const char *_uri, Mutex &_mutex, Cond &_cond) - :plugin(_plugin), uri(g_strdup(_uri)), + :plugin(_plugin), uri(_uri), mutex(_mutex), cond(_cond), ready(false), seekable(false), - size(-1), offset(0), - mime(nullptr) { + size(-1), offset(0) { assert(_uri != NULL); } - - ~input_stream() { - g_free(uri); - g_free(mime); - } }; gcc_nonnull(1) -- cgit v1.2.3