/src/resiprocate/resip/stack/InvalidContents.cxx
Line | Count | Source (jump to first uncovered line) |
1 | | #if defined(HAVE_CONFIG_H) |
2 | | #include "config.h" |
3 | | #endif |
4 | | |
5 | | #include "resip/stack/InvalidContents.hxx" |
6 | | #include "rutil/Logger.hxx" |
7 | | #include "rutil/ParseBuffer.hxx" |
8 | | #include "rutil/WinLeakCheck.hxx" |
9 | | |
10 | | using namespace resip; |
11 | | using namespace std; |
12 | | |
13 | | #define RESIPROCATE_SUBSYSTEM Subsystem::SIP |
14 | | |
15 | | InvalidContents::InvalidContents(const Data& txt, const Mime& originalType) |
16 | | : Contents(getStaticType()), |
17 | | mOriginalType(originalType), |
18 | | mText(txt) |
19 | 0 | {} |
20 | | |
21 | | InvalidContents::InvalidContents(const HeaderFieldValue& hfv, const Mime& contentsType, const Mime& originalType) |
22 | | : Contents(hfv, contentsType), |
23 | | mOriginalType(originalType), |
24 | | mText() |
25 | 6.52k | { |
26 | 6.52k | } |
27 | | |
28 | | InvalidContents::InvalidContents(const Data& txt, const Mime& contentsType, const Mime& originalType) |
29 | | : Contents(contentsType), |
30 | | mOriginalType(originalType), |
31 | | mText(txt) |
32 | 0 | { |
33 | 0 | } |
34 | | |
35 | | InvalidContents::InvalidContents(const InvalidContents& rhs) |
36 | | : Contents(rhs), |
37 | | mOriginalType(rhs.mOriginalType), |
38 | | mText(rhs.mText) |
39 | 0 | { |
40 | 0 | } |
41 | | |
42 | | InvalidContents::~InvalidContents() |
43 | 6.52k | { |
44 | 6.52k | } |
45 | | |
46 | | InvalidContents& |
47 | | InvalidContents::operator=(const InvalidContents& rhs) |
48 | 0 | { |
49 | 0 | if (this != &rhs) |
50 | 0 | { |
51 | 0 | Contents::operator=(rhs); |
52 | 0 | mOriginalType = rhs.mOriginalType; |
53 | 0 | mText = rhs.mText; |
54 | 0 | } |
55 | 0 | return *this; |
56 | 0 | } |
57 | | |
58 | | Contents* |
59 | | InvalidContents::clone() const |
60 | 0 | { |
61 | 0 | return new InvalidContents(*this); |
62 | 0 | } |
63 | | |
64 | | const Mime& |
65 | | InvalidContents::getStaticType() |
66 | 0 | { |
67 | 0 | static Mime type("Invalid","Invalid"); |
68 | 0 | return type; |
69 | 0 | } |
70 | | |
71 | | EncodeStream& |
72 | | InvalidContents::encodeParsed(EncodeStream& str) const |
73 | 0 | { |
74 | 0 | str << mText; |
75 | 0 | return str; |
76 | 0 | } |
77 | | |
78 | | void |
79 | | InvalidContents::parse(ParseBuffer& pb) |
80 | 6.52k | { |
81 | 6.52k | const char* anchor = pb.position(); |
82 | 6.52k | pb.skipToEnd(); |
83 | 6.52k | pb.data(mText, anchor); |
84 | 6.52k | } |
85 | | |
86 | | const Mime& |
87 | | InvalidContents::getOriginalType() const |
88 | 0 | { |
89 | 0 | return mOriginalType; |
90 | 0 | } |
91 | | |
92 | | /* ==================================================================== |
93 | | * The Vovida Software License, Version 1.0 |
94 | | * |
95 | | * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved. |
96 | | * |
97 | | * Redistribution and use in source and binary forms, with or without |
98 | | * modification, are permitted provided that the following conditions |
99 | | * are met: |
100 | | * |
101 | | * 1. Redistributions of source code must retain the above copyright |
102 | | * notice, this list of conditions and the following disclaimer. |
103 | | * |
104 | | * 2. Redistributions in binary form must reproduce the above copyright |
105 | | * notice, this list of conditions and the following disclaimer in |
106 | | * the documentation and/or other materials provided with the |
107 | | * distribution. |
108 | | * |
109 | | * 3. The names "VOCAL", "Vovida Open Communication Application Library", |
110 | | * and "Vovida Open Communication Application Library (VOCAL)" must |
111 | | * not be used to endorse or promote products derived from this |
112 | | * software without prior written permission. For written |
113 | | * permission, please contact vocal@vovida.org. |
114 | | * |
115 | | * 4. Products derived from this software may not be called "VOCAL", nor |
116 | | * may "VOCAL" appear in their name, without prior written |
117 | | * permission of Vovida Networks, Inc. |
118 | | * |
119 | | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED |
120 | | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
121 | | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND |
122 | | * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA |
123 | | * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES |
124 | | * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL, |
125 | | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
126 | | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
127 | | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
128 | | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
129 | | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE |
130 | | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH |
131 | | * DAMAGE. |
132 | | * |
133 | | * ==================================================================== |
134 | | * |
135 | | * This software consists of voluntary contributions made by Vovida |
136 | | * Networks, Inc. and many individuals on behalf of Vovida Networks, |
137 | | * Inc. For more information on Vovida Networks, Inc., please see |
138 | | * <http://www.vovida.org/>. |
139 | | * |
140 | | */ |