xtd 0.2.0
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/iequatable>
8#include <xtd/object>
9#include <xtd/string>
10#include <xtd/convert_string>
11#include <xtd/static>
12
14namespace xtd {
16 namespace forms {
18 class countries;
20
34 class forms_export_ country : public object, public xtd::iequatable<country> {
35 struct data;
36
37 public:
39 country();
40 country(const country& other);
41 country& operator =(const country& other);
43
45
49 static const country empty();
51
53
57 virtual const xtd::string alpha_2_code() const noexcept;
58
61 virtual const xtd::string alpha_3_code() const noexcept;
62
65 virtual const xtd::string emoticon() const noexcept;
66
69 virtual const xtd::drawing::image flag() const noexcept;
70
73 virtual const xtd::drawing::image flag_squared() const noexcept;
74
77 virtual const xtd::string name() const noexcept;
78
81 virtual int32 numeric_code() const noexcept;
83
85
90 bool equals(const xtd::object& obj) const noexcept override;
94 bool equals(const country& other) const noexcept override;
95
98 xtd::size get_hash_code() const noexcept override;
99
102 virtual xtd::string to_string() const noexcept override;
104
106
110 static country from_alpha_2_code(const xtd::string& alpha_2_code);
111
114 static country from_alpha_3_code(const xtd::string& alpha_3_code);
115
118 static country from_name(const xtd::string& name);
119
122 static country from_numeric_code(int32 numeric_code);
124
125 private:
126 friend class countries;
127 static const xtd::array<xtd::string> enclosed_letters;
128 country(const xtd::string& name, const xtd::string& alpha_2_code, const xtd::string& alpha_3_code, int32 numeric_code);
129
130 xtd::sptr<data> data_;
131 };
132 }
133}
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:61
Represents text as a sequence of character units.
Definition basic_string.hpp:71
Provides a collection of xtd::forms::country for all countries in the world. This class cannot be inh...
Definition countries.hpp:24
Represent a country with name, alpha codes, numeric code, emoticon and flag.
Definition country.hpp:34
static const country empty()
Gets an empty country.
virtual const xtd::string alpha_2_code() const noexcept
Gets the country alpha 2 code.
Represent a emoticon with name and codepoints.
Definition emoticon.hpp:32
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:43
The xtd::shared_ptr_object is a shared pointer as std::shared_ptr.
Definition shared_ptr_object.hpp:30
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
@ other
The operating system is other.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.hpp:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10