cmVisualStudioWCEPlatformParser.h 1.83 KB
Newer Older
1 2
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
3 4
#ifndef cmVisualStudioWCEPlatformParser_h
#define cmVisualStudioWCEPlatformParser_h
Brad King's avatar
Brad King committed
5

6
#include "cmConfigure.h" // IWYU pragma: keep
7

8 9 10 11
#include <map>
#include <stddef.h>
#include <string>
#include <vector>
12 13 14 15 16 17 18 19 20

#include "cmXMLParser.h"

// This class is used to parse XML with configuration
// of installed SDKs in system
class cmVisualStudioWCEPlatformParser : public cmXMLParser
{
public:
  cmVisualStudioWCEPlatformParser(const char* name = NULL)
21 22 23 24
    : RequiredName(name)
    , FoundRequiredName(false)
  {
  }
25 26 27

  int ParseVersion(const char* version);

28
  bool Found() const { return this->FoundRequiredName; }
29 30
  const char* GetArchitectureFamily() const;
  std::string GetOSVersion() const;
31 32 33 34 35 36 37 38 39 40 41 42 43
  std::string GetIncludeDirectories() const
  {
    return this->FixPaths(this->Include);
  }
  std::string GetLibraryDirectories() const
  {
    return this->FixPaths(this->Library);
  }
  std::string GetPathDirectories() const { return this->FixPaths(this->Path); }
  const std::vector<std::string>& GetAvailablePlatforms() const
  {
    return this->AvailablePlatforms;
  }
44 45

protected:
46 47
  virtual void StartElement(const std::string& name, const char** attributes);
  void EndElement(const std::string& name);
48 49 50
  void CharacterDataHandler(const char* data, int length);

private:
51 52
  std::string FixPaths(const std::string& paths) const;

53 54
  std::string CharacterData;

55 56 57
  std::string Include;
  std::string Library;
  std::string Path;
58 59 60 61 62 63 64 65
  std::string PlatformName;
  std::string OSMajorVersion;
  std::string OSMinorVersion;
  std::map<std::string, std::string> Macros;
  std::vector<std::string> AvailablePlatforms;

  const char* RequiredName;
  bool FoundRequiredName;
66 67
  std::string VcInstallDir;
  std::string VsInstallDir;
68 69 70
};

#endif