Leaked source code of windows server 2003
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.

444 lines
10 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_bAuthorityHelp = FALSE;
  76. m_bGlblAllInfoHelp = FALSE;
  77. m_bCmdAllInfoHelp = FALSE;
  78. m_bGetVerbHelp = FALSE;
  79. m_bSetVerbHelp = FALSE;
  80. m_bListVerbHelp = FALSE;
  81. m_bCallVerbHelp = FALSE;
  82. m_bDumpVerbHelp = FALSE;
  83. m_bAssocVerbHelp = FALSE;
  84. m_bCreateVerbHelp = FALSE;
  85. m_bDeleteVerbHelp = FALSE;
  86. m_bAliasVerbHelp = FALSE;
  87. m_bPATHHelp = FALSE;
  88. m_bWHEREHelp = FALSE;
  89. m_bCLASSHelp = FALSE;
  90. m_bEXITHelp = FALSE;
  91. m_bPWhereHelp = FALSE;
  92. m_bTRANSLATEHelp = FALSE;
  93. m_bEVERYHelp = FALSE;
  94. m_bFORMATHelp = FALSE;
  95. m_bVERBSWITCHESHelp = FALSE;
  96. m_bDESCRIPTIONHelp = FALSE;
  97. m_bGETSwitchesOnlyHelp = FALSE;
  98. m_bLISTSwitchesOnlyHelp = FALSE;
  99. m_bContextHelp = FALSE;
  100. m_bGlblSwitchValuesHelp = FALSE;
  101. m_bRESULTCLASSHelp = FALSE;
  102. m_bRESULTROLE = FALSE;
  103. m_bASSOCCLASS = FALSE;
  104. m_bASSOCSwitchesOnlyHelp = FALSE;
  105. m_bFAILFASTHelp = FALSE;
  106. m_bREPEATHelp = FALSE;
  107. m_bOUTPUTHelp = FALSE;
  108. m_bAPPENDHelp = FALSE;
  109. m_bAggregateHelp = FALSE;
  110. }
  111. /*------------------------------------------------------------------------
  112. Name :SetHelp
  113. Synopsis :This function sets a HelpFlag member variable
  114. specified by input arguments.
  115. Type :Member function
  116. Input parameter :
  117. htHelp :Help type
  118. bFlag :Flag value
  119. Output parameters :None
  120. Return Type :None
  121. Global Variables :None
  122. Calling Syntax :SetHelp(htHelp, bFlag )
  123. Notes :None
  124. ------------------------------------------------------------------------*/
  125. void CHelpInfo::SetHelp( HELPTYPE htHelp, BOOL bFlag )
  126. {
  127. switch ( htHelp )
  128. {
  129. case Namespace:
  130. m_bNameSpaceHelp = bFlag;
  131. break;
  132. case Role:
  133. m_bRoleHelp = bFlag;
  134. break;
  135. case Node:
  136. m_bNodeHelp = bFlag;
  137. break;
  138. case User:
  139. m_bUserHelp = bFlag;
  140. break;
  141. case Aggregate:
  142. m_bAggregateHelp = bFlag;
  143. break;
  144. case Password:
  145. m_bPasswordHelp = bFlag;
  146. break;
  147. case Locale:
  148. m_bLocaleHelp = bFlag;
  149. break;
  150. case RecordPath:
  151. m_bRecordPathHelp = bFlag;
  152. break;
  153. case Privileges:
  154. m_bPrivilegesHelp = bFlag;
  155. break;
  156. case Level:
  157. m_bLevelHelp = bFlag;
  158. break;
  159. case AuthLevel:
  160. m_bAuthLevelHelp = bFlag;
  161. break;
  162. case Interactive:
  163. m_bInteractiveHelp = bFlag;
  164. break;
  165. case Trace:
  166. m_bTraceHelp = bFlag;
  167. break;
  168. case Authority:
  169. m_bAuthorityHelp = bFlag;
  170. break;
  171. case GlblAllInfo:
  172. m_bGlblAllInfoHelp = bFlag;
  173. break;
  174. case CmdAllInfo:
  175. m_bCmdAllInfoHelp = bFlag;
  176. break;
  177. case GETVerb:
  178. m_bGetVerbHelp = bFlag;
  179. break;
  180. case SETVerb:
  181. m_bSetVerbHelp = bFlag;
  182. break;
  183. case LISTVerb:
  184. m_bListVerbHelp = bFlag;
  185. break;
  186. case CALLVerb:
  187. m_bCallVerbHelp = bFlag;
  188. break;
  189. case DUMPVerb:
  190. m_bDumpVerbHelp = bFlag;
  191. break;
  192. case ASSOCVerb:
  193. m_bAssocVerbHelp = bFlag;
  194. break;
  195. case DELETEVerb:
  196. m_bDeleteVerbHelp = bFlag;
  197. break;
  198. case CREATEVerb:
  199. m_bCreateVerbHelp = bFlag;
  200. break;
  201. case AliasVerb:
  202. m_bAliasVerbHelp = bFlag;
  203. break;
  204. case PATH:
  205. m_bPATHHelp = bFlag;
  206. break;
  207. case WHERE:
  208. m_bWHEREHelp = bFlag;
  209. break;
  210. case CLASS:
  211. m_bCLASSHelp = bFlag;
  212. break;
  213. case EXIT:
  214. m_bEXITHelp = bFlag;
  215. break;
  216. case PWhere:
  217. m_bPWhereHelp = bFlag;
  218. break;
  219. case TRANSLATE:
  220. m_bTRANSLATEHelp = bFlag;
  221. break;
  222. case EVERY:
  223. m_bEVERYHelp = bFlag;
  224. break;
  225. case FORMAT:
  226. m_bFORMATHelp = bFlag;
  227. break;
  228. case VERBSWITCHES:
  229. m_bVERBSWITCHESHelp = bFlag;
  230. break;
  231. case DESCRIPTION:
  232. m_bDESCRIPTIONHelp = bFlag;
  233. break;
  234. case GETSwitchesOnly:
  235. m_bGETSwitchesOnlyHelp = bFlag;
  236. break;
  237. case LISTSwitchesOnly:
  238. m_bLISTSwitchesOnlyHelp = bFlag;
  239. break;
  240. case CONTEXTHELP:
  241. m_bContextHelp = bFlag;
  242. break;
  243. case GLBLCONTEXT:
  244. m_bGlblSwitchValuesHelp = bFlag;
  245. break;
  246. case RESULTCLASShelp:
  247. m_bRESULTCLASSHelp = bFlag;
  248. break;
  249. case RESULTROLEhelp:
  250. m_bRESULTROLE = bFlag;
  251. break;
  252. case ASSOCCLASShelp:
  253. m_bASSOCCLASS = bFlag;
  254. break;
  255. case ASSOCSwitchesOnly:
  256. m_bASSOCSwitchesOnlyHelp = bFlag;
  257. break;
  258. case FAILFAST:
  259. m_bFAILFASTHelp = bFlag;
  260. break;
  261. case REPEAT:
  262. m_bREPEATHelp = bFlag;
  263. break;
  264. case OUTPUT:
  265. m_bOUTPUTHelp = bFlag;
  266. break;
  267. case APPEND:
  268. m_bAPPENDHelp = bFlag;
  269. break;
  270. }
  271. }
  272. /*------------------------------------------------------------------------
  273. Name :GetHelp
  274. Synopsis :his function returns a HelpFlag member variable
  275. specified by input argument
  276. Type :Member function
  277. Input parameter :
  278. htHelp :Help type
  279. Output parameters :None
  280. Return Type :Bool
  281. Global Variables :None
  282. Calling Syntax :GetHelp(htHelp)
  283. Calls :None
  284. Called by :CFormatEngine::DisplayGlobalSwitchesAndOtherDesc,
  285. CFormatEngine::DisplayAliasVerbDescriptions,
  286. CFormatEngine::DisplayStdVerbDescriptions,
  287. CFormatEngine::DisplayHelp,
  288. CFormatEngine::DisplayMethodDetails
  289. Notes :None
  290. ------------------------------------------------------------------------*/
  291. BOOL CHelpInfo::GetHelp(HELPTYPE htHelp)
  292. {
  293. BOOL bResult = FALSE;
  294. switch ( htHelp )
  295. {
  296. case Namespace:
  297. bResult = m_bNameSpaceHelp;
  298. break;
  299. case Role:
  300. bResult = m_bRoleHelp;
  301. break;
  302. case Node:
  303. bResult = m_bNodeHelp;
  304. break;
  305. case User:
  306. bResult = m_bUserHelp;
  307. break;
  308. case Aggregate:
  309. bResult = m_bAggregateHelp;
  310. break;
  311. case Password:
  312. bResult = m_bPasswordHelp;
  313. break;
  314. case Locale:
  315. bResult = m_bLocaleHelp;
  316. break;
  317. case RecordPath:
  318. bResult = m_bRecordPathHelp;
  319. break;
  320. case Privileges:
  321. bResult = m_bPrivilegesHelp;
  322. break;
  323. case Level:
  324. bResult = m_bLevelHelp;
  325. break;
  326. case AuthLevel:
  327. bResult = m_bAuthLevelHelp;
  328. break;
  329. case Interactive:
  330. bResult = m_bInteractiveHelp;
  331. break;
  332. case Trace:
  333. bResult = m_bTraceHelp;
  334. break;
  335. case Authority:
  336. bResult = m_bAuthorityHelp;
  337. break;
  338. case GlblAllInfo:
  339. bResult = m_bGlblAllInfoHelp;
  340. break;
  341. case CmdAllInfo:
  342. bResult = m_bCmdAllInfoHelp;
  343. break;
  344. case GETVerb:
  345. bResult = m_bGetVerbHelp;
  346. break;
  347. case SETVerb:
  348. bResult = m_bSetVerbHelp;
  349. break;
  350. case LISTVerb:
  351. bResult = m_bListVerbHelp;
  352. break;
  353. case CALLVerb:
  354. bResult = m_bCallVerbHelp;
  355. break;
  356. case DELETEVerb:
  357. bResult = m_bDeleteVerbHelp;
  358. break;
  359. case CREATEVerb:
  360. bResult = m_bCreateVerbHelp;
  361. break;
  362. case DUMPVerb:
  363. bResult = m_bDumpVerbHelp;
  364. break;
  365. case ASSOCVerb:
  366. bResult = m_bAssocVerbHelp;
  367. break;
  368. case AliasVerb:
  369. bResult = m_bAliasVerbHelp;
  370. break;
  371. case PATH:
  372. bResult = m_bPATHHelp;
  373. break;
  374. case WHERE:
  375. bResult = m_bWHEREHelp;
  376. break;
  377. case CLASS:
  378. bResult = m_bCLASSHelp;
  379. break;
  380. case EXIT:
  381. bResult = m_bEXITHelp;
  382. break;
  383. case PWhere:
  384. bResult = m_bPWhereHelp;
  385. break;
  386. case TRANSLATE:
  387. bResult = m_bTRANSLATEHelp;
  388. break;
  389. case EVERY:
  390. bResult = m_bEVERYHelp;
  391. break;
  392. case FORMAT:
  393. bResult = m_bFORMATHelp;
  394. break;
  395. case VERBSWITCHES:
  396. bResult = m_bVERBSWITCHESHelp;
  397. break;
  398. case DESCRIPTION:
  399. bResult = m_bDESCRIPTIONHelp;
  400. break;
  401. case GETSwitchesOnly:
  402. bResult = m_bGETSwitchesOnlyHelp;
  403. break;
  404. case LISTSwitchesOnly:
  405. bResult = m_bLISTSwitchesOnlyHelp;
  406. break;
  407. case CONTEXTHELP:
  408. bResult = m_bContextHelp;
  409. break;
  410. case GLBLCONTEXT:
  411. bResult = m_bGlblSwitchValuesHelp;
  412. break;
  413. case RESULTCLASShelp:
  414. bResult = m_bRESULTCLASSHelp ;
  415. break;
  416. case RESULTROLEhelp:
  417. bResult = m_bRESULTROLE ;
  418. break;
  419. case ASSOCCLASShelp:
  420. bResult = m_bASSOCCLASS ;
  421. break;
  422. case ASSOCSwitchesOnly:
  423. bResult = m_bASSOCSwitchesOnlyHelp ;
  424. break;
  425. case FAILFAST:
  426. bResult = m_bFAILFASTHelp ;
  427. break;
  428. case REPEAT:
  429. bResult = m_bREPEATHelp ;
  430. break;
  431. case OUTPUT:
  432. bResult = m_bOUTPUTHelp ;
  433. break;
  434. case APPEND:
  435. bResult = m_bAPPENDHelp ;
  436. break;
  437. }
  438. return bResult;
  439. }