1
#if defined(HAVE_CONFIG_H)
5
#include "resip/stack/OctetContents.hxx"
6
#include "resip/stack/SipMessage.hxx"
7
#include "rutil/Logger.hxx"
8
#include "rutil/ParseBuffer.hxx"
9
#include "rutil/WinLeakCheck.hxx"
12
using namespace resip;
15
#define RESIPROCATE_SUBSYSTEM Subsystem::SIP
17
const OctetContents OctetContents::Empty;
22
static ContentsFactory<OctetContents> factory;
27
OctetContents::OctetContents()
28
: Contents(getStaticType()),
32
OctetContents::OctetContents(const Data& octets)
33
: Contents(getStaticType()),
37
OctetContents::OctetContents(const HeaderFieldValue& hfv, const Mime& contentsType)
38
: Contents(hfv, contentsType),
43
OctetContents::OctetContents(const Data& octets, const Mime& contentsType)
44
: Contents(contentsType),
49
OctetContents::OctetContents(const OctetContents& rhs)
55
OctetContents::~OctetContents()
60
OctetContents::operator=(const OctetContents& rhs)
64
Contents::operator=(rhs);
65
mOctets = rhs.mOctets;
71
OctetContents::clone() const
73
return new OctetContents(*this);
77
OctetContents::getStaticType()
79
static Mime type("application","octet-stream");
84
OctetContents::encodeParsed(EncodeStream& str) const
86
//DebugLog(<< "OctetContents::encodeParsed " << mOctets);
92
OctetContents::parse(ParseBuffer& pb)
94
//DebugLog(<< "OctetContents::parse: " << pb.position());
96
const char* anchor = pb.position();
98
pb.data(mOctets, anchor);
100
//DebugLog("OctetContents::parsed <" << mOctets << ">" );
104
/* ====================================================================
105
* The Vovida Software License, Version 1.0
107
* Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
109
* Redistribution and use in source and binary forms, with or without
110
* modification, are permitted provided that the following conditions
113
* 1. Redistributions of source code must retain the above copyright
114
* notice, this list of conditions and the following disclaimer.
116
* 2. Redistributions in binary form must reproduce the above copyright
117
* notice, this list of conditions and the following disclaimer in
118
* the documentation and/or other materials provided with the
121
* 3. The names "VOCAL", "Vovida Open Communication Application Library",
122
* and "Vovida Open Communication Application Library (VOCAL)" must
123
* not be used to endorse or promote products derived from this
124
* software without prior written permission. For written
125
* permission, please contact vocal@vovida.org.
127
* 4. Products derived from this software may not be called "VOCAL", nor
128
* may "VOCAL" appear in their name, without prior written
129
* permission of Vovida Networks, Inc.
131
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
132
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
133
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
134
* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
135
* NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
136
* IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
137
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
138
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
139
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
140
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
141
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
142
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
145
* ====================================================================
147
* This software consists of voluntary contributions made by Vovida
148
* Networks, Inc. and many individuals on behalf of Vovida Networks,
149
* Inc. For more information on Vovida Networks, Inc., please see
150
* <http://www.vovida.org/>.