reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
Rlmi.cxx
Go to the documentation of this file.
1#if defined(HAVE_CONFIG_H)
2#include "config.h"
3#endif
4
8#include "rutil/Logger.hxx"
11
12using namespace resip;
13using namespace std;
14
15#define RESIPROCATE_SUBSYSTEM Subsystem::SIP
16
17bool
19{
20 static ContentsFactory<Rlmi> factory;
21 (void)factory;
22 return true;
23}
24
26 : Contents(getStaticType())
27{}
28
29Rlmi::Rlmi(const HeaderFieldValue& hfv, const Mime& contentsType)
30 : Contents(hfv, contentsType)
31{
32}
33
34Rlmi::Rlmi(const Rlmi& rhs)
35 : Contents(rhs)
36{
37 mText = rhs.mText;
38}
39
41{
42}
43
44Rlmi&
46{
47 if (this != &rhs)
48 {
49 mText = rhs.mText;
50 }
51 return *this;
52}
53
56{
57 return new Rlmi(*this);
58}
59
60const Mime&
62{
63 static Mime type("application","rlmi+xml");
64 return type;
65}
66
68Rlmi::encodeParsed(EncodeStream& str) const
69{
70 //DebugLog(<< "Rlmi::encodeParsed " << mText);
71 str << mText;
72
73 return str;
74}
75
76void
78{
79 const char* anchor = pb.position();
80 pb.skipToEnd();
81 pb.data(mText, anchor);
82}
83
84const Data&
86{
88 return mText;
89}
90
91void
92Rlmi::set(const Data& text)
93{
94 mText = text;
95}
96
97/* ====================================================================
98 * The Vovida Software License, Version 1.0
99 *
100 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
101 *
102 * Redistribution and use in source and binary forms, with or without
103 * modification, are permitted provided that the following conditions
104 * are met:
105 *
106 * 1. Redistributions of source code must retain the above copyright
107 * notice, this list of conditions and the following disclaimer.
108 *
109 * 2. Redistributions in binary form must reproduce the above copyright
110 * notice, this list of conditions and the following disclaimer in
111 * the documentation and/or other materials provided with the
112 * distribution.
113 *
114 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
115 * and "Vovida Open Communication Application Library (VOCAL)" must
116 * not be used to endorse or promote products derived from this
117 * software without prior written permission. For written
118 * permission, please contact vocal@vovida.org.
119 *
120 * 4. Products derived from this software may not be called "VOCAL", nor
121 * may "VOCAL" appear in their name, without prior written
122 * permission of Vovida Networks, Inc.
123 *
124 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
125 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
126 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
127 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
128 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
129 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
130 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
131 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
132 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
133 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
134 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
135 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
136 * DAMAGE.
137 *
138 * ====================================================================
139 *
140 * This software consists of voluntary contributions made by Vovida
141 * Networks, Inc. and many individuals on behalf of Vovida Networks,
142 * Inc. For more information on Vovida Networks, Inc., please see
143 * <http://www.vovida.org/>.
144 *
145 */
Base class for all SIP body types.
Definition Contents.hxx:51
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
void checkParsed() const
Represents the "media-type" element in the RFC 3261 grammar.
Definition Mime.hxx:20
Provides string-parsing functionality with protection from buffer overflow.
CurrentPosition skipToEnd()
CurrentPosition position() const
void data(Data &data, const char *start) const
make the passed in data share memory with the buffer (uses Data::Share)
SIP body type for holding RLMI contents (MIME content-type application/rlmi+xml).
Definition Rlmi.hxx:17
virtual Contents * clone() const
duplicate an Rlmi object
Definition Rlmi.cxx:55
static const Mime & getStaticType()
Definition Rlmi.cxx:61
void set(const Data &text)
Definition Rlmi.cxx:92
const Data & get()
Definition Rlmi.cxx:85
static bool init()
Definition Rlmi.cxx:18
virtual void parse(ParseBuffer &pb)
Definition Rlmi.cxx:77
Rlmi & operator=(const Rlmi &rhs)
Definition Rlmi.cxx:45
virtual EncodeStream & encodeParsed(EncodeStream &str) const
Definition Rlmi.cxx:68
virtual ~Rlmi()
Definition Rlmi.cxx:40
dcm! – add UnusedChecking(_enum) below;
#define EncodeStream