mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-27 10:07:56 +00:00
LibIPC: Add support for passing around ByteBuffers and HashMap<K, V>
It should be noted that using a shared buffer should still be preferred over passing a raw ByteBuffer over the wire.
This commit is contained in:
committed by
Andreas Kling
parent
705ad670f3
commit
c930e02624
@@ -24,6 +24,7 @@
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/URL.h>
|
||||
#include <LibIPC/Dictionary.h>
|
||||
@@ -141,6 +142,13 @@ Encoder& Encoder::operator<<(const String& value)
|
||||
return *this << value.view();
|
||||
}
|
||||
|
||||
Encoder& Encoder::operator<<(const ByteBuffer& value)
|
||||
{
|
||||
*this << static_cast<i32>(value.size());
|
||||
m_buffer.append(value.data(), value.size());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Encoder& Encoder::operator<<(const URL& value)
|
||||
{
|
||||
return *this << value.to_string();
|
||||
|
||||
Reference in New Issue
Block a user