stlab.adobe.com Adobe Systems Incorporated

zuid.hpp

Go to the documentation of this file.
00001 /*
00002     Copyright 2005-2007 Adobe Systems Incorporated and others
00003     Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
00004     or a copy at http://stlab.adobe.com/licenses.html)
00005 */
00006 
00007 /*************************************************************************************************/
00008 
00009 #ifndef ADOBE_ZUID_HPP
00010 #define ADOBE_ZUID_HPP
00011 
00012 #include <adobe/config.hpp>
00013 
00014 #include <boost/operators.hpp>
00015 #include <boost/cstdint.hpp>
00016 
00017 #include <string>
00018 
00019 /*************************************************************************************************/
00020 
00021 /*
00022     Relevant copyright information is provided below and may not be removed from this file. 
00023 
00024     Derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm.
00025 */
00026 
00027 /*************************************************************************************************/
00028 
00029 /*
00030     Copyright (c) 1990 - 1993, 1996 Open Software Foundation, Inc.
00031     Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. &
00032     Digital Equipment Corporation, Maynard, Mass.
00033     Copyright (c) 1998 Microsoft.
00034   
00035     To anyone who acknowledges that this file is provided "AS IS" without any 
00036     express or implied warranty: permission to use, copy, modify, and 
00037     distribute this file for any purpose is hereby granted without fee, 
00038     provided that the above copyright notices and this notice appears in all 
00039     source code copies, and that none of the names of Open Software Foundation, 
00040     Inc., Hewlett-Packard Company, or Digital Equipment Corporation be used in 
00041     advertising or publicity pertaining to distribution of the software without 
00042     specific, written prior permission. Neither Open Software Foundation, Inc., 
00043     Hewlett-Packard Company, Microsoft, nor Digital Equipment Corporation makes 
00044     any representations about the suitability of this software for any purpose.
00045 */
00046 
00047 /*************************************************************************************************/
00048 
00049 /*
00050     MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
00051 
00052     Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights 
00053     reserved.
00054 
00055     License to copy and use this software is granted provided that it is 
00056     identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in 
00057     all material mentioning or referencing this software or this function. 
00058 
00059     License is also granted to make and use derivative works provided that such 
00060     works are identified as "derived from the RSA Data Security, Inc. MD5 
00061     Message-Digest Algorithm" in all material mentioning or referencing the 
00062     derived work. 
00063     
00064     RSA Data Security, Inc. makes no representations concerning either the 
00065     merchantability of this software or the suitability of this software for 
00066     any particular purpose. It is provided "as is" without express or implied 
00067     warranty of any kind. 
00068     
00069     These notices must be retained in any copies of any part of this 
00070     documentation and/or software. 
00071 */
00072 
00073 /*************************************************************************************************/
00074 
00075 namespace adobe {
00076 
00077 /*************************************************************************************************/
00078 
00079 struct uuid_t
00080 {
00081 #if !defined(ADOBE_NO_DOCUMENTATION)
00082     boost::uint32_t data1_m;
00083     boost::uint16_t data2_m;
00084     boost::uint16_t data3_m;
00085     boost::uint8_t  data4_m[8];
00086 #endif
00087 };
00088 
00089 class zuid_t
00090 #if !defined(ADOBE_NO_DOCUMENTATION)
00091     : private boost::totally_ordered<zuid_t>
00092 #endif
00093 {
00094 public:
00095 #if !defined(ADOBE_NO_DOCUMENTATION)
00096     zuid_t ();
00097     zuid_t (const zuid_t&);
00098 #endif
00099 
00100     explicit zuid_t (const uuid_t&);
00101     explicit zuid_t (const std::string&);
00102     explicit zuid_t (const char*);
00103 
00104     zuid_t (const zuid_t& name_space, const std::string& name);
00105 
00106 #if !defined(ADOBE_NO_DOCUMENTATION)
00107     zuid_t& operator = (const zuid_t&);
00108     zuid_t& operator = (const uuid_t&);
00109 #endif
00110 
00111     std::string str () const;
00112     char*       c_str () const;
00113 
00114     static const zuid_t null;
00115 
00116 #if !defined(ADOBE_NO_DOCUMENTATION)
00117     enum { string_size_k = 36 };
00118 
00119 private:
00120     friend bool operator == (const zuid_t& a, const zuid_t& b);
00121     friend bool operator < (const zuid_t& a, const zuid_t& b);
00122 
00123     struct zeroed { };
00124 
00125     zuid_t(zeroed);
00126 
00127     uuid_t uuid_m;
00128 #endif
00129 };
00130 
00131 /*************************************************************************************************/
00132 #if !defined(ADOBE_NO_DOCUMENTATION)
00133 
00134 bool operator == (const zuid_t& a, const zuid_t& b);
00135 bool operator < (const zuid_t& a, const zuid_t& b);
00136 
00137 #endif
00138 
00139 /*************************************************************************************************/
00140 
00141 } // namespace adobe
00142 
00143 /*************************************************************************************************/
00144     
00145 #endif
00146 
00147 /*************************************************************************************************/

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google