xtd 0.2.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 object, public xtd::icomparable<country>, public xtd::iequatable<country> {
36 struct data;
37
38 public:
40 country();
41 country(const country& other);
42 country& operator =(const country& other);
44
46
50 static const country empty();
52
54
58 virtual const xtd::string alpha_2_code() const noexcept;
59
62 virtual const xtd::string alpha_3_code() const noexcept;
63
66 virtual const xtd::string emoticon() const noexcept;
67
70 virtual const xtd::drawing::image flag() const noexcept;
71
74 virtual const xtd::drawing::image flag_squared() const noexcept;
75
78 virtual const xtd::string name() const noexcept;
79
82 virtual int32 numeric_code() const noexcept;
84
86
98 int compare_to(const country& obj) const noexcept override;
99
103 bool equals(const xtd::object& obj) const noexcept override;
107 bool equals(const country& other) const noexcept override;
108
111 xtd::size get_hash_code() const noexcept override;
112
115 virtual xtd::string to_string() const noexcept override;
117
119
123 static country from_alpha_2_code(const xtd::string& alpha_2_code);
124
127 static country from_alpha_3_code(const xtd::string& alpha_3_code);
128
131 static country from_name(const xtd::string& name);
132
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:63
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.
int compare_to(const country &obj) const noexcept override
Compares the current instance with another object of the same type.
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 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
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
std::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