home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 27 / IOPROG_27.ISO / SOFT / COMPOUND.ZIP / CScanDir.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-11-09  |  2.4 KB  |  117 lines

  1. #if !defined(AFX_CSCANDIR_H__854FFFA1_77EE_11D2_9F15_00A0246D0F63__INCLUDED_)
  2. #define AFX_CSCANDIR_H__854FFFA1_77EE_11D2_9F15_00A0246D0F63__INCLUDED_
  3.  
  4. #if _MSC_VER >= 1000
  5. #pragma once
  6. #endif // _MSC_VER >= 1000
  7. //
  8. //    CScanDir.h
  9. //+
  10. //    header file
  11. //-
  12. //    rev 11/09/98 gls
  13. //
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CScanDir window
  17.  
  18. class CScanDir : public CObject
  19. {
  20.     CStringArray    m_rgsFile;        // local list management
  21.     CStringArray    m_rgsDir;
  22.  
  23.  
  24. // Construction
  25. public:
  26.     CScanDir();
  27.  
  28. // Attributes
  29. public:
  30.  
  31.     int    Zprintf( const char *format, ... ) { return(0); }
  32.  
  33.     int        getFileCount( void )
  34.         {
  35.         return( m_rgsFile.GetSize() );
  36.         }
  37.  
  38.     BOOL    GetFile( CString &sFile, int iFile )
  39.         {
  40.             sFile = "";
  41.  
  42.             if( (0 <= iFile) && (iFile < m_rgsFile.GetSize()) )
  43.                 {
  44.                 sFile = m_rgsFile[iFile];
  45.                 }
  46.             return( sFile != "" ? TRUE : FALSE );
  47.         }
  48.  
  49.  
  50.     int        getDirCount( void )
  51.         {
  52.         return( m_rgsDir.GetSize() );
  53.         }
  54.  
  55.     BOOL    GetDir( CString &sDir, int iDir )
  56.         {
  57.             sDir = "";
  58.  
  59.             if( (0 <= iDir) && (iDir < m_rgsDir.GetSize()) )
  60.                 {
  61.                 sDir = m_rgsDir[iDir];
  62.                 }
  63.             return( sDir != "" ? TRUE : FALSE );
  64.         }
  65.  
  66.  
  67.  
  68. // Operations
  69. public:
  70.  
  71. // Overrides
  72.     // ClassWizard generated virtual function overrides
  73.     //{{AFX_VIRTUAL(CScanDir)
  74.     //}}AFX_VIRTUAL
  75.  
  76.     virtual    BOOL    OnEnumDir( LPCSTR pszDir )
  77.         {
  78. //        printf( "OnEnumDir( %s )\n", pszDir );
  79.  
  80.         return( TRUE );
  81.         }
  82.     
  83.     virtual    BOOL    OnEnumFile( LPCSTR pszFile )
  84.         {
  85. //        printf( "OnEnumFile( %s )\n", pszFile );
  86.  
  87.         return( TRUE );
  88.         }
  89.  
  90.  
  91.     virtual    BOOL    Scan( LPCSTR pszFileSpec );
  92.     virtual    BOOL    ScanEnum( LPCSTR pszFileSpec,
  93.                 BOOL (*pFunc)( void *pContext, CFileFind *pFind ) = NULL,
  94.                 void *pContextCallback = NULL );
  95.  
  96. // Implementation
  97. public:
  98.     virtual ~CScanDir();
  99.  
  100.     // Generated message map functions
  101. protected:
  102.     //{{AFX_MSG(CScanDir)
  103.         // NOTE - the ClassWizard will add and remove member functions here.
  104.     //}}AFX_MSG
  105. };
  106.  
  107. /////////////////////////////////////////////////////////////////////////////
  108.  
  109. //{{AFX_INSERT_LOCATION}}
  110. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  111.  
  112. #endif // !defined(AFX_CSCANDIR_H__854FFFA1_77EE_11D2_9F15_00A0246D0F63__INCLUDED_)
  113.  
  114. // ////////////////////////////////////////////////////////////
  115. // ////////////////////////////////////////////////////////////
  116. // ////////////////////////////////////////////////////////////
  117.