sipxtacklib  Version 3.3
NameValuePair.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 
14 #ifndef _NameValuePair_h_
15 #define _NameValuePair_h_
16 
17 // SYSTEM INCLUDES
18 
19 // APPLICATION INCLUDES
20 #include <utl/UtlString.h>
21 
22 #include <os/OsMutex.h>
23 
24 // DEFINES
25 // MACROS
26 // EXTERNAL FUNCTIONS
27 // EXTERNAL VARIABLES
28 // CONSTANTS
29 // STRUCTS
30 // TYPEDEFS
31 // FORWARD DECLARATIONS
32 
33 //: Name Value pair
34 // for storing string values associated with a key or name
35 class NameValuePair : public UtlString
36 {
37 /* //////////////////////////// PUBLIC //////////////////////////////////// */
38 public:
39 
40 /* ============================ CREATORS ================================== */
41 
42  NameValuePair(const char* name, const char* value = NULL);
43  //: Construct a pair
44  // Data is copied not attached or freed
48 
49  virtual
51  //:Destructor
52 
53 /* ============================ MANIPULATORS ============================== */
54 
56  //:Assignment operator
57 
58  NameValuePair(const NameValuePair& rNameValuePair);
59  //: Copy constructor
60 
61 /* ============================ ACCESSORS ================================= */
62 
63  const char* getValue();
64  //: get value string
67 
68  void setValue(const char*);
69 
70 /* ============================ INQUIRY =================================== */
71 
72  UtlBoolean isInstanceOf(const UtlContainableType type) const;
73 
74 public:
75  static int count;
76 
77 /* //////////////////////////// PROTECTED ///////////////////////////////// */
78 protected:
79 
80 /* //////////////////////////// PRIVATE /////////////////////////////////// */
81 private:
82  char* valueString;
83 
84  NameValuePair();
85  //: Hide Default constructor
86 
87  static OsMutex mCountLock;
88 
89 };
90 
91 /* ============================ INLINE METHODS ============================ */
92 
93 #endif // _NameValuePair_h_
UtlBoolean isInstanceOf(const UtlContainableType type) const
Definition: NameValuePair.cpp:129
virtual ~NameValuePair()
param: name - the key for this object, null terminated string param: value - the data or value for th...
Definition: NameValuePair.cpp:67
void setValue(const char *)
returns: the null terminated string containing the value Note: this should not be freed as it is pa...
Definition: NameValuePair.cpp:103
Definition: NameValuePair.h:35
NameValuePair & operator=(const NameValuePair &rhs)
Definition: NameValuePair.cpp:86
static int count
Definition: NameValuePair.h:75
const char * getValue()
Definition: NameValuePair.cpp:98

sipXtackLib home page