Skip to content

Commit

Permalink
Merge pull request musescore#18545 from handrok/bytearra_constructors
Browse files Browse the repository at this point in the history
[DRAFT] added constructors to bytearray and buffer
  • Loading branch information
handrok committed Jul 12, 2023
2 parents d010b46 + 42c4180 commit 2fb92d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/framework/global/io/buffer.cpp
Expand Up @@ -51,6 +51,12 @@ Buffer::Buffer(ByteArray* ba)
}
}

Buffer::Buffer(ByteArray&& ba)
{
m_ba = std::move(ba);
m_ref = &m_ba;
}

const ByteArray& Buffer::data() const
{
return *m_ref;
Expand Down
1 change: 1 addition & 0 deletions src/framework/global/io/buffer.h
Expand Up @@ -33,6 +33,7 @@ class Buffer : public IODevice
Buffer(size_t size);
Buffer(const uint8_t* data, size_t size);
Buffer(ByteArray* ba);
Buffer(ByteArray&& ba);

const ByteArray& data() const;

Expand Down

0 comments on commit 2fb92d5

Please sign in to comment.