renamed and moved IODevice to io/device
This commit is contained in:
parent
0b5ecf41c4
commit
1de2439036
55 changed files with 175 additions and 124 deletions
|
@ -44,7 +44,7 @@ static const QString DEVICE_ID_KEY("device_id");
|
|||
constexpr int USER_UNAUTHORIZED_ERR_CODE = 401;
|
||||
constexpr int INVALID_SCORE_ID = 0;
|
||||
|
||||
int scoreIdFromSourceUrl(const QUrl& sourceUrl)
|
||||
static int scoreIdFromSourceUrl(const QUrl& sourceUrl)
|
||||
{
|
||||
QStringList parts = sourceUrl.toString().split("/");
|
||||
if (parts.isEmpty()) {
|
||||
|
@ -170,7 +170,7 @@ void CloudService::onUserAuthorized()
|
|||
|
||||
saveTokens();
|
||||
|
||||
if (downloadUserInfo() == RequestStatus::Ok) {
|
||||
if (downloadUserInfo() == RequestStatus::Ok && m_onUserAuthorizedCallback) {
|
||||
m_onUserAuthorizedCallback();
|
||||
m_onUserAuthorizedCallback = OnUserAuthorizedCallback();
|
||||
}
|
||||
|
@ -292,7 +292,7 @@ void CloudService::setAccountInfo(const AccountInfo& info)
|
|||
m_userAuthorized.set(info.isValid());
|
||||
}
|
||||
|
||||
void CloudService::uploadScore(system::IODevice& scoreSourceDevice, const QString& title, const QUrl& sourceUrl)
|
||||
void CloudService::uploadScore(io::Device& scoreSourceDevice, const QString& title, const QUrl& sourceUrl)
|
||||
{
|
||||
auto uploadCallback = [this, &scoreSourceDevice, title, sourceUrl]() {
|
||||
return doUploadScore(scoreSourceDevice, title, sourceUrl);
|
||||
|
@ -306,7 +306,7 @@ void CloudService::uploadScore(system::IODevice& scoreSourceDevice, const QStrin
|
|||
executeRequest(uploadCallback);
|
||||
}
|
||||
|
||||
CloudService::RequestStatus CloudService::doUploadScore(system::IODevice& scoreSourceDevice, const QString& title, const QUrl& sourceUrl)
|
||||
CloudService::RequestStatus CloudService::doUploadScore(io::Device& scoreSourceDevice, const QString& title, const QUrl& sourceUrl)
|
||||
{
|
||||
QUrl uploadUrl = prepareUrlForRequest(configuration()->uploadingApiUrl());
|
||||
if (uploadUrl.isEmpty()) {
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
ValCh<bool> userAuthorized() const override;
|
||||
ValCh<AccountInfo> accountInfo() const override;
|
||||
|
||||
void uploadScore(system::IODevice& scoreSourceDevice, const QString& title, const QUrl& sourceUrl = QUrl()) override;
|
||||
void uploadScore(io::Device& scoreSourceDevice, const QString& title, const QUrl& sourceUrl = QUrl()) override;
|
||||
|
||||
async::Channel<QUrl> sourceUrlReceived() const override;
|
||||
framework::ProgressChannel progressChannel() const override;
|
||||
|
@ -88,7 +88,7 @@ private:
|
|||
network::RequestHeaders headers() const;
|
||||
|
||||
RequestStatus downloadUserInfo();
|
||||
RequestStatus doUploadScore(system::IODevice& scoreSourceDevice, const QString& title, const QUrl& sourceUrl = QUrl());
|
||||
RequestStatus doUploadScore(io::Device& scoreSourceDevice, const QString& title, const QUrl& sourceUrl = QUrl());
|
||||
|
||||
using RequestCallback = std::function<RequestStatus()>;
|
||||
void executeRequest(const RequestCallback& requestCallback);
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include "modularity/imoduleexport.h"
|
||||
#include "progress.h"
|
||||
#include "system/iodevice.h"
|
||||
#include "io/device.h"
|
||||
#include "progress.h"
|
||||
|
||||
class QByteArray;
|
||||
|
@ -39,7 +39,7 @@ class IUploadingService : MODULE_EXPORT_INTERFACE
|
|||
public:
|
||||
virtual ~IUploadingService() = default;
|
||||
|
||||
virtual void uploadScore(system::IODevice& scoreSourceDevice, const QString& title, const QUrl& sourceUrl = QUrl()) = 0;
|
||||
virtual void uploadScore(io::Device& scoreSourceDevice, const QString& title, const QUrl& sourceUrl = QUrl()) = 0;
|
||||
|
||||
virtual async::Channel<QUrl> sourceUrlReceived() const = 0;
|
||||
virtual framework::ProgressChannel progressChannel() const = 0;
|
||||
|
|
|
@ -45,6 +45,7 @@ set(MODULE_SRC
|
|||
${CMAKE_CURRENT_LIST_DIR}/iglobalconfiguration.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/io/path.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/io/path.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/io/device.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/log.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/logstream.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/dataformatter.cpp
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef MU_SYSTEM_IODEVICE_H
|
||||
#define MU_SYSTEM_IODEVICE_H
|
||||
#ifndef MU_IO_DEVICE_H
|
||||
#define MU_IO_DEVICE_H
|
||||
|
||||
#include <QIODevice>
|
||||
|
||||
namespace mu::system {
|
||||
using IODevice = QIODevice;
|
||||
namespace mu::io {
|
||||
using Device = QIODevice;
|
||||
}
|
||||
|
||||
#endif // MU_SYSTEM_IODEVICE_H
|
||||
#endif // MU_IO_DEVICE_H
|
|
@ -26,7 +26,7 @@
|
|||
#include <QFile>
|
||||
|
||||
using namespace mu::framework;
|
||||
using namespace mu::system;
|
||||
using namespace mu::io;
|
||||
|
||||
static XmlReader::TokenType convertTokenType(QXmlStreamReader::TokenType type)
|
||||
{
|
||||
|
@ -57,12 +57,12 @@ static XmlReader::TokenType convertTokenType(QXmlStreamReader::TokenType type)
|
|||
XmlReader::XmlReader(const io::path& path)
|
||||
{
|
||||
m_device = std::make_unique<QFile>(path.toQString());
|
||||
m_device->open(IODevice::ReadOnly);
|
||||
m_device->open(Device::ReadOnly);
|
||||
|
||||
m_reader = std::make_unique<QXmlStreamReader>(m_device.get());
|
||||
}
|
||||
|
||||
XmlReader::XmlReader(IODevice* device)
|
||||
XmlReader::XmlReader(Device* device)
|
||||
{
|
||||
m_reader = std::make_unique<QXmlStreamReader>(device);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <memory>
|
||||
|
||||
#include "io/path.h"
|
||||
#include "system/iodevice.h"
|
||||
#include "io/device.h"
|
||||
|
||||
class QXmlStreamReader;
|
||||
class QByteArray;
|
||||
|
@ -36,7 +36,7 @@ class XmlReader
|
|||
{
|
||||
public:
|
||||
XmlReader(const io::path& path);
|
||||
XmlReader(system::IODevice* device);
|
||||
XmlReader(io::Device* device);
|
||||
XmlReader(const QByteArray& bytes);
|
||||
~XmlReader();
|
||||
|
||||
|
@ -80,7 +80,7 @@ private:
|
|||
QString readElementText(ReadStringBehavior behavior = ErrorOnUnexpectedElement);
|
||||
QStringRef attributeValue(std::string_view name) const;
|
||||
|
||||
std::unique_ptr<system::IODevice> m_device;
|
||||
std::unique_ptr<io::Device> m_device;
|
||||
std::unique_ptr<QXmlStreamReader> m_reader;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -26,22 +26,22 @@
|
|||
#include <QFile>
|
||||
|
||||
using namespace mu::framework;
|
||||
using namespace mu::system;
|
||||
using namespace mu::io;
|
||||
|
||||
XmlWriter::XmlWriter(const io::path& path)
|
||||
{
|
||||
m_device = std::make_unique<QFile>(path.toQString());
|
||||
m_device->open(IODevice::WriteOnly);
|
||||
m_device->open(Device::WriteOnly);
|
||||
|
||||
initWriter(m_device.get());
|
||||
}
|
||||
|
||||
XmlWriter::XmlWriter(IODevice* device)
|
||||
XmlWriter::XmlWriter(Device* device)
|
||||
{
|
||||
initWriter(device);
|
||||
}
|
||||
|
||||
void XmlWriter::initWriter(IODevice* device)
|
||||
void XmlWriter::initWriter(Device* device)
|
||||
{
|
||||
m_writer = std::make_unique<QXmlStreamWriter>(device);
|
||||
m_writer->setAutoFormatting(true);
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <memory>
|
||||
|
||||
#include "io/path.h"
|
||||
#include "system/iodevice.h"
|
||||
#include "io/device.h"
|
||||
|
||||
class QXmlStreamWriter;
|
||||
|
||||
|
@ -35,7 +35,7 @@ class XmlWriter
|
|||
{
|
||||
public:
|
||||
XmlWriter(const io::path& path);
|
||||
XmlWriter(system::IODevice* device);
|
||||
XmlWriter(io::Device* device);
|
||||
~XmlWriter();
|
||||
|
||||
void writeStartDocument(std::string_view version = std::string_view());
|
||||
|
@ -51,9 +51,9 @@ public:
|
|||
bool success() const;
|
||||
|
||||
private:
|
||||
void initWriter(system::IODevice* device);
|
||||
void initWriter(io::Device* device);
|
||||
|
||||
std::unique_ptr<system::IODevice> m_device;
|
||||
std::unique_ptr<io::Device> m_device;
|
||||
std::unique_ptr<QXmlStreamWriter> m_writer;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
using namespace mu;
|
||||
using namespace mu::network;
|
||||
using namespace mu::framework;
|
||||
using namespace mu::system;
|
||||
using namespace mu::io;
|
||||
|
||||
static constexpr int NET_TIMEOUT_MS = 60000;
|
||||
|
||||
|
@ -79,13 +79,13 @@ Ret NetworkManager::execRequest(RequestType requestType, const QUrl& url, Incomi
|
|||
const RequestHeaders& headers)
|
||||
{
|
||||
if (outgoingData && outgoingData->device()) {
|
||||
if (!openIoDevice(outgoingData->device(), IODevice::ReadOnly)) {
|
||||
if (!openDevice(outgoingData->device(), Device::ReadOnly)) {
|
||||
return make_ret(Err::FiledOpenIODeviceRead);
|
||||
}
|
||||
}
|
||||
|
||||
if (incommingData) {
|
||||
if (!openIoDevice(incommingData, IODevice::WriteOnly)) {
|
||||
if (!openDevice(incommingData, Device::WriteOnly)) {
|
||||
return make_ret(Err::FiledOpenIODeviceWrite);
|
||||
}
|
||||
m_incommingData = incommingData;
|
||||
|
@ -117,10 +117,10 @@ Ret NetworkManager::execRequest(RequestType requestType, const QUrl& url, Incomi
|
|||
}
|
||||
|
||||
if (outgoingData && outgoingData->device()) {
|
||||
closeIoDevice(outgoingData->device());
|
||||
closeDevice(outgoingData->device());
|
||||
}
|
||||
|
||||
closeIoDevice(m_incommingData);
|
||||
closeDevice(m_incommingData);
|
||||
m_incommingData = nullptr;
|
||||
|
||||
return ret;
|
||||
|
@ -167,7 +167,7 @@ void NetworkManager::abort()
|
|||
emit aborted();
|
||||
}
|
||||
|
||||
bool NetworkManager::openIoDevice(IODevice* device, IODevice::OpenModeFlag flags)
|
||||
bool NetworkManager::openDevice(Device* device, Device::OpenModeFlag flags)
|
||||
{
|
||||
IF_ASSERT_FAILED(device) {
|
||||
return false;
|
||||
|
@ -180,7 +180,7 @@ bool NetworkManager::openIoDevice(IODevice* device, IODevice::OpenModeFlag flags
|
|||
return device->open(flags);
|
||||
}
|
||||
|
||||
void NetworkManager::closeIoDevice(IODevice* device)
|
||||
void NetworkManager::closeDevice(Device* device)
|
||||
{
|
||||
if (device && device->isOpen()) {
|
||||
device->close();
|
||||
|
|
|
@ -66,8 +66,8 @@ private:
|
|||
|
||||
QNetworkReply* receiveReply(RequestType requestType, const QNetworkRequest& request, OutgoingDevice* outgoingData = nullptr);
|
||||
|
||||
bool openIoDevice(system::IODevice* device, QIODevice::OpenModeFlag flags);
|
||||
void closeIoDevice(system::IODevice* device);
|
||||
bool openDevice(io::Device* device, QIODevice::OpenModeFlag flags);
|
||||
void closeDevice(io::Device* device);
|
||||
|
||||
bool isAborted() const;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include <QVariantMap>
|
||||
#include <QNetworkRequest>
|
||||
|
||||
#include "system/iodevice.h"
|
||||
#include "io/device.h"
|
||||
|
||||
class QHttpMultiPart;
|
||||
|
||||
|
@ -36,16 +36,16 @@ struct RequestHeaders
|
|||
QMap<QByteArray, QByteArray> rawHeaders;
|
||||
};
|
||||
|
||||
using IncomingDevice = system::IODevice;
|
||||
using IncomingDevice = io::Device;
|
||||
|
||||
struct OutgoingDevice
|
||||
{
|
||||
OutgoingDevice(system::IODevice* device)
|
||||
OutgoingDevice(io::Device* device)
|
||||
: m_device(device), m_multiPart(nullptr) {}
|
||||
OutgoingDevice(QHttpMultiPart* multiPart)
|
||||
: m_device(nullptr), m_multiPart(multiPart) {}
|
||||
|
||||
system::IODevice* device() const
|
||||
io::Device* device() const
|
||||
{
|
||||
return m_device;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ struct OutgoingDevice
|
|||
}
|
||||
|
||||
private:
|
||||
system::IODevice* m_device = nullptr;
|
||||
io::Device* m_device = nullptr;
|
||||
QHttpMultiPart* m_multiPart = nullptr;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ set(MODULE_SRC
|
|||
${CMAKE_CURRENT_LIST_DIR}/systemmodule.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/systemerrors.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/ifilesystem.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/iodevice.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/internal/filesystem.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/internal/filesystem.h
|
||||
)
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
#include "log.h"
|
||||
|
||||
using namespace mu::iex::audioexport;
|
||||
using namespace mu::system;
|
||||
using namespace mu::io;
|
||||
|
||||
mu::Ret FlacWriter::write(notation::INotationPtr notation, IODevice& destinationDevice, const Options& options)
|
||||
mu::Ret FlacWriter::write(notation::INotationPtr notation, Device& destinationDevice, const Options& options)
|
||||
{
|
||||
UNUSED(notation)
|
||||
UNUSED(destinationDevice)
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace mu::iex::audioexport {
|
|||
class FlacWriter : public notation::AbstractNotationWriter
|
||||
{
|
||||
public:
|
||||
Ret write(notation::INotationPtr notation, system::IODevice& destinationDevice, const Options& options = Options()) override;
|
||||
Ret write(notation::INotationPtr notation, io::Device& destinationDevice, const Options& options = Options()) override;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
using namespace mu::iex::audioexport;
|
||||
using namespace mu::framework;
|
||||
|
||||
mu::Ret Mp3Writer::write(notation::INotationPtr notation, system::IODevice& destinationDevice, const Options& options)
|
||||
mu::Ret Mp3Writer::write(notation::INotationPtr notation, io::Device& destinationDevice, const Options& options)
|
||||
{
|
||||
UNUSED(notation)
|
||||
UNUSED(destinationDevice)
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace mu::iex::audioexport {
|
|||
class Mp3Writer : public notation::AbstractNotationWriter
|
||||
{
|
||||
public:
|
||||
Ret write(notation::INotationPtr notation, system::IODevice& destinationDevice, const Options& options = Options()) override;
|
||||
Ret write(notation::INotationPtr notation, io::Device& destinationDevice, const Options& options = Options()) override;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
#include "log.h"
|
||||
|
||||
using namespace mu::iex::audioexport;
|
||||
using namespace mu::system;
|
||||
using namespace mu::io;
|
||||
|
||||
mu::Ret OggWriter::write(notation::INotationPtr notation, IODevice& destinationDevice, const Options& options)
|
||||
mu::Ret OggWriter::write(notation::INotationPtr notation, Device& destinationDevice, const Options& options)
|
||||
{
|
||||
UNUSED(notation)
|
||||
UNUSED(destinationDevice)
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace mu::iex::audioexport {
|
|||
class OggWriter : public notation::AbstractNotationWriter
|
||||
{
|
||||
public:
|
||||
Ret write(notation::INotationPtr notation, system::IODevice& destinationDevice, const Options& options = Options()) override;
|
||||
Ret write(notation::INotationPtr notation, io::Device& destinationDevice, const Options& options = Options()) override;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
using namespace mu::iex::audioexport;
|
||||
using namespace mu::framework;
|
||||
|
||||
mu::Ret WaveWriter::write(notation::INotationPtr notation, system::IODevice& destinationDevice, const Options& options)
|
||||
mu::Ret WaveWriter::write(notation::INotationPtr notation, io::Device& destinationDevice, const Options& options)
|
||||
{
|
||||
UNUSED(notation)
|
||||
UNUSED(destinationDevice)
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace mu::iex::audioexport {
|
|||
class WaveWriter : public notation::AbstractNotationWriter
|
||||
{
|
||||
public:
|
||||
Ret write(notation::INotationPtr notation, system::IODevice& destinationDevice, const Options& options = Options()) override;
|
||||
Ret write(notation::INotationPtr notation, io::Device& destinationDevice, const Options& options = Options()) override;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
using namespace mu::iex::imagesexport;
|
||||
using namespace mu::notation;
|
||||
using namespace mu::system;
|
||||
using namespace mu::io;
|
||||
using namespace Ms;
|
||||
|
||||
std::vector<INotationWriter::UnitType> PdfWriter::supportedUnitTypes() const
|
||||
|
@ -39,7 +39,7 @@ std::vector<INotationWriter::UnitType> PdfWriter::supportedUnitTypes() const
|
|||
return { UnitType::PER_PART, UnitType::MULTI_PART };
|
||||
}
|
||||
|
||||
mu::Ret PdfWriter::write(INotationPtr notation, system::IODevice& destinationDevice, const Options& options)
|
||||
mu::Ret PdfWriter::write(INotationPtr notation, io::Device& destinationDevice, const Options& options)
|
||||
{
|
||||
UnitType unitType = unitTypeFromOptions(options);
|
||||
IF_ASSERT_FAILED(unitType == UnitType::PER_PART) {
|
||||
|
@ -69,7 +69,7 @@ mu::Ret PdfWriter::write(INotationPtr notation, system::IODevice& destinationDev
|
|||
return true;
|
||||
}
|
||||
|
||||
mu::Ret PdfWriter::writeList(const INotationPtrList& notations, system::IODevice& destinationDevice, const Options& options)
|
||||
mu::Ret PdfWriter::writeList(const INotationPtrList& notations, io::Device& destinationDevice, const Options& options)
|
||||
{
|
||||
IF_ASSERT_FAILED(!notations.empty()) {
|
||||
return make_ret(Ret::Code::UnknownError);
|
||||
|
|
|
@ -37,9 +37,8 @@ class PdfWriter : public notation::AbstractNotationWriter
|
|||
|
||||
public:
|
||||
std::vector<notation::INotationWriter::UnitType> supportedUnitTypes() const override;
|
||||
Ret write(notation::INotationPtr notation, system::IODevice& destinationDevice, const Options& options = Options()) override;
|
||||
Ret writeList(const notation::INotationPtrList& notations, system::IODevice& destinationDevice,
|
||||
const Options& options = Options()) override;
|
||||
Ret write(notation::INotationPtr notation, io::Device& destinationDevice, const Options& options = Options()) override;
|
||||
Ret writeList(const notation::INotationPtrList& notations, io::Device& destinationDevice, const Options& options = Options()) override;
|
||||
|
||||
private:
|
||||
QString documentTitle(const Ms::Score& score) const;
|
||||
|
|
|
@ -35,14 +35,14 @@
|
|||
|
||||
using namespace mu::iex::imagesexport;
|
||||
using namespace mu::notation;
|
||||
using namespace mu::system;
|
||||
using namespace mu::io;
|
||||
|
||||
std::vector<INotationWriter::UnitType> PngWriter::supportedUnitTypes() const
|
||||
{
|
||||
return { UnitType::PER_PAGE };
|
||||
}
|
||||
|
||||
mu::Ret PngWriter::write(INotationPtr notation, IODevice& destinationDevice, const Options& options)
|
||||
mu::Ret PngWriter::write(INotationPtr notation, Device& destinationDevice, const Options& options)
|
||||
{
|
||||
IF_ASSERT_FAILED(notation) {
|
||||
return make_ret(Ret::Code::UnknownError);
|
||||
|
|
|
@ -35,7 +35,7 @@ class PngWriter : public notation::AbstractNotationWriter
|
|||
|
||||
public:
|
||||
std::vector<notation::INotationWriter::UnitType> supportedUnitTypes() const override;
|
||||
Ret write(notation::INotationPtr notation, system::IODevice& destinationDevice, const Options& options = Options()) override;
|
||||
Ret write(notation::INotationPtr notation, io::Device& destinationDevice, const Options& options = Options()) override;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -37,14 +37,14 @@
|
|||
|
||||
using namespace mu::iex::imagesexport;
|
||||
using namespace mu::notation;
|
||||
using namespace mu::system;
|
||||
using namespace mu::io;
|
||||
|
||||
std::vector<INotationWriter::UnitType> SvgWriter::supportedUnitTypes() const
|
||||
{
|
||||
return { UnitType::PER_PAGE };
|
||||
}
|
||||
|
||||
mu::Ret SvgWriter::write(INotationPtr notation, IODevice& destinationDevice, const Options& options)
|
||||
mu::Ret SvgWriter::write(INotationPtr notation, Device& destinationDevice, const Options& options)
|
||||
{
|
||||
IF_ASSERT_FAILED(notation) {
|
||||
return make_ret(Ret::Code::UnknownError);
|
||||
|
|
|
@ -30,7 +30,7 @@ class SvgWriter : public notation::AbstractNotationWriter
|
|||
{
|
||||
public:
|
||||
std::vector<notation::INotationWriter::UnitType> supportedUnitTypes() const override;
|
||||
Ret write(notation::INotationPtr notation, system::IODevice& destinationDevice, const Options& options = Options()) override;
|
||||
Ret write(notation::INotationPtr notation, io::Device& destinationDevice, const Options& options = Options()) override;
|
||||
|
||||
private:
|
||||
using NotesColors = QHash<int /* noteIndex */, QColor>;
|
||||
|
|
|
@ -26,9 +26,10 @@
|
|||
#include "midiexport/exportmidi.h"
|
||||
|
||||
using namespace mu::iex::midi;
|
||||
using namespace mu::system;
|
||||
using namespace mu::io;
|
||||
using namespace mu::notation;
|
||||
|
||||
mu::Ret NotationMidiWriter::write(notation::INotationPtr notation, IODevice& destinationDevice, const Options&)
|
||||
mu::Ret NotationMidiWriter::write(INotationPtr notation, io::Device& destinationDevice, const Options&)
|
||||
{
|
||||
IF_ASSERT_FAILED(notation) {
|
||||
return make_ret(Ret::Code::UnknownError);
|
||||
|
|
|
@ -36,7 +36,7 @@ class NotationMidiWriter : public notation::AbstractNotationWriter
|
|||
INJECT(midi, IMidiImportExportConfiguration, midiImportExportConfiguration)
|
||||
|
||||
public:
|
||||
Ret write(notation::INotationPtr notation, system::IODevice& destinationDevice, const Options& options = Options()) override;
|
||||
Ret write(notation::INotationPtr notation, io::Device& destinationDevice, const Options& options = Options()) override;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
#include "musicxml/exportxml.h"
|
||||
|
||||
using namespace mu::iex::musicxml;
|
||||
using namespace mu::system;
|
||||
using namespace mu::io;
|
||||
|
||||
mu::Ret MusicXmlWriter::write(notation::INotationPtr notation, IODevice& destinationDevice, const Options&)
|
||||
mu::Ret MusicXmlWriter::write(notation::INotationPtr notation, Device& destinationDevice, const Options&)
|
||||
{
|
||||
IF_ASSERT_FAILED(notation) {
|
||||
return make_ret(Ret::Code::UnknownError);
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace mu::iex::musicxml {
|
|||
class MusicXmlWriter : public notation::AbstractNotationWriter
|
||||
{
|
||||
public:
|
||||
Ret write(notation::INotationPtr notation, system::IODevice& destinationDevice, const Options& options = Options()) override;
|
||||
Ret write(notation::INotationPtr notation, io::Device& destinationDevice, const Options& options = Options()) override;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
#include "musicxml/exportxml.h"
|
||||
|
||||
using namespace mu::iex::musicxml;
|
||||
using namespace mu::system;
|
||||
using namespace mu::io;
|
||||
|
||||
mu::Ret MxlWriter::write(notation::INotationPtr notation, system::IODevice& destinationDevice, const Options&)
|
||||
mu::Ret MxlWriter::write(notation::INotationPtr notation, io::Device& destinationDevice, const Options&)
|
||||
{
|
||||
IF_ASSERT_FAILED(notation) {
|
||||
return make_ret(Ret::Code::UnknownError);
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace mu::iex::musicxml {
|
|||
class MxlWriter : public notation::AbstractNotationWriter
|
||||
{
|
||||
public:
|
||||
Ret write(notation::INotationPtr notation, system::IODevice& destinationDevice, const Options& options = Options()) override;
|
||||
Ret write(notation::INotationPtr notation, io::Device& destinationDevice, const Options& options = Options()) override;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -32,9 +32,8 @@ public:
|
|||
std::vector<UnitType> supportedUnitTypes() const override;
|
||||
bool supportsUnitType(UnitType unitType) const override;
|
||||
|
||||
virtual Ret write(INotationPtr notation, system::IODevice& destinationDevice, const Options& options = Options()) override;
|
||||
virtual Ret writeList(const INotationPtrList& notations, system::IODevice& destinationDevice,
|
||||
const Options& options = Options()) override;
|
||||
virtual Ret write(INotationPtr notation, io::Device& destinationDevice, const Options& options = Options()) override;
|
||||
virtual Ret writeList(const INotationPtrList& notations, io::Device& destinationDevice, const Options& options = Options()) override;
|
||||
|
||||
void abort() override;
|
||||
framework::ProgressChannel progress() const override;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "iexcerptnotation.h"
|
||||
#include "retval.h"
|
||||
#include "io/path.h"
|
||||
#include "system/iodevice.h"
|
||||
#include "io/device.h"
|
||||
|
||||
namespace mu::notation {
|
||||
using ExcerptNotationList = std::vector<IExcerptNotationPtr>;
|
||||
|
@ -55,7 +55,7 @@ public:
|
|||
virtual INotationPartsPtr parts() const = 0;
|
||||
virtual INotationPtr clone() const = 0;
|
||||
|
||||
virtual Ret writeToDevice(system::IODevice& destinationDevice) = 0;
|
||||
virtual Ret writeToDevice(io::Device& destinationDevice) = 0;
|
||||
};
|
||||
|
||||
using IMasterNotationPtr = std::shared_ptr<IMasterNotation>;
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "async/channel.h"
|
||||
#include "global/progress.h"
|
||||
#include "system/iodevice.h"
|
||||
#include "io/device.h"
|
||||
#include "inotation.h"
|
||||
|
||||
namespace mu::notation {
|
||||
|
@ -56,8 +56,8 @@ public:
|
|||
|
||||
virtual ~INotationWriter() = default;
|
||||
|
||||
virtual Ret write(INotationPtr notation, system::IODevice& destinationDevice, const Options& options = Options()) = 0;
|
||||
virtual Ret writeList(const INotationPtrList& notations, system::IODevice& destinationDevice, const Options& options = Options()) = 0;
|
||||
virtual Ret write(INotationPtr notation, io::Device& destinationDevice, const Options& options = Options()) = 0;
|
||||
virtual Ret writeList(const INotationPtrList& notations, io::Device& destinationDevice, const Options& options = Options()) = 0;
|
||||
virtual void abort() = 0;
|
||||
virtual framework::ProgressChannel progress() const = 0;
|
||||
};
|
||||
|
|
|
@ -38,7 +38,7 @@ bool AbstractNotationWriter::supportsUnitType(UnitType unitType) const
|
|||
return std::find(unitTypes.cbegin(), unitTypes.cend(), unitType) != unitTypes.cend();
|
||||
}
|
||||
|
||||
mu::Ret AbstractNotationWriter::write(INotationPtr, system::IODevice&, const Options& options)
|
||||
mu::Ret AbstractNotationWriter::write(INotationPtr, io::Device&, const Options& options)
|
||||
{
|
||||
IF_ASSERT_FAILED(unitTypeFromOptions(options) != UnitType::MULTI_PART) {
|
||||
return Ret(Ret::Code::NotSupported);
|
||||
|
@ -53,7 +53,7 @@ mu::Ret AbstractNotationWriter::write(INotationPtr, system::IODevice&, const Opt
|
|||
return Ret(Ret::Code::NotSupported);
|
||||
}
|
||||
|
||||
mu::Ret AbstractNotationWriter::writeList(const INotationPtrList&, system::IODevice&, const Options& options)
|
||||
mu::Ret AbstractNotationWriter::writeList(const INotationPtrList&, io::Device&, const Options& options)
|
||||
{
|
||||
IF_ASSERT_FAILED(unitTypeFromOptions(options) == UnitType::MULTI_PART) {
|
||||
return Ret(Ret::Code::NotSupported);
|
||||
|
|
|
@ -706,7 +706,7 @@ mu::Ret MasterNotation::saveSelectionOnScore(const mu::io::path& path)
|
|||
return ret;
|
||||
}
|
||||
|
||||
mu::Ret MasterNotation::writeToDevice(system::IODevice& destinationDevice)
|
||||
mu::Ret MasterNotation::writeToDevice(io::Device& destinationDevice)
|
||||
{
|
||||
bool ok = score()->saveCompressedFile(&destinationDevice, score()->title(), false);
|
||||
return ok;
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
INotationPartsPtr parts() const override;
|
||||
INotationPtr clone() const override;
|
||||
|
||||
Ret writeToDevice(system::IODevice& destinationDevice) override;
|
||||
Ret writeToDevice(io::Device& destinationDevice) override;
|
||||
|
||||
private:
|
||||
Ret exportScore(const io::path& path, const std::string& suffix);
|
||||
|
|
50
src/notation/internal/notationmetawriter.h
Normal file
50
src/notation/internal/notationmetawriter.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: GPL-3.0-only
|
||||
* MuseScore-CLA-applies
|
||||
*
|
||||
* MuseScore
|
||||
* Music Composition & Notation
|
||||
*
|
||||
* Copyright (C) 2021 MuseScore BVBA and others
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef MU_NOTATION_NOTATIONMETAWRITER_H
|
||||
#define MU_NOTATION_NOTATIONMETAWRITER_H
|
||||
|
||||
#include "abstractnotationwriter.h"
|
||||
|
||||
namespace Ms {
|
||||
class Score;
|
||||
}
|
||||
|
||||
namespace mu::notation {
|
||||
class NotationMetaWriter : public AbstractNotationWriter
|
||||
{
|
||||
public:
|
||||
Ret write(notation::INotationPtr notation, io::Device& destinationDevice, const Options& options = Options()) override;
|
||||
|
||||
private:
|
||||
std::string title(const Ms::Score* score) const;
|
||||
std::string subtitle(const Ms::Score* score) const;
|
||||
std::string composer(const Ms::Score* score) const;
|
||||
std::string poet(const Ms::Score* score) const;
|
||||
std::string timesig(const Ms::Score* score) const;
|
||||
std::pair<std::string, std::string> tempo(const Ms::Score* score) const;
|
||||
std::string parts(const Ms::Score* score) const;
|
||||
std::string pageFormat(const Ms::Score* score) const;
|
||||
std::string typeData(Ms::Score* score);
|
||||
};
|
||||
}
|
||||
|
||||
#endif // MU_NOTATION_MSCZNOTATIONMETAWRITER_H
|
|
@ -31,7 +31,7 @@
|
|||
#include "global/xmlwriter.h"
|
||||
|
||||
using namespace mu::notation;
|
||||
using namespace mu::system;
|
||||
using namespace mu::io;
|
||||
using namespace mu::framework;
|
||||
|
||||
constexpr std::string_view SCORE_TAG("score");
|
||||
|
@ -76,7 +76,7 @@ PositionsWriter::PositionsWriter(PositionsWriter::ElementType elementType)
|
|||
{
|
||||
}
|
||||
|
||||
mu::Ret PositionsWriter::write(notation::INotationPtr notation, system::IODevice& destinationDevice, const Options&)
|
||||
mu::Ret PositionsWriter::write(INotationPtr notation, Device& destinationDevice, const Options&)
|
||||
{
|
||||
IF_ASSERT_FAILED(notation) {
|
||||
return make_ret(Ret::Code::UnknownError);
|
||||
|
|
|
@ -49,7 +49,7 @@ public:
|
|||
explicit PositionsWriter() = default;
|
||||
explicit PositionsWriter(ElementType elementType);
|
||||
|
||||
Ret write(notation::INotationPtr notation, system::IODevice& destinationDevice, const Options& options = Options()) override;
|
||||
Ret write(notation::INotationPtr notation, io::Device& destinationDevice, const Options& options = Options()) override;
|
||||
|
||||
private:
|
||||
qreal pngDpiResolution() const;
|
||||
|
|
|
@ -29,11 +29,11 @@
|
|||
|
||||
using namespace mu::palette;
|
||||
using namespace mu::workspace;
|
||||
using namespace mu::system;
|
||||
using namespace mu::io;
|
||||
|
||||
static const QString PALETTE_TAG("PaletteBox");
|
||||
|
||||
AbstractDataPtrList WorkspacePaletteStream::read(IODevice& sourceDevice) const
|
||||
AbstractDataPtrList WorkspacePaletteStream::read(Device& sourceDevice) const
|
||||
{
|
||||
Ms::XmlReader reader(&sourceDevice);
|
||||
|
||||
|
@ -58,7 +58,7 @@ PaletteWorkspaceDataPtr WorkspacePaletteStream::readPalettes(Ms::XmlReader& read
|
|||
return palettes;
|
||||
}
|
||||
|
||||
void WorkspacePaletteStream::write(const AbstractDataPtrList& dataList, IODevice& destinationDevice) const
|
||||
void WorkspacePaletteStream::write(const AbstractDataPtrList& dataList, Device& destinationDevice) const
|
||||
{
|
||||
Ms::XmlWriter writer(nullptr, &destinationDevice);
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@ namespace mu::palette {
|
|||
class WorkspacePaletteStream : public workspace::IWorkspaceDataStream
|
||||
{
|
||||
public:
|
||||
workspace::AbstractDataPtrList read(system::IODevice& sourceDevice) const override;
|
||||
void write(const workspace::AbstractDataPtrList& dataList, system::IODevice& destinationDevice) const override;
|
||||
workspace::AbstractDataPtrList read(io::Device& sourceDevice) const override;
|
||||
void write(const workspace::AbstractDataPtrList& dataList, io::Device& destinationDevice) const override;
|
||||
|
||||
workspace::WorkspaceTag tag() const override;
|
||||
|
||||
|
|
|
@ -23,27 +23,27 @@
|
|||
|
||||
using namespace mu::network;
|
||||
|
||||
mu::Ret NetworkManagerStub::get(const QUrl&, mu::system::IODevice*)
|
||||
mu::Ret NetworkManagerStub::get(const QUrl&, IncomingDevice*, const RequestHeaders&)
|
||||
{
|
||||
return make_ret(Ret::Code::NotSupported);
|
||||
}
|
||||
|
||||
mu::Ret NetworkManagerStub::head(const QUrl&)
|
||||
mu::Ret NetworkManagerStub::head(const QUrl&, const RequestHeaders&)
|
||||
{
|
||||
return make_ret(Ret::Code::NotSupported);
|
||||
}
|
||||
|
||||
mu::Ret NetworkManagerStub::post(const QUrl&, mu::system::IODevice*, mu::system::IODevice*)
|
||||
mu::Ret NetworkManagerStub::post(const QUrl&, OutgoingDevice*, IncomingDevice*, const RequestHeaders&)
|
||||
{
|
||||
return make_ret(Ret::Code::NotSupported);
|
||||
}
|
||||
|
||||
mu::Ret NetworkManagerStub::put(const QUrl&, mu::system::IODevice*, mu::system::IODevice*)
|
||||
mu::Ret NetworkManagerStub::put(const QUrl&, OutgoingDevice*, IncomingDevice*, const RequestHeaders&)
|
||||
{
|
||||
return make_ret(Ret::Code::NotSupported);
|
||||
}
|
||||
|
||||
mu::Ret NetworkManagerStub::del(const QUrl&, mu::system::IODevice*)
|
||||
mu::Ret NetworkManagerStub::del(const QUrl&, IncomingDevice*, const RequestHeaders&)
|
||||
{
|
||||
return make_ret(Ret::Code::NotSupported);
|
||||
}
|
||||
|
|
|
@ -28,11 +28,13 @@ namespace mu::network {
|
|||
class NetworkManagerStub : public INetworkManager
|
||||
{
|
||||
public:
|
||||
Ret get(const QUrl&, system::IODevice*) override;
|
||||
Ret head(const QUrl&) override;
|
||||
Ret post(const QUrl&, system::IODevice*, system::IODevice*) override;
|
||||
Ret put(const QUrl&, system::IODevice*, system::IODevice*) override;
|
||||
Ret del(const QUrl&, system::IODevice*) override;
|
||||
Ret get(const QUrl& url, IncomingDevice* incommingData, const RequestHeaders& headers = RequestHeaders()) override;
|
||||
Ret head(const QUrl& url, const RequestHeaders& headers = RequestHeaders()) override;
|
||||
Ret post(const QUrl& url, OutgoingDevice* outgoingData, IncomingDevice* incommingData,
|
||||
const RequestHeaders& headers = RequestHeaders()) override;
|
||||
Ret put(const QUrl& url, OutgoingDevice* outgoingData, IncomingDevice* incommingData,
|
||||
const RequestHeaders& headers = RequestHeaders()) override;
|
||||
Ret del(const QUrl& url, IncomingDevice* incommingData, const RequestHeaders& headers = RequestHeaders()) override;
|
||||
|
||||
framework::ProgressChannel progressChannel() const override;
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ bool ExportScoreScenario::exportScores(const INotationPtrList& notations, const
|
|||
? chosenPath
|
||||
: completeExportPath(chosenPath, notation, isMainNotation(notation), page);
|
||||
|
||||
auto exportFunction = [writer, notation, options](system::IODevice& destinationDevice) {
|
||||
auto exportFunction = [writer, notation, options](io::Device& destinationDevice) {
|
||||
return writer->write(notation, destinationDevice, options);
|
||||
};
|
||||
|
||||
|
@ -106,7 +106,7 @@ bool ExportScoreScenario::exportScores(const INotationPtrList& notations, const
|
|||
? chosenPath
|
||||
: completeExportPath(chosenPath, notation, isMainNotation(notation));
|
||||
|
||||
auto exportFunction = [writer, notation, options](system::IODevice& destinationDevice) {
|
||||
auto exportFunction = [writer, notation, options](io::Device& destinationDevice) {
|
||||
return writer->write(notation, destinationDevice, options);
|
||||
};
|
||||
|
||||
|
@ -119,7 +119,7 @@ bool ExportScoreScenario::exportScores(const INotationPtrList& notations, const
|
|||
{ INotationWriter::OptionKey::TRANSPARENT_BACKGROUND, Val(imagesExportConfiguration()->exportPngWithTransparentBackground()) }
|
||||
};
|
||||
|
||||
auto exportFunction = [writer, notations, options](system::IODevice& destinationDevice) {
|
||||
auto exportFunction = [writer, notations, options](io::Device& destinationDevice) {
|
||||
return writer->writeList(notations, destinationDevice, options);
|
||||
};
|
||||
|
||||
|
@ -262,7 +262,7 @@ bool ExportScoreScenario::askForRetry(const QString& filename) const
|
|||
return result.standartButton() == IInteractive::Button::Retry;
|
||||
}
|
||||
|
||||
bool ExportScoreScenario::doExportLoop(const io::path& scorePath, std::function<bool(system::IODevice&)> exportFunction) const
|
||||
bool ExportScoreScenario::doExportLoop(const io::path& scorePath, std::function<bool(io::Device&)> exportFunction) const
|
||||
{
|
||||
IF_ASSERT_FAILED(exportFunction) {
|
||||
return false;
|
||||
|
|
|
@ -66,7 +66,7 @@ private:
|
|||
bool shouldReplaceFile(const QString& filename) const;
|
||||
bool askForRetry(const QString& filename) const;
|
||||
|
||||
bool doExportLoop(const io::path& path, std::function<bool(system::IODevice&)> exportFunction) const;
|
||||
bool doExportLoop(const io::path& path, std::function<bool(io::Device&)> exportFunction) const;
|
||||
|
||||
mutable FileConflictPolicy m_fileConflictPolicy;
|
||||
};
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
using namespace mu;
|
||||
using namespace mu::workspace;
|
||||
using namespace mu::system;
|
||||
using namespace mu::io;
|
||||
using namespace mu::framework;
|
||||
|
||||
static constexpr std::string_view WORKSPACE_MUSESCORE_TAG("museScore");
|
||||
|
@ -216,7 +216,7 @@ Ret Workspace::readWorkspace(const QByteArray& xmlData)
|
|||
{
|
||||
QBuffer buffer;
|
||||
buffer.setData(xmlData);
|
||||
buffer.open(IODevice::ReadOnly);
|
||||
buffer.open(Device::ReadOnly);
|
||||
|
||||
XmlReader reader(&buffer);
|
||||
while (reader.canRead()) {
|
||||
|
@ -251,7 +251,7 @@ Ret Workspace::write()
|
|||
}
|
||||
|
||||
QBuffer buffer;
|
||||
buffer.open(IODevice::WriteOnly);
|
||||
buffer.open(Device::WriteOnly);
|
||||
XmlWriter writer(&buffer);
|
||||
|
||||
writer.writeStartDocument();
|
||||
|
|
|
@ -171,7 +171,7 @@ void WorkspaceFile::MetaInfo::writeContainer(QByteArray* data) const
|
|||
}
|
||||
|
||||
QBuffer buffer(data);
|
||||
buffer.open(IODevice::WriteOnly);
|
||||
buffer.open(Device::WriteOnly);
|
||||
|
||||
XmlWriter writer(&buffer);
|
||||
writer.writeStartDocument();
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
using namespace mu::workspace;
|
||||
using namespace mu::framework;
|
||||
using namespace mu::system;
|
||||
using namespace mu::io;
|
||||
|
||||
static constexpr std::string_view SETTINGS_TAG("Preferences");
|
||||
static constexpr std::string_view UI_ARRANGMENT_TAG("UiArrangment");
|
||||
|
@ -42,7 +42,7 @@ WorkspaceSettingsStream::WorkspaceSettingsStream(WorkspaceTag tag)
|
|||
{
|
||||
}
|
||||
|
||||
AbstractDataPtrList WorkspaceSettingsStream::read(IODevice& sourceDevice) const
|
||||
AbstractDataPtrList WorkspaceSettingsStream::read(Device& sourceDevice) const
|
||||
{
|
||||
XmlReader reader(&sourceDevice);
|
||||
|
||||
|
@ -75,7 +75,7 @@ SettingsDataPtr WorkspaceSettingsStream::readSettings(XmlReader& reader) const
|
|||
return settings;
|
||||
}
|
||||
|
||||
void WorkspaceSettingsStream::write(const AbstractDataPtrList& settingsList, IODevice& destinationDevice) const
|
||||
void WorkspaceSettingsStream::write(const AbstractDataPtrList& settingsList, Device& destinationDevice) const
|
||||
{
|
||||
XmlWriter writer(&destinationDevice);
|
||||
|
||||
|
|
|
@ -35,8 +35,8 @@ class WorkspaceSettingsStream : public IWorkspaceDataStream
|
|||
public:
|
||||
WorkspaceSettingsStream(WorkspaceTag tag);
|
||||
|
||||
AbstractDataPtrList read(system::IODevice& sourceDevice) const override;
|
||||
void write(const AbstractDataPtrList& settingsList, system::IODevice& destinationDevice) const override;
|
||||
AbstractDataPtrList read(io::Device& sourceDevice) const override;
|
||||
void write(const AbstractDataPtrList& settingsList, io::Device& destinationDevice) const override;
|
||||
|
||||
WorkspaceTag tag() const override;
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ static constexpr std::string_view TOOLBAR_TAG("Toolbar");
|
|||
static constexpr std::string_view ACTION_TAG("action");
|
||||
static constexpr std::string_view TOOLBAR_NAME_TAG("name");
|
||||
|
||||
AbstractDataPtrList WorkspaceToolbarStream::read(IODevice& sourceDevice) const
|
||||
AbstractDataPtrList WorkspaceToolbarStream::read(Device& sourceDevice) const
|
||||
{
|
||||
XmlReader reader(&sourceDevice);
|
||||
AbstractDataPtrList toolbars;
|
||||
|
@ -73,7 +73,7 @@ AbstractDataPtr WorkspaceToolbarStream::readToolbar(XmlReader& reader) const
|
|||
return toolbar;
|
||||
}
|
||||
|
||||
void WorkspaceToolbarStream::write(const AbstractDataPtrList& toolbars, IODevice& destinationDevice) const
|
||||
void WorkspaceToolbarStream::write(const AbstractDataPtrList& toolbars, Device& destinationDevice) const
|
||||
{
|
||||
XmlWriter writer(&destinationDevice);
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ namespace mu::workspace {
|
|||
class WorkspaceToolbarStream : public IWorkspaceDataStream
|
||||
{
|
||||
public:
|
||||
AbstractDataPtrList read(system::IODevice& sourceDevice) const override;
|
||||
void write(const AbstractDataPtrList& toolbars, system::IODevice& destinationDevice) const override;
|
||||
AbstractDataPtrList read(io::Device& sourceDevice) const override;
|
||||
void write(const AbstractDataPtrList& toolbars, io::Device& destinationDevice) const override;
|
||||
|
||||
WorkspaceTag tag() const override;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include <memory>
|
||||
|
||||
#include "workspacetypes.h"
|
||||
#include "framework/system/iodevice.h"
|
||||
#include "io/device.h"
|
||||
|
||||
namespace mu::workspace {
|
||||
class IWorkspaceDataStream
|
||||
|
@ -33,8 +33,8 @@ class IWorkspaceDataStream
|
|||
public:
|
||||
virtual ~IWorkspaceDataStream() = default;
|
||||
|
||||
virtual AbstractDataPtrList read(system::IODevice& sourceDevice) const = 0;
|
||||
virtual void write(const AbstractDataPtrList& dataList, system::IODevice& destinationDevice) const = 0;
|
||||
virtual AbstractDataPtrList read(io::Device& sourceDevice) const = 0;
|
||||
virtual void write(const AbstractDataPtrList& dataList, io::Device& destinationDevice) const = 0;
|
||||
|
||||
virtual WorkspaceTag tag() const = 0;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue