* Fixed the main page entry for locale kit
* Also parse the actual code to get the methods shown in the classes, inheritance diagrams, and all that stuff * Add some docs on date formatting to BLocale git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37925 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -473,6 +473,7 @@ INPUT = . \
|
||||
../../headers/os/drivers/fs_interface.h \
|
||||
../../headers/os/drivers/USB3.h \
|
||||
../../headers/os/drivers/USB_spec.h \
|
||||
../../headers/os/locale \
|
||||
../../headers/os/midi2 \
|
||||
../../headers/os/support \
|
||||
../../headers/posix/syslog.h
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
\brief Collection of utility classes that are used throughout the API.
|
||||
\defgroup libbe (libbe.so)
|
||||
\defgroup libroot (libroot.so)
|
||||
\defgroup locale (liblocale.so)
|
||||
\defgroup locale Locale Kit
|
||||
\brief Collection of classes for localizing applications.
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*!
|
||||
\class BLocale
|
||||
\ingroup locale
|
||||
\brief Class for representing a locale and its settings
|
||||
\brief Class for representing a locale and its settings.
|
||||
|
||||
A locale is defined by the combination of a country and a language. Using these
|
||||
two informations, it is possible to determine the format to use for date, time,
|
||||
@@ -9,11 +9,14 @@ and number formatting. The BLocale class also provide collators, which allows
|
||||
you to sort a list of strings properly depending on a set of rules about
|
||||
accented chars and other special cases that vary over the different locales.
|
||||
|
||||
BLocale is also the class to use when you want to perform formatting or parsing
|
||||
of dates, times, and numbers, in the natural language of the user.
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn const BLocale::BCollator* Collator() const
|
||||
\brief Returns the collator associated to this locale
|
||||
\brief Returns the collator associated to this locale.
|
||||
|
||||
Returns the collator in use for this locale, allowing you to use it to sort a
|
||||
set of strings.
|
||||
@@ -22,7 +25,7 @@ set of strings.
|
||||
|
||||
/*!
|
||||
\fn const BLocale::BCountry* Country() const
|
||||
\brief Returns the country associated to this locale
|
||||
\brief Returns the country associated to this locale.
|
||||
|
||||
A locale is defined by the combination of a country and a language. This
|
||||
method gets the country part of this information, so you can access the
|
||||
@@ -32,7 +35,95 @@ data that is not language-dependant (such as the country flag).
|
||||
|
||||
/*!
|
||||
\fn const BLocale::BLanguage* Language() const
|
||||
\brief Returns the language associated to this locale
|
||||
\brief Returns the language associated to this locale.
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn const char* BLocale::Code() const
|
||||
\brief Returns the locale code.
|
||||
|
||||
This function returns the locale name (such as en_US for united states english).
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool Blocale::GetName(BString& name) const
|
||||
\brief Get the name of the locale.
|
||||
|
||||
This function fills the name string with the localized name of this locale.
|
||||
For example, if the locale us en_US and the user language is french, this function will return "anglais (Etats-Unis)".
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BLocale::SetCountry(const BCountry& newCountry)
|
||||
\brief Set the country for this locale.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BLocale::SetCollator(const BCollator& newCollator)
|
||||
\brief Set the collator for this locale.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void BLocale::SetLanguage(const char* languageCode)
|
||||
\brief Set the language for this locale.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn status_t BLocale::FormatDate(char* string, size_t maxSize, time_t time, bool longFormat)
|
||||
\fn status_t BLocale::FormatDate(BString* string, time_t time, bool longFormat)
|
||||
\brief Format a date.
|
||||
|
||||
Fills in the string with a formatted date. The longFormat parameter allows you
|
||||
to select the short or the full format.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn status_t BLocale::FormatDate(BString* string, int*& fieldPositions, int& fieldCount, time_t time, bool longFormat)
|
||||
\brief Format a date and get information about the different fields.
|
||||
|
||||
This works the same way as the other FormatDatz methods, but also gives you the
|
||||
offset of the beginning of each field in the date. This is useful if you need to
|
||||
split the date in different parts for an user-modifiable area (see the Time
|
||||
preflet for an example).
|
||||
|
||||
To identify the content of each field, you can use GetDateFields.
|
||||
|
||||
This function allocates the fieldPositions arrays, you have to free it when you
|
||||
are finished with it.
|
||||
|
||||
\sa GetDateFields
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn status_t BLocale::GetDateFields(BDateElement*& fields, int& fieldCount, bool longFormat) const
|
||||
\brief Get the type of each field in this date format
|
||||
|
||||
This function is most often used in combination with FormatDate. FormatDate
|
||||
gives you the offset of each field in a formated string, anf GetDateFields gives
|
||||
you the type of the field at a given offset. With these informations, you can
|
||||
handle the formatted date string as a list of fields that you can split and
|
||||
alter at will.
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn status_t BLocale::GetDateFormat(BString& format, bool longFormat) const
|
||||
\brief Get the date format string
|
||||
|
||||
This function returns the string used internally to represent a date format.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn status_t BLocale::SetDateFormat(const char* formatString, bool longFormat)
|
||||
\brief Set the date format for this locale
|
||||
|
||||
Thisfunction allows you to define your own date format for specific purposes.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int StartOfWeek() const
|
||||
\brief Returns the day used as start of week in this locale.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user