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