return !theBody ? BodySize() : BodySize(theBody->bodySize());
}
-Ecap::BodyRep::size_type
-Ecap::BodyRep::consumedSize() const
-{
- return theBody->consumedSize();
-}
-
-bool
-Ecap::BodyRep::productionEnded() const
-{
- return theBody->productionEnded();
-}
-
-Ecap::BodyRep::Area
-Ecap::BodyRep::prefix(Ecap::BodyRep::size_type size) const
-{
- Must(size <= static_cast<size_type>(theBody->buf().contentSize()));
- // XXX: optimize by making theBody a shared_ptr (see FromTemp*() src)
- return Area::FromTempBuffer(theBody->buf().content(), size);
-}
-
/* MessageRep */
class BodyRep: public libecap::Body
{
public:
- typedef libecap::Area Area;
typedef libecap::BodySize BodySize;
- using libecap::Body::size_type;
public:
BodyRep(const BodyPipe::Pointer &aBody); // using NULL pointer? see tie()
// libecap::Body API
virtual BodySize bodySize() const;
- virtual size_type consumedSize() const;
- virtual bool productionEnded() const;
- virtual Area prefix(size_type size) const;
private:
BodyPipe::Pointer theBody; // the body being translated to libecap