1.::uuid++(3) Universally Unique Identifier .::uuid++(3)
2
3
4
6 OSSP uuid - Universally Unique Identifier (C++ API)
7
9 OSSP uuid 1.6.0 (19-May-2007)
10
12 uuid++ is the ISO-C++ language binding of the OSSP uuid C API. It pro‐
13 vides a thin ISO-C++ class uuid wrapping the ISO-C API type uuid_t.
14
16 The ISO-C++ Application Programming Interface (API) of OSSP uuid con‐
17 sists of the following components:
18
19 CONSTANTS
20
21 The constants are the same to those provided by the ISO-C API. See
22 uuid(3) for details.
23
24 CLASSES
25
26 The following classes are provided:
27
28 uuid
29 This is the class corresponding to the C API type uuid_t. It is
30 the main object.
31
32 uuid_error_t
33 This is the class corresponding to the C API function uuid_error.
34 It is the object thrown as an exception in case of any errors.
35
36 METHODS
37
38 The following methods are provided:
39
40 uuid();
41 The standard constructor.
42
43 uuid(const uuid &_obj);
44 The copy constructor for uuid class.
45
46 uuid(const uuid_t *_obj);
47 The import constructor for C API objects.
48
49 uuid(const void *_bin);
50 The import constructor for binary representation.
51
52 uuid(const char *_str);
53 The import constructor for string representation.
54
55 ~uuid();
56 The standard destructor for uuid class.
57
58 uuid &uuid::operator=(const uuid &_obj);
59 The assignment operator corresponding to the copy constructor.
60
61 uuid &uuid::operator=(const uuid_t *_obj);
62 The assignment operator corresponding to the import constructor for
63 C API objects.
64
65 uuid &uuid::operator=(const void *_bin);
66 The assignment operator corresponding to the import constructor for
67 binary representation.
68
69 uuid &uuid::operator=(const char *_str);
70 The assignment operator corresponding to the import constructor for
71 string and single integer value representation.
72
73 uuid uuid::clone(void);
74 Regular method corresponding to the C API function uuid_clone.
75
76 void uuid::load(const char *_name);
77 Regular method corresponding to the C API function uuid_load.
78
79 void uuid::make(unsigned int _mode, ...);
80 Regular method corresponding to the C API function uuid_make.
81
82 int uuid::isnil(void);
83 Regular method corresponding to the C API function uuid_isnil.
84
85 int uuid::compare(const uuid &_obj);
86 Regular method corresponding to the C API function uuid_compare.
87
88 int uuid::operator==(const uuid &_obj);
89 The comparison operator corresponding to uuid_compare usage for
90 equality.
91
92 int uuid::operator!=(const uuid &_obj);
93 The comparison operator corresponding to uuid_compare usage for
94 inequality.
95
96 int uuid::operator<(const uuid &_obj);
97 The comparison operator corresponding to uuid_compare usage for
98 less-than.
99
100 int uuid::operator<=(const uuid &_obj);
101 The comparison operator corresponding to uuid_compare usage for
102 less-than-or-equal.
103
104 int uuid::operator>(const uuid &_obj);
105 The comparison operator corresponding to uuid_compare usage for
106 greater-than.
107
108 int uuid::operator>=(const uuid &_obj);
109 The comparison operator corresponding to uuid_compare usage for
110 greater-than-or-equal.
111
112 void uuid::import(const void *_bin);
113 Regular method corresponding to the C API function uuid_import for
114 binary representation usage.
115
116 void uuid::import(const char *_str);
117 Regular method corresponding to the C API function uuid_import for
118 string representation usage.
119
120 void *uuid::binary(void);
121 Regular method corresponding to the C API function uuid_export for
122 binary representation usage.
123
124 char *uuid::string(void);
125 Regular method corresponding to the C API function uuid_export for
126 string representation usage.
127
128 char *uuid::integer(void);
129 Regular method corresponding to the C API function uuid_export for
130 single integer value representation usage.
131
132 char *uuid::summary(void);
133 Regular method corresponding to the C API function uuid_export for
134 textual summary representation usage.
135
136 unsigned long uuid::version(void);
137 Regular method corresponding to the C API function uuid_version.
138
139 uuid_error_t()
140 The standard constructor for uuid_error_t class.
141
142 uuid_error_t(uuid_rc_t _code)
143 The standard constructor for uuid_error_t class with return code
144 initialization.
145
146 ~uuid_error_t()
147 The standard destructor for uuid_error_t class.
148
149 void uuid_error_t::code(uuid_rc_t _code)
150 Regular method for setting the return code.
151
152 uuid_rc_t uuid_error_t::code(void)
153 Regular method for fetching the return code.
154
155 char *uuid_error_t::string(void)
156 Regular method for fetching the string corresponding to the current
157 return code.
158
160 The following shows an example usage of the C++ API. Exception handling
161 is omitted for code simplification and has to be re-added for produc‐
162 tion code.
163
164 /* generate a DCE 1.1 v1 UUID from system environment */
165 char *uuid_v1(void)
166 {
167 uuid id;
168 char *str;
169
170 id.make(UUID_MAKE_V1);
171 str = id.string();
172 return str;
173 }
174
175 /* generate a DCE 1.1 v3 UUID from an URL */
176 char *uuid_v3(const char *url)
177 {
178 uuid id;
179 uuid id_ns;
180 char *str;
181
182 id_ns.load("ns:URL");
183 id.make(UUID_MAKE_V3, &id_ns, url);
184 str = id.string();
185 return str;
186 }
187
189 uuid(3).
190
191
192
19319-May-2007 OSSP uuid 1.6.0 .::uuid++(3)