Up Top       Prev BINARY_FILE_READ      Next BIT_N



class interface BINARY_FILE_WRITE
   -- This class allow to write a file on the disk as a binary file 
   -- (ie. file containing bytes). If you need to write text in a file,
   -- then consider using TEXT_FILE_WRITE.

creation
   make
      -- The new created object is not connected. (See also connect_to and
      -- connect_for_appending_to.)

      ensure
         not is_connected

   connect_to (new_path: STRING)
      -- Truncate file to zero length or create binary file for writing.
      -- The stream is positioned at the beginning of the file.

      require
         not is_connected;
         not new_path.is_empty

   connect_for_appending_to (new_path: STRING)
      -- Truncate file to zero length or create binary file for writing.
      -- The stream is positioned at the beginning of the file.

      require
         not is_connected;
         not new_path.is_empty

feature(s) from MEMORY
   -- Garbage collector information and tuning:

   collecting: BOOLEAN
      -- Is garbage collection enabled?


   collection_off
      -- Disable garbage collection.


   collection_on
      -- Enable garbage collection.


   full_collect
      -- Force a full collection cycle if garbage collection is
      -- enabled (i.e. collecting is true); do nothing otherwise.


   collector_counter: INTEGER
      -- The number of collections actually performed or -1 when the
      -- system is not using the SmartEiffel garbage collector (i.e. when
      -- the system is compiled using the -no_gc flag).

      ensure
         Result >= -1

feature(s) from MEMORY
   -- SmartEiffel Garbage collector information and tuning:

   small_eiffel_collector: BOOLEAN
      -- Is the SmartEiffel garbage collector really used?

      ensure
         Result = (collector_counter >= 0)

   low_memory_strategy: BOOLEAN
      -- Is the low memory strategy in use? When this strategy is used,
      -- the garbage collector try to use as few memory as possible.

      require
         small_eiffel_collector

   set_low_memory_strategy
      require
         small_eiffel_collector
      ensure
         low_memory_strategy

   high_memory_strategy: BOOLEAN
      -- Is the high memory strategy in use? When this strategy is used,
      -- the garbage collector assume that more memory can be allocated
      -- if necessary.

      require
         small_eiffel_collector

   set_high_memory_strategy
      require
         small_eiffel_collector
      ensure
         high_memory_strategy

   default_memory_strategy: BOOLEAN
      -- Is the default memory strategy in use? This is the default initial
      -- mode for the garbage collector (somewhere between low_memory_strategy
      -- and high_memory_strategy).

      require
         small_eiffel_collector

   set_default_memory_strategy
      require
         small_eiffel_collector
      ensure
         default_memory_strategy

   allocated_bytes: INTEGER
      -- Total number of allocated bytes of memory in the heap.

      require
         collector_counter >= 0

feature(s) from MEMORY
   -- Other features:

   pointer_size: INTEGER
      -- The size in number of bytes for a pointer.


feature(s) from FILE   is_connected: BOOLEAN
      -- Is this file connected to some file of the operating system?

      ensure
         definition: Result = (path /= Void)

   connect_to (new_path: STRING)
      -- Truncate file to zero length or create binary file for writing.
      -- The stream is positioned at the beginning of the file.

      require
         not is_connected;
         not new_path.is_empty

   disconnect
      -- Disconnect from any file.

      require
         is_connected
      ensure
         not is_connected

feature(s) from BINARY_FILE_WRITE   path: STRING
      -- Not Void when connected to the corresponding file on the disk.


   connect_for_appending_to (new_path: STRING)
      -- Truncate file to zero length or create binary file for writing.
      -- The stream is positioned at the beginning of the file.

      require
         not is_connected;
         not new_path.is_empty

   flush
      -- forces a write of unwritten character (write my have been 
      -- delayed, flush writes buffered characters)


   put_byte (byte: INTEGER)
      require
         is_connected

   put_integer_16_native_endian (i: INTEGER_16)
      -- Write in the same order as the machine running this code.
      -- The result is machine dependant.

      require
         is_connected

   put_integer_16_big_endian (i: INTEGER_16)
      -- Write i in big endian mode.
      -- The result is machine independant.

      require
         is_connected

   put_integer_16_little_endian (i: INTEGER_16)
      -- Write i in little endian mode.
      -- The result is machine independant.

      require
         is_connected



end of BINARY_FILE_WRITE




All classes inherit from ANY, ANY inherits from PLATFORM and PLATFORM inherits from GENERAL.



Generated by short -html_deb on 31 March 2005.