reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
Pidf.hxx
Go to the documentation of this file.
1#if !defined(RESIP_PIDF_HXX)
2#define RESIP_PIDF_HXX
3
4#include <vector>
5
7#include "rutil/Data.hxx"
8#include "rutil/HashMap.hxx"
10#include "resip/stack/Uri.hxx"
13
14namespace resip
15{
16
23class Pidf : public Contents
24{
25 public:
26 static const Pidf Empty;
27
29 Pidf(const Mime& contentType);
30 explicit Pidf(const Uri& entity);
31 Pidf();
32 Pidf(const Data& txt);
33 Pidf(const HeaderFieldValue& hfv, const Mime& contentType);
34 Pidf(const Data& txt, const Mime& contentType);
35 Pidf(const Pidf& rhs);
36 virtual ~Pidf();
37 Pidf& operator=(const Pidf& rhs);
38
42 virtual Contents* clone() const;
43 static const Mime& getStaticType() ;
44 virtual EncodeStream& encodeParsed(EncodeStream& str) const;
45 virtual void parse(ParseBuffer& pb);
46
47 void setSimpleId(const Data& id);
48 void setEntity(const Uri& entity);
49 const Uri& getEntity() const;
50 void setSimpleStatus(bool online, const Data& note = Data::Empty,
51 const Data& contact = Data::Empty);
52 bool getSimpleStatus(Data* note=NULL) const;
53
54 Data& text() {checkParsed(); return mNote;}
55
56 static bool init();
57
61 class Tuple
62 {
63 public:
64 bool status;
70 // Same type as XMLCursor::AttributeMap, which explains the keyed hash
72 };
73
74 std::vector<Tuple>& getTuples();
75 const std::vector<Tuple>& getTuples() const;
76 int getNumTuples() const;
77
78 // combine tuples
79 void merge(const Pidf& other);
80
81 private:
82 Data mNote;
83 Uri mEntity;
84 std::vector<Tuple> mTuples;
85};
86
88
89static bool invokePidfInit = Pidf::init();
90
91}
92
93#endif
94
95/* ====================================================================
96 * The Vovida Software License, Version 1.0
97 *
98 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
99 *
100 * Redistribution and use in source and binary forms, with or without
101 * modification, are permitted provided that the following conditions
102 * are met:
103 *
104 * 1. Redistributions of source code must retain the above copyright
105 * notice, this list of conditions and the following disclaimer.
106 *
107 * 2. Redistributions in binary form must reproduce the above copyright
108 * notice, this list of conditions and the following disclaimer in
109 * the documentation and/or other materials provided with the
110 * distribution.
111 *
112 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
113 * and "Vovida Open Communication Application Library (VOCAL)" must
114 * not be used to endorse or promote products derived from this
115 * software without prior written permission. For written
116 * permission, please contact vocal@vovida.org.
117 *
118 * 4. Products derived from this software may not be called "VOCAL", nor
119 * may "VOCAL" appear in their name, without prior written
120 * permission of Vovida Networks, Inc.
121 *
122 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
123 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
124 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
125 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
126 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
127 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
128 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
129 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
130 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
131 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
132 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
133 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
134 * DAMAGE.
135 *
136 * ====================================================================
137 *
138 * This software consists of voluntary contributions made by Vovida
139 * Networks, Inc. and many individuals on behalf of Vovida Networks,
140 * Inc. For more information on Vovida Networks, Inc., please see
141 * <http://www.vovida.org/>.
142 *
143 */
Wraps your platform's implementation of hash_map, hash_multimap, and hash_set.
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
static const Data Empty
Constant that represents a zero-length data.
Definition Data.hxx:882
void checkParsed() const
A hash map that iterates in insertion order, so a container filled while parsing (eg.
Represents the "media-type" element in the RFC 3261 grammar.
Definition Mime.hxx:20
Provides string-parsing functionality with protection from buffer overflow.
Deprecated.
Definition Pidf.hxx:62
LinkedHashMap< Data, Data, KeyedDataHash > attributes
Definition Pidf.hxx:71
QValue contactPriority
Definition Pidf.hxx:67
Deprecated.
Definition Pidf.hxx:24
bool getSimpleStatus(Data *note=NULL) const
Definition Pidf.cxx:331
Pidf & operator=(const Pidf &rhs)
Definition Pidf.cxx:59
int getNumTuples() const
Definition Pidf.cxx:118
virtual void parse(ParseBuffer &pb)
Definition Pidf.cxx:171
static const Pidf Empty
Definition Pidf.hxx:26
static bool init()
Definition Pidf.cxx:19
virtual Contents * clone() const
duplicate an Pidf object
Definition Pidf.cxx:125
void merge(const Pidf &other)
Definition Pidf.cxx:348
void setSimpleId(const Data &id)
Definition Pidf.cxx:302
static const Mime & getStaticType()
Definition Pidf.cxx:131
std::vector< Tuple > & getTuples()
Definition Pidf.cxx:104
void setEntity(const Uri &entity)
Definition Pidf.cxx:90
Data & text()
Definition Pidf.hxx:54
virtual EncodeStream & encodeParsed(EncodeStream &str) const
Definition Pidf.cxx:138
const Uri & getEntity() const
Definition Pidf.cxx:97
void setSimpleStatus(bool online, const Data &note=Data::Empty, const Data &contact=Data::Empty)
Definition Pidf.cxx:314
virtual ~Pidf()
Definition Pidf.cxx:85
RESIP_HeapCount(Pidf)
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
Definition Uri.hxx:22
dcm! – add UnusedChecking(_enum) below;
EncodeStream & operator<<(EncodeStream &strm, const BaseException &e)
static bool invokePidfInit
Definition Pidf.hxx:89
#define EncodeStream