xtd 0.2.0
country.h
Go to the documentation of this file.
1 #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 
14 namespace 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();
48 
50 
54  virtual const xtd::ustring alpha_2_code() const noexcept;
55 
58  virtual const xtd::ustring alpha_3_code() const noexcept;
59 
62  virtual const xtd::ustring emoticon() const noexcept;
63 
66  virtual const xtd::drawing::image flag() const noexcept;
67 
70  virtual const xtd::drawing::image flag_squared() const noexcept;
71 
74  virtual const xtd::ustring name() const noexcept;
75 
78  virtual int32 numeric_code() const noexcept;
80 
82 
84  bool equals(const country& value) const noexcept override;
85 
88  static country from_alpha_2_code(const xtd::ustring& alpha_2_code);
89 
92  static country from_alpha_3_code(const xtd::ustring& alpha_3_code);
93 
96  static country from_name(const xtd::ustring& name);
97 
100  static country from_numeric_code(int32 numeric_code);
101 
104  virtual xtd::ustring to_string() const noexcept override;
107 
108  private:
109  friend class countries;
110  static const std::vector<xtd::ustring> enclosed_letters;
111  country(const xtd::ustring& name, const xtd::ustring& alpha_2_code, const xtd::ustring& alpha_3_code, int32 numeric_code);
112 
113  std::shared_ptr<data> data_;
114  };
115  }
116 }
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: date_time.h:1063
Provides a collection of xtd::forms::country for all countries in the world. This class cannot be inh...
Definition: countries.h:22
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition: iequatable.h:18
The operating system is other.
An abstract base class that provides functionality for the bitmap and metafile descended classes...
Definition: image.h:48
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:32
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:129
Represent a country with name, alpha codes, numeric code, emoticon and flag.
Definition: country.h:32
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
Represent a emoticon with name and codepoints.
Definition: emoticon.h:28