Mercurial > octave-nkf
comparison src/load-path.cc @ 9010:f914834836e7
Partial implementation of derived classes using the old form with "@" files.
author | rtshort@smoketree.phaselocked.com |
---|---|
date | Tue, 24 Mar 2009 11:29:53 -0400 |
parents | eb63fbe60fab |
children | 9b12ed1fbbbd |
comparison
equal
deleted
inserted
replaced
9009:da58ec8f62e8 | 9010:f914834836e7 |
---|---|
510 { | 510 { |
511 dir_info_list.clear (); | 511 dir_info_list.clear (); |
512 fcn_map.clear (); | 512 fcn_map.clear (); |
513 private_fcn_map.clear (); | 513 private_fcn_map.clear (); |
514 method_map.clear (); | 514 method_map.clear (); |
515 parent_map.clear (); | |
515 | 516 |
516 do_append (".", false); | 517 do_append (".", false); |
517 } | 518 } |
518 | 519 |
519 static std::list<std::string> | 520 static std::list<std::string> |
1014 { | 1015 { |
1015 const fcn_map_type& m = q->second; | 1016 const fcn_map_type& m = q->second; |
1016 | 1017 |
1017 const_fcn_map_iterator p = m.find (meth); | 1018 const_fcn_map_iterator p = m.find (meth); |
1018 | 1019 |
1019 if (p != m.end ()) | 1020 if (p == m.end ()) |
1021 { | |
1022 // Look in parent classes. | |
1023 | |
1024 const_parent_map_iterator r = parent_map.find (class_name); | |
1025 | |
1026 if (r != parent_map.end ()) | |
1027 { | |
1028 const std::list<std::string>& plist = r->second; | |
1029 std::list<std::string>::const_iterator it = plist.begin (); | |
1030 | |
1031 while (it != plist.end ()) | |
1032 { | |
1033 retval = do_find_method (*it, meth, dir_name, type); | |
1034 | |
1035 if (retval != "") | |
1036 break; | |
1037 | |
1038 it++; | |
1039 } | |
1040 } | |
1041 } | |
1042 else | |
1020 { | 1043 { |
1021 const file_info_list_type& file_info_list = p->second; | 1044 const file_info_list_type& file_info_list = p->second; |
1022 | 1045 |
1023 for (const_file_info_list_iterator i = file_info_list.begin (); | 1046 for (const_file_info_list_iterator i = file_info_list.begin (); |
1024 i != file_info_list.end (); | 1047 i != file_info_list.end (); |
1533 } | 1556 } |
1534 | 1557 |
1535 os << "\n"; | 1558 os << "\n"; |
1536 | 1559 |
1537 #endif | 1560 #endif |
1561 } | |
1562 | |
1563 void | |
1564 load_path::do_add_to_parent_map (const std::string& classname, | |
1565 const std::list<std::string>& parent_list) const | |
1566 { | |
1567 parent_map[classname] = parent_list; | |
1538 } | 1568 } |
1539 | 1569 |
1540 void | 1570 void |
1541 load_path::add_to_fcn_map (const dir_info& di, bool at_end) const | 1571 load_path::add_to_fcn_map (const dir_info& di, bool at_end) const |
1542 { | 1572 { |