summaryrefslogtreecommitdiff
path: root/shared/ossp_uuid/uuid++.pod
blob: 8b5a4b1e47b8b9343f7cf098ecf46ff787acfec6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
##
##  OSSP uuid - Universally Unique Identifier
##  Copyright (c) 2004-2008 Ralf S. Engelschall <rse@engelschall.com>
##  Copyright (c) 2004-2008 The OSSP Project <http://www.ossp.org/>
##
##  This file is part of OSSP uuid, a library for the generation
##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
##
##  Permission to use, copy, modify, and distribute this software for
##  any purpose with or without fee is hereby granted, provided that
##  the above copyright notice and this permission notice appear in all
##  copies.
##
##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
##  SUCH DAMAGE.
##
##  uuid++.pod: manual page for C++ API
##

=pod

=head1 NAME

B<OSSP uuid> - B<Universally Unique Identifier> (C++ API)

=head1 VERSION

OSSP uuid UUID_VERSION_STR

=head1 DESCRIPTION

B<uuid++> is the ISO-C++ language binding of the B<OSSP uuid> C API.
It provides a thin ISO-C++ class B<uuid> wrapping the ISO-C API type
B<uuid_t>.

=head1 APPLICATION PROGRAMMING INTERFACE

The ISO-C++ Application Programming Interface (API) of B<OSSP uuid>
consists of the following components:

=head2 CONSTANTS

The constants are the same to those provided by the ISO-C API.
See uuid(3) for details.

=head2 CLASSES

The following classes are provided:

=over 4

=item B<uuid>

This is the class corresponding to the C API type B<uuid_t>.
It is the main object.

=item B<uuid_error_t>

This is the class corresponding to the C API function B<uuid_error>.
It is the object thrown as an exception in case of any errors.

=back

=head2 METHODS

The following methods are provided:

=over 4

=item B<uuid>();

The standard constructor.

=item B<uuid>(const uuid &_obj);

The copy constructor for B<uuid> class.

=item B<uuid>(const uuid_t *_obj);

The import constructor for C API objects.

=item B<uuid>(const void *_bin);

The import constructor for binary representation.

=item B<uuid>(const char *_str);

The import constructor for string representation.

=item ~B<uuid>();

The standard destructor for B<uuid> class.

=item uuid &B<uuid::operator=>(const uuid &_obj);

The assignment operator corresponding to the copy constructor.

=item uuid &B<uuid::operator=>(const uuid_t *_obj);

The assignment operator corresponding to the import constructor for C API objects.

=item uuid &B<uuid::operator=>(const void *_bin);

The assignment operator corresponding to the import constructor for binary representation.

=item uuid &B<uuid::operator=>(const char *_str);

The assignment operator corresponding to the import constructor for string and single integer value representation.

=item uuid B<uuid::clone>(void);

Regular method corresponding to the C API function B<uuid_clone>.

=item void B<uuid::load>(const char *_name);

Regular method corresponding to the C API function B<uuid_load>.

=item void B<uuid::make>(unsigned int _mode, ...);

Regular method corresponding to the C API function B<uuid_make>.

=item int B<uuid::isnil>(void);

Regular method corresponding to the C API function B<uuid_isnil>.

=item int B<uuid::compare>(const uuid &_obj);

Regular method corresponding to the C API function B<uuid_compare>.

=item int B<uuid::operator==>(const uuid &_obj);

The comparison operator corresponding to B<uuid_compare> usage for equality.

=item int B<uuid::operator!=>(const uuid &_obj);

The comparison operator corresponding to B<uuid_compare> usage for inequality.

=item int B<uuid::operatorE<lt>>(const uuid &_obj);

The comparison operator corresponding to B<uuid_compare> usage for less-than.

=item int B<uuid::operatorE<lt>=>(const uuid &_obj);

The comparison operator corresponding to B<uuid_compare> usage for less-than-or-equal.

=item int B<uuid::operatorE<gt>>(const uuid &_obj);

The comparison operator corresponding to B<uuid_compare> usage for greater-than.

=item int B<uuid::operatorE<gt>=>(const uuid &_obj);

The comparison operator corresponding to B<uuid_compare> usage for greater-than-or-equal.

=item void B<uuid::import>(const void *_bin);

Regular method corresponding to the C API function B<uuid_import> for binary representation usage.

=item void B<uuid::import>(const char *_str);

Regular method corresponding to the C API function B<uuid_import> for string representation usage.

=item void *B<uuid::binary>(void);

Regular method corresponding to the C API function B<uuid_export> for binary representation usage.

=item char *B<uuid::string>(void);

Regular method corresponding to the C API function B<uuid_export> for string representation usage.

=item char *B<uuid::integer>(void);

Regular method corresponding to the C API function B<uuid_export> for single integer value representation usage.

=item char *B<uuid::summary>(void);

Regular method corresponding to the C API function B<uuid_export> for textual summary representation usage.

=item unsigned long B<uuid::version>(void);

Regular method corresponding to the C API function B<uuid_version>.

=item B<uuid_error_t>()

The standard constructor for B<uuid_error_t> class.

=item B<uuid_error_t>(uuid_rc_t _code)

The standard constructor for B<uuid_error_t> class with return code initialization.

=item ~B<uuid_error_t>()

The standard destructor for B<uuid_error_t> class.

=item void B<uuid_error_t::code>(uuid_rc_t _code)

Regular method for setting the return code.

=item uuid_rc_t B<uuid_error_t::code>(void)

Regular method for fetching the return code.

=item char *B<uuid_error_t::string>(void)

Regular method for fetching the string corresponding to the current return code.

=back

=head1 EXAMPLE

The following shows an example usage of the C++ API. Exception handling is
omitted for code simplification and has to be re-added for production
code.

 /* generate a DCE 1.1 v1 UUID from system environment */
 char *uuid_v1(void)
 {
     uuid id;
     char *str;

     id.make(UUID_MAKE_V1);
     str = id.string();
     return str;
 }

 /* generate a DCE 1.1 v3 UUID from an URL */
 char *uuid_v3(const char *url)
 {
     uuid id;
     uuid id_ns;
     char *str;

     id_ns.load("ns:URL");
     id.make(UUID_MAKE_V3, &id_ns, url);
     str = id.string();
     return str;
 }

=head1 SEE ALSO

uuid(3).

=cut

bgstack15