AppXmlInfo.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #include "StdAfx.h"
  2. #include "AppXmlInfo.h"
  3. #include "markup.h"
  4. CAppXmlInfo::CAppXmlInfo(CString strFile)
  5. {
  6. CMarkup xml;
  7. xml.Load(strFile);
  8. xml.FindElem(); // root ORDER element
  9. xml.IntoElem(); // inside ORDER
  10. if ( xml.FindElem(_T("download_server")) )
  11. {
  12. xml.IntoElem();
  13. while(xml.FindElem(_T("url")))
  14. {
  15. CString url = xml.GetData();
  16. this->download_servers.Add(url);
  17. }
  18. xml.OutOfElem();
  19. }
  20. if ( xml.FindElem(_T("download_files")) )
  21. {
  22. xml.IntoElem();
  23. while(xml.FindElem(_T("zipfile")))
  24. {
  25. CZipFileInfo info;
  26. info.fileName = xml.GetData();
  27. info.lastUpdateTime = xml.GetAttrib(_T("lastupdatetime"));
  28. info.hash = xml.GetAttrib(_T("hash"));
  29. info.updateMode = xml.GetAttrib(_T("updatemode"));
  30. this->download_files.Add(info);
  31. }
  32. xml.OutOfElem();
  33. }
  34. if ( xml.FindElem(_T("startup")) )
  35. {
  36. xml.IntoElem();
  37. while(xml.FindElem(_T("app")))
  38. {
  39. CRunExeInfo info;
  40. info.appname = xml.GetData();
  41. info.mode = xml.GetAttrib(_T("wait"));
  42. this->run_apps.Add(info);
  43. }
  44. xml.OutOfElem();
  45. }
  46. }
  47. CAppXmlInfo::~CAppXmlInfo(void)
  48. {
  49. }