home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / guit01.zip / DIRLIST.HPP < prev    next >
C/C++ Source or Header  |  1993-11-30  |  2KB  |  55 lines

  1. /*********************************************************** C++ HEADER *****
  2.  *
  3.  *               (C) Copyright JBA International Plc - 1993
  4.  *               Licensed Material - Program Property of JBA.
  5.  *      Not to be used for other than licensed and/or agreed purposes.
  6.  *-------------------------------------------------------------------------
  7.  *
  8.  * Project:         GUIDELINES
  9.  *
  10.  * Component:       Tech Support
  11.  *
  12.  * Module:          DirList.CPP
  13.  *
  14.  * Original Author: Jon Wright
  15.  *
  16.  * Description:     This file contains an object which reads in a list
  17.  *                  of the files from a directory. This list may
  18.  *                  then be accessed by a JOT program. It is a trivial
  19.  *                  program to demonstrate how to interface to external 
  20.  *                  C++ code from within Guidelines
  21.  *
  22.  * Environment:     OS/2 V2.1 - IBM CSet++
  23.  *
  24.  * Modification history:
  25.  *
  26.  *  24nov93 : Initial release                                            jw
  27.  *
  28.  *  $Log$
  29.  *
  30.  ***************************************************************************/
  31.  
  32. #define INCL_BASE
  33. #define INCL_NOPM
  34. #include <os2.h>            // Needed by guirun.h
  35.  
  36. #include "guirun.h"         // Use Guidelines String class
  37.  
  38. const int LISTLEN = 100;    // First LISTLEN files in directory are logged
  39.  
  40. class DirList
  41.     {
  42. private:
  43.     String *ptrList[LISTLEN];
  44.     short   count;
  45.  
  46. public:
  47.     DirList();
  48.     DirList(char *DirName);
  49.     ~DirList();
  50.  
  51.     short   RefreshList(char *DirName); // Rebuild list
  52.     short   GetCount() {return count;}  // Get number of filemanes
  53.     String *ReadItem(int Index);        // Get specific filename
  54.     };
  55.