PTLib  Version 2.12.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
guid.h
Go to the documentation of this file.
1 /*
2  * guid.h
3  *
4  * Globally Unique Identifier
5  *
6  * Open H323 Library
7  *
8  * Copyright (c) 1998-2001 Equivalence Pty. Ltd.
9  *
10  * The contents of this file are subject to the Mozilla Public License
11  * Version 1.0 (the "License"); you may not use this file except in
12  * compliance with the License. You may obtain a copy of the License at
13  * http://www.mozilla.org/MPL/
14  *
15  * Software distributed under the License is distributed on an "AS IS"
16  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17  * the License for the specific language governing rights and limitations
18  * under the License.
19  *
20  * The Original Code is Open H323 Library.
21  *
22  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
23  *
24  * Contributor(s): ______________________________________.
25  *
26  * $Revision: 27549 $
27  * $Author: rjongbloed $
28  * $Date: 2012-04-30 14:11:00 +1000 (Mon, 30 Apr 2012) $
29  */
30 
31 #ifndef PTLIB_GUID_H
32 #define PTLIB_GUID_H
33 
34 #ifdef P_USE_PRAGMA
35 #pragma interface
36 #endif
37 
38 class PASN_OctetString;
39 
40 
42 
49 {
50  PCLASSINFO(PGloballyUniqueID, PBYTEArray);
51 
52  public:
53  enum {
55  Size = 16
56  };
57 
65 
72  const char * cstr
73  );
77  const PString & str
78  );
84  const void * data,
85  PINDEX size
86  );
87 #if P_ASN
88 
91  const PASN_OctetString & ostr
92  );
93 #endif
94 
95 
102  virtual void PrintOn(
103  ostream & strm
104  ) const;
105 
110  virtual void ReadFrom(
111  istream & strm
112  );
113 
118  virtual PObject * Clone() const;
119 
124  virtual PINDEX HashFunction() const;
126 
131  PString AsString() const;
132 
135  PBoolean IsNULL() const;
136 
137  PBoolean operator!() const { return !IsNULL(); }
139 
140  private:
141  virtual PBoolean SetSize(PINDEX) { return true; }
142 };
143 
144 
145 #endif // PTLIB_GUID_H
146 
147 
148 // End Of File ///////////////////////////////////////////////////////////////