< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index Next in Thread >

Re: [reSIProcate] Getting access to raw Contents


Hi again,

To answer my own question:

1) There is a Contents::encodeFromHeaderFieldValue method that is
defined. It looks like it would have worked but it hasn't been
implemented yet.

2) I can achieve what I said by using Contents::getHeaderField() and
then by calling HeaderFieldValue::encode.

For example:

Data encodedContents;
DataStream stream(encodedContents);

HeaderFieldValue hfv = pContents->getHeaderField();

hfv.encode(stream);
stream.flush();

Seems to work fine.

Thanks :)

On Fri, May 14, 2010 at 8:29 AM, Francis Joanis
<francis.joanis@xxxxxxxxx> wrote:
> Hi guys,
>
> I've been experimenting with an extended version of the pidf+xml
> content type (by extended I mean there are a few more fields to it).
> Since pidf+xml is already registered to the Pidf contents class
> (through the content factory), every time I try to read it out of a
> SipMessage instance it ends up dropping the additional fields since
> Pidf::encode re-encodes the XML payload from its cached data.
>
> I was wondering if there's a way to get the raw data of a content
> instance, something like Data Contents::getRaw() or
> Contents::encodeRaw?
>
> If there is no way of currently doing this, I'll try to implement it
> and let you know of the result.
>
> Thanks,
> Francis
>