Public Member Functions
BCountry Class Reference

Class representing a country. More...

List of all members.

Public Member Functions

 BCountry (const char *countryCode=NULL)
 Initialize a BCountry from a country code.
 BCountry (const BCountry &other)
 Initialize a BCountry from another BCountry object.
 ~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.

Detailed Description

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.


Constructor & Destructor Documentation

BCountry::BCountry ( const char *  countryCode = NULL)

Initialize a BCountry from a country code.

Parameters:
countryCodeThe country code to initialize from.
BCountry::BCountry ( const BCountry other)

Initialize a BCountry from another BCountry object.

Parameters:
otherThe BCountry object to initialize from.

Member Function Documentation

const char * BCountry::Code ( ) const

Gets the ISO country code for the country.

Returns:
The ISO country code for the country.
status_t BCountry::GetIcon ( BBitmap result) const

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.

Parameters:
resultThe BBitmap object to draw the flag into.
Returns:
B_OK if the drawing was successful.
status_t BCountry::GetName ( BString name,
const BLanguage *  displayLanguage = NULL 
) const

Writes the country's name into the supplied BString.

Parameters:
nameA reference to a BString to write the country name to.
displayLanguageThe language to use when writing the name. Can be NULL to use the language set by the user's locale.
Returns:
A status code, B_OK if everything went fine, or an error code otherwise.

The Haiku Book pre-R1 - BCountry Class Reference
Generated on Mon May 20 2013 by Doxygen 1.7.5.1