mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:17:34 +00:00
BufferStream: Support "bool" as a streaming type
This commit is contained in:
parent
659ddddd20
commit
b04dae7faa
1 changed files with 15 additions and 0 deletions
|
@ -47,6 +47,21 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BufferStream& operator<<(bool value)
|
||||||
|
{
|
||||||
|
m_buffer[m_offset++] = value;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
BufferStream& operator>>(bool& value )
|
||||||
|
{
|
||||||
|
if (m_offset + sizeof(value) >= unsigned(m_buffer.size())) {
|
||||||
|
m_read_failure = true;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
value = m_buffer[m_offset++];
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
BufferStream& operator<<(char value)
|
BufferStream& operator<<(char value)
|
||||||
{
|
{
|
||||||
m_buffer[m_offset++] = (u8)value;
|
m_buffer[m_offset++] = (u8)value;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue