xtd 0.2.0
Loading...
Searching...
No Matches
country.h
Go to the documentation of this file.
1
4#pragma once
5#include "../forms_export.h"
6#include <xtd/drawing/bitmap>
7#include <xtd/iequatable>
8#include <xtd/object>
9#include <xtd/ustring>
10#include <xtd/convert_string>
11#include <xtd/static>
12
14namespace xtd {
16 namespace forms {
18 class countries;
20
32 class forms_export_ country : public object, public xtd::iequatable<country> {
33 struct data;
34
35 public:
37 country();
38 country(const country& other);
39 country& operator =(const country& other);
41
43
47 static const country empty();
49
51
55 virtual const xtd::ustring alpha_2_code() const noexcept;
56
59 virtual const xtd::ustring alpha_3_code() const noexcept;
60
63 virtual const xtd::ustring emoticon() const noexcept;
64
67 virtual const xtd::drawing::image flag() const noexcept;
68
71 virtual const xtd::drawing::image flag_squared() const noexcept;
72
75 virtual const xtd::ustring name() const noexcept;
76
79 virtual int32 numeric_code() const noexcept;
81
83
85 bool equals(const country& value) const noexcept override;
86
89 virtual xtd::ustring to_string() const noexcept override;
91
93
97 static country from_alpha_2_code(const xtd::ustring& alpha_2_code);
98
101 static country from_alpha_3_code(const xtd::ustring& alpha_3_code);
102
105 static country from_name(const xtd::ustring& name);
106
109 static country from_numeric_code(int32 numeric_code);
111
112 private:
113 friend class countries;
114 static const std::vector<xtd::ustring> enclosed_letters;
115 country(const xtd::ustring& name, const xtd::ustring& alpha_2_code, const xtd::ustring& alpha_3_code, int32 numeric_code);
116
117 std::shared_ptr<data> data_;
118 };
119 }
120}
Provides a collection of xtd::forms::country for all countries in the world. This class cannot be inh...
Definition countries.h:22
Represent a country with name, alpha codes, numeric code, emoticon and flag.
Definition country.h:32
static const country empty()
Gets an empty country.
virtual const xtd::ustring alpha_2_code() const noexcept
Gets the country alpha 2 code.
Represent a emoticon with name and codepoints.
Definition emoticon.h:28
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.h:18
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:32
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
#define forms_export_
Define shared library export.
Definition forms_export.h:13
int_least32_t int32
Represents a 32-bit signed integer.
Definition types.h:131
@ 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.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10