Mercurial > octave-nkf
comparison src/load-path.cc @ 7971:dd5cc5016487
handle private functions in class directories
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 24 Jul 2008 15:42:40 -0400 |
parents | 37ff0c21c17d |
children | a2ab20ba78f7 |
comparison
equal
deleted
inserted
replaced
7970:b6d4c644b4b6 | 7971:dd5cc5016487 |
---|---|
216 | 216 |
217 void | 217 void |
218 load_path::dir_info::get_method_file_map (const std::string& d, | 218 load_path::dir_info::get_method_file_map (const std::string& d, |
219 const std::string& class_name) | 219 const std::string& class_name) |
220 { | 220 { |
221 method_file_map[class_name] = get_fcn_files (d); | 221 method_file_map[class_name].method_file_map = get_fcn_files (d); |
222 | |
223 std::string pd = file_ops::concat (d, "private"); | |
224 | |
225 file_stat fs (pd); | |
226 | |
227 if (fs && fs.is_dir ()) | |
228 method_file_map[class_name].private_file_map = get_fcn_files (pd); | |
222 } | 229 } |
223 | 230 |
224 bool | 231 bool |
225 load_path::instance_ok (void) | 232 load_path::instance_ok (void) |
226 { | 233 { |
1344 p++) | 1351 p++) |
1345 { | 1352 { |
1346 os << "\n*** methods in " << i->dir_name | 1353 os << "\n*** methods in " << i->dir_name |
1347 << "/@" << p->first << ":\n\n"; | 1354 << "/@" << p->first << ":\n\n"; |
1348 | 1355 |
1349 string_vector method_files = get_file_list (p->second); | 1356 const dir_info::class_info& ci = p->second; |
1357 | |
1358 string_vector method_files = get_file_list (ci.method_file_map); | |
1350 | 1359 |
1351 method_files.list_in_columns (os); | 1360 method_files.list_in_columns (os); |
1352 } | 1361 } |
1353 } | 1362 } |
1354 } | 1363 } |
1492 void | 1501 void |
1493 load_path::add_to_method_map (const dir_info& di, bool at_end) const | 1502 load_path::add_to_method_map (const dir_info& di, bool at_end) const |
1494 { | 1503 { |
1495 std::string dir_name = di.dir_name; | 1504 std::string dir_name = di.dir_name; |
1496 | 1505 |
1497 // <CLASS_NAME, <FCN_NAME, TYPES>> | 1506 // <CLASS_NAME, CLASS_INFO> |
1498 dir_info::method_file_map_type method_file_map = di.method_file_map; | 1507 dir_info::method_file_map_type method_file_map = di.method_file_map; |
1499 | 1508 |
1500 for (dir_info::const_method_file_map_iterator q = method_file_map.begin (); | 1509 for (dir_info::const_method_file_map_iterator q = method_file_map.begin (); |
1501 q != method_file_map.end (); | 1510 q != method_file_map.end (); |
1502 q++) | 1511 q++) |
1506 fcn_map_type& fm = method_map[class_name]; | 1515 fcn_map_type& fm = method_map[class_name]; |
1507 | 1516 |
1508 std::string full_dir_name | 1517 std::string full_dir_name |
1509 = file_ops::concat (dir_name, "@" + class_name); | 1518 = file_ops::concat (dir_name, "@" + class_name); |
1510 | 1519 |
1520 const dir_info::class_info& ci = q->second; | |
1521 | |
1511 // <FCN_NAME, TYPES> | 1522 // <FCN_NAME, TYPES> |
1512 const dir_info::fcn_file_map_type& m = q->second; | 1523 const dir_info::fcn_file_map_type& m = ci.method_file_map; |
1513 | 1524 |
1514 for (dir_info::const_fcn_file_map_iterator p = m.begin (); | 1525 for (dir_info::const_fcn_file_map_iterator p = m.begin (); |
1515 p != m.end (); | 1526 p != m.end (); |
1516 p++) | 1527 p++) |
1517 { | 1528 { |
1547 file_info& fi = *p2; | 1558 file_info& fi = *p2; |
1548 | 1559 |
1549 fi.types = types; | 1560 fi.types = types; |
1550 } | 1561 } |
1551 } | 1562 } |
1563 | |
1564 // <FCN_NAME, TYPES> | |
1565 dir_info::fcn_file_map_type private_file_map = ci.private_file_map; | |
1566 | |
1567 if (! private_file_map.empty ()) | |
1568 private_fcn_map[full_dir_name] = private_file_map; | |
1552 } | 1569 } |
1553 } | 1570 } |
1554 | 1571 |
1555 std::string | 1572 std::string |
1556 genpath (const std::string& dirname, const string_vector& skip) | 1573 genpath (const std::string& dirname, const string_vector& skip) |