Exemplo n.º 1
0
void FileBrx::Read(Bwx& aBuffer, TUint32 aBytes)
{
    ASSERT(aBytes <= aBuffer.MaxBytes());
    TUint32 bytes = ( iCursor + aBytes > Bytes() ? Bytes() - iCursor : aBytes );
    aBuffer.Replace(iBuffer->Split(iCursor, bytes));
    iCursor += bytes;
}
Exemplo n.º 2
0
static void AppendUint32(Bwx& aBuf, TUint aNum)
{
    TUint bytes = aBuf.Bytes();
    ASSERT(bytes + sizeof(TUint32) <= aBuf.MaxBytes());
    memcpy(const_cast<TByte*>(aBuf.Ptr()+bytes), &aNum, sizeof(TUint32));
    aBuf.SetBytes(bytes + sizeof(TUint32));
}
Exemplo n.º 3
0
void Bwn::Set(const Bwx& aBwx)
{
    iPtr = aBwx.Ptr();
    ASSERT(iPtr != NULL);
    iBytes = aBwx.Bytes();
    iMaxBytes = aBwx.MaxBytes();
}
Exemplo n.º 4
0
void MdnsPlatform::AppendTxtRecord(Bwx& aBuffer, const TChar* aKey, const TChar* aValue)
{
    ASSERT((strlen(aKey) + strlen(aValue) + 3) <= (aBuffer.MaxBytes()-aBuffer.Bytes()));
    TByte length = (TByte)(strlen(aKey) + strlen(aValue) + 1);
    aBuffer.Append(length);
    aBuffer.Append(aKey);
    aBuffer.Append('=');
    aBuffer.Append(aValue);
}
Exemplo n.º 5
0
void ReaderBinary::ReadReplace(TUint aBytes, Bwx& aBuffer)
{
    ASSERT(aBytes <= aBuffer.MaxBytes());
    aBuffer.SetBytes(0);
    while (aBytes > 0) {
        Brn buf = iReader.Read(aBytes);
        aBuffer.Append(buf);
        aBytes -= buf.Bytes();
    }
}
Exemplo n.º 6
0
TInt OpenHome::Os::NetworkReceiveFrom(THandle aHandle, Bwx& aBuffer, Endpoint& aEndpoint)
{
    TIpAddress address;
    TUint16 port;
    TInt ret = OsNetworkReceiveFrom(aHandle, (uint8_t*)aBuffer.Ptr(), aBuffer.MaxBytes(), &address, &port);
    if (ret != -1) {
        aEndpoint.SetAddress(address);
        aEndpoint.SetPort(port);
    }
    return ret;
}
Exemplo n.º 7
0
Arquivo: Fifo.cpp Projeto: ACDN/ohNet
void FifoByte::Read(Bwx& aBuffer)
{
    Read(aBuffer, aBuffer.MaxBytes());
}
Exemplo n.º 8
0
void FileBrx::Read(Bwx& aBuffer)
{
    Read(aBuffer, aBuffer.MaxBytes());
}
Exemplo n.º 9
0
Bwn::Bwn(const Bwx& aBwx) : Bwx(aBwx.Bytes(), aBwx.MaxBytes()), iPtr(aBwx.Ptr())
{
    ASSERT(iPtr != NULL);
}