Open Babel
3.0
|
#include <openbabel/locale.h>
Public Member Functions | |
OBLocale () | |
~OBLocale () | |
void | SetLocale () |
void | RestoreLocale () |
Protected Attributes | |
OBLocalePrivate * | d |
Handle the locale for numeric data parsing.
Many users will utilize Open Babel and tools built on top of the library in non-English locales. In particular, the numeric locale (LC_NUMERIC) is used to determine the parsing of numeric data in files, reference data, etc.
The OBLocale class, and its global variable obLocale handle both internal parsing of data through the ANSI-C numeric locale and can be used for external use as well.
In particular, where available, OBLocale will use the enhanced uselocale() interface, which sets the locale for a particular thread, rather for the entire process. (This is available on Linux, Mac OS X, and other platforms.)
To prevent errors, OBLocale will handle reference counting. If nested function calls all set the locale, only the first call to SetLocale() and the last call to RestoreLocale() will do any work.
OBLocale | ( | ) |
~OBLocale | ( | ) |
void SetLocale | ( | ) |
Referenced by OBGlobalDataBase::Init(), OBBuilder::LoadFragments(), OBConversion::Read(), and OBConversion::Write().
void RestoreLocale | ( | ) |
Referenced by OBGlobalDataBase::Init(), OBBuilder::LoadFragments(), OBConversion::Read(), and OBConversion::Write().
|
protected |