summaryrefslogtreecommitdiffstats
path: root/src/io/uristream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/io/uristream.cpp')
-rw-r--r--src/io/uristream.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/io/uristream.cpp b/src/io/uristream.cpp
index 19994bc82..37c13ada0 100644
--- a/src/io/uristream.cpp
+++ b/src/io/uristream.cpp
@@ -402,34 +402,30 @@ void UriOutputStream::flush() throw(StreamException)
/**
* Writes the specified byte to this output stream.
*/
-void UriOutputStream::put(int ch) throw(StreamException)
+int UriOutputStream::put(gunichar ch) throw(StreamException)
{
if (closed)
- return;
+ return -1;
unsigned char uch;
- gunichar gch;
switch (scheme) {
-
case SCHEME_FILE:
if (!outf)
- return;
+ return -1;
uch = (unsigned char)(ch & 0xff);
if (fputc(uch, outf) == EOF) {
Glib::ustring err = "ERROR writing to file ";
throw StreamException(err);
}
- //fwrite(uch, 1, 1, outf);
- break;
+ break;
case SCHEME_DATA:
- gch = (gunichar) ch;
- data.push_back(gch);
- break;
+ data.push_back(ch);
+ break;
}//switch
-
+ return 1;
}
@@ -474,8 +470,7 @@ void UriWriter::flush() throw(StreamException)
*/
void UriWriter::put(gunichar ch) throw(StreamException)
{
- int ich = (int)ch;
- outputStream->put(ich);
+ outputStream->put(ch);
}