xtd 0.2.0
Loading...
Searching...
No Matches
assembly_version_attribute.hpp
Go to the documentation of this file.
1
3#pragma once
4#include "../attribute.hpp"
5#include "../iequatable.hpp"
6
9#if !defined(__XTD_ASSEMBLY_VERSION__)
10# define __XTD_ASSEMBLY_VERSION__ "0.0.0"
11#endif
13
15namespace xtd {
17 namespace reflection {
33 class core_export_ assembly_version_attribute final : public xtd::attribute, public xtd::iequatable<xtd::reflection::assembly_version_attribute> {
34 public:
38 explicit assembly_version_attribute(const string& version);
40
42
46 [[nodiscard]] auto version() const noexcept -> const xtd::string&;
48
50
55 [[nodiscard]] auto equals(const object& obj) const noexcept -> bool override;
59 [[nodiscard]] auto equals(const assembly_version_attribute& other) const noexcept -> bool override;
60
63 [[nodiscard]] auto get_hash_code() const noexcept -> xtd::size override;
65
67
77 static auto create(const string& version) -> assembly_version_attribute;
79
80 protected:
81 [[nodiscard]] auto get_type_id() const noexcept -> xtd::sptr<xtd::object> override;
82
83 private:
84 string version_;
85 };
86 }
87}
88
90auto __assembly_version_attribute__() -> xtd::sptr<xtd::reflection::assembly_version_attribute>&;
92
108#define assembly_version_(version) \
109 auto __assembly_version_attribute = xtd::reflection::assembly_version_attribute::create(xtd::string(version) == "" || xtd::string(version) == "*" ? __XTD_ASSEMBLY_VERSION__ : version)
Contains xtd::attribute class.
Represents the base class for custom attributes.
Definition attribute.hpp:25
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:23
auto get_hash_code() const noexcept -> xtd::size override
Serves as a hash function for a particular type.
auto get_type_id() const noexcept -> xtd::sptr< xtd::object > override
When implemented in a derived class, gets a unique identifier for this attribute.
assembly_version_attribute(const string &version)
Initializes a new instance of the xtd::reflection::assembly_version_attribute class.
auto equals(const object &obj) const noexcept -> bool override
Determines whether the specified object is equal to the current object.
static auto create(const string &version) -> assembly_version_attribute
Creates the assembly version information. Must be called once in your application.
auto version() const noexcept -> const xtd::string &
Gets version information.
#define core_export_
Define shared library export.
Definition core_export.hpp:13
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
Contains xtd::iequatable interface.
The xtd::reflection namespace contains types that retrieve information about assemblies,...
Definition assembly.hpp:11
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8