xtd 1.0.0
Loading...
Searching...
No Matches
country.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "../forms_export.hpp"
6#include <xtd/drawing/bitmap>
7#include <xtd/icomparable>
8#include <xtd/iequatable>
9#include <xtd/object>
10#include <xtd/string>
11#include <xtd/convert_string>
12#include <xtd/static>
13
15namespace xtd {
17 namespace forms {
19 class countries;
21
35 class forms_export_ country : public xtd::object, public xtd::icomparable<country>, public xtd::iequatable<country> {
36 struct data;
37
38 public:
40 country();
41 country(const country& other);
42 auto operator =(const country& other) -> country&;
44
46
50 [[nodiscard]] static auto empty() -> country;
52
54
58 [[nodiscard]] virtual auto alpha_2_code() const noexcept -> xtd::string;
59
62 [[nodiscard]] virtual auto alpha_3_code() const noexcept -> xtd::string;
63
66 [[nodiscard]] virtual auto emoticon() const noexcept -> xtd::string;
67
70 [[nodiscard]] virtual auto flag() const noexcept -> xtd::drawing::image;
71
74 [[nodiscard]] virtual auto flag_squared() const noexcept -> xtd::drawing::image;
75
78 [[nodiscard]] virtual auto name() const noexcept -> xtd::string;
79
82 [[nodiscard]] virtual auto numeric_code() const noexcept -> xtd::int32;
84
86
98 [[nodiscard]] auto compare_to(const country& obj) const noexcept -> xtd::int32 override;
99
103 [[nodiscard]] auto equals(const xtd::object& obj) const noexcept -> bool override;
107 [[nodiscard]] auto equals(const country& other) const noexcept -> bool override;
108
111 [[nodiscard]] auto get_hash_code() const noexcept -> xtd::usize override;
112
115 [[nodiscard]] virtual auto to_string() const noexcept -> xtd::string override;
117
119
123 [[nodiscard]] static auto from_alpha_2_code(const xtd::string& alpha_2_code) -> country;
124
127 [[nodiscard]] static auto from_alpha_3_code(const xtd::string& alpha_3_code) -> country;
128
131 [[nodiscard]] static auto from_name(const xtd::string& name) -> country;
132
135 [[nodiscard]] static auto from_numeric_code(xtd::int32 numeric_code) -> country;
137
138 private:
139 friend class countries;
140 static const xtd::array<xtd::string> enclosed_letters;
141 country(const xtd::string& name, const xtd::string& alpha_2_code, const xtd::string& alpha_3_code, int32 numeric_code);
142
143 xtd::sptr<data> data_;
144 };
145 }
146}
147
148#include "../literals/country.hpp"
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
Provides a collection of xtd::forms::country for all countries in the world. This class cannot be inh...
Definition countries.hpp:24
virtual auto emoticon() const noexcept -> xtd::string
Gets the country emoticon.
virtual auto alpha_3_code() const noexcept -> xtd::string
Gets the country alpha 3 code.
virtual auto alpha_2_code() const noexcept -> xtd::string
Gets the country alpha 2 code.
virtual auto to_string() const noexcept -> xtd::string override
Returns a string containing the name, alpha codes and numeric code of the country.
static auto from_name(const xtd::string &name) -> country
Gets a country from name.
static auto empty() -> country
Gets an empty country.
auto compare_to(const country &obj) const noexcept -> xtd::int32 override
Compares the current instance with another object of the same type.
static auto from_alpha_2_code(const xtd::string &alpha_2_code) -> country
Gets a country from alpha 2 code.
auto equals(const xtd::object &obj) const noexcept -> bool override
Determines whether the specified object is equal to the current object.
auto get_hash_code() const noexcept -> xtd::usize override
Serves as a hash function for a particular type.
virtual auto flag() const noexcept -> xtd::drawing::image
Gets the country flag.
static auto from_numeric_code(xtd::int32 numeric_code) -> country
Gets a country from numeric code.
virtual auto name() const noexcept -> xtd::string
Gets the country name.
static auto from_alpha_3_code(const xtd::string &alpha_3_code) -> country
Gets a country from alpha 3 code.
virtual auto numeric_code() const noexcept -> xtd::int32
Gets the country numeric code.
virtual auto flag_squared() const noexcept -> xtd::drawing::image
Gets the country flag.
Defines a generalized comparison method that a value type or class implements to create a type-specif...
Definition icomparable.hpp:22
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:23
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
Contains forms_export_ keyword.
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
std::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:25
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition usize.hpp:22
@ other
The operating system is other.
Definition platform_id.hpp:60
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:219
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
constexpr auto data() const noexcept -> const_pointer
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:197