Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.5 KiB

  1. /*******************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORPORATION, 1998, 1999, 2000, 1999, 2000
  4. *
  5. * TITLE: FINDIMGS.H
  6. *
  7. * VERSION: 1.0
  8. *
  9. * AUTHOR: ShaunIv
  10. *
  11. * DATE: 1/13/1999
  12. *
  13. * DESCRIPTION: Specialization of CFindFiles class that looks for image files and
  14. * stores them in a dynamic array which is shuffled on initialization
  15. *
  16. *******************************************************************************/
  17. #ifndef __FINDIMGS_H_INCLUDED
  18. #define __FINDIMGS_H_INCLUDED
  19. #include <windows.h>
  20. #include "findfile.h"
  21. #include "randgen.h"
  22. #include "simarray.h"
  23. class CFindImageFiles
  24. {
  25. private:
  26. CSimpleDynamicArray<CSimpleString> m_ImageFiles;
  27. CRandomNumberGen m_RandomNumberGen;
  28. int m_nCurrentFile;
  29. private:
  30. CFindImageFiles( const CFindImageFiles & );
  31. CFindImageFiles &operator=( const CFindImageFiles & );
  32. public:
  33. CFindImageFiles(void);
  34. virtual ~CFindImageFiles(void);
  35. bool NextFile( CSimpleString &strFilename );
  36. bool PreviousFile( CSimpleString &strFilename );
  37. void Shuffle(void);
  38. bool FoundFile( LPCTSTR pszFilename )
  39. {
  40. if (pszFilename)
  41. m_ImageFiles.Append(pszFilename);
  42. return true;
  43. }
  44. void Reset(void)
  45. {
  46. m_nCurrentFile = 0;
  47. }
  48. int Count(void) const
  49. {
  50. return(m_ImageFiles.Size());
  51. }
  52. CSimpleString operator[](int nIndex)
  53. {
  54. return(m_ImageFiles[nIndex]);
  55. }
  56. };
  57. #endif