<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package Data::Dump::FilterContext;

sub new {
    my($class, $obj, $oclass, $type, $ref, $pclass, $pidx, $idx) = @_;
    return bless {
	object =&gt; $obj,
	class =&gt; $ref &amp;&amp; $oclass,
	reftype =&gt; $type,
	is_ref =&gt; $ref,
	pclass =&gt; $pclass,
	pidx =&gt; $pidx,
	idx =&gt; $idx,
    }, $class;
}

sub object_ref {
    my $self = shift;
    return $self-&gt;{object};
}

sub class {
    my $self = shift;
    return $self-&gt;{class} || "";
}

*is_blessed = \&amp;class;

sub reftype {
    my $self = shift;
    return $self-&gt;{reftype};
}

sub is_scalar {
    my $self = shift;
    return $self-&gt;{reftype} eq "SCALAR";
}

sub is_array {
    my $self = shift;
    return $self-&gt;{reftype} eq "ARRAY";
}

sub is_hash {
    my $self = shift;
    return $self-&gt;{reftype} eq "HASH";
}

sub is_code {
    my $self = shift;
    return $self-&gt;{reftype} eq "CODE";
}

sub is_ref {
    my $self = shift;
    return $self-&gt;{is_ref};
}

sub container_class {
    my $self = shift;
    return $self-&gt;{pclass} || "";
}

sub container_self {
    my $self = shift;
    return "" unless $self-&gt;{pclass};
    my $idx = $self-&gt;{idx};
    my $pidx = $self-&gt;{pidx};
    return Data::Dump::fullname("self", [@$idx[$pidx..(@$idx - 1)]]);
}

sub object_isa {
    my($self, $class) = @_;
    return $self-&gt;{class} &amp;&amp; $self-&gt;{class}-&gt;isa($class);
}

sub container_isa {
    my($self, $class) = @_;
    return $self-&gt;{pclass} &amp;&amp; $self-&gt;{pclass}-&gt;isa($class);
}

sub depth {
    my $self = shift;
    return scalar @{$self-&gt;{idx}};
}

1;
</pre></body></html>