# HG changeset patch # User John W. Eaton # Date 1216928560 14400 # Node ID dd5cc5016487f81a49b0f17a8127cdabc61a4c6c # Parent b6d4c644b4b61ada8f5f7ede36072a9b64005389 handle private functions in class directories diff -r b6d4c644b4b6 -r dd5cc5016487 src/ChangeLog --- a/src/ChangeLog Thu Jul 24 13:03:36 2008 -0400 +++ b/src/ChangeLog Thu Jul 24 15:42:40 2008 -0400 @@ -1,5 +1,13 @@ 2008-07-24 John W. Eaton + * load-path.h (load_path::dir_info::class_info): New struct. + (load_path::dir_info::method_file_map_type): Now a map from + class name to a to a class_info object. Change all uses. + * load-path.cc (load_path::dir_info::get_method_file_map): + Also look for private functions in the class directory. + (load_path::add_to_method_map): Also add private functions from + class directories to private_fcn_map. + * dirfns.cc (Fmkdir): If directory already exists, return status = true, but also set error message. diff -r b6d4c644b4b6 -r dd5cc5016487 src/load-path.cc --- a/src/load-path.cc Thu Jul 24 13:03:36 2008 -0400 +++ b/src/load-path.cc Thu Jul 24 15:42:40 2008 -0400 @@ -218,7 +218,14 @@ load_path::dir_info::get_method_file_map (const std::string& d, const std::string& class_name) { - method_file_map[class_name] = get_fcn_files (d); + method_file_map[class_name].method_file_map = get_fcn_files (d); + + std::string pd = file_ops::concat (d, "private"); + + file_stat fs (pd); + + if (fs && fs.is_dir ()) + method_file_map[class_name].private_file_map = get_fcn_files (pd); } bool @@ -1346,7 +1353,9 @@ os << "\n*** methods in " << i->dir_name << "/@" << p->first << ":\n\n"; - string_vector method_files = get_file_list (p->second); + const dir_info::class_info& ci = p->second; + + string_vector method_files = get_file_list (ci.method_file_map); method_files.list_in_columns (os); } @@ -1494,7 +1503,7 @@ { std::string dir_name = di.dir_name; - // > + // dir_info::method_file_map_type method_file_map = di.method_file_map; for (dir_info::const_method_file_map_iterator q = method_file_map.begin (); @@ -1508,8 +1517,10 @@ std::string full_dir_name = file_ops::concat (dir_name, "@" + class_name); + const dir_info::class_info& ci = q->second; + // - const dir_info::fcn_file_map_type& m = q->second; + const dir_info::fcn_file_map_type& m = ci.method_file_map; for (dir_info::const_fcn_file_map_iterator p = m.begin (); p != m.end (); @@ -1549,6 +1560,12 @@ fi.types = types; } } + + // + dir_info::fcn_file_map_type private_file_map = ci.private_file_map; + + if (! private_file_map.empty ()) + private_fcn_map[full_dir_name] = private_file_map; } } diff -r b6d4c644b4b6 -r dd5cc5016487 src/load-path.h --- a/src/load-path.h Thu Jul 24 13:03:36 2008 -0400 +++ b/src/load-path.h Thu Jul 24 15:42:40 2008 -0400 @@ -233,8 +233,14 @@ typedef fcn_file_map_type::const_iterator const_fcn_file_map_iterator; typedef fcn_file_map_type::iterator fcn_file_map_iterator; - // > - typedef std::map method_file_map_type; + struct class_info + { + fcn_file_map_type method_file_map; + fcn_file_map_type private_file_map; + }; + + // + typedef std::map method_file_map_type; typedef method_file_map_type::const_iterator const_method_file_map_iterator; typedef method_file_map_type::iterator method_file_map_iterator;