reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
Message.cxx
Go to the documentation of this file.
1#if defined(HAVE_CONFIG_H)
2#include "config.h"
3#endif
4
7#include "rutil/ResipAssert.h"
8
9using namespace resip;
10
11
13{}
14
17{
18 return Message::Brief(*this);
19}
20
22 mSource(source)
23{
24}
25
26std::ostream&
27resip::operator<<(std::ostream& strm,
28 const resip::Message& msg)
29{
30 Data encoded;
31
32 DataStream encodeStream(encoded);
33 msg.encode(encodeStream);
34 encodeStream.flush();
35
36 strm << encoded.c_str();
37
38 return strm;
39}
40
41std::ostream&
42resip::operator<<(std::ostream& strm,
44{
45 Data encoded;
46
47 DataStream encodeStream(encoded);
48 brief.mSource.encodeBrief(encodeStream);
49 encodeStream.flush();
50
51 strm << encoded.c_str();
52
53 return strm;
54}
55
56#ifndef RESIP_USE_STL_STREAMS
58resip::operator<<(EncodeStream& strm,
59 const resip::Message& msg)
60{
61 return msg.encode(strm);
62}
63
65resip::operator<<(EncodeStream& strm,
67{
68 return brief.mSource.encodeBrief(strm);
69}
70#endif
71
72/* ====================================================================
73 * The Vovida Software License, Version 1.0
74 *
75 * Redistribution and use in source and binary forms, with or without
76 * modification, are permitted provided that the following conditions
77 * are met:
78 *
79 * 1. Redistributions of source code must retain the above copyright
80 * notice, this list of conditions and the following disclaimer.
81 *
82 * 2. Redistributions in binary form must reproduce the above copyright
83 * notice, this list of conditions and the following disclaimer in
84 * the documentation and/or other materials provided with the
85 * distribution.
86 *
87 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
88 * and "Vovida Open Communication Application Library (VOCAL)" must
89 * not be used to endorse or promote products derived from this
90 * software without prior written permission. For written
91 * permission, please contact vocal@vovida.org.
92 *
93 * 4. Products derived from this software may not be called "VOCAL", nor
94 * may "VOCAL" appear in their name, without prior written
95 * permission of Vovida Networks, Inc.
96 *
97 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
98 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
99 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
100 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
101 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
102 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
103 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
104 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
105 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
106 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
107 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
108 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
109 * DAMAGE.
110 *
111 * ====================================================================
112 *
113 * This software consists of voluntary contributions made by Vovida
114 * Networks, Inc. and many individuals on behalf of Vovida Networks,
115 * Inc. For more information on Vovida Networks, Inc., please see
116 * <http://www.vovida.org/>.
117 *
118 */
An iostream that operates on an existing Data.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
const char * c_str() const
Returns a null-terminated string representing.
Definition Data.cxx:1097
facet for brief output to streams
Definition Message.hxx:28
Brief(const Message &src)
Definition Message.cxx:21
const Message & mSource
Definition Message.hxx:31
The base-class used for message-passing.
Definition Message.hxx:21
virtual Brief brief() const
return a facet for brief encoding of message
Definition Message.cxx:16
virtual EncodeStream & encodeBrief(EncodeStream &str) const =0
output a brief description to stream
virtual EncodeStream & encode(EncodeStream &strm) const =0
output the entire message to stream
dcm! – add UnusedChecking(_enum) below;
EncodeStream & operator<<(EncodeStream &strm, const BaseException &e)
#define EncodeStream