reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
HeaderFieldValue.hxx
Go to the documentation of this file.
1
#if !defined(RESIP_HEADERFIELDVALUE_HXX)
2
#define RESIP_HEADERFIELDVALUE_HXX
3
4
#include "
rutil/ParseException.hxx
"
5
#include "
rutil/Data.hxx
"
6
#include "
resip/stack/ParameterTypes.hxx
"
7
8
#include <iosfwd>
9
10
namespace
resip
11
{
12
13
class
ParserCategory;
14
class
UnknownParameter;
15
class
ParseBuffer;
16
20
class
HeaderFieldValue
21
{
22
public
:
23
static
const
HeaderFieldValue
Empty
;
24
25
enum
CopyPaddingEnum
26
{
27
CopyPadding
28
};
29
30
enum
NoOwnershipEnum
31
{
32
NoOwnership
33
};
34
35
HeaderFieldValue
()
36
: mField(0),
//this must be initialized to 0 or ParserCategory will parse
37
mFieldLength(0),
38
mMine(false)
39
{}
40
HeaderFieldValue
(
const
char
* field,
size_t
fieldLength);
41
HeaderFieldValue
(
const
HeaderFieldValue
& hfv);
42
HeaderFieldValue
(
const
HeaderFieldValue
& hfv,
CopyPaddingEnum
);
43
HeaderFieldValue
(
const
HeaderFieldValue
& hfv,
NoOwnershipEnum
);
44
HeaderFieldValue
&
operator=
(
const
HeaderFieldValue
&);
45
HeaderFieldValue
&
copyWithPadding
(
const
HeaderFieldValue
& rhs);
46
HeaderFieldValue
&
swap
(
HeaderFieldValue
& orig);
47
48
~HeaderFieldValue
();
49
50
EncodeStream
&
encode
(
EncodeStream
& str)
const
;
51
52
inline
void
init
(
const
char
* field,
size_t
length,
bool
own)
53
{
54
if
(mMine)
55
{
56
delete
[] mField;
57
}
58
59
mField=field;
60
mFieldLength=(
unsigned
int)length;
61
mMine=own;
62
}
63
64
inline
const
char
*
getBuffer
()
const
{
return
mField;}
65
inline
size_t
getLength
()
const
{
return
mFieldLength;}
66
inline
void
clear
()
67
{
68
if
(mMine)
69
{
70
delete
[] mField;
71
mMine=
false
;
72
}
73
mField=0;
74
mFieldLength=0;
75
}
76
77
// const because Data::Share implies read-only access
78
void
toShareData
(
Data
& data)
const
79
{
80
data.
setBuf
(
Data::Share
, mField, mFieldLength);
81
}
82
83
// not const because Data::Borrow implies read/write access
84
void
toBorrowData
(
Data
& data)
85
{
86
data.
setBuf
(
Data::Borrow
, mField, mFieldLength);
87
}
88
89
private
:
90
91
const
char
* mField;
92
size_t
mFieldLength;
93
bool
mMine;
94
95
friend
EncodeStream
&
operator<<
(
EncodeStream
&,
HeaderFieldValue
&);
96
};
97
98
EncodeStream
&
operator<<
(
EncodeStream
& stream,
HeaderFieldValue
& hList);
99
100
}
101
102
#endif
103
104
/* ====================================================================
105
* The Vovida Software License, Version 1.0
106
*
107
* Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
108
*
109
* Redistribution and use in source and binary forms, with or without
110
* modification, are permitted provided that the following conditions
111
* are met:
112
*
113
* 1. Redistributions of source code must retain the above copyright
114
* notice, this list of conditions and the following disclaimer.
115
*
116
* 2. Redistributions in binary form must reproduce the above copyright
117
* notice, this list of conditions and the following disclaimer in
118
* the documentation and/or other materials provided with the
119
* distribution.
120
*
121
* 3. The names "VOCAL", "Vovida Open Communication Application Library",
122
* and "Vovida Open Communication Application Library (VOCAL)" must
123
* not be used to endorse or promote products derived from this
124
* software without prior written permission. For written
125
* permission, please contact vocal@vovida.org.
126
*
127
* 4. Products derived from this software may not be called "VOCAL", nor
128
* may "VOCAL" appear in their name, without prior written
129
* permission of Vovida Networks, Inc.
130
*
131
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
132
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
133
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
134
* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
135
* NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
136
* IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
137
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
138
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
139
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
140
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
141
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
142
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
143
* DAMAGE.
144
*
145
* ====================================================================
146
*
147
* This software consists of voluntary contributions made by Vovida
148
* Networks, Inc. and many individuals on behalf of Vovida Networks,
149
* Inc. For more information on Vovida Networks, Inc., please see
150
* <http://www.vovida.org/>.
151
*
152
* set shiftwidth=3 expandtab:
153
*/
Data.hxx
ParameterTypes.hxx
ParseException.hxx
resip::Data
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition
Data.hxx:90
resip::Data::Share
@ Share
The Data instance will use the buffer in a read-only mode.
Definition
Data.hxx:266
resip::Data::Borrow
@ Borrow
The Data instance is borrowing the memory from the passed in buffer.
Definition
Data.hxx:260
resip::Data::setBuf
Data & setBuf(ShareEnum se, const char *buf, size_type length)
Set the Data to hold {buf} using share type {se}, which may be any of Share (read-only,...
Definition
Data.cxx:627
resip::HeaderFieldValue
Definition
HeaderFieldValue.hxx:21
resip::HeaderFieldValue::CopyPaddingEnum
CopyPaddingEnum
Definition
HeaderFieldValue.hxx:26
resip::HeaderFieldValue::CopyPadding
@ CopyPadding
Definition
HeaderFieldValue.hxx:27
resip::HeaderFieldValue::swap
HeaderFieldValue & swap(HeaderFieldValue &orig)
Definition
HeaderFieldValue.cxx:109
resip::HeaderFieldValue::encode
EncodeStream & encode(EncodeStream &str) const
Definition
HeaderFieldValue.cxx:129
resip::HeaderFieldValue::getBuffer
const char * getBuffer() const
Definition
HeaderFieldValue.hxx:64
resip::HeaderFieldValue::Empty
static const HeaderFieldValue Empty
Definition
HeaderFieldValue.hxx:23
resip::HeaderFieldValue::toBorrowData
void toBorrowData(Data &data)
Definition
HeaderFieldValue.hxx:84
resip::HeaderFieldValue::HeaderFieldValue
HeaderFieldValue()
Definition
HeaderFieldValue.hxx:35
resip::HeaderFieldValue::getLength
size_t getLength() const
Definition
HeaderFieldValue.hxx:65
resip::HeaderFieldValue::operator<<
friend EncodeStream & operator<<(EncodeStream &, HeaderFieldValue &)
resip::HeaderFieldValue::~HeaderFieldValue
~HeaderFieldValue()
Definition
HeaderFieldValue.cxx:120
resip::HeaderFieldValue::clear
void clear()
Definition
HeaderFieldValue.hxx:66
resip::HeaderFieldValue::NoOwnershipEnum
NoOwnershipEnum
Definition
HeaderFieldValue.hxx:31
resip::HeaderFieldValue::NoOwnership
@ NoOwnership
Definition
HeaderFieldValue.hxx:32
resip::HeaderFieldValue::init
void init(const char *field, size_t length, bool own)
Definition
HeaderFieldValue.hxx:52
resip::HeaderFieldValue::copyWithPadding
HeaderFieldValue & copyWithPadding(const HeaderFieldValue &rhs)
Definition
HeaderFieldValue.cxx:68
resip::HeaderFieldValue::toShareData
void toShareData(Data &data) const
Definition
HeaderFieldValue.hxx:78
resip::HeaderFieldValue::operator=
HeaderFieldValue & operator=(const HeaderFieldValue &)
Definition
HeaderFieldValue.cxx:45
resip
dcm! – add UnusedChecking(_enum) below;
Definition
AbstractFifo.hxx:16
resip::operator<<
EncodeStream & operator<<(EncodeStream &strm, const BaseException &e)
Definition
BaseException.cxx:25
EncodeStream
#define EncodeStream
Definition
resipfaststreams.hxx:461
resip
stack
HeaderFieldValue.hxx
Generated by
1.9.8