aboutsummaryrefslogtreecommitdiffstats
path: root/src/InputStream.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-28 23:41:45 +0100
committerMax Kellermann <max@duempel.org>2013-01-28 23:41:45 +0100
commit76417d44464248949e7843eee0d5338a8e0a22ac (patch)
treec8f6416505b7268ce4f3902660ba35f4e35d1c04 /src/InputStream.hxx
parentcffc78ad6a978c8ef0afae4fbdd4b189612a7167 (diff)
downloadmpd-76417d44464248949e7843eee0d5338a8e0a22ac.tar.gz
mpd-76417d44464248949e7843eee0d5338a8e0a22ac.tar.xz
mpd-76417d44464248949e7843eee0d5338a8e0a22ac.zip
InputStream: use std::string
Diffstat (limited to '')
-rw-r--r--src/InputStream.hxx21
1 files changed, 7 insertions, 14 deletions
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 <glib.h>
+#include <string>
#include <assert.h>
@@ -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)