1 -- Created on: 1997-06-19
2 -- Created by: Christophe LEYNADIER
3 -- Copyright (c) 1997-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
22 class GUID from Standard
24 inherits Storable from Standard
27 Create returns GUID from Standard;
29 Create(aGuid : CString from Standard)
30 returns GUID from Standard;
31 ---Purpose: build a GUID from an ascii string with the
34 -- "00000000-0000-0000-0000-000000000000"
36 Create(aGuid : ExtString from Standard)
37 returns GUID from Standard;
38 ---Purpose: build a GUID from an unicode string with the
41 -- "00000000-0000-0000-0000-000000000000"
44 Create(a32b : Integer from Standard;
45 a16b1 : ExtCharacter from Standard;
46 a16b2 : ExtCharacter from Standard;
47 a16b3 : ExtCharacter from Standard;
48 a8b1 : Byte from Standard;
49 a8b2 : Byte from Standard;
50 a8b3 : Byte from Standard;
51 a8b4 : Byte from Standard;
52 a8b5 : Byte from Standard;
53 a8b6 : Byte from Standard)
54 returns GUID from Standard;
56 Create(aGuid : UUID from Standard)
57 returns GUID from Standard;
59 Create(aGuid : GUID from Standard)
60 returns GUID from Standard;
63 returns UUID from Standard ;
65 ToCString(me; aStrGuid : PCharacter from Standard);
66 ---Purpose: translate the GUID into ascii string
67 -- the aStrGuid is allocated by user.
68 -- the guid have the following format:
70 -- "00000000-0000-0000-0000-000000000000"
72 ToExtString(me; aStrGuid : PExtCharacter from Standard);
73 ---Purpose: translate the GUID into unicode string
74 -- the aStrGuid is allocated by user.
75 -- the guid have the following format:
77 -- "00000000-0000-0000-0000-000000000000"
79 IsSame(me; uid : GUID from Standard)
80 returns Boolean from Standard;
81 ---C++: alias operator ==
83 IsNotSame(me; uid : GUID from Standard)
84 returns Boolean from Standard;
85 ---C++: alias operator !=
87 Assign(me : out; uid : GUID from Standard);
88 ---C++: alias operator =
90 Assign(me : out; uid : UUID from Standard);
91 ---C++: alias operator =
93 ShallowDump(me; aStream : in out OStream from Standard) is redefined;
94 ---Purpose: Display the GUID with the following format:
96 -- "00000000-0000-0000-0000-000000000000"
98 CheckGUIDFormat(myclass; aGuid : CString from Standard)
99 returns Boolean from Standard;
100 ---Purpose: Check the format of a GUID string.
101 -- It checks the size, the position of the '-' and the correct size of fields.
103 Hash(me; Upper : Integer)
106 ---Purpose: Hash function for GUID.
108 HashCode(myclass ; aguid : GUID from Standard; Upper : Integer)
111 ---Purpose: H method used by collections.
113 IsEqual(myclass ; string1 : GUID from Standard;
114 string2 : GUID from Standard)
117 ---Purpose: Returns True when the two GUID are the same.
122 my16b1 : ExtCharacter;
123 my16b2 : ExtCharacter;
124 my16b3 : ExtCharacter;