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
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}
134
135#include "../literals/country.hpp"
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:61
Provides a collection of xtd::forms::country for all countries in the world. This class cannot be inh...
Definition countries.hpp:24
static country from_name(const xtd::string &name)
Gets a country from name.
virtual xtd::string to_string() const noexcept override
Returns a string containing the name, alpha codes and numeric code of the country.
bool equals(const xtd::object &obj) const noexcept override
Determines whether the specified object is equal to the current object.
virtual const xtd::string alpha_3_code() const noexcept
Gets the country alpha 3 code.
virtual const xtd::string emoticon() const noexcept
Gets the country emoticon.
virtual int32 numeric_code() const noexcept
Gets the country numeric code.
static const country empty()
Gets an empty country.
static country from_numeric_code(int32 numeric_code)
Gets a country from numeric code.
xtd::size get_hash_code() const noexcept override
Serves as a hash function for a particular type.
virtual const xtd::drawing::image flag_squared() const noexcept
Gets the country flag.
virtual const xtd::string name() const noexcept
Gets the country name.
virtual const xtd::drawing::image flag() const noexcept
Gets the country flag.
static country from_alpha_3_code(const xtd::string &alpha_3_code)
Gets a country from alpha 3 code.
static country from_alpha_2_code(const xtd::string &alpha_2_code)
Gets a country from alpha 2 code.
virtual const xtd::string alpha_2_code() const noexcept
Gets the country alpha 2 code.
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
object()=default
Create a new instance of the ultimate base class object.
Contains forms_export_ keyword.
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
xtd::shared_ptr_object< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
@ other
The operating system is other.
Definition platform_id.hpp:58
@ size
Specifies that both the width and height property values of the control are defined.
Definition bounds_specified.hpp:36
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 const_pointer data() const noexcept
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:201