~ubuntu-branches/ubuntu/hardy/codeblocks/hardy-backports

« back to all changes in this revision

Viewing changes to src/plugins/projectsimporter/msvcworkspacebase.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Casadevall
  • Date: 2008-07-17 04:39:23 UTC
  • Revision ID: james.westby@ubuntu.com-20080717043923-gmsy5cwkdjswghkm
Tags: upstream-8.02
ImportĀ upstreamĀ versionĀ 8.02

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
 
3
 * http://www.gnu.org/licenses/gpl-3.0.html
 
4
 */
 
5
 
 
6
#ifndef MSVCWORKSPACEBASE_H
 
7
#define MSVCWORKSPACEBASE_H
 
8
 
 
9
#include <wx/version.h>
 
10
#include <wx/arrstr.h>
 
11
#include <wx/hashmap.h>
 
12
 
 
13
class cbProject;
 
14
 
 
15
// common features for MSVC importers, version 6, 7 etc.
 
16
// note that there's no workspace config in MSVC6...
 
17
class MSVCWorkspaceBase {
 
18
public:
 
19
    MSVCWorkspaceBase();
 
20
    virtual ~MSVCWorkspaceBase();
 
21
 
 
22
protected:
 
23
    // register a new project in the project array
 
24
    virtual void registerProject(const wxString& projectID, cbProject* project);
 
25
    // add a dependency
 
26
    virtual void addDependency(const wxString& projectID, const wxString& dependencyID);
 
27
    // add a workspace config
 
28
    virtual void addWorkspaceConfiguration(const wxString& config);
 
29
    // add a matching between a workspace configuration and a project configuration
 
30
    virtual void addConfigurationMatching(const wxString& projectID, const wxString& workspConfig, const wxString& projConfig);
 
31
    // update cbProjects and cbWorkspace once parsing done
 
32
    virtual void updateProjects();
 
33
 
 
34
private:
 
35
    // hash for configurations matchings
 
36
    WX_DECLARE_STRING_HASH_MAP(wxString, ConfigurationMatchings);
 
37
    // project record while parsing
 
38
    struct ProjectRecord {
 
39
        // current project data structure
 
40
        cbProject* _project;
 
41
        // list of the IDs of projects that the current project depend on
 
42
        wxSortedArrayString _dependencyList;
 
43
        // which project-config each solution-config correspond to
 
44
        ConfigurationMatchings _configurations;
 
45
        // default constructor
 
46
        ProjectRecord() : _project(0) {}
 
47
        // constructor with a project data structure
 
48
        ProjectRecord(cbProject* project) : _project(project) {}
 
49
    };
 
50
 
 
51
    // an associative array of project records indexed by project ID which are:
 
52
    // UUIDs in MSVC7, like "{35AFBABB-DF05-43DE-91A7-BB828A874015}" (with brackets, no quotes)
 
53
    // Project names in MSVC6
 
54
    WX_DECLARE_STRING_HASH_MAP(ProjectRecord, HashProjects);
 
55
    // list of projects records
 
56
    HashProjects _projects;
 
57
    // build configurations for the workspace (i.e. solution)
 
58
    wxSortedArrayString _workspaceConfigurations;
 
59
};
 
60
 
 
61
#endif // MSVCWORKSPACEBASE_H
 
62