(code)
| 248 | |
| 249 | |
| 250 | def decode(code): |
| 251 | encodeMap = { |
| 252 | "c": "char", |
| 253 | "i": "int", |
| 254 | "s": "short", |
| 255 | "l": "long", |
| 256 | "q": "long long", |
| 257 | "C": "unsigned char", |
| 258 | "I": "unsigned int", |
| 259 | "S": "unsigned short", |
| 260 | "L": "unsigned long", |
| 261 | "Q": "unsigned long long", |
| 262 | "f": "float", |
| 263 | "d": "double", |
| 264 | "B": "bool", |
| 265 | "v": "void", |
| 266 | "*": "char *", |
| 267 | "@": "id", |
| 268 | "#": "Class", |
| 269 | ":": "SEL", |
| 270 | } |
| 271 | |
| 272 | ret = code |
| 273 | if code in encodeMap: |
| 274 | ret = encodeMap[code] |
| 275 | elif ret[0:1] == "@": |
| 276 | if ret[1:2] == "?": # @? represent a block |
| 277 | ret = code |
| 278 | elif ret[2:3] == "<": # @"<aDelegate><bDelegate>" |
| 279 | ret = "id" + ret[2:-1].replace("><", ", ") |
| 280 | else: |
| 281 | ret = ret[2:-1] + " *" |
| 282 | elif ret[0:1] == "^": |
| 283 | ret = decode(ret[1:]) + " *" |
| 284 | |
| 285 | return ret |
| 286 | |
| 287 | |
| 288 | # Notice that evaluateExpression doesn't work with variable arguments. such as -[NSString stringWithFormat:] |
no outgoing calls
no test coverage detected