home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 4.1 KB | 170 lines | [TEXT/MPS ] |
- //
- // File: SLFilRep.idl
- //
- // Contains: Interface for FW_OFile class
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
-
- #ifndef SLFILREP_IDL
- #define SLFILREP_IDL
-
- #ifndef SLSTDDEF_IDL
- #include "SLStdDef.idl"
- #endif
-
- #ifndef SLREFCNT_IDL
- #include "SLRefCnt.idl"
- #endif
-
- #ifndef SLFILESP_IDL
- #include "SLFileSp.idl"
- #endif
-
-
- //==============================================================================
- // Classes defined in this interface
- //==============================================================================
-
- interface FW_OFile;
-
-
- //==============================================================================
- // Classes used by this interface
- //==============================================================================
-
- interface FW_OFileSpecification;
-
-
- //==============================================================================
- // Types used by this interface
- //==============================================================================
-
- typedef somToken FW_CPrivFileRep;
- typedef somToken FW_SAccessPermission;
- typedef somToken FW_PlatformFileHandle;
-
-
- //========================================================================================
- // FW_OFile
- //
- // Class holding representation for FW_OFileSink. This is an implementation class
- // and should not be used in general. Use the FW_OFileSink class instead.
- //========================================================================================
-
- interface FW_OFile : FW_ORefCount
- {
- void InitWithExclusiveAccess(in FW_OFileSpecification fileSpecification,
- in FW_Boolean allowCreate);
- // Open with exclusive access
-
- void InitWithPermissions(in FW_OFileSpecification fileSpecification,
- in FW_SAccessPermission* permission,
- in FW_Boolean allowCreate);
- // Open with specified permissions.
-
-
-
- //===========================================================
- // Read/Write
- //===========================================================
-
- void Read(in void* destination, in long count);
- // Read 'count' bytes from current position to 'destination' and
- // increment current position by 'count'.
-
- void Write(in void* source, in long count);
- // Write 'count' bytes from 'source' to current file position.
-
-
- //===========================================================
- // File Positioning
- //===========================================================
-
- long GetLength();
- // Return the logical size of the file.
-
- void SetLength(in long length);
- // Return the logical size of the file.
-
- long GetPosition();
- // Return current file position.
-
- void SetPosition(in long positioningMode,
- in long markOffset);
- // Set current file position using mode.
-
- long BytesToEndOfFile();
- // Returns the number of bytes from the current position to the
- // end of the file.
-
-
- //===========================================================
- // Accessor methods
- //===========================================================
-
- void GetPermissions(out FW_SAccessPermission thePerms);
- // Returns the permissions used to open this file.
-
- FW_OFileSpecification GetFileSpecification();
- // Returns a reference to the file. This routine is primarily used for
- // exception handling.
-
- FW_PlatformFileHandle* GetFileHandle();
- // Returns the native platform handle to the file.
-
-
- //===========================================================
- // Operators
- //===========================================================
-
- FW_Boolean IsEqual(in FW_OFile theOtherFile);
- // Equality operator.
-
-
- #ifdef __SOMIDL__
- implementation
- {
- functionprefix = FW_OFile__;
-
- override:
- somInit,
- somUninit;
-
- releaseorder:
- somInit,
- somUninit,
-
- InitWithExclusiveAccess,
- InitWithPermissions,
- Read,
- Write,
- GetLength,
- SetLength,
- GetPosition,
- SetPosition,
- BytesToEndOfFile,
- GetPermissions,
- GetFileSpecification,
- GetFileHandle,
- IsEqual;
-
- majorversion = 1;
- minorversion = 0;
-
- passthru C_xh =
- "";
-
- passthru C_xih =
- "class FW_CPrivFileRep;";
-
- #ifdef __PRIVATE__
- FW_CPrivFileRep *fRep;
- #endif
- };
- #endif //# __SOMIDL__
- };
-
- #endif
-