sipxtacklib  Version 3.3
NameValuePairInsensitive.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006-2012 SIPez LLC. All rights reserved.
3 //
4 // Copyright (C) 2004-2006 SIPfoundry Inc.
5 // Licensed by SIPfoundry under the LGPL license.
6 //
7 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
8 // Licensed to SIPfoundry under a Contributor Agreement.
9 //
10 // $$
12 
13 #ifndef _NameValuePairInsensitive_h_
14 #define _NameValuePairInsensitive_h_
15 
16 // SYSTEM INCLUDES
17 
18 // APPLICATION INCLUDES
19 #include <net/NameValuePair.h>
20 
21 // DEFINES
22 // MACROS
23 // EXTERNAL FUNCTIONS
24 // EXTERNAL VARIABLES
25 // CONSTANTS
26 // STRUCTS
27 // TYPEDEFS
28 // FORWARD DECLARATIONS
29 
30 //: For storing string values associated with a key or name.
31 // Functions like NameValuePair, but the name (key) is case-insensitive.
33 {
34 /* //////////////////////////// PUBLIC //////////////////////////////////// */
35 public:
36 
37 /* ============================ CREATORS ================================== */
38 
39  NameValuePairInsensitive(const char* name, const char* value = NULL);
40  //: Construct a pair
41  // Data is copied, not attached or freed
45 
46  virtual
48  //:Destructor
49 
50 /* ============================ MANIPULATORS ============================== */
51 
53  //:Assignment operator
54 
55  NameValuePairInsensitive(const NameValuePairInsensitive& rNameValuePairInsensitive);
56  //: Copy constructor
57 
58 /* ============================ ACCESSORS ================================= */
59 
60  const char* getValue();
61  //: get value string
64 
65  void setValue(const char*);
66 
67 /* ============================ INQUIRY =================================== */
68 public:
69 
70  // Redefine all the container support operations to be case-insenstive,
71  // rather than the case-sensitive operations on keys that NameValuePair
72  // inherits from UtlString.
73 
75  virtual unsigned hash() const;
81  virtual UtlContainableType getContainableType() const;
83 
85  virtual int compareTo(UtlContainable const *other) const;
94  virtual UtlBoolean isEqual(UtlContainable const *) const;
100  virtual UtlBoolean isInstanceOf(const UtlContainableType type) const;
101 
102 /* //////////////////////////// PROTECTED ///////////////////////////////// */
103 protected:
104 
105  static UtlContainableType TYPE;
107 /* //////////////////////////// PRIVATE /////////////////////////////////// */
108 private:
109 
110 };
111 
112 /* ============================ INLINE METHODS ============================ */
113 
114 #endif // _NameValuePairInsensitive_h_
virtual unsigned hash() const
Calculate a hash over the string contents.
Definition: NameValuePairInsensitive.cpp:80
const char * getValue()
Definition: NameValuePairInsensitive.cpp:66
static UtlContainableType TYPE
Definition: NameValuePairInsensitive.h:105
virtual int compareTo(UtlContainable const *other) const
Compare to any other UtlContainable.
Definition: NameValuePairInsensitive.cpp:107
virtual UtlBoolean isEqual(UtlContainable const *) const
Test this object to another like-object for equality.
Definition: NameValuePairInsensitive.cpp:126
void setValue(const char *)
returns: the null terminated string containing the value Note: this should not be freed as it is pa...
Definition: NameValuePairInsensitive.cpp:71
NameValuePairInsensitive & operator=(const NameValuePairInsensitive &rhs)
Definition: NameValuePairInsensitive.cpp:58
virtual ~NameValuePairInsensitive()
param: name - the key for this object, null terminated string param: value - the data or value for th...
Definition: NameValuePairInsensitive.cpp:49
Definition: NameValuePair.h:35
Definition: NameValuePairInsensitive.h:32
virtual UtlContainableType getContainableType() const
Return the unique type value for this class.
Definition: NameValuePairInsensitive.cpp:100
virtual UtlBoolean isInstanceOf(const UtlContainableType type) const
Definition: NameValuePairInsensitive.cpp:132
NameValuePairInsensitive(const char *name, const char *value=NULL)
Definition: NameValuePairInsensitive.cpp:33

sipXtackLib home page