diff options
author | Robin Gareus <robin@gareus.org> | 2016-05-05 20:02:23 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-05-05 20:02:48 +0200 |
commit | f2c5522f0f0ddc70ebf182186b3cc821252dd24f (patch) | |
tree | 0b87b290eb07d18f221b2045a6942a398c0115ed /libs/pbd/pbd/locale_guard.h | |
parent | a644212506dcf41ad0b90a3c38ccb2279b6054c5 (diff) |
rework locale-guard for C and C++ locales
let's hope querying the C-locale is more lightweight than setting it
on windows.
Diffstat (limited to 'libs/pbd/pbd/locale_guard.h')
-rw-r--r-- | libs/pbd/pbd/locale_guard.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/libs/pbd/pbd/locale_guard.h b/libs/pbd/pbd/locale_guard.h index dc82ab4483..3d37562ced 100644 --- a/libs/pbd/pbd/locale_guard.h +++ b/libs/pbd/pbd/locale_guard.h @@ -22,20 +22,21 @@ #include "pbd/libpbd_visibility.h" -#include <string> +#include <locale> namespace PBD { -struct LIBPBD_API LocaleGuard { - LocaleGuard (const char*); - ~LocaleGuard (); - - static std::string current; - -private: - char* old; -}; - + struct LIBPBD_API LocaleGuard { + public: + LocaleGuard (); + LocaleGuard (const char*); // deprecated + ~LocaleGuard (); + + private: + void init (); + std::locale old_cpp; + char* old_c; + }; } #endif /* __pbd_locale_guard__ */ |