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.

79 lines
1.6 KiB

  1. #include "stdafx.h"
  2. #include "scripmap.h"
  3. CScriptMap::CScriptMap ( LPCTSTR pchFileExtension, LPCTSTR pchScriptMap, BOOL bExistingEntry)
  4. {
  5. m_strScriptMap = pchScriptMap;
  6. if (bExistingEntry) {
  7. m_strPrevFileExtension = pchFileExtension;
  8. m_strFileExtension = pchFileExtension;
  9. }
  10. else {
  11. m_strPrevFileExtension= _T("");
  12. SetFileExtension(pchFileExtension);
  13. }
  14. }
  15. CScriptMap::~CScriptMap()
  16. {
  17. }
  18. void CScriptMap::SetScriptMap(LPCTSTR pchScriptMap)
  19. {
  20. m_strScriptMap = pchScriptMap;
  21. }
  22. LPCTSTR CScriptMap::GetScriptMap()
  23. {
  24. return (m_strScriptMap);
  25. }
  26. void CScriptMap::SetFileExtension(LPCTSTR pchFileExtension)
  27. {
  28. CString strTempFileExtension = pchFileExtension;
  29. CheckDot(strTempFileExtension);
  30. m_strFileExtension = strTempFileExtension;
  31. }
  32. LPCTSTR CScriptMap::GetFileExtension()
  33. {
  34. return(m_strFileExtension);
  35. }
  36. LPCTSTR CScriptMap::GetPrevFileExtension()
  37. {
  38. return(m_strPrevFileExtension);
  39. }
  40. void CScriptMap::SetPrevFileExtension()
  41. {
  42. m_strPrevFileExtension = m_strFileExtension;
  43. }
  44. BOOL CScriptMap::PrevScriptMapExists()
  45. {
  46. return (m_strPrevFileExtension != _T(""));
  47. }
  48. LPCTSTR CScriptMap::GetDisplayString()
  49. {
  50. m_strDisplayString = m_strFileExtension;
  51. m_strDisplayString += _T("\t");
  52. m_strDisplayString += m_strScriptMap;
  53. return (m_strDisplayString);
  54. }
  55. ////////////////////////////////////////////////////////////////////////////////
  56. // Private functions
  57. void CScriptMap::CheckDot(CString &strFileExtension)
  58. {
  59. if (strFileExtension.Left(1) != _T(".")) {
  60. CString strTemp = _T(".") + strFileExtension;
  61. strFileExtension = strTemp;
  62. }
  63. }