mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-25 18:52:22 -05:00
68739dc43e
This is a mess right now, but I'd rather commit as I go.
29 lines
441 B
C++
29 lines
441 B
C++
#include "NullDevice.h"
|
|
#include "Limits.h"
|
|
#include <AK/StdLib.h>
|
|
#include <AK/kstdio.h>
|
|
|
|
NullDevice::NullDevice()
|
|
: CharacterDevice(1, 3)
|
|
{
|
|
}
|
|
|
|
NullDevice::~NullDevice()
|
|
{
|
|
}
|
|
|
|
bool NullDevice::hasDataAvailableForRead() const
|
|
{
|
|
return true;
|
|
}
|
|
|
|
Unix::ssize_t NullDevice::read(byte*, Unix::size_t)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
Unix::ssize_t NullDevice::write(const byte*, Unix::size_t bufferSize)
|
|
{
|
|
return min(GoodBufferSize, bufferSize);
|
|
}
|
|
|