indexing
	description: "SToraGe Mode flags"
	legal: "See notice at end of class."
	info: "Priority mode not supported"
	status: "See notice at end of class."
	date: "$Date: 2006-08-17 13:49:39 -0700 (Thu, 17 Aug 2006) $"
	revision: "$Revision: 62697 $"

class interface
	ECOM_STGM

create 
	default_create
			-- Process instances of classes with no creation clause.
			-- (Default: do nothing.)
			-- (from ANY)

feature -- Access

	generating_type: STRING_8
			-- Name of current object's generating type
			-- (type of which it is a direct instance)
			-- (from ANY)

	generator: STRING_8
			-- Name of current object's generating class
			-- (base class of the type of which it is a direct instance)
			-- (from ANY)

	is_valid_stgm (stgm: INTEGER_32): BOOLEAN
			-- Is `stgm' a valid storage mode flag?

	stgm_convert: INTEGER_32
			-- This flag is applicable only to the creation of IStorage objects.
			-- Stgm_convert allows the creation to proceed while preserving
			-- existing data. The old data is saved to a stream named CONTENTS
			-- containing the same data that was in the old IStorage or IStream
			-- instance. In the IStorage case, the data is flattened to a
			-- stream regardless of whether the existing file currently contains
			-- a layered storage object.

	stgm_create: INTEGER_32
			-- Stgm_create indicates an existing IStorage or IStream object
			-- should be removed before the new one replaces it. A new object
			-- is created when this flag is specified only if the existing
			-- IStorage or IStream has been successfully removed.

	stgm_deleteonrelease: INTEGER_32
			-- The Stgm_deleteonrelease flag indicates that the underlying
			-- file is to be automatically destroyed when the root IStorage
			-- object is released. This capability is most useful for
			-- creating temporary files.

	stgm_direct: INTEGER_32
			-- Stgm_DIrect is always specified for IStream objects.
			-- Stgm_transacted is not supported in the compound file
			-- implementation of IStream. Other implementations can choose
			-- to support it.

	stgm_failifthere: INTEGER_32
			-- Stgm_failifthere causes the create operation to fail if an
			-- existing object with the specified name exists. In this case,
			-- Stg_e_filealreadyexists is returned. Stgm_failifthere
			-- applies to both IStorage and IStream objects.

	stgm_priority: INTEGER_32
			-- The Stgm_priority flag allows an IStorage object to be opened
			-- so that a subsequent copy operation can be done at reduced cost.
			-- Stgm_priority allows an application to read certain streams
			-- from storage before opening the storage object in a mode that would
			-- require a snapshot copy to be made. Priority mode has exclusive
			-- access to the committed version of the IStorage object.
			-- While a compound file is open in priority mode, no other opening
			-- of the compound file can commit changes even one that was opened
			-- before the priority mode opening. Therefore, applications should
			-- keep IStorage objects open in priority mode for as short a time
			-- as possible.

	stgm_read: INTEGER_32
			-- When applied to an IStream object, Stgm_READ enables
			-- applications to successfully call IStream.Read. If Stgm_read
			-- is omitted, IStream.Read will return an error. When applied to an
			-- IStorage, Stgm_READ allows the enumeration of the storage
			-- object's elements and enables applications to open these elements
			-- in read mode. Parents of storage objects to be opened in read mode
			-- must also have been opened in read mode otherwise, an error is
			-- returned.

	stgm_readwrite: INTEGER_32
			-- Stgm_readwrite is the logical combination of the
			-- Stgm_read and Stgm_write. However, the defined value
			-- of Stgm_readwrite is not equal to
			-- (Stgm_read or Stgm_write).

	stgm_share_deny_none: INTEGER_32
			-- 0x00000040L
			-- Stgm_SHARE_DENY_NONE indicates that neither read access nor
			-- write access should be denied to subsequent openings. This is the
			-- default sharing mode and if no Stgm_SHARE_* flag is explicitly
			-- given, Stgm_SHARE_DENY_NONE is implied.

	stgm_share_deny_read: INTEGER_32
			-- 0x00000030L
			-- When successfully applied to a root IStorage, the
			-- Stgm_SHARE_DENY_READ flag prevents others from opening the
			-- object in read mode. The open call fails and returns an error if
			-- the object is presently open in deny-read mode.
			-- Stgm_SHARE_DENY_READ is most useful when opening root storage
			-- objects. Deny modes on inner elements are still useful if some
			-- component is coordinating the opening of these inner elements, as
			-- might happen in a Copy/Paste operation. However, inner elements
			-- always require Stgm_SHARE_EXCLUSIVE. Opening a parent storage
			-- object with Stgm_SHARE_DENY_READ applies only to that opening,
			-- not the network-wide set of openings of the parent.

	stgm_share_deny_write: INTEGER_32
			-- When successfully applied the Stgm_share_deny_write flag
			-- prevents subsequent openings of either a storage or a stream from
			-- specifying write mode. The open call fails and returns an error
			-- if the storage or stream is presently open in write mode.
			-- For information about the interaction of this flag with nested
			-- openings, see the earlier discussion about Stgm_share_deny_read.

	stgm_share_exclusive: INTEGER_32
			-- The compound files implementation requires that all inner elements
			-- be opened Stgm_share_exclusive. It is the logical combination
			-- of the Stgm_share_deny_read and Stgm_share_deny_write.
			-- All root storage objects, as well as child storage and stream
			-- objects must be opened with Stgm_share_exclusive.

	stgm_transacted: INTEGER_32
			-- The transaction for each open object is nested in the transaction
			-- for its parent storage object. Therefore, committing changes at the
			-- child level is dependent on committing changes in the parent and
			-- a commit of the root storage object (top-level parent) is necessary
			-- before changes to an object are actually written to disk.
			-- The changes percolate upward: inner objects publish changes to the
			-- transaction of the next object outwards. Outermost objects publish
			-- changes permanently into the file system. Transacted mode is not
			-- required on the parent storage object in order to use transacted
			-- mode on a contained object.The scope of changes that are buffered
			-- in transacted mode is very broad. A storage or stream object can
			-- be opened, have arbitrary changes made to it, and then have the
			-- changes reverted, preserving the object as it was when it was
			-- first opened. The creation and destruction of elements within a
			-- storage object are scoped by its transaction.

	stgm_write: INTEGER_32
			-- Stgm_write lets an object commit changes to the storage.
			-- Specifically, unless this flag has been given, IStorage.Commit
			-- and IStream.Commit will fail. An open object whose changes cannot
			-- be committed can save its changes by copying the storage or stream
			-- with IStorage.CopyTo or IStream.CopyTo. In direct mode,
			-- changes are committed after every change operation. Thus, write
			-- permissions are needed to call any function that causes a change.
			-- On streams, this includes IStream.Write and IStream.SetSize.
			-- If a parent storage is opened in direct mode without write
			-- permission, any attempt to open a child stream within it in direct
			-- mode with write permission will fail, because it causes an implicit
			-- commit to be made on the storage. Similarly, trying to create or
			-- destroy a contained element in this storage object also causes an
			-- implicit commit, resulting in an error.
	
feature -- Comparison

	frozen deep_equal (some: ANY; other: like arg #1): BOOLEAN
			-- Are `some' and `other' either both void
			-- or attached to isomorphic object structures?
			-- (from ANY)
		ensure -- from ANY
			shallow_implies_deep: standard_equal (some, other) implies Result
			both_or_none_void: (some = Void) implies (Result = (other = Void))
			same_type: (Result and (some /= Void)) implies some.same_type (other)
			symmetric: Result implies deep_equal (other, some)

	frozen equal (some: ANY; other: like arg #1): BOOLEAN
			-- Are `some' and `other' either both void or attached
			-- to objects considered equal?
			-- (from ANY)
		ensure -- from ANY
			definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.is_equal (other))

	is_equal (other: like Current): BOOLEAN
			-- Is `other' attached to an object considered
			-- equal to current object?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			symmetric: Result implies other.is_equal (Current)
			consistent: standard_is_equal (other) implies Result

	frozen standard_equal (some: ANY; other: like arg #1): BOOLEAN
			-- Are `some' and `other' either both void or attached to
			-- field-by-field identical objects of the same type?
			-- Always uses default object comparison criterion.
			-- (from ANY)
		ensure -- from ANY
			definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.standard_is_equal (other))

	frozen standard_is_equal (other: like Current): BOOLEAN
			-- Is `other' attached to an object of the same type
			-- as current object, and field-by-field identical to it?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			same_type: Result implies same_type (other)
			symmetric: Result implies other.standard_is_equal (Current)
	
feature -- Status report

	conforms_to (other: ANY): BOOLEAN
			-- Does type of current object conform to type
			-- of `other' (as per Eiffel: The Language, chapter 13)?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void

	same_type (other: ANY): BOOLEAN
			-- Is type of current object identical to type of `other'?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			definition: Result = (conforms_to (other) and other.conforms_to (Current))
	
feature -- Duplication

	copy (other: like Current)
			-- Update current object using fields of object attached
			-- to `other', so as to yield equal objects.
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
			type_identity: same_type (other)
		ensure -- from ANY
			is_equal: is_equal (other)

	frozen deep_copy (other: like Current)
			-- Effect equivalent to that of:
			--		copy (`other' . deep_twin)
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			deep_equal: deep_equal (Current, other)

	frozen deep_twin: like Current
			-- New object structure recursively duplicated from Current.
			-- (from ANY)
		ensure -- from ANY
			deep_equal: deep_equal (Current, Result)

	frozen standard_copy (other: like Current)
			-- Copy every field of `other' onto corresponding field
			-- of current object.
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
			type_identity: same_type (other)
		ensure -- from ANY
			is_standard_equal: standard_is_equal (other)

	frozen standard_twin: like Current
			-- New object field-by-field identical to `other'.
			-- Always uses default copying semantics.
			-- (from ANY)
		ensure -- from ANY
			standard_twin_not_void: Result /= Void
			equal: standard_equal (Result, Current)

	frozen twin: like Current
			-- New object equal to `Current'
			-- twin calls copy; to change copying/twining semantics, redefine copy.
			-- (from ANY)
		ensure -- from ANY
			twin_not_void: Result /= Void
			is_equal: Result.is_equal (Current)
	
feature -- Basic operations

	frozen default: like Current
			-- Default value of object's type
			-- (from ANY)

	frozen default_pointer: POINTER
			-- Default value of type `POINTER'
			-- (Avoid the need to write `p'.default for
			-- some `p' of type `POINTER'.)
			-- (from ANY)

	default_rescue
			-- Process exception for routines with no Rescue clause.
			-- (Default: do nothing.)
			-- (from ANY)

	frozen do_nothing
			-- Execute a null action.
			-- (from ANY)
	
feature -- Output

	io: STD_FILES
			-- Handle to standard file setup
			-- (from ANY)

	out: STRING_8
			-- New string containing terse printable representation
			-- of current object
			-- Was declared in ANY as synonym of tagged_out.
			-- (from ANY)

	print (some: ANY)
			-- Write terse external representation of `some'
			-- on standard output.
			-- (from ANY)

	frozen tagged_out: STRING_8
			-- New string containing terse printable representation
			-- of current object
			-- Was declared in ANY as synonym of out.
			-- (from ANY)
	
feature -- Platform

	operating_environment: OPERATING_ENVIRONMENT
			-- Objects available from the operating system
			-- (from ANY)
	
invariant
		-- from ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)

indexing
	copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
	source: "[
		Eiffel Software
		356 Storke Road, Goleta, CA 93117 USA
		Telephone 805-685-1006, Fax 805-685-6869
		Website http://www.eiffel.com
		Customer support http://support.eiffel.com
	]"

end -- class ECOM_STGM