Imported Upstream version 2.8.12.2
[platform/upstream/cmake.git] / Source / cmVisualStudioSlnData.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2000-2013 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 cmVisualStudioSlnData_h
13 #define cmVisualStudioSlnData_h
14
15 #include "cmStandardIncludes.h"
16
17 class cmSlnProjectEntry
18 {
19 public:
20   cmSlnProjectEntry() {}
21   cmSlnProjectEntry(const std::string& guid,
22                     const std::string& name,
23                     const std::string& relativePath)
24     : Guid(guid), Name(name), RelativePath(relativePath)
25   {}
26
27   std::string GetGUID() const { return Guid; }
28   std::string GetName() const { return Name; }
29   std::string GetRelativePath() const { return RelativePath; }
30
31 private:
32   std::string Guid, Name, RelativePath;
33 };
34
35
36 class cmSlnData
37 {
38 public:
39   const cmSlnProjectEntry*
40   GetProjectByGUID(const std::string& projectGUID) const;
41
42   const cmSlnProjectEntry*
43   GetProjectByName(const std::string& projectName) const;
44
45   std::vector<cmSlnProjectEntry> GetProjects() const;
46
47   cmSlnProjectEntry* AddProject(const std::string& projectGUID,
48                                 const std::string& projectName,
49                                 const std::string& projectRelativePath);
50
51 private:
52   typedef std::map<std::string, cmSlnProjectEntry> ProjectStorage;
53   ProjectStorage ProjectsByGUID;
54   typedef std::map<std::string, ProjectStorage::iterator> ProjectStringIndex;
55   ProjectStringIndex ProjectNameIndex;
56 };
57
58 #endif