Loading...
Searching...
No Matches
OBLocale Class Reference

`#include <openbabel/locale.h>`

## Public Member Functions

| OBLocale ()
| ~OBLocale ()
void | SetLocale ()
void | RestoreLocale ()

## Protected Attributes

OBLocalePrivate * | d

## Detailed Description

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.)

obLocale.SetLocale(); // set the numeric locale before reading data
... // your data processing here
obLocale.RestoreLocale(); // restore the numeric locale
OpenBabel::obLocale
OBLocale obLocale
Global OBLocale for setting and restoring locale information.
Definition locale.cpp:134

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.

## Constructor & Destructor Documentation

## OBLocale()

OBLocale | ( |  | ) |

## ~OBLocale()

~OBLocale | ( |  | ) |

## Member Function Documentation

## SetLocale()

void SetLocale | ( |  | ) |

## RestoreLocale()

void RestoreLocale | ( |  | ) |

## Member Data Documentation

## d

OBLocalePrivate* d

protected

Referenced by OBLocale(), RestoreLocale(), SetLocale(), and ~OBLocale().

The documentation for this class was generated from the following files:

- locale.h
- locale.cpp