home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / guit01.zip / DIRINT.CPP next >
C/C++ Source or Header  |  1993-11-30  |  3KB  |  129 lines

  1. /*********************************************************** C++ SOURCE *****
  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:       Custom Controls
  11.  *
  12.  * Module:          DirInt.C
  13.  *
  14.  * Original Author: Jon Wright
  15.  *
  16.  * Description:     This file contains a C wrapper for the DirList object
  17.  *                  which is callable from JOT code.
  18.  *
  19.  * Environment:     OS/2 V2.1 - IBM CSet++
  20.  *
  21.  * Modification history:
  22.  *
  23.  *  24nov93 : Initial release                                            jw
  24.  *
  25.  *  28nov93 : Modified to show way of allowing multiple instances        gj
  26.  *
  27.  *  $Log$
  28.  *
  29.  ***************************************************************************/
  30.  
  31. /**************************************************************************
  32.  * Include Local files
  33.  *************************************************************************/
  34.  
  35. #include "dirlist.hpp"
  36. #include "dirint.hpp"
  37.  
  38. /**************************************************************************
  39.  * Static Variables
  40.  *************************************************************************/
  41.  
  42.  
  43. /**************************************************************************
  44.  * Function:   InitList
  45.  *
  46.  * Purpose:    Create directory list object
  47.  *
  48.  * Parameters: Directory/Filespec to be logged
  49.  *
  50.  * Returns:    none
  51.  *
  52.  *************************************************************************/
  53.  
  54. ULONG InitList (String DirName)
  55.     {
  56.     return ((ULONG) new DirList (DirName));
  57.     }
  58.  
  59.  
  60.  
  61. /**************************************************************************
  62.  * Function:   DestroyList
  63.  *
  64.  * Purpose:    Destructor: Delete object and any list entries.
  65.  *
  66.  * Parameters: none
  67.  *
  68.  * Returns:    none
  69.  *
  70.  *************************************************************************/
  71.  
  72. void DestroyList(ULONG List)
  73.     {
  74.     delete (DirList *)List;
  75.     }
  76.  
  77.  
  78. /**************************************************************************
  79.  * Function:   UpdateList
  80.  *
  81.  * Purpose:    Relogs files in file list
  82.  *
  83.  * Parameters: Filespec of files to be logged
  84.  *
  85.  * Returns:    none
  86.  *
  87.  *************************************************************************/
  88.  
  89. short UpdateList (ULONG List, String DirName)
  90.     {
  91.     return (((DirList *)List)->RefreshList(DirName));
  92.     }
  93.  
  94.  
  95. /**************************************************************************
  96.  * Function:   ListLen
  97.  *
  98.  * Purpose:    Get number of items in the list
  99.  *
  100.  * Parameters: none
  101.  *
  102.  * Returns:    number of items in list
  103.  *
  104.  *************************************************************************/
  105.  
  106. short ListLen(ULONG List)
  107.     {
  108.     return(((DirList *)List)->GetCount());
  109.     }
  110.  
  111.  
  112. /**************************************************************************
  113.  * Function:   ReadList
  114.  *
  115.  * Purpose:    Get specified list item
  116.  *
  117.  * Parameters: Index - index of item in list to be retrieved
  118.  *
  119.  * Returns:    Filename as a String
  120.  *
  121.  *************************************************************************/
  122.  
  123. String ReadList (ULONG List, short Item)
  124.     {
  125.     return *((DirList *)List)->ReadItem(Item);
  126.     }
  127.  
  128.  
  129.