+void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event))
+{
+ wxTextCtrl& textCtrl = * GetTextCtrl();
+
+ textCtrl.Clear();
+ textCtrl << "\nTest fstream vs. wxFileStream:\n\n";
+
+ ofstream std_file_output( "test_std.dat" );
+ wxFileOutputStream file_output( "test_wx.dat" );
+
+ textCtrl.WriteText( "Writig to fstream:\n" );
+
+ wxString tmp;
+ signed int si = 0xFFFFFFFF;
+ tmp.Printf( "Signed int: %d\n", si );
+ textCtrl.WriteText( tmp );
+ file_output << si << "\n";
+ std_file_output << si << "\n";
+
+ unsigned int ui = 0xFFFFFFFF;
+ tmp.Printf( "Unsigned int: %u\n", ui );
+ textCtrl.WriteText( tmp );
+ file_output << ui << "\n";
+ std_file_output << ui << "\n";
+
+ double d = 2.01234567890123456789;
+ tmp.Printf( "Double: %f\n", d );
+ textCtrl.WriteText( tmp );
+ file_output << d << "\n";
+ std_file_output << d << "\n";
+
+ wxString str( "Hello!" );
+ tmp.Printf( "String: %s\n", str.c_str() );
+ textCtrl.WriteText( tmp );
+ file_output << str << "\n";
+ std_file_output << str.c_str() << "\n";
+
+}
+