Scribus
Open source desktop publishing at your fingertips
scclocale.h
1 //
2 // C++ Interface: sclocale
3 //
4 // Description:
5 //
6 //
7 // Author: Pierre Marchand <pierremarc@oep-h.com>, (C) 2009
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12 
13 #ifndef SCCLOCALE_H
14 #define SCCLOCALE_H
15 
16 #include <QLocale>
17 #include <QString>
18 
19 #include <clocale>
20 #if defined(Q_OS_MAC)
21 #include <xlocale.h>
22 #endif
23 
24 #if defined(Q_OS_SOLARIS) || defined (Q_OS_OPENBSD) || defined(Q_OS_FREEBSD) || defined(Q_OS_HAIKU)
25 #include <locale.h>
26 #endif
27 
28 #if defined(Q_OS_WIN)
29 #define XLocaleType _locale_t
30 #else
31  #if defined (Q_OS_SOLARIS) || defined (Q_OS_OPENBSD) || defined(Q_OS_FREEBSD) || defined(Q_OS_HAIKU)
32  #define XLocaleType char* //dummy?
33  #else
34  #define XLocaleType locale_t
35  #endif
36 #endif
37 
38 #include "scribusapi.h"
39 
40 class SCRIBUS_API ScCLocale
41 {
42  ScCLocale();
43  ~ScCLocale();
44  QLocale qLocale;
45  XLocaleType cLocale;
46 
47  static ScCLocale * m_instance;
48  static ScCLocale * that();
49 
50  public:
51  static double toDoubleC(const QString& str, bool * ok = 0);
52  static double toDoubleC(const QString& str, double defValue);
53  static float toFloatC(const QString& str, bool * ok = 0);
54  static float toFloatC(const QString& str, float defValue);
55  static QString toQStringC(double d, int prec = 3);
56  static double strtod ( const char * str, char ** endptr );
57 
58 };
59 
60 #endif // SCCLOCALE_H
61 
62 
63 
Definition: scclocale.h:40