Class representing a country. More...
Public Member Functions | |
BCountry (const BCountry &other) | |
Initialize a BCountry from another BCountry object. | |
BCountry (const char *countryCode=NULL) | |
Initialize a BCountry from a country code. | |
~BCountry () | |
Destructor method. | |
const char * | Code () const |
Gets the ISO country code for the country. | |
status_t | GetIcon (BBitmap *result) const |
Render the country's flag to the given BBitmap. | |
status_t | GetName (BString &name, const BLanguage *displayLanguage=NULL) const |
Writes the country's name into the supplied BString. | |
status_t | GetPreferredLanguage (BLanguage &) const |
Get the most likely language to use in that country. | |
status_t | InitCheck () const |
Check validity of the BCountry object. | |
BCountry & | operator= (const BCountry &other) |
Initialize a BCountry from another BCountry object by overloading the = operator. | |
status_t | SetTo (const char *countryCode) |
Initialize a BCountry from a country code. | |
Class representing a country.
BCountry provides information about a particular country including the countries flag (as an HVIF icon), the localized name of the country, and the ISO country code.
Date, time, and number formatting also depends to some extent on the language used so they are found in the BLocale class instead.
BCountry::BCountry | ( | const char * | countryCode = NULL | ) |
Initialize a BCountry from a country code.
countryCode | The country code to initialize from. |
BCountry::BCountry | ( | const BCountry & | other | ) |
BCountry::~BCountry | ( | ) |
Destructor method.
const char * BCountry::Code | ( | ) | const |
Gets the ISO country code for the country.
Render the country's flag to the given BBitmap.
This function renders the country's flag to the given BBitmap. The bitmap should already be set to the pixel format and size you want to use.
The flag is stored in HVIF format so it can be rendered at any size and color depth.
result | The BBitmap object to draw the flag into. |
B_OK
if the drawing was successful.Writes the country's name into the supplied BString.
name | A reference to a BString to write the country name to. |
displayLanguage | The language to use when writing the name. Can be NULL to use the language set by the user's locale. |
status_t BCountry::GetPreferredLanguage | ( | BLanguage & | language | ) | const |
Get the most likely language to use in that country.
language | A reference to a BLanguage to set to the preferred language. |
status_t BCountry::InitCheck | ( | ) | const |
Check validity of the BCountry object.