Coverage Report

Created: 2026-02-14 06:40

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/resiprocate/resip/stack/GenericUri.hxx
Line
Count
Source
1
#if !defined(RESIP_GENERIC_URI_HXX)
2
#define RESIP_GENERIC_URI_HXX
3
4
#include <iosfwd>
5
#include "rutil/Data.hxx"
6
#include "resip/stack/ParserCategory.hxx"
7
#include "resip/stack/ParserContainer.hxx"
8
9
namespace resip
10
{
11
12
/**
13
   @ingroup sip_grammar
14
   @brief Represents the "absoluteURI" element in the RFC 3261 grammar.
15
*/
16
class GenericUri : public ParserCategory
17
{
18
   public:
19
      static constexpr CommaHandlingMode commaHandling = CommasAllowedOutputMulti;
20
21
0
      GenericUri() : ParserCategory() {}
22
      GenericUri(const HeaderFieldValue& hfv, 
23
                  Headers::Type type,
24
                  PoolBase* pool=0);
25
      GenericUri(const GenericUri& orig,
26
                  PoolBase* pool=0);
27
      GenericUri& operator=(const GenericUri&);
28
29
      virtual void parse(ParseBuffer& pb);
30
      virtual ParserCategory* clone() const;
31
      virtual ParserCategory* clone(void* location) const;
32
      virtual ParserCategory* clone(PoolBase* pool) const;
33
      virtual EncodeStream& encodeParsed(EncodeStream& str) const;
34
35
      Data& uri();
36
      const Data& uri() const;
37
38
      // Inform the compiler that overloads of these may be found in
39
      // ParserCategory, too.
40
      using ParserCategory::exists;
41
      using ParserCategory::remove;
42
      using ParserCategory::param;
43
44
      virtual Parameter* createParam(ParameterTypes::Type type, ParseBuffer& pb, const std::bitset<256>& terminators, PoolBase* pool);
45
      // .bwc, This is an awful lot for one lousy param type.
46
      bool exists(const Param<GenericUri>& paramType) const;
47
      void remove(const Param<GenericUri>& paramType);
48
49
#define defineParam(_enum, _name, _type, _RFC_ref_ignored)                      \
50
      const _enum##_Param::DType& param(const _enum##_Param& paramType) const;  \
51
      _enum##_Param::DType& param(const _enum##_Param& paramType); \
52
      friend class _enum##_Param
53
54
defineParam(purpose, "purpose", DataParameter, "RFC 3261");
55
56
#undef defineParam
57
58
   private:
59
      Data mUri;
60
61
      static ParameterTypes::Factory ParameterFactories[ParameterTypes::MAX_PARAMETER];
62
};
63
typedef ParserContainer<GenericUri> GenericUris;
64
typedef GenericUri GenericURI; //.dcm. deprecated, should be removed soon
65
}
66
67
68
#endif
69
/* ====================================================================
70
 * The Vovida Software License, Version 1.0 
71
 * 
72
 * Copyright (c) 2000 Vovida Networks, Inc.  All rights reserved.
73
 * 
74
 * Redistribution and use in source and binary forms, with or without
75
 * modification, are permitted provided that the following conditions
76
 * are met:
77
 * 
78
 * 1. Redistributions of source code must retain the above copyright
79
 *    notice, this list of conditions and the following disclaimer.
80
 * 
81
 * 2. Redistributions in binary form must reproduce the above copyright
82
 *    notice, this list of conditions and the following disclaimer in
83
 *    the documentation and/or other materials provided with the
84
 *    distribution.
85
 * 
86
 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
87
 *    and "Vovida Open Communication Application Library (VOCAL)" must
88
 *    not be used to endorse or promote products derived from this
89
 *    software without prior written permission. For written
90
 *    permission, please contact vocal@vovida.org.
91
 *
92
 * 4. Products derived from this software may not be called "VOCAL", nor
93
 *    may "VOCAL" appear in their name, without prior written
94
 *    permission of Vovida Networks, Inc.
95
 * 
96
 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
97
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
98
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
99
 * NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL VOVIDA
100
 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
101
 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
102
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
103
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
104
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
105
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
106
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
107
 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
108
 * DAMAGE.
109
 * 
110
 * ====================================================================
111
 * 
112
 * This software consists of voluntary contributions made by Vovida
113
 * Networks, Inc. and many individuals on behalf of Vovida Networks,
114
 * Inc.  For more information on Vovida Networks, Inc., please see
115
 * <http://www.vovida.org/>.
116
 *
117
 */