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.

437 lines
9.9 KiB

  1. /****************************************************************************
  2. Copyright information : Copyright (c) 1998-1999 Microsoft Corporation
  3. File Name : HelpInfo.cpp
  4. Project Name : WMI Command Line
  5. Author Name : C. V. Nandi
  6. Date of Creation (dd/mm/yy) : 29th-September-2000
  7. Version Number : 1.0
  8. Brief Description : The CHelpInfo class encapsulates the
  9. functionality needed for storing and retrieving
  10. help Flag for displaying help..
  11. Revision History :
  12. Last Modified By : Ch. Sriramachandramurthy
  13. Last Modified Date : 16th-January-2001
  14. ****************************************************************************/
  15. // HelpInfo.cpp : implementation file
  16. //
  17. #include "Precomp.h"
  18. #include "HelpInfo.h"
  19. /*------------------------------------------------------------------------
  20. Name :CHelpInfo
  21. Synopsis :This function initializes the member variables when
  22. an object of the class type is instantiated
  23. Type :Constructor
  24. Input parameter :None
  25. Output parameters :None
  26. Return Type :None
  27. Global Variables :None
  28. Calling Syntax :None
  29. Notes :None
  30. ------------------------------------------------------------------------*/
  31. CHelpInfo::CHelpInfo()
  32. {
  33. Initialize();
  34. }
  35. /*------------------------------------------------------------------------
  36. Name :~CHelpInfo
  37. Synopsis :This function uninitializes the member variables
  38. when an object of the class type goes out of scope.
  39. Type :Destructor
  40. Input parameter :None
  41. Output parameters :None
  42. Return Type :None
  43. Global Variables :None
  44. Calling Syntax :None
  45. Notes :None
  46. ------------------------------------------------------------------------*/
  47. CHelpInfo::~CHelpInfo()
  48. {
  49. }
  50. /*------------------------------------------------------------------------
  51. Name :Initialize
  52. Synopsis :This function initializes the member variables
  53. Type :Member function
  54. Input parameter :None
  55. Output parameters :None
  56. Return Type :None
  57. Global Variables :None
  58. Calling Syntax :Initialize()
  59. Notes :None
  60. ------------------------------------------------------------------------*/
  61. void CHelpInfo::Initialize()
  62. {
  63. m_bNameSpaceHelp = FALSE;
  64. m_bRoleHelp = FALSE;
  65. m_bNodeHelp = FALSE;
  66. m_bUserHelp = FALSE;
  67. m_bPasswordHelp = FALSE;
  68. m_bLocaleHelp = FALSE;
  69. m_bRecordPathHelp = FALSE;
  70. m_bPrivilegesHelp = FALSE;
  71. m_bLevelHelp = FALSE;
  72. m_bAuthLevelHelp = FALSE;
  73. m_bInteractiveHelp = FALSE;
  74. m_bTraceHelp = FALSE;
  75. m_bGlblAllInfoHelp = FALSE;
  76. m_bCmdAllInfoHelp = FALSE;
  77. m_bGetVerbHelp = FALSE;
  78. m_bSetVerbHelp = FALSE;
  79. m_bListVerbHelp = FALSE;
  80. m_bCallVerbHelp = FALSE;
  81. m_bDumpVerbHelp = FALSE;
  82. m_bAssocVerbHelp = FALSE;
  83. m_bCreateVerbHelp = FALSE;
  84. m_bDeleteVerbHelp = FALSE;
  85. m_bAliasVerbHelp = FALSE;
  86. m_bPATHHelp = FALSE;
  87. m_bWHEREHelp = FALSE;
  88. m_bCLASSHelp = FALSE;
  89. m_bEXITHelp = FALSE;
  90. m_bPWhereHelp = FALSE;
  91. m_bTRANSLATEHelp = FALSE;
  92. m_bEVERYHelp = FALSE;
  93. m_bFORMATHelp = FALSE;
  94. m_bVERBSWITCHESHelp = FALSE;
  95. m_bDESCRIPTIONHelp = FALSE;
  96. m_bGETSwitchesOnlyHelp = FALSE;
  97. m_bLISTSwitchesOnlyHelp = FALSE;
  98. m_bContextHelp = FALSE;
  99. m_bGlblSwitchValuesHelp = FALSE;
  100. m_bRESULTCLASSHelp = FALSE;
  101. m_bRESULTROLE = FALSE;
  102. m_bASSOCCLASS = FALSE;
  103. m_bASSOCSwitchesOnlyHelp = FALSE;
  104. m_bFAILFASTHelp = FALSE;
  105. m_bREPEATHelp = FALSE;
  106. m_bOUTPUTHelp = FALSE;
  107. m_bAPPENDHelp = FALSE;
  108. m_bAggregateHelp = FALSE;
  109. }
  110. /*------------------------------------------------------------------------
  111. Name :SetHelp
  112. Synopsis :This function sets a HelpFlag member variable
  113. specified by input arguments.
  114. Type :Member function
  115. Input parameter :
  116. htHelp :Help type
  117. bFlag :Flag value
  118. Output parameters :None
  119. Return Type :None
  120. Global Variables :None
  121. Calling Syntax :SetHelp(htHelp, bFlag )
  122. Notes :None
  123. ------------------------------------------------------------------------*/
  124. void CHelpInfo::SetHelp( HELPTYPE htHelp, BOOL bFlag )
  125. {
  126. switch ( htHelp )
  127. {
  128. case Namespace:
  129. m_bNameSpaceHelp = bFlag;
  130. break;
  131. case Role:
  132. m_bRoleHelp = bFlag;
  133. break;
  134. case Node:
  135. m_bNodeHelp = bFlag;
  136. break;
  137. case User:
  138. m_bUserHelp = bFlag;
  139. break;
  140. case Aggregate:
  141. m_bAggregateHelp = bFlag;
  142. break;
  143. case Password:
  144. m_bPasswordHelp = bFlag;
  145. break;
  146. case Locale:
  147. m_bLocaleHelp = bFlag;
  148. break;
  149. case RecordPath:
  150. m_bRecordPathHelp = bFlag;
  151. break;
  152. case Privileges:
  153. m_bPrivilegesHelp = bFlag;
  154. break;
  155. case Level:
  156. m_bLevelHelp = bFlag;
  157. break;
  158. case AuthLevel:
  159. m_bAuthLevelHelp = bFlag;
  160. break;
  161. case Interactive:
  162. m_bInteractiveHelp = bFlag;
  163. break;
  164. case Trace:
  165. m_bTraceHelp = bFlag;
  166. break;
  167. case GlblAllInfo:
  168. m_bGlblAllInfoHelp = bFlag;
  169. break;
  170. case CmdAllInfo:
  171. m_bCmdAllInfoHelp = bFlag;
  172. break;
  173. case GETVerb:
  174. m_bGetVerbHelp = bFlag;
  175. break;
  176. case SETVerb:
  177. m_bSetVerbHelp = bFlag;
  178. break;
  179. case LISTVerb:
  180. m_bListVerbHelp = bFlag;
  181. break;
  182. case CALLVerb:
  183. m_bCallVerbHelp = bFlag;
  184. break;
  185. case DUMPVerb:
  186. m_bDumpVerbHelp = bFlag;
  187. break;
  188. case ASSOCVerb:
  189. m_bAssocVerbHelp = bFlag;
  190. break;
  191. case DELETEVerb:
  192. m_bDeleteVerbHelp = bFlag;
  193. break;
  194. case CREATEVerb:
  195. m_bCreateVerbHelp = bFlag;
  196. break;
  197. case AliasVerb:
  198. m_bAliasVerbHelp = bFlag;
  199. break;
  200. case PATH:
  201. m_bPATHHelp = bFlag;
  202. break;
  203. case WHERE:
  204. m_bWHEREHelp = bFlag;
  205. break;
  206. case CLASS:
  207. m_bCLASSHelp = bFlag;
  208. break;
  209. case EXIT:
  210. m_bEXITHelp = bFlag;
  211. break;
  212. case PWhere:
  213. m_bPWhereHelp = bFlag;
  214. break;
  215. case TRANSLATE:
  216. m_bTRANSLATEHelp = bFlag;
  217. break;
  218. case EVERY:
  219. m_bEVERYHelp = bFlag;
  220. break;
  221. case FORMAT:
  222. m_bFORMATHelp = bFlag;
  223. break;
  224. case VERBSWITCHES:
  225. m_bVERBSWITCHESHelp = bFlag;
  226. break;
  227. case DESCRIPTION:
  228. m_bDESCRIPTIONHelp = bFlag;
  229. break;
  230. case GETSwitchesOnly:
  231. m_bGETSwitchesOnlyHelp = bFlag;
  232. break;
  233. case LISTSwitchesOnly:
  234. m_bLISTSwitchesOnlyHelp = bFlag;
  235. break;
  236. case CONTEXTHELP:
  237. m_bContextHelp = bFlag;
  238. break;
  239. case GLBLCONTEXT:
  240. m_bGlblSwitchValuesHelp = bFlag;
  241. break;
  242. case RESULTCLASShelp:
  243. m_bRESULTCLASSHelp = bFlag;
  244. break;
  245. case RESULTROLEhelp:
  246. m_bRESULTROLE = bFlag;
  247. break;
  248. case ASSOCCLASShelp:
  249. m_bASSOCCLASS = bFlag;
  250. break;
  251. case ASSOCSwitchesOnly:
  252. m_bASSOCSwitchesOnlyHelp = bFlag;
  253. break;
  254. case FAILFAST:
  255. m_bFAILFASTHelp = bFlag;
  256. break;
  257. case REPEAT:
  258. m_bREPEATHelp = bFlag;
  259. break;
  260. case OUTPUT:
  261. m_bOUTPUTHelp = bFlag;
  262. break;
  263. case APPEND:
  264. m_bAPPENDHelp = bFlag;
  265. break;
  266. }
  267. }
  268. /*------------------------------------------------------------------------
  269. Name :GetHelp
  270. Synopsis :his function returns a HelpFlag member variable
  271. specified by input argument
  272. Type :Member function
  273. Input parameter :
  274. htHelp :Help type
  275. Output parameters :None
  276. Return Type :Bool
  277. Global Variables :None
  278. Calling Syntax :GetHelp(htHelp)
  279. Calls :None
  280. Called by :CFormatEngine::DisplayGlobalSwitchesAndOtherDesc,
  281. CFormatEngine::DisplayAliasVerbDescriptions,
  282. CFormatEngine::DisplayStdVerbDescriptions,
  283. CFormatEngine::DisplayHelp,
  284. CFormatEngine::DisplayMethodDetails
  285. Notes :None
  286. ------------------------------------------------------------------------*/
  287. BOOL CHelpInfo::GetHelp(HELPTYPE htHelp)
  288. {
  289. BOOL bResult = FALSE;
  290. switch ( htHelp )
  291. {
  292. case Namespace:
  293. bResult = m_bNameSpaceHelp;
  294. break;
  295. case Role:
  296. bResult = m_bRoleHelp;
  297. break;
  298. case Node:
  299. bResult = m_bNodeHelp;
  300. break;
  301. case User:
  302. bResult = m_bUserHelp;
  303. break;
  304. case Aggregate:
  305. bResult = m_bAggregateHelp;
  306. break;
  307. case Password:
  308. bResult = m_bPasswordHelp;
  309. break;
  310. case Locale:
  311. bResult = m_bLocaleHelp;
  312. break;
  313. case RecordPath:
  314. bResult = m_bRecordPathHelp;
  315. break;
  316. case Privileges:
  317. bResult = m_bPrivilegesHelp;
  318. break;
  319. case Level:
  320. bResult = m_bLevelHelp;
  321. break;
  322. case AuthLevel:
  323. bResult = m_bAuthLevelHelp;
  324. break;
  325. case Interactive:
  326. bResult = m_bInteractiveHelp;
  327. break;
  328. case Trace:
  329. bResult = m_bTraceHelp;
  330. break;
  331. case GlblAllInfo:
  332. bResult = m_bGlblAllInfoHelp;
  333. break;
  334. case CmdAllInfo:
  335. bResult = m_bCmdAllInfoHelp;
  336. break;
  337. case GETVerb:
  338. bResult = m_bGetVerbHelp;
  339. break;
  340. case SETVerb:
  341. bResult = m_bSetVerbHelp;
  342. break;
  343. case LISTVerb:
  344. bResult = m_bListVerbHelp;
  345. break;
  346. case CALLVerb:
  347. bResult = m_bCallVerbHelp;
  348. break;
  349. case DELETEVerb:
  350. bResult = m_bDeleteVerbHelp;
  351. break;
  352. case CREATEVerb:
  353. bResult = m_bCreateVerbHelp;
  354. break;
  355. case DUMPVerb:
  356. bResult = m_bDumpVerbHelp;
  357. break;
  358. case ASSOCVerb:
  359. bResult = m_bAssocVerbHelp;
  360. break;
  361. case AliasVerb:
  362. bResult = m_bAliasVerbHelp;
  363. break;
  364. case PATH:
  365. bResult = m_bPATHHelp;
  366. break;
  367. case WHERE:
  368. bResult = m_bWHEREHelp;
  369. break;
  370. case CLASS:
  371. bResult = m_bCLASSHelp;
  372. break;
  373. case EXIT:
  374. bResult = m_bEXITHelp;
  375. break;
  376. case PWhere:
  377. bResult = m_bPWhereHelp;
  378. break;
  379. case TRANSLATE:
  380. bResult = m_bTRANSLATEHelp;
  381. break;
  382. case EVERY:
  383. bResult = m_bEVERYHelp;
  384. break;
  385. case FORMAT:
  386. bResult = m_bFORMATHelp;
  387. break;
  388. case VERBSWITCHES:
  389. bResult = m_bVERBSWITCHESHelp;
  390. break;
  391. case DESCRIPTION:
  392. bResult = m_bDESCRIPTIONHelp;
  393. break;
  394. case GETSwitchesOnly:
  395. bResult = m_bGETSwitchesOnlyHelp;
  396. break;
  397. case LISTSwitchesOnly:
  398. bResult = m_bLISTSwitchesOnlyHelp;
  399. break;
  400. case CONTEXTHELP:
  401. bResult = m_bContextHelp;
  402. break;
  403. case GLBLCONTEXT:
  404. bResult = m_bGlblSwitchValuesHelp;
  405. break;
  406. case RESULTCLASShelp:
  407. bResult = m_bRESULTCLASSHelp ;
  408. break;
  409. case RESULTROLEhelp:
  410. bResult = m_bRESULTROLE ;
  411. break;
  412. case ASSOCCLASShelp:
  413. bResult = m_bASSOCCLASS ;
  414. break;
  415. case ASSOCSwitchesOnly:
  416. bResult = m_bASSOCSwitchesOnlyHelp ;
  417. break;
  418. case FAILFAST:
  419. bResult = m_bFAILFASTHelp ;
  420. break;
  421. case REPEAT:
  422. bResult = m_bREPEATHelp ;
  423. break;
  424. case OUTPUT:
  425. bResult = m_bOUTPUTHelp ;
  426. break;
  427. case APPEND:
  428. bResult = m_bAPPENDHelp ;
  429. break;
  430. }
  431. return bResult;
  432. }