home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / som / include / fma.idl < prev    next >
Text File  |  1999-02-22  |  8KB  |  213 lines

  1. //
  2. //   COMPONENT_NAME: somp
  3. //
  4. //   ORIGINS: 27
  5. //
  6. //
  7. //    25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,1994,1996 
  8. //   All Rights Reserved
  9. //   Licensed Materials - Property of IBM
  10. //   US Government Users Restricted Rights - Use, duplication or
  11. //   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  12. //
  13. //#  @(#) 2.10 src/somp/fma.idl, somp, som2.1 12/26/95 16:54:24 [7/30/96 14:46:49]
  14.  
  15.  
  16. #ifndef fma_idl
  17. #define fma_idl
  18.  
  19. #include <somobj.idl>
  20. #include <somp.idl>
  21. #include <mia.idl>
  22. #include <somperrd.idl>
  23.  
  24. interface SOMPFileMediaAbstract : SOMPMediaInterfaceAbstract
  25.  
  26. // This is the abstract class definition for an interface to
  27. // a file media.
  28.  
  29. {
  30.    void sompInitReadWrite(in string mediaInfo) raises (SOMPError::sompException);
  31. // Initialize the media interface for read-write access.
  32.  
  33.    void sompInitReadOnly(in string mediaInfo) raises (SOMPError::sompException);
  34. // Initialize the media interface for read-only access.
  35.  
  36.  
  37.    void sompSeekPosition(in long offset) raises (SOMPError::sompException);
  38. // Position the media to an offset.  Any further reading
  39. // or writing will begin from that point.  Reading and writing
  40. // implicitly repositions the file, so usually this is not needed.
  41.  
  42.    void sompSeekPositionRel(in long offset) raises (SOMPError::sompException);
  43. // Like Position, but offset is relative to current.
  44.  
  45.    long sompGetOffset();
  46. // Returns the current offset within the file.
  47.  
  48.    void sompReadBytes(in string byteStream, in long length) raises (SOMPError::sompException);
  49. // Read a byte stream of the given length from the media.
  50.  
  51.    void sompWriteBytes(in string byteStream, in long length) raises (SOMPError::sompException);
  52. // Write a byte stream of the given length to the media.
  53.  
  54.    void sompWriteOctet(in octet i1) raises (SOMPError::sompException);
  55. // Writes the given 8-bit integer
  56.  
  57.    void sompWriteShort(in short i2) raises (SOMPError::sompException);
  58. // Writes the given short integer
  59.  
  60.    void sompWriteUnsignedShort(in unsigned short u2) raises (SOMPError::sompException);
  61. // Writes the given unsigned short integer
  62.  
  63.    void sompWriteLong(in long i4) raises (SOMPError::sompException);
  64. // Writes the given long integer
  65.  
  66.    void sompWriteUnsignedLong(in unsigned long u4) raises (SOMPError::sompException);
  67. // Writes the given unsigned long integer
  68.  
  69.    void sompWriteDouble(in double f8) raises (SOMPError::sompException);
  70. // Writes the given double-precision float
  71.  
  72.    void sompWriteFloat(in float f4) raises (SOMPError::sompException);
  73. // Writes the given float
  74.  
  75.    void sompWriteCharacter(in char c) raises (SOMPError::sompException);
  76. // Writes the given character
  77.  
  78.    void sompWriteSomobject(in SOMObject so, in SOMObject parentObject)
  79.                 raises (SOMPError::sompException);
  80. // Writes the given object.  Uses parentObject to determine whether relative
  81. // Ids are used.  If object (so) has no persistent parent, client passes
  82. // NULL parentObject.
  83.  
  84.    void sompWriteString(in string wstring) raises (SOMPError::sompException);
  85. // Writes the given string to the media.
  86. //
  87.  
  88.    void sompReadOctet(inout octet i1) raises (SOMPError::sompException);
  89. // Reads an 8-bit integer into memory at given the pointer
  90.  
  91.    void sompReadShort(inout short i2) raises (SOMPError::sompException);
  92. // Reads a short integer into memory at given the pointer
  93.  
  94.    void sompReadUnsignedShort(inout unsigned short u2) raises (SOMPError::sompException);
  95. // Reads an unsigned short integer into memory at given the pointer
  96.  
  97.    void sompReadLong(inout long i4) raises (SOMPError::sompException);
  98. // Reads a long integer into memory at given the pointer
  99.  
  100.    void sompReadUnsignedLong(inout unsigned long i4) raises (SOMPError::sompException);
  101. // Reads a long integer into memory at given the pointer
  102.  
  103.    void sompReadDouble(inout double f8) raises (SOMPError::sompException);
  104. // Reads a float into memory at given the pointer
  105.  
  106.    void sompReadFloat(inout float f4) raises (SOMPError::sompException);
  107. // Reads a float into memory at given the pointer
  108.  
  109.    void sompReadCharacter(inout char c) raises (SOMPError::sompException);
  110. // Reads a character into memory at given the pointer
  111.  
  112.    void sompReadSomobject(inout SOMObject so) raises (SOMPError::sompException);
  113. // Instantiates and returns a new object of the class specified in
  114. // the file. Standard SOM objects are simply instantiated. Persistent
  115. // objects are instantiated and marked for restoration.
  116.  
  117.    void sompReadString(inout string rstring) raises (SOMPError::sompException);
  118. // Read and allocate a string. Input is a pointer to a string. The input
  119. // pointer is modified to point to a newly allocated buffer which
  120. // will contain the string read from the media.
  121. // Callers are responsible for freeing the returned buffer with SOMFree.
  122. // If you want to read a string into a predefined buffer,
  123. // use sompReadStringToBuffer.
  124. //
  125. // This method can be used to read strings which were stored by
  126. // sompWriteString.
  127.  
  128.    void sompReadStringToBuffer(in string buffer, in long bufsize) raises (SOMPError::sompException);
  129. // Read a string into the preallocated buffer given. The size of the
  130. // buffer is given in <bufsize>. If the string read is larger than
  131. // bufsize it is truncated to fit in bufsize.
  132. //
  133. // This method can be used to read strings which were stored by
  134. // sompWriteString.
  135.  
  136.    void sompWriteLine(in string buffer) raises (SOMPError::sompException);
  137.  
  138. // Writes the given string in <buffer> at the current position.
  139. // The terminating null character (\0) is not written.
  140. //
  141. // This method does NOT append a newline character (\n) to the
  142. // given string before writing. If the user of this method intends to
  143. // restore this <buffer> of data with sompReadLine, the user must
  144. // put the newline character in the <buffer> before calling this
  145. // method.
  146.  
  147.    void sompReadLine(in string buffer, in long bufsize) raises (SOMPError::sompException);
  148. // Read a string up to and including the first newline character (\n)
  149. // into the preallocated buffer given.
  150. // Use this method for reading strings stored with sompWriteLine.
  151. //
  152. // The size of the buffer is given in <bufsize>. If the string read is
  153. // larger than bufsize it is truncated to fit in bufsize.
  154. //
  155. // The characters read are stored in <buffer>, and a null character (\0)
  156. // is appended. The newline character, if read, is included in the string.
  157.  
  158.    void sompWriteTypeCode(in TypeCode tc) raises (SOMPError::sompException);
  159. // Writes a restoreable version of an IDL type code. Restore with
  160. // sompReadTypeCode().
  161.  
  162.    void sompReadTypeCode(inout TypeCode tc) raises (SOMPError::sompException);
  163. // Restores an IDL type code that was stored with sompWriteTypeCode().
  164.  
  165. #ifdef __SOMIDL__
  166.  
  167. implementation
  168. {
  169.     callstyle=idl;
  170.     dllname="somp.dll";
  171.  
  172.     // #####  Methods sompWriteInteger and sompReadInteger have been deleted.
  173.     //        They remain in the release order for binary / ir compatibility
  174.     //        with the remainder of the SOM beta world.  New release orders
  175.     //        should be generated at GA.
  176.  
  177.     releaseorder: sompInitReadWrite, sompInitReadOnly,
  178.           somReserved1,
  179.           somReserved2, sompSeekPosition,
  180.           sompSeekPositionRel, sompGetOffset,
  181.           sompReadBytes, sompWriteBytes,
  182.           sompWriteOctet, sompWriteShort,
  183.           sompWriteUnsignedShort, sompWriteInteger,
  184.           sompWriteLong, sompWriteUnsignedLong,
  185.           sompWriteDouble, sompWriteFloat,
  186.           sompWriteCharacter, sompWriteSomobject,
  187.           sompWriteString,
  188.           sompReadOctet, sompReadShort,
  189.           sompReadUnsignedShort, sompReadInteger,
  190.           sompReadLong, sompReadUnsignedLong,
  191.           sompReadDouble, sompReadFloat,
  192.           sompReadCharacter, sompReadSomobject,
  193.           sompReadString,
  194.           sompReadStringToBuffer, sompWriteLine,
  195.           sompReadLine, sompWriteTypeCode,
  196.           sompReadTypeCode;
  197.  
  198.  
  199. // Class Modifiers
  200.    majorversion = 2;
  201.    minorversion = 1;
  202.    filestem = fma;
  203.  
  204. // Method Modifiers
  205.    sompOpen  : override;
  206.    sompClose : override;
  207.  
  208. };
  209. #endif /* __SOMIDL__ */
  210. };
  211.  
  212. #endif  /* fma_idl */
  213.