Commit 2f2f4664 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Removed deprecated methods from String

parent b3f3a373
Loading
Loading
Loading
Loading
+0 −40
Original line number Diff line number Diff line
@@ -304,46 +304,6 @@ char* String :: getString()
}


bool String :: save( std::ostream& file ) const
{
   assert( string );

   int len = strlen( string );
   file. write( ( char* ) &len, sizeof( int ) );
   file. write( string, len );
   if( file. bad() ) return false;
   return true;
}

bool String :: load( std::istream& file )
{
   int _length;
   file. read( ( char* ) &_length, sizeof( int ) );
   if( file. bad() ) return false;
   if( ! _length )
   {
      string[ 0 ] = 0;
      length = 0;
      return true;
   }
   if( string && length < _length )
   {
      delete[] string;
      string = NULL;
   }
   if( ! string )
   {
      //dbgCout( "Reallocating string..." );
      length = STRING_PAGE * ( _length / STRING_PAGE + 1 );
      string = new char[ length ];
   }

   file. read( string, _length );
   if( file. bad() ) return false;
   string[ _length ] = 0;
   return true;
}

bool String :: save( File& file ) const
{
   TNL_ASSERT( string,
+0 −8
Original line number Diff line number Diff line
@@ -132,14 +132,6 @@ class String

   String strip( char strip = ' ' ) const;

   // TODO: remove
   //! Write to a binary file
   bool save( std::ostream& file ) const;

   // TODO: remove
   //! Read from binary file
   bool load( std::istream& file );

   //! Write to a binary file
   bool save( File& file ) const;