Adobe Source Libraries 1.49.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
zuid.hpp
Go to the documentation of this file.
1/*
2 Copyright 2005-2007 Adobe Systems Incorporated and others
3 Distributed under the Boost Software License - Version 1.0 (see the accompanying file LICENSE
4 or a copy at https://stlab.github.io/adobe_source_libraries/licenses.html)
5*/
6
7/**************************************************************************************************/
8
9#ifndef ADOBE_ZUID_HPP
10#define ADOBE_ZUID_HPP
11
12#include <adobe/config.hpp>
13
14#include <boost/operators.hpp>
15
16#include <cstdint>
17#include <string>
18
19/**************************************************************************************************/
20
21/*
22 Relevant copyright information is provided below and may not be removed from this file.
23
24 Derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm.
25*/
26
27/**************************************************************************************************/
28
29/*
30 Copyright (c) 1990 - 1993, 1996 Open Software Foundation, Inc.
31 Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. &
32 Digital Equipment Corporation, Maynard, Mass.
33 Copyright (c) 1998 Microsoft.
34
35 To anyone who acknowledges that this file is provided "AS IS" without any
36 express or implied warranty: permission to use, copy, modify, and
37 distribute this file for any purpose is hereby granted without fee,
38 provided that the above copyright notices and this notice appears in all
39 source code copies, and that none of the names of Open Software Foundation,
40 Inc., Hewlett-Packard Company, or Digital Equipment Corporation be used in
41 advertising or publicity pertaining to distribution of the software without
42 specific, written prior permission. Neither Open Software Foundation, Inc.,
43 Hewlett-Packard Company, Microsoft, nor Digital Equipment Corporation makes
44 any representations about the suitability of this software for any purpose.
45*/
46
47/**************************************************************************************************/
48
49/*
50 MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
51
52 Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights
53 reserved.
54
55 License to copy and use this software is granted provided that it is
56 identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in
57 all material mentioning or referencing this software or this function.
58
59 License is also granted to make and use derivative works provided that such
60 works are identified as "derived from the RSA Data Security, Inc. MD5
61 Message-Digest Algorithm" in all material mentioning or referencing the
62 derived work.
63
64 RSA Data Security, Inc. makes no representations concerning either the
65 merchantability of this software or the suitability of this software for
66 any particular purpose. It is provided "as is" without express or implied
67 warranty of any kind.
68
69 These notices must be retained in any copies of any part of this
70 documentation and/or software.
71*/
72
73/**************************************************************************************************/
74
75namespace adobe {
76
77/**************************************************************************************************/
78
79struct uuid_t {
80#if !defined(ADOBE_NO_DOCUMENTATION)
81 std::uint32_t data1_m;
82 std::uint16_t data2_m;
83 std::uint16_t data3_m;
84 std::uint8_t data4_m[8];
85#endif
86};
87
88class zuid_t
89#if !defined(ADOBE_NO_DOCUMENTATION)
90 : private boost::totally_ordered<zuid_t>
91#endif
92{
93public:
94#if !defined(ADOBE_NO_DOCUMENTATION)
96 zuid_t(const zuid_t&);
97#endif
98
99 explicit zuid_t(const uuid_t&);
100 explicit zuid_t(const std::string&);
101 explicit zuid_t(const char*);
102
103 zuid_t(const zuid_t& name_space, const std::string& name);
104
105#if !defined(ADOBE_NO_DOCUMENTATION)
108#endif
109
110 std::string str() const;
111 char* c_str() const;
112
113 static const zuid_t null;
114
115#if !defined(ADOBE_NO_DOCUMENTATION)
116 enum { string_size_k = 36 };
117
118private:
119 friend bool operator==(const zuid_t& a, const zuid_t& b);
120 friend bool operator<(const zuid_t& a, const zuid_t& b);
121
122 struct zeroed {};
123
124 zuid_t(zeroed);
125
126 uuid_t uuid_m;
127#endif
128};
129
130/**************************************************************************************************/
131#if !defined(ADOBE_NO_DOCUMENTATION)
132
133bool operator==(const zuid_t& a, const zuid_t& b);
134bool operator<(const zuid_t& a, const zuid_t& b);
135
136#endif
137
138/**************************************************************************************************/
139
140} // namespace adobe
141
142/**************************************************************************************************/
143
144#endif
145
146/**************************************************************************************************/
UUID-like identifier generator.
Definition zuid.hpp:92
char * c_str() const
zuid_t & operator=(const uuid_t &)
friend bool operator<(const zuid_t &a, const zuid_t &b)
zuid_t & operator=(const zuid_t &)
zuid_t(const char *)
zuid_t(const uuid_t &)
static const zuid_t null
Definition zuid.hpp:113
zuid_t(const zuid_t &)
friend bool operator==(const zuid_t &a, const zuid_t &b)
zuid_t(const std::string &)
zuid_t(const zuid_t &name_space, const std::string &name)
std::string str() const
bool operator<(const step_iterator_adaptor< D, IT, S_FN > &p1, const step_iterator_adaptor< D, IT, S_FN > &p2)
Definition iterator.hpp:363
bool operator==(const any_regular_t &x, const any_regular_t &y)
std::uint16_t data3_m
Definition zuid.hpp:83
std::uint8_t data4_m[8]
Definition zuid.hpp:84
std::uint16_t data2_m
Definition zuid.hpp:82
std::uint32_t data1_m
Definition zuid.hpp:81