| 1262 | // ---------------------------------------------------------------------------------------- |
| 1263 | |
| 1264 | class_record convert_tok_class_record ( |
| 1265 | const tok_class_record& rec, |
| 1266 | const unsigned long expand_tabs |
| 1267 | ) |
| 1268 | { |
| 1269 | class_record crec; |
| 1270 | |
| 1271 | |
| 1272 | crec.scope = rec.scope; |
| 1273 | crec.file = rec.file; |
| 1274 | crec.comment = format_comment(rec.comment, expand_tabs); |
| 1275 | |
| 1276 | crec.name.clear(); |
| 1277 | |
| 1278 | // find the first class token |
| 1279 | for (unsigned long i = 0; i+1 < rec.declaration.size(); ++i) |
| 1280 | { |
| 1281 | if (rec.declaration[i].first == tok_type::KEYWORD && |
| 1282 | (rec.declaration[i].second == "class" || |
| 1283 | rec.declaration[i].second == "struct" ) |
| 1284 | ) |
| 1285 | { |
| 1286 | crec.name = rec.declaration[i+1].second; |
| 1287 | break; |
| 1288 | } |
| 1289 | } |
| 1290 | |
| 1291 | crec.declaration = pretty_print_declaration(rec.declaration); |
| 1292 | |
| 1293 | for (unsigned long i = 0; i < rec.public_typedefs.size(); ++i) |
| 1294 | crec.public_typedefs.push_back(convert_tok_typedef_record(rec.public_typedefs[i])); |
| 1295 | |
| 1296 | for (unsigned long i = 0; i < rec.public_variables.size(); ++i) |
| 1297 | crec.public_variables.push_back(convert_tok_variable_record(rec.public_variables[i])); |
| 1298 | |
| 1299 | for (unsigned long i = 0; i < rec.protected_typedefs.size(); ++i) |
| 1300 | crec.protected_typedefs.push_back(convert_tok_typedef_record(rec.protected_typedefs[i])); |
| 1301 | |
| 1302 | for (unsigned long i = 0; i < rec.protected_variables.size(); ++i) |
| 1303 | crec.protected_variables.push_back(convert_tok_variable_record(rec.protected_variables[i])); |
| 1304 | |
| 1305 | for (unsigned long i = 0; i < rec.public_methods.size(); ++i) |
| 1306 | crec.public_methods.push_back(convert_tok_method_record(rec.public_methods[i], expand_tabs)); |
| 1307 | |
| 1308 | for (unsigned long i = 0; i < rec.protected_methods.size(); ++i) |
| 1309 | crec.protected_methods.push_back(convert_tok_method_record(rec.protected_methods[i], expand_tabs)); |
| 1310 | |
| 1311 | for (unsigned long i = 0; i < rec.public_inner_classes.size(); ++i) |
| 1312 | crec.public_inner_classes.push_back(convert_tok_class_record(rec.public_inner_classes[i], expand_tabs)); |
| 1313 | |
| 1314 | for (unsigned long i = 0; i < rec.protected_inner_classes.size(); ++i) |
| 1315 | crec.protected_inner_classes.push_back(convert_tok_class_record(rec.protected_inner_classes[i], expand_tabs)); |
| 1316 | |
| 1317 | |
| 1318 | return crec; |
| 1319 | } |
| 1320 | |
| 1321 | // ---------------------------------------------------------------------------------------- |
no test coverage detected