]> git.saurik.com Git - wxWidgets.git/commitdiff
Added interface for getting/setting text converter of wxDataInputStream and wxDataOut...
authorRobert Roebling <robert@roebling.de>
Sun, 11 Jan 2009 19:37:11 +0000 (19:37 +0000)
committerRobert Roebling <robert@roebling.de>
Sun, 11 Jan 2009 19:37:11 +0000 (19:37 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58028 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/datstrm.h
interface/wx/datstrm.h
src/common/datstrm.cpp

index ef049c9f2afe80a20f7fd8bb41751a3bdc1a2af4..c11de7b2049e64b20a5753467456d5bb1f753fc4 100644 (file)
@@ -78,6 +78,11 @@ public:
     wxDataInputStream& operator>>(float& f);
 
     void BigEndianOrdered(bool be_order) { m_be_order = be_order; }
     wxDataInputStream& operator>>(float& f);
 
     void BigEndianOrdered(bool be_order) { m_be_order = be_order; }
+    
+#if wxUSE_UNICODE
+    void SetConv( const wxMBConv &conv );
+    wxMBConv *GetConv() const { return m_conv; }
+#endif
 
 protected:
     wxInputStream *m_input;
 
 protected:
     wxInputStream *m_input;
@@ -152,6 +157,11 @@ public:
 
     void BigEndianOrdered(bool be_order) { m_be_order = be_order; }
 
 
     void BigEndianOrdered(bool be_order) { m_be_order = be_order; }
 
+#if wxUSE_UNICODE
+    void SetConv( const wxMBConv &conv );
+    wxMBConv *GetConv() const { return m_conv; }
+#endif
+
 protected:
     wxOutputStream *m_output;
     bool m_be_order;
 protected:
     wxOutputStream *m_output;
     bool m_be_order;
index 8ff65a4495887a9ed35a14261dd016ad0e521074..387cb43467d4ad02d9497a2d581689059cb36cb3 100644 (file)
@@ -57,7 +57,18 @@ public:
         order.
     */
     void BigEndianOrdered(bool be_order);
         order.
     */
     void BigEndianOrdered(bool be_order);
+    
+    /**
+       Returns the current text conversion class used for
+       writing strings.
+    */
+    wxMBConv *GetConv() const;
 
 
+    /** 
+       Sets the text conversion class used for writing strings.
+    */
+    void SetConv( const wxMBConv &conv );
+    
     /**
         Writes the single byte @a i8 to the stream.
     */
     /**
         Writes the single byte @a i8 to the stream.
     */
@@ -193,6 +204,13 @@ public:
     */
     void BigEndianOrdered(bool be_order);
 
     */
     void BigEndianOrdered(bool be_order);
 
+    
+    /**
+       Returns the current text conversion class used for
+       reading strings.
+    */
+    wxMBConv *GetConv() const;
+    
     /**
         Reads a single byte from the stream.
     */
     /**
         Reads a single byte from the stream.
     */
@@ -260,5 +278,10 @@ public:
         @see wxDataOutputStream::WriteString()
     */
     wxString ReadString();
         @see wxDataOutputStream::WriteString()
     */
     wxString ReadString();
+
+    /** 
+       Sets the text conversion class used for reading strings.
+    */
+    void SetConv( const wxMBConv &conv );
 };
 
 };
 
index d568c6d7c0c5aa282b0644bd1000e0de443f4ffe..8a97eca767c0fe20bfd006a9373cb552c696e1b4 100644 (file)
@@ -45,6 +45,14 @@ wxDataInputStream::~wxDataInputStream()
 #endif // wxUSE_UNICODE
 }
 
 #endif // wxUSE_UNICODE
 }
 
+#if wxUSE_UNICODE
+void wxDataInputStream::SetConv( const wxMBConv &conv )
+{
+    delete m_conv;
+    m_conv = conv.Clone();
+}
+#endif
+
 #if wxHAS_INT64
 wxUint64 wxDataInputStream::Read64()
 {
 #if wxHAS_INT64
 wxUint64 wxDataInputStream::Read64()
 {
@@ -473,6 +481,14 @@ wxDataOutputStream::~wxDataOutputStream()
 #endif // wxUSE_UNICODE
 }
 
 #endif // wxUSE_UNICODE
 }
 
+#if wxUSE_UNICODE
+void wxDataOutputStream::SetConv( const wxMBConv &conv )
+{
+    delete m_conv;
+    m_conv = conv.Clone();
+}
+#endif
+
 #if wxHAS_INT64
 void wxDataOutputStream::Write64(wxUint64 i)
 {
 #if wxHAS_INT64
 void wxDataOutputStream::Write64(wxUint64 i)
 {