cmVisualStudioWCEPlatformParser.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2012 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmVisualStudioWCEPlatformParser_h
  11. #define cmVisualStudioWCEPlatformParser_h
  12. #include "cmStandardIncludes.h"
  13. #include "cmXMLParser.h"
  14. // This class is used to parse XML with configuration
  15. // of installed SDKs in system
  16. class cmVisualStudioWCEPlatformParser : public cmXMLParser
  17. {
  18. public:
  19. cmVisualStudioWCEPlatformParser(const char* name = NULL)
  20. : RequiredName(name)
  21. , FoundRequiredName(false)
  22. {
  23. }
  24. int ParseVersion(const char* version);
  25. bool Found() const {return this->FoundRequiredName;}
  26. const char* GetArchitectureFamily() const;
  27. std::string GetOSVersion() const;
  28. std::string GetIncludeDirectories() const {
  29. return this->FixPaths(this->Include); }
  30. std::string GetLibraryDirectories() const {
  31. return this->FixPaths(this->Library); }
  32. std::string GetPathDirectories() const {
  33. return this->FixPaths(this->Path); }
  34. const std::vector<std::string>& GetAvailablePlatforms() const {
  35. return this->AvailablePlatforms; }
  36. protected:
  37. virtual void StartElement(const std::string& name, const char** attributes);
  38. void EndElement(const std::string& name);
  39. void CharacterDataHandler(const char* data, int length);
  40. private:
  41. std::string FixPaths(const std::string& paths) const;
  42. std::string CharacterData;
  43. std::string Include;
  44. std::string Library;
  45. std::string Path;
  46. std::string PlatformName;
  47. std::string OSMajorVersion;
  48. std::string OSMinorVersion;
  49. std::map<std::string, std::string> Macros;
  50. std::vector<std::string> AvailablePlatforms;
  51. const char* RequiredName;
  52. bool FoundRequiredName;
  53. std::string VcInstallDir;
  54. std::string VsInstallDir;
  55. };
  56. #endif