home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / os2tk20 / c / samples / tp / fm.cs_ / FM.CSC
Encoding:
Text File  |  1992-07-15  |  1.4 KB  |  61 lines

  1. #   @(#)fm.csc 1.3 1/22/92 16:09:34 [1/26/92] (c)IBM Corp. 1992
  2.  
  3. -- This class is adapted from the book
  4. --   Class Construction in C and C++, Object Oriented Fundamentals
  5. --   by Roger Sessions, Copyright (c) 1992 Prentice Hall.
  6. -- Reprinted with permission.
  7.  
  8. include <somobj.sc>
  9.  
  10. class: fileMgr,
  11.   local;
  12.  
  13. parent: SOMObject;
  14.  
  15. /*
  16. ----------------------------------------------------
  17.   Class: fileMgr
  18.  
  19. Purpose: This is a class interface to the file system.
  20.      It is simplified in only providing read functionality.
  21.      It supports one major concept in addition to standard
  22.      file functions, and that is the method fmPeekChar().
  23.      This method allows the client to "peek-ahead" into
  24.      the file, looking at characters without changing
  25.      the result of fmGetChar().
  26. ---------------------------------------------------- */
  27.  
  28. data:
  29.  
  30.   FILE *funit;
  31.   int buffer[BUFF_SIZE];
  32.   int putSide;
  33.   int getSide;
  34.  
  35. methods:
  36.  
  37. group: fmMethods;
  38.  
  39.    void fmInit(char *newFile);
  40.    -- Initialize and open a new file.
  41.  
  42.    int fmGetChar();
  43.    -- Get the next character in the file.
  44.  
  45.    int fmPeekChar(int offset);
  46.    -- Peek ahead in the file.
  47.  
  48. group: internalMethods;
  49.  
  50.    int fmSize(), private;
  51.    int fmIncr(int oldNum), private;
  52.    int fmAdd(int oldNum, int addNum), private;
  53.  
  54. group: SystemMethodOverrides;
  55.  
  56.    override somInit;
  57.  
  58.    override somUninit;
  59.  
  60.    override somDumpSelfInt;
  61.