Exemple #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;
}
Exemple #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));
}
Exemple #3
0
void Bwn::Set(const Bwx& aBwx)
{
    iPtr = aBwx.Ptr();
    ASSERT(iPtr != NULL);
    iBytes = aBwx.Bytes();
    iMaxBytes = aBwx.MaxBytes();
}
Exemple #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);
}
Exemple #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();
    }
}
Exemple #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;
}
Exemple #7
0
void FifoByte::Read(Bwx& aBuffer)
{
    Read(aBuffer, aBuffer.MaxBytes());
}
Exemple #8
0
void FileBrx::Read(Bwx& aBuffer)
{
    Read(aBuffer, aBuffer.MaxBytes());
}
Exemple #9
0
Bwn::Bwn(const Bwx& aBwx) : Bwx(aBwx.Bytes(), aBwx.MaxBytes()), iPtr(aBwx.Ptr())
{
    ASSERT(iPtr != NULL);
}