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.

76 lines
1.4 KiB

  1. #pragma once
  2. #include "Resource.h"
  3. #include <map>
  4. #ifndef StringVector
  5. #include <vector>
  6. typedef std::vector<_bstr_t> StringVector;
  7. #endif
  8. #include "Argument.h"
  9. #include "Switch.h"
  10. enum ETask
  11. {
  12. TASK_NONE,
  13. TASK_USER,
  14. TASK_GROUP,
  15. TASK_COMPUTER,
  16. TASK_SECURITY,
  17. TASK_SERVICE,
  18. TASK_REPORT,
  19. TASK_KEY,
  20. };
  21. //---------------------------------------------------------------------------
  22. // Parameter Map
  23. //---------------------------------------------------------------------------
  24. class CParameterMap :
  25. public std::map<int, _variant_t>
  26. {
  27. public:
  28. CParameterMap(CArguments& rArgs)
  29. {
  30. Initialize(rArgs);
  31. }
  32. bool IsExist(int nParam)
  33. {
  34. return (find(nParam) != end());
  35. }
  36. bool GetValue(int nParam, bool& bValue);
  37. bool GetValue(int nParam, long& lValue);
  38. bool GetValue(int nParam, _bstr_t& strValue);
  39. bool GetValues(int nParam, _variant_t& vntValues);
  40. bool GetValues(int nParam, StringVector& vecValues);
  41. protected:
  42. void Initialize(CArguments& rArgs);
  43. bool DoTask(LPCTSTR pszArg);
  44. void DoSwitches(CArguments& rArgs);
  45. void DoSwitch(int nSwitch, CArguments& rArgs);
  46. _variant_t& Insert(int nParam);
  47. void DoOptionFile(LPCTSTR pszFileName);
  48. FILE* OpenOptionFile(LPCTSTR pszFileName);
  49. int FindTask(FILE* fp);
  50. void DoTask(FILE* fp, CSwitchMap& mapSwitchs);
  51. void DoParameter(int nSwitch, LPCTSTR pszValue);
  52. void DoTaskKey(CArguments& rArgs);
  53. void VerifyIncludeExclude();
  54. protected:
  55. CSwitchMap m_mapSwitchs;
  56. };