From f02ccb928fd4ed591d2efe118a571e154f5df68a Mon Sep 17 00:00:00 2001 From: "Felix (xq) Queißner" Date: Mon, 8 Jun 2020 00:30:32 +0200 Subject: Starts to implement gopher protocol and gophermap support. Heavily WIP, but you can already surf on gopherspace! --- src/ioutil.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/ioutil.cpp (limited to 'src/ioutil.cpp') 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; +} -- cgit v1.2.3