aboutsummaryrefslogtreecommitdiff
path: root/src/ioutil.cpp
diff options
context:
space:
mode:
authorFelix (xq) Queißner <git@mq32.de>2020-06-08 00:30:32 +0200
committerFelix (xq) Queißner <git@mq32.de>2020-06-08 00:30:32 +0200
commitf02ccb928fd4ed591d2efe118a571e154f5df68a (patch)
tree2fc7c4037423d074c410f4c53714ddc842d33351 /src/ioutil.cpp
parent425f9d41cd337133d5677744eef937a8a2a61212 (diff)
downloadkristall-f02ccb928fd4ed591d2efe118a571e154f5df68a.tar.gz
Starts to implement gopher protocol and gophermap support. Heavily WIP, but you can already surf on gopherspace!
Diffstat (limited to 'src/ioutil.cpp')
-rw-r--r--src/ioutil.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ioutil.cpp b/src/ioutil.cpp
new file mode 100644
index 0000000..047a901
--- /dev/null
+++ b/src/ioutil.cpp
@@ -0,0 +1,16 @@
+#include "ioutil.hpp"
+
+bool IoUtil::writeAll(QIODevice &dst, QByteArray const & src)
+{
+ qint64 offset = 0;
+
+ while(offset < src.size())
+ {
+ qint64 len = dst.write(src.data() + offset, src.size() - offset);
+ if(len == 0)
+ return false;
+ offset += len;
+ }
+
+ return true;
+}