Added Read(int64*)

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3947 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm 2003-07-10 20:13:23 +00:00
parent 0524d8feef
commit e76917c658
2 changed files with 17 additions and 0 deletions

View File

@ -47,6 +47,7 @@ public:
void *Buffer(void) { return _buffer; }
ssize_t BufferSize(void) { return _buffersize; }
status_t Read(int64 *data);
status_t Read(bool *data);
status_t Read(BPoint *data);
status_t Read(BRect *data);

View File

@ -128,6 +128,22 @@ void PortMessage::SetBuffer(const void *buffer, const ssize_t &size, const bool
}
}
status_t PortMessage::Read(int64 *data)
{
if(!data)
return B_BAD_VALUE;
if( !_buffer ||
_buffersize<sizeof(int64) ||
((_index+sizeof(int64))>(_buffer+_buffersize)) )
return B_NO_MEMORY;
*data=*((int64*)_index);
_index+=sizeof(bool);
return B_OK;
}
status_t PortMessage::Read(bool *data)
{
if(!data)