xtd 0.2.0
Loading...
Searching...
No Matches
guid.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "core_export.hpp"
6#include "icomparable.hpp"
7#include "iequatable.hpp"
8#include "iformatable.hpp"
9#include "object.hpp"
10#include "string.hpp"
11
13namespace xtd {
23 class core_export_ guid final : public object, public icomparable<guid>, public xtd::iequatable<guid>, public xtd::iformatable {
24 public:
26
31 static const guid empty;
33
35
38 guid() = default;
46 explicit guid(const std::initializer_list<xtd::byte>& data);
122 explicit guid(const string& guid);
124
126 guid(const guid&) = default;
127 guid& operator =(const guid&) = default;
129
131
143 int32 compare_to(const guid& value) const noexcept override;
144
148 bool equals(const object& obj) const noexcept override;
152 bool equals(const guid& g) const noexcept override;
153
156 xtd::size get_hash_code() const noexcept override;
157
160 xtd::array<xtd::byte> to_byte_array() const noexcept;
161
167 xtd::string to_string() const noexcept override;
185 string to_string(const string& format) const;
204 string to_string(const string& format, const globalization::culture_info& culture) const override;
206
208
214 static guid new_guid() noexcept;
216
217 private:
218 xtd::array<xtd::byte> data_ = xtd::array<xtd::byte>(16);
219 };
220}
221
222#include "literals/guid.hpp"
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
guid(const string &guid)
Initializes a new instance of the xtd::guid structure by using the value represented by the specified...
static guid new_guid() noexcept
Initializes a new instance of the xtd::guid structure.
guid()=default
Initializes a new instance of the xtd::guid structure.
guid(const xtd::array< xtd::byte > &data)
Initializes a new instance of the xtd::guid structure by using the specified array of bytes.
static const guid empty
Gets A read-only instance of the xtd::guid structure whose value is all zeros.
Definition guid.hpp:31
guid(uint32 a, uint16 b, uint16 c, const xtd::array< xtd::byte > &d)
Initializes a new instance of the xtd::guid structure by using the specified unsigned integers and by...
guid(int32 a, int16 b, int16 c, xtd::byte d, xtd::byte e, xtd::byte f, xtd::byte g, xtd::byte h, xtd::byte i, xtd::byte j, xtd::byte k) noexcept
Initializes a new instance of the xtd::guid structure by using the specified integers and bytes.
xtd::array< xtd::byte > to_byte_array() const noexcept
Returns a 16-element byte array that contains the value of this instance.
xtd::string to_string() const noexcept override
Returns a string representation of the value of this instance in registry format.
bool equals(const object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
bool equals(const guid &g) const noexcept override
Determines whether the specified object is equal to the current object.
guid(int32 a, int16 b, int16 c, const xtd::array< xtd::byte > &d)
Initializes a new instance of the xtd::guid structure by using the specified integers and byte array.
xtd::size get_hash_code() const noexcept override
Serves as a hash function for a particular type.
guid(uint32 a, uint16 b, uint16 c, xtd::byte d, xtd::byte e, xtd::byte f, xtd::byte g, xtd::byte h, xtd::byte i, xtd::byte j, xtd::byte k) noexcept
Initializes a new instance of the xtd::guid structure by using the specified unsigned integers and by...
int32 compare_to(const guid &value) const noexcept override
Compares the current instance with another object of the same type.
guid(const std::initializer_list< xtd::byte > &data)
Initializes a new instance of the xtd::guid structure by using the specified array of bytes.
Defines a generalized comparison method that a value type or class implements to create a type-specif...
Definition icomparable.hpp:21
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Provides functionality to format the value of an object into a string representation.
Definition iformatable.hpp:41
object()=default
Create a new instance of the ultimate base class object.
Contains core_export_ keyword.
xtd::string format(const xtd::string &fmt, args_t &&... args)
Writes the text representation of the specified arguments list, to string using the specified format ...
Definition format.hpp:21
#define core_export_
Define shared library export.
Definition core_export.hpp:13
std::uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
std::uint16_t uint16
Represents a 16-bit unsigned integer.
Definition uint16.hpp:23
std::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
std::int16_t int16
Represents a 16-bit signed integer.
Definition int16.hpp:23
std::uint8_t byte
Represents a 8-bit unsigned integer.
Definition byte.hpp:23
@ a
The A key.
Definition console_key.hpp:88
@ h
The H key.
Definition console_key.hpp:102
@ j
The J key.
Definition console_key.hpp:106
@ c
The C key.
Definition console_key.hpp:92
@ d
The D key.
Definition console_key.hpp:94
@ i
The I key.
Definition console_key.hpp:104
@ k
The K key.
Definition console_key.hpp:108
@ f
The F key.
Definition console_key.hpp:98
@ b
The B key.
Definition console_key.hpp:90
@ g
The G key.
Definition console_key.hpp:100
@ e
The E key.
Definition console_key.hpp:96
Contains xtd::icomparable interface.
Contains xtd::iequatable interface.
Contains xtd::iformatable interface.
Contains classes that define culture-related information, including language, country/region,...
Definition culture_info.hpp:20
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
constexpr const_pointer data() const noexcept
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:201
Contains xtd::object class.
Contains xtd::string alias.