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.

845 lines
31 KiB

  1. //////////////////////////////////////////////////////////////////
  2. // RaidDataStructs.h: interface for the CRaidDataStructs class.
  3. //
  4. //////////////////////////////////////////////////////////////////
  5. #if !defined(AFX_RAIDDATASTRUCTS_H__5FD93F0B_81D9_11D2_8162_00C04F68FDA4__INCLUDED_)
  6. #define AFX_RAIDDATASTRUCTS_H__5FD93F0B_81D9_11D2_8162_00C04F68FDA4__INCLUDED_
  7. #include "XMLBase.h"
  8. #include "XmlTagInformation.h"
  9. #if _MSC_VER > 1000
  10. #pragma once
  11. #endif // _MSC_VER > 1000
  12. //////////////////////////////////////////////////////////////////
  13. const LPCTSTR STR_RAID_BUGREPORT = _T("BUGREPORT");
  14. const LPCTSTR STR_RAIDFILE_BUG_STATUS = _T("BUG_STATUS");
  15. const LPCTSTR STR_RAIDFILE_ACCESSIBILITY = _T("Accessibility");
  16. const LPCTSTR STR_RAIDFILE_ASSIGNEDTO = _T("AssignedTo");
  17. const LPCTSTR STR_RAIDFILE_BY = _T("BY");
  18. const LPCTSTR STR_RAIDFILE_ISSUETYPE = _T("IssueType");
  19. const LPCTSTR STR_RAIDFILE_SEVERITY = _T("Severity");
  20. const LPCTSTR STR_RAIDFILE_BUG_OPENED = _T("BUG_OPENED");
  21. const LPCTSTR STR_RAIDFILE_OPENEDBY = _T("OpenedBy");
  22. const LPCTSTR STR_RAIDFILE_SOURCE = _T("Source");
  23. const LPCTSTR STR_RAIDFILE_BETAID = _T("BetaID");
  24. const LPCTSTR STR_RAIDFILE_REVISION = _T("FixedRev");
  25. const LPCTSTR STR_RAIDFILE_SOURCEID = _T("SourceID");
  26. const LPCTSTR STR_RAIDFILE_HOWFOUND = _T("HowFound");
  27. const LPCTSTR STR_RAIDFILE_LANGUAGE = _T("Lang");
  28. const LPCTSTR STR_RAIDFILE_BUG_DESCRIPTION = _T("BUG_DESCRIPTION");
  29. const LPCTSTR STR_RAIDFILE_DESCRIPTION = _T("Description");
  30. const LPCTSTR STR_RAIDFILE_BUG_GENERAL = _T("BUG_GENERAL");
  31. const LPCTSTR STR_RAIDFILE_TITLE = _T("Title ");
  32. const LPCTSTR STR_RAIDFILE_ENVIRONMENT = _T("Environment");
  33. const LPCTSTR STR_RAIDFILE_ACTION = _T("Action");
  34. const LPCTSTR STR_RAIDFILE_ACTION_ADD = _T("Add");
  35. const LPCTSTR STR_RAIDFILE_ACTION_CHANGE = _T("Change");
  36. const LPCTSTR STR_RAIDFILE_ACTION_ATTACH = _T("Attach");
  37. //////////////////////////////////////////////////////////////////
  38. typedef class CRaidFileFields
  39. {
  40. public:
  41. static LPCTSTR GetBugReportFileField() { return STR_RAID_BUGREPORT ; }
  42. static LPCTSTR GetBugStatusFileField() { return STR_RAIDFILE_BUG_STATUS ; }
  43. static LPCTSTR GetAccessibilityFileField() { return STR_RAIDFILE_ACCESSIBILITY ; }
  44. static LPCTSTR GetAssignedtoFileField() { return STR_RAIDFILE_ASSIGNEDTO ; }
  45. static LPCTSTR GetByFileField() { return STR_RAIDFILE_BY ; }
  46. static LPCTSTR GetIssuetypeFileField() { return STR_RAIDFILE_ISSUETYPE ; }
  47. static LPCTSTR GetSeverityFileField() { return STR_RAIDFILE_SEVERITY ; }
  48. static LPCTSTR GetBugOpenedFileField() { return STR_RAIDFILE_BUG_OPENED ; }
  49. static LPCTSTR GetOpenedbyFileField() { return STR_RAIDFILE_OPENEDBY ; }
  50. static LPCTSTR GetSourceFileField() { return STR_RAIDFILE_SOURCE ; }
  51. static LPCTSTR GetBetaidFileField() { return STR_RAIDFILE_BETAID ; }
  52. static LPCTSTR GetRevisionFileField() { return STR_RAIDFILE_REVISION ; }
  53. static LPCTSTR GetSourceIDFileField() { return STR_RAIDFILE_SOURCEID ; }
  54. static LPCTSTR GetHowfoundFileField() { return STR_RAIDFILE_HOWFOUND ; }
  55. static LPCTSTR GetLanguageFileField() { return STR_RAIDFILE_LANGUAGE ; }
  56. static LPCTSTR GetBugDescriptionFileField() { return STR_RAIDFILE_BUG_DESCRIPTION; }
  57. static LPCTSTR GetDescriptionFileField() { return STR_RAIDFILE_DESCRIPTION ; }
  58. static LPCTSTR GetBugGeneralFileField() { return STR_RAIDFILE_BUG_GENERAL ; }
  59. static LPCTSTR GetTitleFileField() { return STR_RAIDFILE_TITLE ; }
  60. static LPCTSTR GetEnvironmentFileField() { return STR_RAIDFILE_ENVIRONMENT ; }
  61. static LPCTSTR GetActionFileField() { return STR_RAIDFILE_ACTION ; }
  62. static LPCTSTR GetAddFileField() { return STR_RAIDFILE_ACTION_ADD ; }
  63. static LPCTSTR GetChangeFileField() { return STR_RAIDFILE_ACTION_CHANGE; }
  64. static LPCTSTR GetAttachFileField() { return STR_RAIDFILE_ACTION_ATTACH; }
  65. } CRAIDFILEFIELDS, FAR* LPCRAIDFILEFIELDS;
  66. typedef CRAIDFILEFIELDS RFF;
  67. //////////////////////////////////////////////////////////////////
  68. const LPCTSTR STR_RAIDTAG_BUGREPORT = _T("BUGREPORT");
  69. const LPCTSTR STR_RAIDTAG_BUG_STATUS = _T("BUG_STATUS");
  70. const LPCTSTR STR_RAIDTAG_ACCESSIBILITY = _T("ACCESSIBILITY");
  71. const LPCTSTR STR_RAIDTAG_ASSIGNEDTO = _T("ASSIGNEDTO");
  72. const LPCTSTR STR_RAIDTAG_BY = _T("BY");
  73. const LPCTSTR STR_RAIDTAG_ISSUETYPE = _T("ISSUETYPE");
  74. const LPCTSTR STR_RAIDTAG_SEVERITY = _T("SEVERITY");
  75. const LPCTSTR STR_RAIDTAG_BUG_OPENED = _T("BUG_OPENED");
  76. const LPCTSTR STR_RAIDTAG_OPENEDBY = _T("OPENEDBY");
  77. const LPCTSTR STR_RAIDTAG_SOURCE = _T("SOURCE");
  78. const LPCTSTR STR_RAIDTAG_BETAID = _T("BETAID");
  79. const LPCTSTR STR_RAIDTAG_REVISION = _T("REVISION");
  80. const LPCTSTR STR_RAIDTAG_SOURCEID = _T("SOURCEID");
  81. const LPCTSTR STR_RAIDTAG_HOWFOUND = _T("HOWFOUND");
  82. const LPCTSTR STR_RAIDTAG_LANGUAGE = _T("LANGUAGE");
  83. const LPCTSTR STR_RAIDTAG_BUG_DESCRIPTION = _T("BUG_DESCRIPTION");
  84. const LPCTSTR STR_RAIDTAG_DESCRIPTION = _T("DESCRIPTION");
  85. const LPCTSTR STR_RAIDTAG_BUG_GENERAL = _T("BUG_GENERAL");
  86. const LPCTSTR STR_RAIDTAG_TITLE = _T("TITLE ");
  87. const LPCTSTR STR_RAIDTAG_ENVIRONMENT = _T("ENVIRONMENT");
  88. const LPCTSTR STR_RAIDTAG_FILENAME = _T("FILENAME");
  89. //////////////////////////////////////////////////////////////////
  90. typedef class CRaidXMLTags
  91. {
  92. public:
  93. static LPCTSTR GetBugReportXMLTag() { return STR_RAIDTAG_BUGREPORT ; }
  94. static LPCTSTR GetBugStatusXMLTag() { return STR_RAIDTAG_BUG_STATUS ; }
  95. static LPCTSTR GetAccessibilityXMLTag() { return STR_RAIDTAG_ACCESSIBILITY; }
  96. static LPCTSTR GetAssignedtoXMLTag() { return STR_RAIDTAG_ASSIGNEDTO ; }
  97. static LPCTSTR GetByXMLTag() { return STR_RAIDTAG_BY ; }
  98. static LPCTSTR GetIssuetypeXMLTag() { return STR_RAIDTAG_ISSUETYPE ; }
  99. static LPCTSTR GetSeverityXMLTag() { return STR_RAIDTAG_SEVERITY ; }
  100. static LPCTSTR GetBugOpenedXMLTag() { return STR_RAIDTAG_BUG_OPENED ; }
  101. static LPCTSTR GetOpenedbyXMLTag() { return STR_RAIDTAG_OPENEDBY ; }
  102. static LPCTSTR GetSourceXMLTag() { return STR_RAIDTAG_SOURCE ; }
  103. static LPCTSTR GetBetaidXMLTag() { return STR_RAIDTAG_BETAID ; }
  104. static LPCTSTR GetRevisionXMLTag() { return STR_RAIDTAG_REVISION ; }
  105. static LPCTSTR GetSourceIDXMLTag() { return STR_RAIDTAG_SOURCEID ; }
  106. static LPCTSTR GetHowfoundXMLTag() { return STR_RAIDTAG_HOWFOUND ; }
  107. static LPCTSTR GetLanguageXMLTag() { return STR_RAIDTAG_LANGUAGE ; }
  108. static LPCTSTR GetBugDescriptionXMLTag() { return STR_RAIDTAG_BUG_DESCRIPTION; }
  109. static LPCTSTR GetDescriptionXMLTag() { return STR_RAIDTAG_DESCRIPTION ; }
  110. static LPCTSTR GetBugGeneralXMLTag() { return STR_RAIDTAG_BUG_GENERAL; }
  111. static LPCTSTR GetTitleXMLTag() { return STR_RAIDTAG_TITLE ; }
  112. static LPCTSTR GetEnvironmentXMLTag() { return STR_RAIDTAG_ENVIRONMENT; }
  113. static LPCTSTR GetFilenameXMLTag() { return STR_RAIDTAG_FILENAME ; }
  114. } CRAIDXMLTAGS, FAR* LPCRAIDXMLTAGS;
  115. typedef CRAIDXMLTAGS BXT;
  116. //////////////////////////////////////////////////////////////////
  117. //////////////////////////////////////////////////////////////////
  118. typedef class CRaidFileBase
  119. {
  120. public:
  121. // INLINE
  122. CRaidFileBase()
  123. {
  124. }
  125. // INLINE
  126. virtual ~CRaidFileBase()
  127. {
  128. }
  129. CLString GetLine(CLString strFieldName, CLString strValue)
  130. {
  131. CLString strLine;
  132. ASSERT(!strFieldName.IsEmpty());
  133. if(!strFieldName.IsEmpty() && !strValue.IsEmpty())
  134. {
  135. strLine.Format(_T("%s=%s\n"), strFieldName, strValue);
  136. }
  137. return strLine;
  138. }
  139. CLString GetQuotedLine(CLString strFieldName, CLString strValue)
  140. {
  141. CLString strLine;
  142. ASSERT(!strFieldName.IsEmpty());
  143. if(!strFieldName.IsEmpty() && !strValue.IsEmpty())
  144. {
  145. strLine.Format(_T("%s='%s'\n"), strFieldName, strValue);
  146. }
  147. return strLine;
  148. }
  149. public:
  150. } CRAIDFILEBASE, FAR* LPCRAIDFILEBASE;
  151. //////////////////////////////////////////////////////////////////
  152. //////////////////////////////////////////////////////////////////
  153. typedef class CRaidReportBase
  154. {
  155. public:
  156. //////////////////////////////////////////////
  157. //Inline
  158. CRaidReportBase() : m_bInitialized(false), m_bEnabled(true)
  159. {
  160. }
  161. //////////////////////////////////////////////
  162. //Inline
  163. virtual ~CRaidReportBase()
  164. {
  165. }
  166. //////////////////////////////////////////////
  167. //Inline
  168. bool IsInitialized()
  169. {
  170. return m_bInitialized;
  171. }
  172. //////////////////////////////////////////////
  173. //Inline
  174. void SetInitialized(bool bInitialized)
  175. {
  176. m_bInitialized = bInitialized;
  177. }
  178. //////////////////////////////////////////////
  179. // Pure virtual function.
  180. virtual CLString& GetDataString() = 0;
  181. //////////////////////////////////////////////
  182. // Pure virtual function.
  183. virtual CLString& GetFileString() = 0;
  184. //////////////////////////////////////////////
  185. // data members
  186. public:
  187. CLString m_strData;
  188. bool m_bInitialized;
  189. bool m_bEnabled;
  190. } CRAIDREPORTBASE, FAR* LPCRAIDREPORTBASE;
  191. //////////////////////////////////////////////////////////////////
  192. //////////////////////////////////////////////////////////////////
  193. typedef class CRaidReportStatus : public CRaidReportBase
  194. {
  195. public:
  196. //////////////////////////////////////////////
  197. //Inline
  198. CRaidReportStatus()
  199. {
  200. }
  201. //////////////////////////////////////////////
  202. //Inline
  203. virtual ~CRaidReportStatus()
  204. {
  205. }
  206. //////////////////////////////////////////////
  207. //Inline
  208. virtual void Clone(CRaidReportStatus& refLeftValue)
  209. {
  210. refLeftValue.m_strAccessibility = m_strAccessibility;
  211. refLeftValue.m_strAssignedTo = m_strAssignedTo ;
  212. refLeftValue.m_strBy = m_strBy ;
  213. refLeftValue.m_strIssueType = m_strIssueType ;
  214. refLeftValue.m_strSeverity = m_strSeverity ;
  215. refLeftValue.m_strData = m_strData;
  216. }
  217. //////////////////////////////////////////////
  218. // data members
  219. public:
  220. CLString m_strAccessibility;
  221. CLString m_strAssignedTo;
  222. CLString m_strBy;
  223. CLString m_strIssueType;
  224. CLString m_strSeverity;
  225. } CRAIDREPORTSTATUS, FAR* LPCRAIDREPORTSTATUS;
  226. //////////////////////////////////////////////////////////////////
  227. //////////////////////////////////////////////////////////////////
  228. typedef class CRaidReportOpened : public CRaidReportBase
  229. {
  230. public:
  231. //////////////////////////////////////////////
  232. //Inline
  233. CRaidReportOpened()
  234. {
  235. }
  236. //////////////////////////////////////////////
  237. //Inline
  238. virtual ~CRaidReportOpened()
  239. {
  240. }
  241. //////////////////////////////////////////////
  242. //Inline
  243. virtual void Clone(CRaidReportOpened& refLeftValue)
  244. {
  245. refLeftValue.m_strOpenedBy = m_strOpenedBy;
  246. refLeftValue.m_strSource = m_strSource ;
  247. refLeftValue.m_strBetaID = m_strBetaID ;
  248. refLeftValue.m_strRevision = m_strRevision;
  249. refLeftValue.m_strSourceID = m_strSourceID;
  250. refLeftValue.m_strHowFound = m_strHowFound;
  251. refLeftValue.m_strLanguage = m_strLanguage;
  252. refLeftValue.m_strData = m_strData;
  253. }
  254. //////////////////////////////////////////////
  255. // data members
  256. public:
  257. CLString m_strOpenedBy;
  258. CLString m_strSource;
  259. CLString m_strBetaID;
  260. CLString m_strRevision;
  261. CLString m_strSourceID;
  262. CLString m_strHowFound;
  263. CLString m_strLanguage;
  264. } CRAIDREPORTOPENED, FAR* LPCRAIDREPORTOPENED;
  265. //////////////////////////////////////////////////////////////////
  266. //////////////////////////////////////////////////////////////////
  267. typedef class CRaidReportDescription : public CRaidReportBase
  268. {
  269. public:
  270. //////////////////////////////////////////////
  271. //Inline
  272. CRaidReportDescription()
  273. {
  274. }
  275. //////////////////////////////////////////////
  276. //Inline
  277. virtual ~CRaidReportDescription()
  278. {
  279. }
  280. //////////////////////////////////////////////
  281. //Inline
  282. virtual void Clone(CRaidReportDescription& refLeftValue)
  283. {
  284. refLeftValue.m_strDescription = m_strDescription;
  285. refLeftValue.m_strData = m_strData;
  286. }
  287. //////////////////////////////////////////////
  288. // data members
  289. public:
  290. CLString m_strDescription;
  291. } CRAIDREPORTDESCRIPTION, FAR* LPCRAIDREPORTDESCRIPTION;
  292. //////////////////////////////////////////////////////////////////
  293. //////////////////////////////////////////////////////////////////
  294. typedef class CRaidReportGeneral : public CRaidReportBase
  295. {
  296. public:
  297. //////////////////////////////////////////////
  298. //Inline
  299. CRaidReportGeneral()
  300. {
  301. }
  302. //////////////////////////////////////////////
  303. //Inline
  304. virtual ~CRaidReportGeneral()
  305. {
  306. }
  307. //////////////////////////////////////////////
  308. //Inline
  309. virtual void Clone(CRaidReportGeneral& refLeftValue)
  310. {
  311. refLeftValue.m_strTitle = m_strTitle ;
  312. refLeftValue.m_strEnvironment = m_strEnvironment;
  313. refLeftValue.m_strBugReportFileName = m_strEnvironment;
  314. refLeftValue.m_strData = m_strData;
  315. }
  316. //////////////////////////////////////////////
  317. // data members
  318. public:
  319. CLString m_strTitle;
  320. CLString m_strEnvironment;
  321. CLString m_strBugReportFileName;
  322. } CRAIDREPORTGENERAL, FAR* LPCRAIDREPORTGENERAL;
  323. //////////////////////////////////////////////////////////////////
  324. //////////////////////////////////////////////////////////////////
  325. //////////////////////////////////////////////////////////////////
  326. //////////////////////////////////////////////////////////////////
  327. typedef class CRaidReportData : public CRaidReportBase
  328. {
  329. public:
  330. //////////////////////////////////////////////
  331. //Inline
  332. CRaidReportData()
  333. {
  334. }
  335. //////////////////////////////////////////////
  336. //Inline
  337. virtual ~CRaidReportData()
  338. {
  339. }
  340. //////////////////////////////////////////////
  341. //Inline
  342. virtual void Clone(CRaidReportData& refLeftValue)
  343. {
  344. GetRaidReportGeneralPtr()->Clone(refLeftValue.GetRaidReportGeneral() );
  345. GetRaidReportDescriptionPtr()->Clone(refLeftValue.GetRaidReportDescription());
  346. GetRaidReportOpenedPtr()->Clone(refLeftValue.GetRaidReportOpened() );
  347. GetRaidReportStatusPtr()->Clone(refLeftValue.GetRaidReportStatus() );
  348. }
  349. // Get Get routines.
  350. CRaidReportGeneral & GetRaidReportGeneral() { return *m_pRaidReportGeneral; }
  351. CRaidReportDescription& GetRaidReportDescription() { return *m_pRaidReportDescription; }
  352. CRaidReportOpened & GetRaidReportOpened() { return *m_pRaidReportOpened; }
  353. CRaidReportStatus & GetRaidReportStatus() { return *m_pRaidReportStatus; }
  354. CRaidReportGeneral * GetRaidReportGeneralPtr() { return m_pRaidReportGeneral; }
  355. CRaidReportDescription* GetRaidReportDescriptionPtr() { return m_pRaidReportDescription; }
  356. CRaidReportOpened * GetRaidReportOpenedPtr() { return m_pRaidReportOpened; }
  357. CRaidReportStatus * GetRaidReportStatusPtr() { return m_pRaidReportStatus; }
  358. //////////////////////////////////////////////
  359. // data members
  360. public:
  361. CRaidReportGeneral* m_pRaidReportGeneral;
  362. CRaidReportDescription* m_pRaidReportDescription;
  363. CRaidReportOpened* m_pRaidReportOpened;
  364. CRaidReportStatus* m_pRaidReportStatus;
  365. } CRAIDREPORTDATA, FAR* LPCRAIDREPORTDATA;
  366. //////////////////////////////////////////////////////////////////
  367. //////////////////////////////////////////////////////////////////
  368. typedef class CXMLRaidReportStatus : public CRaidReportStatus, public CXMLBase
  369. {
  370. public:
  371. //////////////////////////////////////////////
  372. //Inline
  373. CXMLRaidReportStatus() : m_XMLTagInformation(BXT::GetBugStatusXMLTag(), _T("\t\t"))
  374. {
  375. }
  376. //////////////////////////////////////////////
  377. //Inline
  378. virtual ~CXMLRaidReportStatus()
  379. {
  380. }
  381. // Override the base class definition
  382. IXMLDOMNodePtr CreateXMLNode(const _bstr_t bstrNewTag, _variant_t& var, IXMLDOMNodePtr spXDNParent)
  383. {
  384. UNREFERENCED_PARAMETER(bstrNewTag);
  385. UNREFERENCED_PARAMETER(var);
  386. UNREFERENCED_PARAMETER(spXDNParent);
  387. ASSERT(FALSE);
  388. return NULL;
  389. }
  390. //////////////////////////////////////////////
  391. // virtual function.
  392. virtual CLString& GetDataString()
  393. {
  394. CLString strTabs = _T("\t\t\t");
  395. CXMLTagInformation XMLTagInfo(BXT::GetAccessibilityXMLTag(), strTabs);
  396. CLString strTmp = XMLTagInfo.GetXMLString(m_strAccessibility);
  397. strTmp += XMLTagInfo.GetXMLString(BXT::GetAssignedtoXMLTag() , m_strAssignedTo , true);
  398. strTmp += XMLTagInfo.GetXMLString(BXT::GetByXMLTag() , m_strBy , true);
  399. strTmp += XMLTagInfo.GetXMLString(BXT::GetIssuetypeXMLTag() , m_strIssueType , true);
  400. strTmp += XMLTagInfo.GetXMLString(BXT::GetSeverityXMLTag() , m_strSeverity , true);
  401. m_strData = m_XMLTagInformation.GetTabbedStartTag();
  402. m_strData += strTmp;
  403. m_strData += m_XMLTagInformation.GetTabbedEndTag();
  404. return m_strData;
  405. }
  406. //////////////////////////////////////////////
  407. // virtual function.
  408. virtual CLString& GetFileString()
  409. {
  410. CRaidFileBase raidFileBase;
  411. m_strData = raidFileBase.GetLine(RFF::GetAccessibilityFileField(), m_strAccessibility);
  412. m_strData += raidFileBase.GetLine(RFF::GetAssignedtoFileField() , m_strAssignedTo );
  413. m_strData += raidFileBase.GetLine(RFF::GetByFileField() , m_strBy );
  414. m_strData += raidFileBase.GetLine(RFF::GetIssuetypeFileField() , m_strIssueType );
  415. m_strData += raidFileBase.GetLine(RFF::GetSeverityFileField() , m_strSeverity );
  416. return m_strData;
  417. }
  418. //////////////////////////////////////////////
  419. // Inline
  420. virtual bool ExtractXMLContents(IXMLDOMNodePtr spParentXDN)
  421. {
  422. _bstr_t bstrTag = BXT::GetBugStatusXMLTag();
  423. IXMLDOMNodePtr spXDNChild = spParentXDN->selectSingleNode(bstrTag);
  424. if(spXDNChild)
  425. {
  426. GetTagText(m_strAccessibility,BXT::GetAccessibilityXMLTag(), spXDNChild);
  427. GetTagText(m_strAssignedTo ,BXT::GetAssignedtoXMLTag() , spXDNChild);
  428. GetTagText(m_strBy ,BXT::GetByXMLTag() , spXDNChild);
  429. GetTagText(m_strIssueType ,BXT::GetIssuetypeXMLTag() , spXDNChild);
  430. GetTagText(m_strSeverity ,BXT::GetSeverityXMLTag() , spXDNChild);
  431. }
  432. return true;
  433. }
  434. //////////////////////////////////////////////
  435. // data members
  436. public:
  437. CXMLTagInformation m_XMLTagInformation;
  438. } CXMLRAIDREPORTSTATUS, FAR* LPCXMLRAIDREPORTSTATUS;
  439. //////////////////////////////////////////////////////////////////
  440. //////////////////////////////////////////////////////////////////
  441. typedef class CXMLRaidReportOpened : public CRaidReportOpened, public CXMLBase
  442. {
  443. public:
  444. //////////////////////////////////////////////
  445. //Inline
  446. CXMLRaidReportOpened() : m_XMLTagInformation(BXT::GetBugOpenedXMLTag(), _T("\t\t"))
  447. {
  448. }
  449. //////////////////////////////////////////////
  450. //Inline
  451. virtual ~CXMLRaidReportOpened()
  452. {
  453. }
  454. // Override the base class definition
  455. IXMLDOMNodePtr CreateXMLNode(const _bstr_t bstrNewTag, _variant_t& var, IXMLDOMNodePtr spXDNParent)
  456. {
  457. UNREFERENCED_PARAMETER(bstrNewTag);
  458. UNREFERENCED_PARAMETER(var);
  459. UNREFERENCED_PARAMETER(spXDNParent);
  460. ASSERT(FALSE);
  461. return NULL;
  462. }
  463. //////////////////////////////////////////////
  464. // virtual function.
  465. virtual CLString& GetDataString()
  466. {
  467. CLString strTabs = _T("\t\t\t");
  468. CXMLTagInformation XMLTagInfo(BXT::GetOpenedbyXMLTag(), strTabs);
  469. CLString strTmp = XMLTagInfo.GetXMLString(m_strOpenedBy);
  470. strTmp += XMLTagInfo.GetXMLString(BXT::GetSourceXMLTag() , m_strSource , true);
  471. strTmp += XMLTagInfo.GetXMLString(BXT::GetBetaidXMLTag() , m_strBetaID , true);
  472. strTmp += XMLTagInfo.GetXMLString(BXT::GetRevisionXMLTag(), m_strRevision , true);
  473. strTmp += XMLTagInfo.GetXMLString(BXT::GetSourceIDXMLTag(), m_strSourceID , true);
  474. strTmp += XMLTagInfo.GetXMLString(BXT::GetHowfoundXMLTag(), m_strHowFound , true);
  475. strTmp += XMLTagInfo.GetXMLString(BXT::GetLanguageXMLTag(), m_strLanguage , true);
  476. m_strData = m_XMLTagInformation.GetTabbedStartTag();
  477. m_strData += strTmp;
  478. m_strData += m_XMLTagInformation.GetTabbedEndTag();
  479. return m_strData;
  480. }
  481. //////////////////////////////////////////////
  482. // virtual function.
  483. virtual CLString& GetFileString()
  484. {
  485. CRaidFileBase raidFileBase;
  486. m_strData = raidFileBase.GetLine(RFF::GetOpenedbyFileField() , m_strOpenedBy);
  487. m_strData += raidFileBase.GetLine(RFF::GetSourceFileField() , m_strSource );
  488. m_strData += raidFileBase.GetLine(RFF::GetBetaidFileField() , m_strBetaID );
  489. m_strData += raidFileBase.GetLine(RFF::GetRevisionFileField() , m_strRevision);
  490. m_strData += raidFileBase.GetLine(RFF::GetSourceIDFileField() , m_strSourceID);
  491. m_strData += raidFileBase.GetLine(RFF::GetHowfoundFileField() , m_strHowFound);
  492. m_strData += raidFileBase.GetLine(RFF::GetLanguageFileField() , m_strLanguage);
  493. return m_strData;
  494. }
  495. //////////////////////////////////////////////
  496. // Inline
  497. virtual bool ExtractXMLContents(IXMLDOMNodePtr spParentXDN)
  498. {
  499. _bstr_t bstrTag = BXT::GetBugOpenedXMLTag();
  500. IXMLDOMNodePtr spXDNChild = spParentXDN->selectSingleNode(bstrTag);
  501. if(spXDNChild)
  502. {
  503. GetTagText(m_strOpenedBy,BXT::GetOpenedbyXMLTag() , spXDNChild);
  504. GetTagText(m_strSource ,BXT::GetSourceXMLTag() , spXDNChild);
  505. GetTagText(m_strBetaID ,BXT::GetBetaidXMLTag() , spXDNChild);
  506. GetTagText(m_strRevision,BXT::GetRevisionXMLTag() , spXDNChild);
  507. GetTagText(m_strSourceID,BXT::GetSourceIDXMLTag() , spXDNChild);
  508. GetTagText(m_strHowFound,BXT::GetHowfoundXMLTag() , spXDNChild);
  509. GetTagText(m_strLanguage,BXT::GetLanguageXMLTag() , spXDNChild);
  510. }
  511. return true;
  512. }
  513. //////////////////////////////////////////////
  514. // data members
  515. public:
  516. CXMLTagInformation m_XMLTagInformation;
  517. } CXMLRAIDREPORTOPENED, FAR* LPCXMLRAIDREPORTOPENED;
  518. //////////////////////////////////////////////////////////////////
  519. //////////////////////////////////////////////////////////////////
  520. typedef class CXMLRaidReportDescription : public CRaidReportDescription, public CXMLBase
  521. {
  522. public:
  523. //////////////////////////////////////////////
  524. //Inline
  525. CXMLRaidReportDescription() : m_XMLTagInformation(BXT::GetBugDescriptionXMLTag(), _T("\t\t"))
  526. {
  527. }
  528. //////////////////////////////////////////////
  529. //Inline
  530. virtual ~CXMLRaidReportDescription()
  531. {
  532. }
  533. // Override the base class definition
  534. IXMLDOMNodePtr CreateXMLNode(const _bstr_t bstrNewTag, _variant_t& var, IXMLDOMNodePtr spXDNParent)
  535. {
  536. UNREFERENCED_PARAMETER(bstrNewTag);
  537. UNREFERENCED_PARAMETER(var);
  538. UNREFERENCED_PARAMETER(spXDNParent);
  539. ASSERT(FALSE);
  540. return NULL;
  541. }
  542. //////////////////////////////////////////////
  543. // virtual function.
  544. virtual CLString& GetDataString()
  545. {
  546. CLString strTabs = _T("\t\t\t");
  547. CXMLTagInformation XMLTagInfo(BXT::GetDescriptionXMLTag(), strTabs);
  548. CLString strTmp = XMLTagInfo.GetXMLString(m_strDescription);
  549. m_strData = m_XMLTagInformation.GetTabbedStartTag();
  550. m_strData += strTmp;
  551. m_strData += m_XMLTagInformation.GetTabbedEndTag();
  552. return m_strData;
  553. }
  554. //////////////////////////////////////////////
  555. // virtual function.
  556. virtual CLString& GetFileString()
  557. {
  558. CRaidFileBase raidFileBase;
  559. m_strData = raidFileBase.GetQuotedLine(RFF::GetDescriptionFileField() , m_strDescription);
  560. return m_strData;
  561. }
  562. //////////////////////////////////////////////
  563. // Inline
  564. virtual bool ExtractXMLContents(IXMLDOMNodePtr spParentXDN)
  565. {
  566. _bstr_t bstrTag = BXT::GetBugDescriptionXMLTag();
  567. IXMLDOMNodePtr spXDNChild = spParentXDN->selectSingleNode(bstrTag);
  568. if(spXDNChild)
  569. {
  570. GetTagText(m_strDescription, BXT::GetDescriptionXMLTag(), spXDNChild);
  571. }
  572. return true;
  573. }
  574. //////////////////////////////////////////////
  575. // data members
  576. public:
  577. CXMLTagInformation m_XMLTagInformation;
  578. } CXMLRAIDREPORTDESCRIPTION, FAR* LPCXMLRAIDREPORTDESCRIPTION;
  579. //////////////////////////////////////////////////////////////////
  580. //////////////////////////////////////////////////////////////////
  581. typedef class CXMLRaidReportGeneral : public CRaidReportGeneral, public CXMLBase
  582. {
  583. public:
  584. //////////////////////////////////////////////
  585. //Inline
  586. CXMLRaidReportGeneral() : m_XMLTagInformation(BXT::GetBugGeneralXMLTag(), _T("\t\t"))
  587. {
  588. }
  589. //////////////////////////////////////////////
  590. //Inline
  591. virtual ~CXMLRaidReportGeneral()
  592. {
  593. }
  594. // Override the base class definition
  595. IXMLDOMNodePtr CreateXMLNode(const _bstr_t bstrNewTag, _variant_t& var, IXMLDOMNodePtr spXDNParent)
  596. {
  597. UNREFERENCED_PARAMETER(bstrNewTag);
  598. UNREFERENCED_PARAMETER(var);
  599. UNREFERENCED_PARAMETER(spXDNParent);
  600. ASSERT(FALSE);
  601. return NULL;
  602. }
  603. //////////////////////////////////////////////
  604. // virtual function.
  605. virtual CLString& GetDataString()
  606. {
  607. CLString strTabs = _T("\t\t\t");
  608. CXMLTagInformation XMLTagInfo(BXT::GetTitleXMLTag(), strTabs);
  609. CLString strTmp = XMLTagInfo.GetXMLString(m_strTitle);
  610. strTmp += XMLTagInfo.GetXMLString(BXT::GetEnvironmentXMLTag(), m_strEnvironment, true);
  611. strTmp += XMLTagInfo.GetXMLString(BXT::GetFilenameXMLTag(), m_strBugReportFileName, true);
  612. m_strData = m_XMLTagInformation.GetTabbedStartTag();
  613. m_strData += strTmp;
  614. m_strData += m_XMLTagInformation.GetTabbedEndTag();
  615. return m_strData;
  616. }
  617. //////////////////////////////////////////////
  618. // virtual function.
  619. virtual CLString& GetFileString()
  620. {
  621. CRaidFileBase raidFileBase;
  622. m_strData = raidFileBase.GetLine(RFF::GetTitleFileField() , m_strTitle );
  623. m_strData += raidFileBase.GetLine(RFF::GetEnvironmentFileField() , m_strEnvironment);
  624. return m_strData;
  625. }
  626. //////////////////////////////////////////////
  627. // Inline
  628. virtual bool ExtractXMLContents(IXMLDOMNodePtr spParentXDN)
  629. {
  630. _bstr_t bstrTag = BXT::GetBugGeneralXMLTag();
  631. IXMLDOMNodePtr spXDNChild = spParentXDN->selectSingleNode(bstrTag);
  632. if(spXDNChild)
  633. {
  634. GetTagText(m_strTitle , BXT::GetTitleXMLTag() , spXDNChild);
  635. GetTagText(m_strEnvironment , BXT::GetEnvironmentXMLTag() , spXDNChild);
  636. GetTagText(m_strBugReportFileName, BXT::GetFilenameXMLTag() , spXDNChild);
  637. }
  638. return true;
  639. }
  640. //////////////////////////////////////////////
  641. // data members
  642. public:
  643. CXMLTagInformation m_XMLTagInformation;
  644. } CXMLRAIDREPORTGENERAL, FAR* LPCXMLRAIDREPORTGENERAL;
  645. //////////////////////////////////////////////////////////////////
  646. //////////////////////////////////////////////////////////////////
  647. //////////////////////////////////////////////////////////////////
  648. //////////////////////////////////////////////////////////////////
  649. typedef class CXMLRaidReportData : public CRaidReportData, public CXMLBase
  650. {
  651. public:
  652. //////////////////////////////////////////////
  653. //Inline
  654. CXMLRaidReportData() : m_XMLTagInformation(BXT::GetBugReportXMLTag(), _T("\t"))
  655. {
  656. m_pRaidReportGeneral = new CXMLRaidReportGeneral ();
  657. m_pRaidReportDescription = new CXMLRaidReportDescription();
  658. m_pRaidReportOpened = new CXMLRaidReportOpened ();
  659. m_pRaidReportStatus = new CXMLRaidReportStatus ();
  660. }
  661. //////////////////////////////////////////////
  662. //Inline
  663. virtual ~CXMLRaidReportData()
  664. {
  665. delete m_pRaidReportGeneral ;
  666. delete m_pRaidReportDescription;
  667. delete m_pRaidReportOpened ;
  668. delete m_pRaidReportStatus ;
  669. }
  670. // Override the base class definition
  671. IXMLDOMNodePtr CreateXMLNode(const _bstr_t bstrNewTag, _variant_t& var, IXMLDOMNodePtr spXDNParent)
  672. {
  673. UNREFERENCED_PARAMETER(bstrNewTag);
  674. UNREFERENCED_PARAMETER(var);
  675. UNREFERENCED_PARAMETER(spXDNParent);
  676. ASSERT(FALSE);
  677. return NULL;
  678. }
  679. //////////////////////////////////////////////
  680. // virtual function.
  681. virtual CLString& GetDataString()
  682. {
  683. m_strData = m_XMLTagInformation.GetTabbedStartTag();
  684. m_strData += GetRaidReportGeneralPtr()->GetDataString();
  685. m_strData += GetRaidReportDescriptionPtr()->GetDataString();
  686. m_strData += GetRaidReportOpenedPtr()->GetDataString();
  687. m_strData += GetRaidReportStatusPtr()->GetDataString();
  688. m_strData += m_XMLTagInformation.GetTabbedEndTag();
  689. return m_strData;
  690. }
  691. //////////////////////////////////////////////
  692. // virtual function.
  693. virtual CLString& GetFileString()
  694. {
  695. m_strData.Empty();
  696. CLString strTmp;
  697. CRaidFileBase raidFileBase;
  698. strTmp = GetRaidReportGeneralPtr()->GetFileString();
  699. strTmp += GetRaidReportOpenedPtr()->GetFileString();
  700. strTmp += GetRaidReportStatusPtr()->GetFileString();
  701. CLString strDescription = GetRaidReportDescriptionPtr()->GetFileString();
  702. if(!strTmp.IsEmpty() || !strDescription.IsEmpty())
  703. {
  704. strTmp += strDescription;
  705. m_strData = raidFileBase.GetLine(RFF::GetActionFileField(),RFF::GetAddFileField());
  706. m_strData += strTmp;
  707. }
  708. return m_strData;
  709. }
  710. //////////////////////////////////////////////
  711. // Inline
  712. virtual bool ExtractXMLContents(IXMLDOMNodePtr spXDNRaid)
  713. {
  714. if(spXDNRaid)
  715. {
  716. ((CXMLRaidReportGeneral* )GetRaidReportGeneralPtr())->ExtractXMLContents(spXDNRaid);
  717. ((CXMLRaidReportDescription*)GetRaidReportDescriptionPtr())->ExtractXMLContents(spXDNRaid);
  718. ((CXMLRaidReportOpened* )GetRaidReportOpenedPtr())->ExtractXMLContents(spXDNRaid);
  719. ((CXMLRaidReportStatus* )GetRaidReportStatusPtr())->ExtractXMLContents(spXDNRaid);
  720. }
  721. return true;
  722. }
  723. //////////////////////////////////////////////
  724. // data members
  725. public:
  726. CXMLTagInformation m_XMLTagInformation;
  727. } CXMLRAIDREPORTDATA, FAR* LPCXMLRAIDREPORTDATA;
  728. //////////////////////////////////////////////////////////////////
  729. //////////////////////////////////////////////////////////////////
  730. #endif // !defined(AFX_RAIDDATASTRUCTS_H__5FD93F0B_81D9_11D2_8162_00C04F68FDA4__INCLUDED_)