OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 // See the License for the specific language governing permissions and | 12 // See the License for the specific language governing permissions and |
13 // limitations under the License. | 13 // limitations under the License. |
14 | 14 |
15 #ifndef CRASHPAD_UTIL_MISC_UUID_H_ | 15 #ifndef CRASHPAD_UTIL_MISC_UUID_H_ |
16 #define CRASHPAD_UTIL_MISC_UUID_H_ | 16 #define CRASHPAD_UTIL_MISC_UUID_H_ |
17 | 17 |
18 #include <stdint.h> | 18 #include <stdint.h> |
19 | 19 |
20 #include <string> | 20 #include <string> |
21 | 21 |
22 namespace crashpad { | 22 namespace crashpad { |
23 | 23 |
24 //! \brief A universally unique identifier (%UUID). | 24 //! \brief A universally unique identifier (%UUID). |
25 //! | 25 //! |
26 //! An alternate term for %UUID is “globally unique identifier” (GUID), used | 26 //! An alternate term for %UUID is “globally unique identifier” (GUID), used |
27 //! primarily by Microsoft. | 27 //! primarily by Microsoft. |
28 //! | 28 //! |
29 //! A %UUID is a unique 128-bit number specified by RFC 4122. | 29 //! A %UUID is a unique 128-bit number specified by RFC 4122. |
| 30 //! |
| 31 //! This is a standard-layout structure. |
30 struct UUID { | 32 struct UUID { |
31 //! \brief Initializes the %UUID to zero. | 33 //! \brief Initializes the %UUID to zero. |
32 UUID(); | 34 UUID(); |
33 | 35 |
34 //! \copydoc InitializeFromBytes() | 36 //! \copydoc InitializeFromBytes() |
35 explicit UUID(const uint8_t* bytes); | 37 explicit UUID(const uint8_t* bytes); |
36 | 38 |
37 //! \brief Initializes the %UUID from a sequence of bytes. | 39 //! \brief Initializes the %UUID from a sequence of bytes. |
38 //! | 40 //! |
39 //! \a bytes is taken as a %UUID laid out in big-endian format in memory. On | 41 //! \a bytes is taken as a %UUID laid out in big-endian format in memory. On |
(...skipping 13 matching lines...) Expand all Loading... |
53 uint32_t data_1; | 55 uint32_t data_1; |
54 uint16_t data_2; | 56 uint16_t data_2; |
55 uint16_t data_3; | 57 uint16_t data_3; |
56 uint8_t data_4[2]; | 58 uint8_t data_4[2]; |
57 uint8_t data_5[6]; | 59 uint8_t data_5[6]; |
58 }; | 60 }; |
59 | 61 |
60 } // namespace crashpad | 62 } // namespace crashpad |
61 | 63 |
62 #endif // CRASHPAD_UTIL_MISC_UUID_H_ | 64 #endif // CRASHPAD_UTIL_MISC_UUID_H_ |
OLD | NEW |