# HG changeset patch # User John W. Eaton # Date 1591822891 14400 # Node ID 55f82d23fe5eebce09ddb56a22f6cf86f41bdddd # Parent 8f3aedc5ab4f26fd22619fcce9aff16e2fd7aa40 new octave_classdef_meta::is_classdef_method function * ov-classdef.h, ov-classdef.cc (octave_classdef_meta::is_classdef_method): New function. diff -r 8f3aedc5ab4f -r 55f82d23fe5e libinterp/octave-value/ov-classdef.cc --- a/libinterp/octave-value/ov-classdef.cc Tue Jun 09 16:48:17 2020 -0400 +++ b/libinterp/octave-value/ov-classdef.cc Wed Jun 10 17:01:31 2020 -0400 @@ -389,6 +389,25 @@ return octave::to_ov (octave::lookup_class (cls)); } +bool octave_classdef_meta::is_classdef_method (const std::string& cname) const +{ + bool retval = false; + + if (object.is_method ()) + { + if (cname.empty ()) + retval = true; + else + { + octave::cdef_method meth (object); + + return meth.is_defined_in_class (cname); + } + } + + return retval; +} + bool octave_classdef_meta::is_classdef_constructor (const std::string& cname) const { bool retval = false; diff -r 8f3aedc5ab4f -r 55f82d23fe5e libinterp/octave-value/ov-classdef.h --- a/libinterp/octave-value/ov-classdef.h Tue Jun 09 16:48:17 2020 -0400 +++ b/libinterp/octave-value/ov-classdef.h Wed Jun 10 17:01:31 2020 -0400 @@ -218,6 +218,8 @@ bool accepts_postfix_index (char type) const { return object.meta_accepts_postfix_index (type); } + bool is_classdef_method (const std::string& cname = "") const; + bool is_classdef_constructor (const std::string& cname = "") const; private: