head 1.7; access; symbols UUID_1_6_2:1.6 UUID_1_6_1:1.6 UUID_1_6_0:1.5 UUID_1_5_1:1.4 UUID_1_5_0:1.4 UUID_1_4_2:1.3 UUID_1_4_1:1.3 UUID_1_4_0:1.3 UUID_1_3_2:1.2 UUID_1_3_1:1.2 UUID_1_3_0:1.2; locks; strict; comment @// @; 1.7 date 2008.07.05.12.58.15; author rse; state dead; branches; next 1.6; commitid XLXN7vUmABwPcC9t; 1.6 date 2008.01.10.14.18.46; author rse; state Exp; branches; next 1.5; commitid LqMgFGBgTR7clSMs; 1.5 date 2007.01.01.18.14.54; author rse; state Exp; branches; next 1.4; commitid jOXiIO8S8v7xFP0s; 1.4 date 2006.05.11.09.37.27; author rse; state Exp; branches; next 1.3; commitid u4EPMISJDipjmAwr; 1.3 date 2006.01.13.06.44.30; author rse; state Exp; branches; next 1.2; commitid hYfQc9JIMh4bcphr; 1.2 date 2005.08.31.20.07.29; author rse; state Exp; branches; next 1.1; 1.1 date 2005.08.31.14.29.56; author rse; state Exp; branches; next ; desc @@ 1.7 log @remove OSSP uuid from CVS -- it is now versioned controlled in a Monotone repository @ text @/* ** OSSP uuid - Universally Unique Identifier ** Copyright (c) 2004-2008 Ralf S. Engelschall ** Copyright (c) 2004-2008 The OSSP Project ** ** 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++.hh: library C++ API definition */ #ifndef __UUIDXX_HH__ #define __UUIDXX_HH__ /* required C API header */ #include #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 *integer (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: 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__ */ @ 1.6 log @adjust copyright messages for 2008 and bump version in advance @ text @@ 1.5 log @Adjust copyright messages for new year 2007. @ text @d3 2 a4 2 ** Copyright (c) 2004-2007 Ralf S. Engelschall ** Copyright (c) 2004-2007 The OSSP Project @ 1.4 log @Add full support for Single Integer Value (SIV) UUID representation for both importing and exporting in C/C++/Perl/PHP APIs. @ text @d3 2 a4 2 ** Copyright (c) 2004-2006 Ralf S. Engelschall ** Copyright (c) 2004-2006 The OSSP Project @ 1.3 log @Adjust copyright messages for new year 2006. @ text @d74 1 @ 1.2 log @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. @ text @d3 2 a4 2 ** Copyright (c) 2004-2005 Ralf S. Engelschall ** Copyright (c) 2004-2005 The OSSP Project @ 1.1 log @Add an experimental C++ API binding which can be enabled under build-time with option --with-cxx. @ text @d34 1 d37 1 d39 39 d80 4 d85 9 a93 31 /* 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 */ @