cdef_property class

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

cdef_property class


I was trying to fix bug #55766: properties function should not return
Hidden properties.  Looking at the properties() function in
there is a simple for loop over the properties of the class and any
non-public properties are rejected.

for (const auto& pname_prop : property_map)
    octave_value acc = pname_prop.second.get ("GetAccess");

    if (! acc.is_string () || acc.string_value () != "public")

So I thought this would be easy and I added to the above.

bool hid = pname_prop.second.get ("Hidden").bool_value ();
if (hid)

At runtime, however, I get a nasty error about not being able to take a
bool_value on a type of 'sq_string'.

This is odd, so for debugging I added

octave_value hid = pname_prop.second.get ("Hidden");
std::cerr << hid.string_value () << std::endl;

Now, for a classdef file that contains

    properties (Hidden = true)

I find that the string is


Does anyone know how this is supposed to work?