-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProjectPropManager.xcsm
More file actions
103 lines (87 loc) · 2.93 KB
/
Copy pathProjectPropManager.xcsm
File metadata and controls
103 lines (87 loc) · 2.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
class DebuggeeManager{
Map<String, ProjectPropInterface> debuggees = new Map<String, ProjectPropInterface>();
public Vector<String > namelist = new Vector<String >();
public ProjectPropInterface getDefault(){
if (debuggees.size() > 0){
return debuggees.iterator().getValue();
}
return nilptr;
}
public ProjectPropInterface get(String name){
try{
return debuggees.get(name);
}catch(Exception e){
}
return nilptr;
}
public void add(String key, ProjectPropInterface pi){
if (key == nilptr || debuggees.containsKey(key)){
return ;
}
namelist.add(key);
debuggees.put(key ,pi);
}
};
class ProjectPropManager{
static Map<String, ProjectPropInterface> _props = new Map<String, ProjectPropInterface>();
static CPlusplusProp cppp = new CPlusplusProp();
public static bool registryAllProp(){
_props.put("xlang", new XlangProjectProp());
_props.put("C/C++", cppp);
_props.put("C", cppp);
return true;
}
public static ProjectPropInterface getForProject(String projLnaguageConf){
try{
return _props.get(projLnaguageConf);
}catch(Exception e){
}
return nilptr;
}
public static bool registryProp(@NotNilptr String name, ProjectPropInterface prop){
if (name.equals("C/C++")){
cppp.setBridge(prop);
}else{
_props.put(name, prop);
}
return true;
}
public @NotNilptr static DebuggeeManager getDebuggeeManager(){
DebuggeeManager dc = new DebuggeeManager();
Map.Iterator<String, ProjectPropInterface> iter = _props.iterator();
while (iter.hasNext()){
ProjectPropInterface pi = iter.getValue();
if (pi != nilptr){
dc.add(pi.getDebuggeeDescription(), pi);
}
iter.next();
}
return dc;
}
public @NotNilptr static String getAllExtensionFilter(){
String output = "";
Map.Iterator<String, ProjectPropInterface> iter = _props.iterator();
while (iter.hasNext()){
ProjectPropInterface pi = iter.getValue();
if (pi != nilptr){
String szf = pi.getFileExtensionFilter();
if (szf != nilptr){
szf = szf.trim(true);
}
if (szf != nilptr && szf.length() > 0){
if (output.length() > 0){
if (output.endsWith(";;")){
output = output + szf;
}else{
output = output + ";;" + szf;
}
}else{
output = szf;
}
}
}
iter.next();
}
return output;
}
};