aboutsummaryrefslogtreecommitdiff
path: root/src/ioutil.cpp
blob: 047a90117dd170b2e6ee53ade2803dd8d96e2fc4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;
}