]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/string.h
Always use gtk2-compat.h definitions.
[wxWidgets.git] / include / wx / string.h
index cb8d6bccfe0c25df3988e4d3c30d8c6dd1e4e072..c7f380b5ec7c41da53060a171d8604e8b35f759c 100644 (file)
@@ -1383,7 +1383,13 @@ public:
     #define wxStringToStdWstringRetType wxStdWideString
     wxStdWideString ToStdWstring() const
     {
+#if wxUSE_UNICODE_WCHAR
+        wxScopedWCharBuffer buf =
+            wxScopedWCharBuffer::CreateNonOwned(m_impl.c_str(), m_impl.length());
+#else // !wxUSE_UNICODE_WCHAR
         wxScopedWCharBuffer buf(wc_str());
+#endif
+
         return wxStdWideString(buf.data(), buf.length());
     }
   #endif
@@ -2115,7 +2121,7 @@ public:
       // insert an unsigned long into string
   wxString& operator<<(unsigned long ul)
     { return (*this) << Format(wxT("%lu"), ul); }
-#if defined wxLongLong_t && !defined wxLongLongIsLong
+#ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG
       // insert a long long if they exist and aren't longs
   wxString& operator<<(wxLongLong_t ll)
     {
@@ -2126,7 +2132,7 @@ public:
     {
       return (*this) << Format("%" wxLongLongFmtSpec "u" , ull);
     }
-#endif // wxLongLong_t && !wxLongLongIsLong
+#endif // wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG
       // insert a float into string
   wxString& operator<<(float f)
     { return (*this) << Format(wxT("%f"), f); }
@@ -2320,12 +2326,12 @@ public:
       // convert to a double
   bool ToCDouble(double *val) const;
 
-  // create a string representing the given floating point number
+  // create a string representing the given floating point number with the
+  // default (like %g) or fixed (if precision >=0) precision
     // in the current locale
-  static wxString FromDouble(double val)
-    { return wxString::Format(wxS("%g"), val); }
+  static wxString FromDouble(double val, int precision = -1);
     // in C locale
-  static wxString FromCDouble(double val);
+  static wxString FromCDouble(double val, int precision = -1);
 
 #ifndef wxNEEDS_WXSTRING_PRINTF_MIXIN
   // formatted input/output