home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c081_11 / 2.ddi / CLASSEXM.ZIP / DIRECTRY.H < prev    next >
Encoding:
C/C++ Source or Header  |  1991-02-13  |  2.7 KB  |  118 lines

  1. // Borland C++ - (C) Copyright 1991 by Borland International
  2.  
  3. // Contents ----------------------------------------------------------------
  4. //
  5. //      directoryClass
  6. //
  7. //      Directory
  8. //
  9. // Description
  10. //
  11. //      Defines class Directory.
  12. //
  13. // End ---------------------------------------------------------------------
  14.  
  15. // Interface Dependencies ---------------------------------------------------
  16.  
  17. #ifndef __DIRECTRY_H
  18. #define __DIRECTRY_H
  19.  
  20. #ifndef __DIR_H
  21. #include <dir.h>
  22. #define __DIR_H
  23. #endif
  24.  
  25. #ifndef __CLSTYPES_H
  26. #include <clstypes.h>
  27. #endif
  28.  
  29. #ifndef __SORTARRY_H
  30. #include <sortarry.h>
  31. #endif
  32.  
  33. #ifndef __FILEDATA_H
  34. #include "filedata.h"
  35. #endif
  36.  
  37. // End Interface Dependencies ------------------------------------------------
  38.  
  39.  
  40. // Macro //
  41.  
  42. // Summary -----------------------------------------------------------------
  43. //
  44. //      Defines a value for the directory class.  We use the next available
  45. //      number after the class which sorts files by date.
  46. //
  47. // End ---------------------------------------------------------------------
  48.  
  49. #define    directoryClass           (filesBySizeClass+1)
  50.  
  51.  
  52. // Class //
  53.  
  54. class Directory:  public SortedArray
  55. {
  56. public:
  57.     virtual ~Directory() {}
  58.             enum sortOrder { byName, byDate, bySize };
  59.             Directory( char *, sortOrder );
  60.  
  61.     virtual classType       isA() { return directoryClass; }
  62.     virtual char           *nameOf() { return "Directory"; }
  63.     virtual hashValueType   hashValue() { return 0; }
  64.  
  65.     virtual void            printHeader( ostream& ) const;
  66.     virtual void            printSeparator( ostream& ) const;
  67.     virtual void            printTrailer( ostream& ) const;
  68.  
  69. private:
  70.     void                    addFile( ffblk&, sortOrder );
  71.     String                  mask;
  72. };
  73.  
  74. // Description -------------------------------------------------------------
  75. //
  76. //      Defines a directory class.  Class Directory is derived from the
  77. //      class SortedArray, which is part of the class library.
  78. //
  79. // Constructor
  80. //
  81. //      Directory
  82. //
  83. //      Constructs a directory object from the given name and sorting
  84. //      order.
  85. //
  86. // Destructor
  87. //
  88. //      ~Directory
  89. //
  90. // Public Members
  91. //
  92. //      sortOrder
  93. //
  94. //      Enumerated order for sorting directories.
  95. //
  96. //      isA
  97. //
  98. //      Returns the class type of Directory.
  99. //
  100. //      nameOf
  101. //
  102. //      Returns a pointer to the character string "Directory."
  103. //
  104. //      hashValue
  105. //
  106. //      Returns a pre-defined hash value for a directory object.
  107. //
  108. // Private Members
  109. //
  110. //      addFile
  111. //
  112. //      Adds a file to the directory structure.
  113. //
  114. // End ---------------------------------------------------------------------
  115.  
  116.  
  117. #endif    // __DIRECTRY_H
  118.