-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathVia.hpp
More file actions
57 lines (49 loc) · 1.36 KB
/
Via.hpp
File metadata and controls
57 lines (49 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef VIA_HPP
#define VIA_HPP
#include <string>
#include "SipDefines.hpp"
#include "SipHeaderValue.hpp"
namespace Sip {
/**
* \class ViaException
* \brief standard exception class for Via
*/
class ViaException : public SipHeaderValueException
{
public:
ViaException ( std::string what ) throw() : SipHeaderValueException ( what ) {};
};
/**
* \class Via
* \brief Creates a usable Via object from a generic SipHeaderValue
* \sa SipHeaderValue
*/
using std::string;
class Via
{
public:
Via ( const SipHeaderValue& shv ) throw ( ViaException );
Via ( const string& viaString ) throw ( ViaException );
Via ();
int Port() const throw( ViaException );
const string& Host() const throw( ViaException );
TRANSPORT_PROTOCOL TransportProtocol() const throw( ViaException );
bool RFC3261Compliant() const throw();
const string& Branch() const throw( ViaException );
bool HasPort() const throw();
bool HasHost() const throw();
bool HasTransportProtocol() const throw();
bool HasBranch() const throw();
//Warning: Will not return branch
string ToString() const;
SipHeaderValue ToSHV();
protected:
void ParseFromSHV( const SipHeaderValue& shv );
int m_port;
string m_host;
string m_branch;
TRANSPORT_PROTOCOL m_transportProtocol;
bool has_port, has_host, has_transportProtocol, m_rfc3261compliant, has_branch;
};
}; //namespace Sip
#endif //VIA_HPP