Mercurial > octave
diff libinterp/octave-value/cdef-class.h @ 28379:e5b76489b1f2
allow help to find docstrings for classdef classes and methods (bug #43047)
* help.cc (help_system::raw_help_from_symbol_table): Also find
docstrings from classdef meta objects (both classes and methods).
* cdef-class.h, cdef-class.cc (cdef_class::cdef_class_rep,
cdef_class): Store docstring for class and provide access.
* ov-classdef.h, ov-classdef.cc (octave_classdef_meta::doc_string):
New function to provide access to doc strings for classdef objects
and methods.
* ov-fcn.h (octave_function::doc_string): Now virtual. New argument
for method name.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 29 May 2020 10:57:04 -0400 |
parents | ec769a7ab9fb |
children | 853e60367cb6 0a5b15007766 |
line wrap: on
line diff
--- a/libinterp/octave-value/cdef-class.h Fri May 29 10:56:22 2020 -0400 +++ b/libinterp/octave-value/cdef-class.h Fri May 29 10:57:04 2020 -0400 @@ -151,6 +151,10 @@ bool is_meta_class (void) const { return meta; } + void doc_string (const std::string& txt) { m_doc_string = txt; } + + std::string doc_string (void) const { return m_doc_string; } + private: void load_all_methods (void); @@ -174,6 +178,8 @@ std::string directory; + std::string m_doc_string; + // The methods defined by this class. std::map<std::string,cdef_method> method_map; @@ -374,6 +380,10 @@ bool is_meta_class (void) const { return get_rep ()->is_meta_class (); } + void doc_string (const std::string& txt) { get_rep ()->doc_string (txt); } + + std::string doc_string (void) const { return get_rep ()->doc_string (); } + public: enum