textCtrl.WriteText( _T("Writing to ofstream and wxFileOutputStream:\n") );
wxSTD ofstream std_file_output( "test_std.dat" );
textCtrl.WriteText( _T("Writing to ofstream and wxFileOutputStream:\n") );
wxSTD ofstream std_file_output( "test_std.dat" );
wxBufferedOutputStream buf_output( file_output );
for (ch = 0; ch < 10; ch++)
buf_output.Write( &ch, 1 );
buf_output.Sync();
wxBufferedOutputStream buf_output( file_output );
for (ch = 0; ch < 10; ch++)
buf_output.Write( &ch, 1 );
buf_output.Sync();
for (ch2 = 0; ch2 < 10; ch2++)
{
file_input.Read( &ch, 1 );
for (ch2 = 0; ch2 < 10; ch2++)
{
file_input.Read( &ch, 1 );
textCtrl.WriteText( _T("Writing number 0 to 9 to buffered wxFileOutputStream, then\n") );
textCtrl.WriteText( _T("seeking back to #3 and writing 0:\n\n") );
textCtrl.WriteText( _T("Writing number 0 to 9 to buffered wxFileOutputStream, then\n") );
textCtrl.WriteText( _T("seeking back to #3 and writing 0:\n\n") );
wxBufferedOutputStream buf_output2( file_output2 );
for (ch = 0; ch < 10; ch++)
buf_output2.Write( &ch, 1 );
wxBufferedOutputStream buf_output2( file_output2 );
for (ch = 0; ch < 10; ch++)
buf_output2.Write( &ch, 1 );
for (ch2 = 0; ch2 < 10; ch2++)
{
file_input2.Read( &ch, 1 );
for (ch2 = 0; ch2 < 10; ch2++)
{
file_input2.Read( &ch, 1 );
textCtrl.WriteText( _T("Reading number 0 to 9 from buffered wxFileInputStream, then\n") );
textCtrl.WriteText( _T("seeking back to #3 and reading the 0:\n\n") );
textCtrl.WriteText( _T("Reading number 0 to 9 from buffered wxFileInputStream, then\n") );
textCtrl.WriteText( _T("seeking back to #3 and reading the 0:\n\n") );
for (ch = 0; ch < 10; ch++)
file_output.Write( &ch, 1 );
for (ch = 0; ch < 10; ch++)
file_output.Write( &ch, 1 );
for (ch2 = 0; ch2 < 11; ch2++)
{
file_input.Read( &ch, 1 );
for (ch2 = 0; ch2 < 11; ch2++)
{
file_input.Read( &ch, 1 );
for (ch2 = 0; ch2 < 11; ch2++)
{
ffile_input.Read( &ch, 1 );
for (ch2 = 0; ch2 < 11; ch2++)
{
ffile_input.Read( &ch, 1 );
wxBufferedInputStream buf_input( file_input );
textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") );
wxBufferedInputStream buf_input( file_input );
textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") );
for (ch = 0; ch < 10; ch++)
file_output.Write( &ch, 1 );
file_output.Sync();
for (ch = 0; ch < 10; ch++)
file_output.Write( &ch, 1 );
file_output.Sync();
for (ch = 0; ch < 10; ch++)
file_output.Write( &ch, 1 );
for (ch = 0; ch < 10; ch++)
file_output.Write( &ch, 1 );
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading another char from wxFileInputStream:\n\n") );
ch = file_input.GetC();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading another char from wxFileInputStream:\n\n") );
ch = file_input.GetC();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading yet another char from wxFileInputStream:\n\n") );
ch = file_input.GetC();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading yet another char from wxFileInputStream:\n\n") );
ch = file_input.GetC();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxFileInputStream...\n\n") );
file_input.Ungetch( 5 );
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxFileInputStream...\n\n") );
file_input.Ungetch( 5 );
str.Printf( wxT("Now at position %d\n\n"), (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading char from wxFileInputStream:\n\n") );
ch = file_input.GetC();
str.Printf( wxT("Now at position %d\n\n"), (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading char from wxFileInputStream:\n\n") );
ch = file_input.GetC();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading another char from wxFileInputStream:\n\n") );
ch = file_input.GetC();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading another char from wxFileInputStream:\n\n") );
ch = file_input.GetC();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxFileInputStream again...\n\n") );
file_input.Ungetch( 5 );
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxFileInputStream again...\n\n") );
file_input.Ungetch( 5 );
str.Printf( wxT("Now at position %d\n\n"), (int) pos );
textCtrl.WriteText( str );
str.Printf( wxT("Now at position %d\n\n"), (int) pos );
textCtrl.WriteText( str );
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
}
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
}
for (ch = 0; ch < 10; ch++)
file_output.Write( &ch, 1 );
for (ch = 0; ch < 10; ch++)
file_output.Write( &ch, 1 );
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading another char from wxBufferedInputStream:\n\n") );
ch = buf_input.GetC();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading another char from wxBufferedInputStream:\n\n") );
ch = buf_input.GetC();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading yet another char from wxBufferedInputStream:\n\n") );
ch = buf_input.GetC();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading yet another char from wxBufferedInputStream:\n\n") );
ch = buf_input.GetC();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxBufferedInputStream...\n\n") );
buf_input.Ungetch( 5 );
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxBufferedInputStream...\n\n") );
buf_input.Ungetch( 5 );
str.Printf( wxT("Now at position %d\n\n"), (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading char from wxBufferedInputStream:\n\n") );
ch = buf_input.GetC();
str.Printf( wxT("Now at position %d\n\n"), (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading char from wxBufferedInputStream:\n\n") );
ch = buf_input.GetC();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading another char from wxBufferedInputStream:\n\n") );
ch = buf_input.GetC();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading another char from wxBufferedInputStream:\n\n") );
ch = buf_input.GetC();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxBufferedInputStream again...\n\n") );
buf_input.Ungetch( 5 );
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxBufferedInputStream again...\n\n") );
buf_input.Ungetch( 5 );
str.Printf( wxT("Now at position %d\n\n"), (int) pos );
textCtrl.WriteText( str );
str.Printf( wxT("Now at position %d\n\n"), (int) pos );
textCtrl.WriteText( str );
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
}
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
}