1 | private StringBuffer generateIncludes(StringBuffer sb) { | | 1 | /** 2002-12-12 Achim Spangler |
2 | for (Iterator it = systemInc.iterator(); it.hasNext(); ) { | | 2 | * generate global typedefs |
3 | String inc = (String) it.next(); | | 3 | */ |
4 | sb.append("#include <"); | | 4 | private StringBuffer generateGlobalTypedefs(Object cls) { |
5 | sb.append(inc).append('>').append(LINE_SEPARATOR); | | 5 | StringBuffer sb = new StringBuffer(); |
6 | } | | 6 | if (getFacade().isAClass(cls) || getFacade().isAInstance(cls)) { |
7 | // separate system from external headers | | 7 | // add typedefs |
8 | if (systemInc.size() > 0) sb.append(LINE_SEPARATOR); | | 8 | if (generatorPass == HEADER_PASS) { |
9 | for (Iterator it = extInc.iterator(); it.hasNext(); ) { | | 9 | Collection globalTypedefStatements = |
10 | String inc = (String) it.next(); | | 10 | findTagValues(cls, "typedef_global_header"); |
11 | sb.append("#include <"); | | 11 | if (!globalTypedefStatements.isEmpty()) { |
12 | sb.append(inc).append('>').append(LINE_SEPARATOR); | | 12 | sb.append("// global type definitions for header defined " |
13 | } | | 13 | + "by Tag entries in ArgoUML"); |
14 | // separate external from local headers | | 14 | sb.append(LINE_SEPARATOR); |
15 | if (extInc.size() > 0) sb.append(LINE_SEPARATOR); | | 15 | sb.append("// Result: typedef <typedef_global_header> " |
16 | for (Iterator it = localInc.iterator(); it.hasNext(); ) { | | 16 | + "<tag_value>;"); |
17 | String inc = (String) it.next(); | | 17 | sb.append(LINE_SEPARATOR); |
18 | sb.append("#include \"").append(inc).append("\"" + LINE_SEPARATOR); | | 18 | Iterator typedefEnum = |
19 | } | | 19 | globalTypedefStatements.iterator(); |
20 | return sb; | | 20 | while (typedefEnum.hasNext()) { |
21 | } | | 21 | sb.append("typedef ").append(typedefEnum.next()); |
| | | 22 | sb.append(";").append(LINE_SEPARATOR); |
| | | 23 | } |
| | | 24 | } |
| | | 25 | } |
| | | 26 | else { |
| | | 27 | Collection globalTypedefStatements = |
| | | 28 | findTagValues(cls, "typedef_global_source"); |
| | | 29 | if (!globalTypedefStatements.isEmpty()) { |
| | | 30 | sb.append("// global type definitions for class " |
| | | 31 | + "implementation in source file defined by Tag " |
| | | 32 | + "entries in ArgoUML"); |
| | | 33 | sb.append(LINE_SEPARATOR); |
| | | 34 | sb.append("// Result: typedef <typedef_global_source> " |
| | | 35 | + "<tag_value>;"); |
| | | 36 | sb.append(LINE_SEPARATOR); |
| | | 37 | Iterator typedefEnum = globalTypedefStatements.iterator(); |
| | | 38 | while (typedefEnum.hasNext()) { |
| | | 39 | sb.append("typedef ").append(typedefEnum.next()); |
| | | 40 | sb.append(";").append(LINE_SEPARATOR); |
| | | 41 | } |
| | | 42 | } |
| | | 43 | } |
| | | 44 | } |
| | | 45 | return sb; |
| | | 46 | } |