mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-07 01:56:38 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
40
Libraries/LibHTTP/Header.h
Normal file
40
Libraries/LibHTTP/Header.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Andreas Kling <andreas@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/ByteString.h>
|
||||
#include <LibIPC/Decoder.h>
|
||||
#include <LibIPC/Encoder.h>
|
||||
|
||||
namespace HTTP {
|
||||
|
||||
struct Header {
|
||||
ByteString name;
|
||||
ByteString value;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace IPC {
|
||||
|
||||
template<>
|
||||
inline ErrorOr<void> encode(Encoder& encoder, HTTP::Header const& header)
|
||||
{
|
||||
TRY(encoder.encode(header.name));
|
||||
TRY(encoder.encode(header.value));
|
||||
return {};
|
||||
}
|
||||
|
||||
template<>
|
||||
inline ErrorOr<HTTP::Header> decode(Decoder& decoder)
|
||||
{
|
||||
auto name = TRY(decoder.decode<ByteString>());
|
||||
auto value = TRY(decoder.decode<ByteString>());
|
||||
return HTTP::Header { move(name), move(value) };
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue