OSSP CVS Repository

ossp - Check-in [5145]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 5145
Date: 2005-Aug-31 22:07:29 (local)
2005-Aug-31 20:07:29 (UTC)
User:rse
Branch:
Comment: ok, second attempt: complete rewrite from scratch of the C++ API. Now with a manual page and more methods. It is now providing the same functionality as the C API and does no longer miss some parts.
Tickets:
Inspections:
Files:
ossp-pkg/uuid/.cvsignore      1.4 -> 1.5     2 inserted, 1 deleted
ossp-pkg/uuid/Makefile.in      1.31 -> 1.32     18 inserted, 2 deleted
ossp-pkg/uuid/uuid++.cc      1.1 -> 1.2     152 inserted, 150 deleted
ossp-pkg/uuid/uuid++.hh      1.1 -> 1.2     54 inserted, 31 deleted
ossp-pkg/uuid/uuid++.pod      added-> 1.1

ossp-pkg/uuid/.cvsignore 1.4 -> 1.5

--- .cvsignore   2005/08/31 11:16:18     1.4
+++ .cvsignore   2005/08/31 20:07:29     1.5
@@ -10,7 +10,8 @@
 uuid-config
 uuid-config.1
 uuid.pc
+uuid.h
 uuid.1
 uuid.3
-uuid.h
+uuid++.3
 uuid


ossp-pkg/uuid/Makefile.in 1.31 -> 1.32

--- Makefile.in  2005/08/31 14:29:56     1.31
+++ Makefile.in  2005/08/31 20:07:29     1.32
@@ -69,7 +69,7 @@
 PRG_NAME    = uuid
 PRG_OBJS    = uuid_cli.o
 
-MAN_NAME    = uuid.3 uuid.1
+MAN_NAME    = uuid.3 uuid++.3 uuid.1
 
 PERL_NAME   = perl/blib/lib/OSSP/uuid.pm
 PERL_OBJS   = perl/uuid.pm
@@ -128,7 +128,7 @@
 uuid_cli.o: uuid_cli.c uuid.h
 uuid++.lo: uuid++.cc uuid++.hh
 
-man: uuid.3 uuid-config.1 uuid.1
+man: uuid.3 uuid++.3 uuid-config.1 uuid.1
 uuid.3: uuid.pod
         V1=`$(SHTOOL) version -l c -d short $(top_srcdir)/uuid_vers.h`; \
         V2=`$(SHTOOL) version -l c -d long $(top_srcdir)/uuid_vers.h`; \
@@ -137,6 +137,14 @@
                    --section=3 --center="Universally Unique Identifier" \
                    --release="$$D" --date="OSSP uuid $$V1" $(srcdir)/uuid.pod | \
         sed -e "s;UUID_VERSION_STR;$$V2;" >uuid.3
+uuid++.3: uuid++.pod
+        V1=`$(SHTOOL) version -l c -d short $(top_srcdir)/uuid_vers.h`; \
+        V2=`$(SHTOOL) version -l c -d long $(top_srcdir)/uuid_vers.h`; \
+        D=`$(SHTOOL) version -l c -d long $(top_srcdir)/uuid_vers.h | sed -e 's;.*(;;' -e 's;).*;;'`; \
+        $(POD2MAN) --quotes=none \
+                   --section=3 --center="Universally Unique Identifier" \
+                   --release="$$D" --date="OSSP uuid $$V1" $(srcdir)/uuid++.pod | \
+        sed -e "s;UUID_VERSION_STR;$$V2;" >uuid++.3
 uuid-config.1: uuid-config.pod
         V1=`$(SHTOOL) version -l c -d short $(top_srcdir)/uuid_vers.h`; \
         V2=`$(SHTOOL) version -l c -d long $(top_srcdir)/uuid_vers.h`; \
@@ -203,6 +211,10 @@
             $(SHTOOL) install -c -m 644 $(srcdir)/uuid++.hh $(DESTDIR)$(includedir)/; \
         fi
         $(SHTOOL) install -c -m 644 $(srcdir)/uuid.3 $(DESTDIR)$(mandir)/man3/
+        -@if [ ".$(WITH_CXX)" = .yes ]; then \
+            echo "$(SHTOOL) install -c -m 644 $(srcdir)/uuid++.3 $(DESTDIR)$(mandir)/man3/"; \
+            $(SHTOOL) install -c -m 644 $(srcdir)/uuid++.3 $(DESTDIR)$(mandir)/man3/; \
+        fi
         @$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 libuuid.la $(DESTDIR)$(libdir)/
         -@if [ ".$(WITH_DCE)" = .yes ]; then \
             $(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 libuuid_dce.la $(DESTDIR)$(libdir)/; \
@@ -227,6 +239,10 @@
             $(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(libdir)/libuuid++.la; \
         fi
         -$(RM) $(DESTDIR)$(mandir)/man3/uuid.3
+        -@if [ ".$(WITH_CXX)" = .yes ]; then \
+            echo "$(RM) $(DESTDIR)$(mandir)/man3/uuid++.3"; \
+            $(RM) $(DESTDIR)$(mandir)/man3/uuid++.3; \
+        fi
         -$(RM) $(DESTDIR)$(includedir)/uuid.h
         -@if [ ".$(WITH_DCE)" = .yes ]; then \
             echo "$(RM) $(DESTDIR)$(includedir)/uuid_dce.h"; \


ossp-pkg/uuid/uuid++.cc 1.1 -> 1.2

--- uuid++.cc    2005/08/31 14:29:56     1.1
+++ uuid++.cc    2005/08/31 20:07:29     1.2
@@ -32,254 +32,256 @@
 
 #include "uuid++.hh"
 
-using namespace std;
-
 /*
-**  OBJECT CONSTRUCTORS AND DESTRUCTOR
+**  ==== Low-Level C++ API (direct mapping of C API) ====
 */
 
 /*  standard constructor */
 uuid::uuid()
 {
-    if (uuid_create(&ctx) != UUID_RC_OK)
-        throw "unable to create UUID context";
-}
-
-/*  standard destructor */
-uuid::~uuid()
-{
-    uuid_destroy(ctx);
+    uuid_rc_t rc;
+    if ((rc = uuid_create(&ctx)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
 }
 
-/*  construction: import of other C++ API object (= special C++ copy constructor) */
+/*  copy constructor */
 uuid::uuid(const uuid &obj)
 {
     /* Notice: the copy constructor is the same as the assignment
-       operator (with the object as the RHS) below, except that (1) no
-       check for self-assignment is required, (2) no existing internals
-       have to be destroyed and (3) no return value is given back. */
-    if (uuid_clone(obj.ctx, &ctx) != UUID_RC_OK)
-        throw "unable to clone UUID context";
+       operator (with the object as the argument) below, except that
+       (1) no check for self-assignment is required, (2) no existing
+       internals have to be destroyed and (3) no return value is given back. */
+    uuid_rc_t rc;
+    if ((rc = uuid_clone(obj.ctx, &ctx)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
 }
 
-/*  construction: import of other C API object */
-uuid::uuid(uuid_t *obj)
-{
-    if (obj != NULL)
-        ctx = obj;
-    else {
-        if (uuid_create(&ctx) != UUID_RC_OK)
-            throw "unable to create UUID context";
-    }
+/*  extra constructor via C API object */
+uuid::uuid(const uuid_t *obj)
+{
+    uuid_rc_t rc;
+    if (obj == NULL)
+        throw uuid_error_t(UUID_RC_ARG);
+    if ((rc = uuid_clone(obj, &ctx)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
 }
 
-/*  construction: import of binary representation */
-uuid::uuid(const unsigned char *bin)
+/*  extra constructor via binary representation */
+uuid::uuid(const void *bin)
 {
-    if (uuid_create(&ctx) != UUID_RC_OK)
-        throw "unable to create UUID context";
-    if (bin != NULL) {
-        if (uuid_import(ctx, UUID_FMT_BIN, bin, UUID_LEN_BIN) != UUID_RC_OK)
-            throw "unable to import UUID from binary representation";
-    }
+    uuid_rc_t rc;
+    if (bin == NULL)
+        throw uuid_error_t(UUID_RC_ARG);
+    if ((rc = uuid_create(&ctx)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    import(bin);
 }
 
-/*  construction: import of string representation */
+/*  extra constructor via string representation */
 uuid::uuid(const char *str)
 {
-    if (uuid_create(&ctx) != UUID_RC_OK)
-        throw "unable to create UUID context";
-    if (str != NULL) {
-        if (uuid_import(ctx, UUID_FMT_STR, str, strlen(str)) != UUID_RC_OK)
-            throw "unable to import UUID from string representation";
-    }
+    uuid_rc_t rc;
+    if (str == NULL)
+        throw uuid_error_t(UUID_RC_ARG);
+    if ((rc = uuid_create(&ctx)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    import(str);
 }
 
-/*
-**  IMPORT METHODS
-*/
+/*  standard destructor */
+uuid::~uuid()
+{
+    uuid_destroy(ctx);
+}
 
-/*  assignment: import of other C++ API object */
-uuid &uuid::operator=(const uuid &rhs)
+/*  assignment operator: import of other C++ API object */
+uuid &uuid::operator=(const uuid &obj)
 {
-    if (this == &rhs)
+    uuid_rc_t rc;
+    if (this == &obj)
         return *this;
-    if (uuid_destroy(ctx) != UUID_RC_OK)
-        throw "failed to destroy old UUID context";
-    if (uuid_clone(rhs.ctx, &ctx) != UUID_RC_OK)
-        throw "unable to clone UUID context";
+    if ((rc = uuid_destroy(ctx)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    if ((rc = uuid_clone(obj.ctx, &ctx)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
     return *this;
 }
 
-/*  assignment: import of other C API object */
-uuid &uuid::operator=(const uuid_t *rhs)
+/*  assignment operator: import of other C API object */
+uuid &uuid::operator=(const uuid_t *obj)
 {
-    if (rhs == NULL)
-        throw "invalid RHS C object";
-    if (uuid_clone((uuid_t *)rhs, &ctx) != UUID_RC_OK)
-        throw "unable to clone UUID context";
+    uuid_rc_t rc;
+    if (obj == NULL)
+        throw uuid_error_t(UUID_RC_ARG);
+    if ((rc = uuid_clone(obj, &ctx)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
     return *this;
 }
 
-/*  assignment: import of binary representation */
-uuid &uuid::operator=(const unsigned char *rhs)
+/*  assignment operator: import of binary representation */
+uuid &uuid::operator=(const void *bin)
 {
-    if (rhs == NULL)
-        throw "invalid RHS string";
-    if (uuid_import(ctx, UUID_FMT_BIN, (const void *)rhs, UUID_LEN_BIN) != UUID_RC_OK)
-        throw "unable to import into source UUID context";
+    if (bin == NULL)
+        throw uuid_error_t(UUID_RC_ARG);
+    import(bin);
     return *this;
 }
 
-/*  assignment: import of string representation */
-uuid &uuid::operator=(const char *rhs)
+/*  assignment operator: import of string representation */
+uuid &uuid::operator=(const char *str)
 {
-    if (rhs == NULL)
-        throw "invalid RHS string";
-    if (uuid_import(ctx, UUID_FMT_STR, (const void *)rhs, strlen(rhs)) != UUID_RC_OK)
-        throw "unable to import into source UUID context";
+    if (str == NULL)
+        throw uuid_error_t(UUID_RC_ARG);
+    import(str);
     return *this;
 }
 
-/*
-**  GENERATION METHODS
-*/
+/*  method: clone object */
+uuid uuid::clone(void)
+{
+    return new uuid(this);
+}
 
-/*  generation: loading existing UUID by name */
+/*  method: loading existing UUID by name */
 void uuid::load(const char *name)
 {
+    uuid_rc_t rc;
     if (name == NULL)
-        throw "invalid UUID name";
-    if (uuid_load(ctx, name) != UUID_RC_OK)
-        throw "unable to load UUID by name";
+        throw uuid_error_t(UUID_RC_ARG);
+    if ((rc = uuid_load(ctx, name)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
     return;
 }
 
-/*  generation: making new UUID one from scratch */
+/*  method: making new UUID one from scratch */
 void uuid::make(unsigned int mode, ...)
 {
-    uuid_rc_t rv;
+    uuid_rc_t rc;
     va_list ap;
 
     va_start(ap, mode);
     if ((mode & UUID_MAKE_V3) || (mode & UUID_MAKE_V5)) {
-        const char *ns   = (const char *)va_arg(ap, char *);
+        const uuid *ns = (const uuid *)va_arg(ap, const uuid *);
         const char *name = (const char *)va_arg(ap, char *);
         if (ns == NULL || name == NULL)
-            throw "invalid arguments";
-        rv = uuid_make(ctx, mode, ns, name);
+            throw uuid_error_t(UUID_RC_ARG);
+        rc = uuid_make(ctx, mode, ns->ctx, name);
     }
     else
-        rv = uuid_make(ctx, mode);
+        rc = uuid_make(ctx, mode);
     va_end(ap);
-    if (rv != UUID_RC_OK)
-        throw "unable to make new UUID";
+    if (rc != UUID_RC_OK)
+        throw uuid_error_t(rc);
     return;
 }
 
-/*
-**  COMPARISON METHODS
-*/
-
-/*  comparison: is-Nil-UUID */
+/*  method: comparison for Nil UUID */
 int uuid::isnil(void)
 {
+    uuid_rc_t rc;
     int rv;
 
-    if (uuid_isnil(ctx, &rv) != UUID_RC_OK)
-        throw "unable to compare UUID for being Nil-UUID";
+    if ((rc = uuid_isnil(ctx, &rv)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
     return rv;
 }
 
-/*  comparison: equality */
-int uuid::operator==(const uuid &rhs)
+/*  method: comparison against other object */
+int uuid::compare(const uuid &obj)
 {
+    uuid_rc_t rc;
     int rv;
 
-    if (uuid_compare(ctx, rhs.ctx, &rv) != UUID_RC_OK)
-        throw "unable to compare UUID contexts";
-    return (rv == 0);
+    if ((rc = uuid_compare(ctx, obj.ctx, &rv)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    return rv;
 }
 
-/*  comparison: inequality */
-int uuid::operator!=(const uuid &rhs)
+/*  method: comparison for equality */
+int uuid::operator==(const uuid &obj)
 {
-    int rv;
-
-    if (uuid_compare(ctx, rhs.ctx, &rv) != UUID_RC_OK)
-        throw "unable to compare UUID contexts";
-    return (rv != 0);
+    return (compare(obj) == 0);
 }
 
-/*  comparison: lower-than */
-int uuid::operator<(const uuid &rhs)
+/*  method: comparison for inequality */
+int uuid::operator!=(const uuid &obj)
 {
-    int rv;
-
-    if (uuid_compare(ctx, rhs.ctx, &rv) != UUID_RC_OK)
-        throw "unable to compare UUID contexts";
-    return (rv < 0);
+    return (compare(obj) != 0);
 }
 
-/*  comparison: lower-than-or-equal */
-int uuid::operator<=(const uuid &rhs)
+/*  method: comparison for lower-than */
+int uuid::operator<(const uuid &obj)
 {
-    int rv;
-
-    if (uuid_compare(ctx, rhs.ctx, &rv) != UUID_RC_OK)
-        throw "unable to compare UUID contexts";
-    return (rv <= 0);
+    return (compare(obj) < 0);
 }
 
-/*  comparison: greater-than */
-int uuid::operator>(const uuid &rhs)
+/*  method: comparison for lower-than-or-equal */
+int uuid::operator<=(const uuid &obj)
 {
-    int rv;
-
-    if (uuid_compare(ctx, rhs.ctx, &rv) != UUID_RC_OK)
-        throw "unable to compare UUID contexts";
-    return (rv > 0);
+    return (compare(obj) <= 0);
 }
 
-/*  comparison: greater-than-or-equal */
-int uuid::operator>=(const uuid &rhs)
+/*  method: comparison for greater-than */
+int uuid::operator>(const uuid &obj)
 {
-    int rv;
-
-    if (uuid_compare(ctx, rhs.ctx, &rv) != UUID_RC_OK)
-        throw "unable to compare UUID contexts";
-    return (rv >= 0);
+    return (compare(obj) > 0);
 }
 
-/*
-**  EXPORT METHODS
-*/
-
-/*  export: object representation */
-uuid_t *uuid::object(void)
+/*  method: comparison for greater-than-or-equal */
+int uuid::operator>=(const uuid &obj)
 {
-    return ctx;
+    return (compare(obj) >= 0);
 }
         
-/*  export: binary representation */
-unsigned char *uuid::binary(void)
+/*  method: import binary representation */
+void uuid::import(const void *bin)
 {
-    unsigned char *bin;
+    uuid_rc_t rc;
+    if ((rc = uuid_import(ctx, UUID_FMT_BIN, bin, UUID_LEN_BIN)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+}
 
-    bin = NULL;
-    if (uuid_export(ctx, UUID_FMT_BIN, (void **)&bin, NULL) != UUID_RC_OK)
-        throw "unable to export UUID context";
+/*  method: import string representation */
+void uuid::import(const char *str)
+{
+    uuid_rc_t rc;
+    if ((rc = uuid_import(ctx, UUID_FMT_STR, str, UUID_LEN_STR)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+}
+        
+/*  method: export binary representation */
+void *uuid::binary(void)
+{
+    uuid_rc_t rc;
+    void *bin = NULL;
+    if ((rc = uuid_export(ctx, UUID_FMT_BIN, &bin, NULL)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
     return bin;
 }
 
-/*  export: string representation */
+/*  method: export string representation */
 char *uuid::string(void)
 {
-    char *str;
-
-    str = NULL;
-    if (uuid_export(ctx, UUID_FMT_STR, (void **)&str, NULL) != UUID_RC_OK)
-        throw "unable to export UUID context";
+    uuid_rc_t rc;
+    char *str = NULL;
+    if ((rc = uuid_export(ctx, UUID_FMT_STR, (void **)&str, NULL)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
     return str;
 }
 
+/*  method: export textual summary representation */
+char *uuid::summary(void)
+{
+    uuid_rc_t rc;
+    char *txt = NULL;
+    if ((rc = uuid_export(ctx, UUID_FMT_TXT, (void **)&txt, NULL)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    return txt;
+}
+
+/*  method: return library version */
+unsigned long uuid::version(void)
+{
+    return uuid_version();
+}
+


ossp-pkg/uuid/uuid++.hh 1.1 -> 1.2

--- uuid++.hh    2005/08/31 14:29:56     1.1
+++ uuid++.hh    2005/08/31 20:07:29     1.2
@@ -31,43 +31,66 @@
 #define __UUIDXX_HH__
 
 /* required C API header */
+#include <stdlib.h>
 #include "uuid.h"
 
+/* UUID object class */
 class uuid {
+    public:
+        /* construction & destruction */
+                      uuid         ();                         /* standard constructor */
+                      uuid         (const uuid   &_obj);       /* copy     constructor */
+                      uuid         (const uuid_t *_obj);       /* import   constructor */
+                      uuid         (const void   *_bin);       /* import   constructor */
+                      uuid         (const char   *_str);       /* import   constructor */
+                     ~uuid         ();                         /* destructor */
+
+        /* copying & cloning */
+        uuid         &operator=    (const uuid   &_obj);       /* copy   assignment operator */
+        uuid         &operator=    (const uuid_t *_obj);       /* import assignment operator */
+        uuid         &operator=    (const void   *_bin);       /* import assignment operator */
+        uuid         &operator=    (const char   *_str);       /* import assignment operator */
+        uuid          clone        (void);                     /* regular method */
+
+        /* content generation */
+        void          load         (const char *_name);        /* regular method */
+        void          make         (unsigned int _mode, ...);  /* regular method */
+
+        /* content comparison */
+        int           isnil        (void);                     /* regular method */
+        int           compare      (const uuid &_obj);         /* regular method */
+        int           operator==   (const uuid &_obj);         /* comparison operator */
+        int           operator!=   (const uuid &_obj);         /* comparison operator */
+        int           operator<    (const uuid &_obj);         /* comparison operator */
+        int           operator<=   (const uuid &_obj);         /* comparison operator */
+        int           operator>    (const uuid &_obj);         /* comparison operator */
+        int           operator>=   (const uuid &_obj);         /* comparison operator */
+
+        /* content importing & exporting */
+        void          import       (const void *_bin);         /* regular method */
+        void          import       (const char *_str);         /* regular method */
+        void         *binary       (void);                     /* regular method */
+        char         *string       (void);                     /* regular method */
+        char         *summary      (void);                     /* regular method */
+
+        unsigned long version      (void);                     /* regular method */
+
     private:
         uuid_t *ctx;
+};
+
+/* UUID exception class */
+class uuid_error_t {
     public:
-        /* object constructors and destructor */
-        uuid();                                      /* standard constructor */
-        ~uuid();                                     /* standard destructor */
-        uuid(const uuid &obj);                       /* construction: import of other C++ API object */
-        uuid(uuid_t *obj);                           /* construction: import of other C   API object */
-        uuid(const unsigned char *str);              /* construction: import of binary representation */
-        uuid(const char *str);                       /* construction: import of string representation */
-
-        /* import methods */
-        uuid &operator=  (const uuid &rhs);          /* assignment: import of other C++ API object */
-        uuid &operator=  (const uuid_t *rhs);        /* assignment: import of other C   API object */
-        uuid &operator=  (const unsigned char *rhs); /* assignment: import of binary representation */
-        uuid &operator=  (const char *rhs);          /* assignment: import of string representation */
-
-        /* generation methods */
-        void load        (const char *name);         /* generation: loading existing UUID by name */
-        void make        (unsigned int mode, ...);   /* generation: making new UUID one from scratch */
-
-        /* comparison methods */
-        int  isnil       (void);                     /* comparison: is-Nil-UUID */
-        int  operator==  (const uuid &rhs);          /* comparison: equality */
-        int  operator!=  (const uuid &rhs);          /* comparison: inequality */
-        int  operator<   (const uuid &rhs);          /* comparison: lower-than */
-        int  operator<=  (const uuid &rhs);          /* comparison: lower-than-or-equal */
-        int  operator>   (const uuid &rhs);          /* comparison: greater-than */
-        int  operator>=  (const uuid &rhs);          /* comparison: greater-than-or-equal */
-
-        /* export methods */                           
-        uuid_t        *object (void);                /* export: object representation */
-        unsigned char *binary (void);                /* export: binary representation */
-        char          *string (void);                /* export: string representation */
+                      uuid_error_t ()                     { code(UUID_RC_OK); };
+                      uuid_error_t (uuid_rc_t _code)      { code(_code); };
+                     ~uuid_error_t ()                     { };
+        void          code         (uuid_rc_t _code)      { rc = _code; };
+        uuid_rc_t     code         (void)                 { return rc; };
+        char         *string       (void)                 { return uuid_error(rc); };
+
+    private:
+        uuid_rc_t rc;
 };
 
 #endif /* __UUIDXX_HH__ */


ossp-pkg/uuid/uuid++.pod -> 1.1

*** /dev/null    Mon Nov 25 21:55:36 2024
--- -    Mon Nov 25 21:55:45 2024
***************
*** 0 ****
--- 1,249 ----
+ ##
+ ##  OSSP uuid - Universally Unique Identifier
+ ##  Copyright (c) 2004-2005 Ralf S. Engelschall <rse@engelschall.com>
+ ##  Copyright (c) 2004-2005 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 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::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
+ 

CVSTrac 2.0.1