2
* Copyright (C) 2016 Canonical Ltd
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License version 3 as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authors: Michi Henning <michi.henning@canonical.com>
19
#include <unity/storage/qt/Uploader.h>
21
#include <unity/storage/qt/internal/UploaderImpl.h>
34
Uploader::Uploader() = default;
36
Uploader::Uploader(unique_ptr<internal::UploaderImpl> p)
42
Uploader::~Uploader() = default;
44
bool Uploader::isValid() const
49
Uploader::Status Uploader::status() const
54
StorageError Uploader::error() const
59
Item::ConflictPolicy Uploader::policy() const
64
qint64 Uploader::sizeInBytes() const
66
return p_->sizeInBytes();
69
Item Uploader::item() const
74
void Uploader::cancel()
79
void Uploader::close()
84
qint64 Uploader::bytesAvailable() const
86
return p_->bytesAvailable();
89
qint64 Uploader::bytesToWrite() const
91
return p_->bytesToWrite();
94
bool Uploader::canReadLine() const
96
return p_->canReadLine();
99
bool Uploader::isSequential() const
101
return p_->isSequential();
104
bool Uploader::waitForBytesWritten(int msecs)
106
return p_->waitForBytesWritten(msecs);
109
bool Uploader::waitForReadyRead(int msecs)
111
return p_->waitForReadyRead(msecs);
115
// Never called by QIODevice because device is opened write-only.
116
qint64 Uploader::readData(char* data, qint64 c)
118
return p_->readData(data, c);
122
qint64 Uploader::writeData(char const* data, qint64 c)
124
return p_->writeData(data, c);
128
} // namespace storage