]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/longlong.h
fixed a canonical example of Stupid Bug(tm)
[wxWidgets.git] / include / wx / longlong.h
index 607859c2c58d1ed9598cdb2bd996efc57893f1e6..26f9e1c112a09c7995269563ccd4f75773439b58 100644 (file)
@@ -18,7 +18,7 @@
 #endif
 
 #include "wx/defs.h"
-#include "wx/wxchar.h"
+#include "wx/string.h"
 
 #include <limits.h>     // for LONG_MAX
 
@@ -203,6 +203,7 @@ public:
         // negation operator
     wxLongLongNative operator-() const
         { return wxLongLongNative(-m_ll); }
+    wxLongLongNative& Negate() { m_ll = -m_ll; return *this; }
 
         // subtraction
     wxLongLongNative operator-(const wxLongLongNative& ll) const
@@ -303,12 +304,16 @@ public:
         { return m_ll >= l; }
 
     // miscellaneous
+
+        // return the string representation of this number
+    wxString ToString() const;
+
         // conversion to byte array: returns a pointer to static buffer!
     void *asArray() const;
 
 #if wxUSE_STD_IOSTREAM
         // input/output
-    friend ostream& operator<<(ostream&, const wxLongLongNative&);
+    friend wxSTD ostream& operator<<(wxSTD ostream&, const wxLongLongNative&);
 #endif
 
 private:
@@ -489,12 +494,16 @@ public:
                 wxLongLongWx& remainder) const;
 
     // input/output
-#if wxUSE_STD_IOSTREAM
-    friend ostream& operator<<(ostream&, const wxLongLongWx&);
-#endif // wxUSE_STD_IOSTREAM
+
+    // return the string representation of this number
+    wxString ToString() const;
 
     void *asArray() const;
 
+#if wxUSE_STD_IOSTREAM
+    friend wxSTD ostream& operator<<(wxSTD ostream&, const wxLongLongWx&);
+#endif // wxUSE_STD_IOSTREAM
+
 private:
     // long is at least 32 bits, so represent our 64bit number as 2 longs