comparison libinterp/octave-value/cdef-method.cc @ 28515:49f4d7814760 stable

find help for not-yet-loaded classdef methods defined in @DIR files. * cdef-method.h, cdef-method.cc (cdef_method::get_doc_string, (cdef_method::cdef_method_rep::get_doc_string): New methods. * ov-classdef.cc (octave_classdef_meta::doc_string): Use find_method to lookup classdef method definition instead of instead of get_method. If method is defined, use cdef_method::get_doc_string to access doc string.
author John W. Eaton <jwe@octave.org>
date Mon, 29 Jun 2020 15:01:27 -0400
parents b018f553fd85
children 0a5b15007766
comparison
equal deleted inserted replaced
28514:fab862fedf85 28515:49f4d7814760
188 return (function.is_function () 188 return (function.is_function ()
189 ? function.function_value ()->dispatch_class () == cname 189 ? function.function_value ()->dispatch_class () == cname
190 : false); 190 : false);
191 } 191 }
192 192
193 std::string
194 cdef_method::cdef_method_rep::get_doc_string (void)
195 {
196 check_method ();
197
198 octave_function *fcn = function.function_value ();
199
200 return fcn ? fcn->doc_string () : "";
201 }
202
193 bool 203 bool
194 cdef_method::cdef_method_rep::check_access (void) const 204 cdef_method::cdef_method_rep::check_access (void) const
195 { 205 {
196 cdef_class cls (to_cdef (get ("DefiningClass"))); 206 cdef_class cls (to_cdef (get ("DefiningClass")));
197 207