Skip to content

Commit 64cf8bc

Browse files
committed
Unused
Signed-off-by: Raul Metsma <raul@metsma.ee>
1 parent 7e46f86 commit 64cf8bc

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

client/Utils.h

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
#include <QTimer>
2525
#include <exception>
2626
#include <thread>
27-
#include <iostream>
28-
29-
#include "Application.h"
3027

3128
namespace {
3229
template <typename F, class... Args>
@@ -84,32 +81,6 @@ namespace {
8481
return escaped;
8582
}
8683

87-
inline qint64 copyIODevice(std::basic_istream<char> *from, QIODevice *to, qint64 max = std::numeric_limits<qint64>::max())
88-
{
89-
std::array<char,16*1024> buf{};
90-
size_t total_read = 0;
91-
while ((total_read < max) && !from->eof() && !from->bad()) {
92-
size_t to_read = std::min<size_t>(max, buf.size());
93-
from->read(buf.data(), to_read);
94-
size_t n_read = from->gcount();
95-
if(to->write(buf.data(), n_read) != n_read) return -1;
96-
total_read += n_read;
97-
}
98-
return total_read;
99-
}
100-
101-
inline qint64 copyIODevice(QIODevice *from, std::streambuf *to, qint64 max = std::numeric_limits<qint64>::max())
102-
{
103-
std::array<char,16*1024> buf{};
104-
qint64 size = 0, i = 0;
105-
for(; (i = from->read(buf.data(), std::min<qint64>(max, buf.size()))) > 0; size += i, max -= i)
106-
{
107-
if(to->sputn(buf.data(), i) != i)
108-
return -1;
109-
}
110-
return i < 0 ? i : size;
111-
}
112-
11384
inline qint64 copyIODevice(QIODevice *from, QIODevice *to, qint64 max = std::numeric_limits<qint64>::max())
11485
{
11586
std::array<char,16*1024> buf{};

0 commit comments

Comments
 (0)