OpenLexocad  28.0
CountryTool.h
Go to the documentation of this file.
1 #pragma once
2 #include <QLocale.h>
3 
4 namespace Base
5 {
6 class LX_BASE_EXPORT CountryTool
7 {
8 public:
9  static void init(); // is called automatically
10 
11  static QLocale::Country getCountryByNumeric(int numeric);
12  static QLocale::Country getCountryByAlpha2(const QString& alpha2);
13  static QLocale::Country getCountryByAlpha3(const QString& alpha3);
14  static QString getCountryName(QLocale::Country country);
15 
16 private:
17  static std::map<int, QLocale::Country> _numericCountry;
18  static std::map<QString, QLocale::Country> _alpha2Country;
19  static std::map<QString, QLocale::Country> _alpha3Country;
20  static std::map<QLocale::Country, int> _countryTranslation;
21 
22  static void _register(QLocale::Country country, int numeric, QString alpha2, QString alpha3, int translatorId = -1);
23 };
24 
25 } // namespace Base
Base::CountryTool::getCountryByNumeric
static QLocale::Country getCountryByNumeric(int numeric)
Base::CountryTool::getCountryByAlpha3
static QLocale::Country getCountryByAlpha3(const QString &alpha3)
Base::CountryTool::getCountryByAlpha2
static QLocale::Country getCountryByAlpha2(const QString &alpha2)
Base::CountryTool::getCountryName
static QString getCountryName(QLocale::Country country)
Base::CountryTool
Definition: CountryTool.h:7
Base::CountryTool::init
static void init()
Base
Definition: AbstractXMLReader.h:5