Commit 7f445c6a authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Removed File::Mode enum

parent d02a0482
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -9,16 +9,15 @@ int main()
{
    File file;

    file.open( String("new-file.tnl"), File::Mode::Out );
    file.open( String("new-file.tnl"), std::ios_base::out );
    String title("'string to file'");
    file << title;
    file.close();

    file.open( String("new-file.tnl"), File::Mode::In );
    file.open( String("new-file.tnl"), std::ios_base::in );
    String restoredString;
    file >> restoredString;
    file.close();

    cout << "restored string = " << restoredString <<endl;
}
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ int main()
    * Save array to file.
    */
   File file;
   file.open( "test-file.tnl", File::Mode::Out | File::Mode::Truncate );
   file.open( "test-file.tnl", std::ios_base::out | std::ios_base::trunc );
   file.save< double, double, Devices::Host >( doubleArray, size );
   file.close();

@@ -30,7 +30,7 @@ int main()
   /***
    * Read array from the file to device
    */
   file.open( "test-file.tnl", File::Mode::In );
   file.open( "test-file.tnl", std::ios_base::in );
   file.load< double, double, Devices::Cuda >( deviceArray, size );
   file.close();

+3 −5
Original line number Diff line number Diff line
@@ -17,21 +17,21 @@ int main()
    * Save the array of doubles as floats.
    */
   File file;
   file.open( "test-file.tnl", File::Mode::Out | File::Mode::Truncate );
   file.open( "test-file.tnl", std::ios_base::out | std::ios_base::trunc );
   file.save< double, float, Devices::Host >( doubleArray, size );
   file.close();

   /***
    * Load the array of floats from the file.
    */
   file.open( "test-file.tnl", File::Mode::In );
   file.open( "test-file.tnl", std::ios_base::in );
   file.load< float, float, Devices::Host >( floatArray, size );
   file.close();

   /***
    * Load the array of floats from the file and convert them to integers.
    */
   file.open( "test-file.tnl", File::Mode::In );
   file.open( "test-file.tnl", std::ios_base::in );
   file.load< int, float, Devices::Host >( intArray, size );
   file.close();

@@ -44,5 +44,3 @@ int main()
                << floatArray[ i ] << " -- "
                << intArray[ i ] << std::endl;
}

+2 −2
Original line number Diff line number Diff line
@@ -47,11 +47,11 @@ int main( int argc, char* argv[] )
      cout << "string1 is not empty" << endl;

   File myFile;
   myFile.open( "string_save.out", File::Mode::Out );
   myFile.open( "string_save.out", std::ios_base::out );
   myFile << string1;
   myFile.close();

   myFile.open( "string_save.out", File::Mode::In );
   myFile.open( "string_save.out", std::ios_base::in );
   myFile >> string3;
   cout << "string 3 after loading = " << string3 << endl;
}
+2 −2
Original line number Diff line number Diff line
@@ -379,7 +379,7 @@ ArrayView< Value, Device, Index >::
save( const String& fileName ) const
{
   File file;
   file.open( fileName, File::Mode::Out );
   file.open( fileName, std::ios_base::out );
   this->save( file );
}

@@ -391,7 +391,7 @@ ArrayView< Value, Device, Index >::
load( const String& fileName )
{
   File file;
   file.open( fileName, File::Mode::In );
   file.open( fileName, std::ios_base::in );
   this->load( file );
}

Loading