1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 01:37:35 +00:00

SpiceAgent: Implement FileTransferStart messages

This commit is contained in:
Caoimhe 2023-05-13 19:47:59 +01:00 committed by Andreas Kling
parent 0d98920930
commit 476774d681
3 changed files with 89 additions and 0 deletions

View file

@ -179,6 +179,33 @@ private:
ByteBuffer m_contents;
};
// Sent to the agent to indicate that a file transfer has been requested.
class FileTransferStartMessage : public Message {
public:
struct Metadata {
String name;
u32 size;
};
static ErrorOr<FileTransferStartMessage> read_from_stream(AK::Stream& stream);
ErrorOr<String> debug_description() override;
u32 id() const { return m_id; }
Metadata const& metadata() { return m_metadata; }
private:
FileTransferStartMessage(u32 id, FileTransferStartMessage::Metadata const& metadata)
: Message(Type::FileTransferStart)
, m_id(id)
, m_metadata(metadata)
{
}
u32 m_id { 0 };
Metadata m_metadata;
};
}
namespace AK {