1 26 27 package org.objectweb.openccm.task; 28 29 import java.util.Iterator ; 31 32 33 40 public class CPPoptions 41 { 42 48 49 private boolean line_info_; 50 51 52 private java.util.List defines_; 53 54 55 private java.util.List undefines_; 56 57 58 private java.util.List includes_; 59 60 66 69 public CPPoptions() 70 { 71 line_info_ = false; 73 defines_ = new java.util.ArrayList (); 74 undefines_ = new java.util.ArrayList (); 75 includes_ = new java.util.ArrayList (); 76 } 77 78 84 89 protected String 90 getCPParguments() 91 { 92 String args = ""; 93 MacroType macro = null; 94 95 for (Iterator it = defines_.iterator(); it.hasNext();) 96 { 97 macro = (MacroType) it.next(); 98 args += "-D" + macro.getName(); 99 if (macro.getValue() != null) 100 args += "=" + macro.getValue(); 101 args += " "; 102 } 103 for (Iterator it = undefines_.iterator(); it.hasNext();) 104 { 105 args += "-U" + it.next() + " "; 106 } 107 for (Iterator it = includes_.iterator(); it.hasNext();) 108 { 109 args += "-I" + it.next() + " "; 110 } 111 if (line_info_) 112 args += "-P "; 113 114 return args; 115 } 116 117 123 128 public void 129 setLineinfo(boolean b) 130 { 131 line_info_ = b; 132 } 133 134 140 public void 141 addConfiguredDefine(MacroType macro) 142 { 143 defines_.add(macro); 144 } 145 146 151 public void 152 addConfiguredUndefine(StringType str) 153 { 154 undefines_.add(str.getName()); 155 } 156 157 162 public void 163 addConfiguredIncludepath(StringType dir) 164 { 165 includes_.add(dir.getName()); 166 } 167 168 } 169 | Popular Tags |