Team Fortress 2 Source Code as on 22/4/2020
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.

70 lines
1.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. /**
  3. * Utility class for providing some basic capabilities for enumerating and specifying MOD
  4. * directories.
  5. *
  6. * \version 1.0
  7. *
  8. * \date 07-18-2006
  9. *
  10. * \author mdurand
  11. *
  12. * \todo
  13. *
  14. * \bug
  15. *
  16. */
  17. #ifndef MODCONFIGSHELPER_H
  18. #define MODCONFIGSHELPER_H
  19. #ifdef _WIN32
  20. #pragma once
  21. #endif
  22. #include "utlvector.h"
  23. #include "sdklauncher_main.h"
  24. class ModConfigsHelper
  25. {
  26. public:
  27. /**
  28. * Default constructor which automatically finds and sets the base directory for all MODs
  29. * and populates a vector of MOD directory names.
  30. */
  31. ModConfigsHelper();
  32. /**
  33. * Default destructor.
  34. */
  35. ~ModConfigsHelper();
  36. /**
  37. * Getter method that provides the parent directory for all MODs.
  38. * \return parent directory for all MODs
  39. */
  40. const char *getSourceModBaseDir();
  41. /**
  42. * Getter method that provides a vector of the names of each MOD found.
  43. * \return vector of the names of each MOD found
  44. */
  45. const CUtlVector<char *> &getModDirsVector();
  46. protected:
  47. /**
  48. * Determines and sets the base directory for all MODs
  49. */
  50. void setSourceModBaseDir();
  51. /**
  52. * Searches the parent MOD directory for child MODs and puts their names in the member vector
  53. */
  54. void EnumerateModDirs();
  55. private:
  56. // Member that holds the base directory of MODs
  57. char m_sourceModBaseDir[MAX_PATH];
  58. // Member that holds the child MOD names
  59. CUtlVector<char *> m_ModDirs;
  60. };
  61. #endif // MODCONFIGSHELPER_H