Clang::CastXML::Container - Container class for XML output from CastXML
version 0.02
use Clang::CastXML; my $castxml = Clang::CastXML->new; my $container = $castxml->introspect(' int add(int,int); '); # get the raw XML output from CastXML my $xml = $container->to_xml; # get a nested datastructure (hash reference) # of the output from CastXML my $perl = $container->to_href;
This class provides an interface to the output generated from CastXML. You can assume that the CastXML successfully processed the C/C++ source, because the Clang::CastXML method introspect
will throw an exception if there is an error there, rather than return a bad object.
my $result = $container->result;
This is a Clang::CastXML::Wrapper::Result, which contains the raw output of the process run.
my $source = $container->source.
This is a Path::Tiny which points to the C/C++ source file.
my $dest = $container->dest;
This is a Path::Tiny which points to the XML output file.
my $xml = $xml->to_xml;
Returns the raw XML as a utf-8 string.
my $perl = $container->to_href;
Returns a set of nested data structures (hash references, array references, etc) with the same data as what is in the raw XML. This is probably easier for Perl to grock than the raw XML.
May throw an exception:
If there is an error parsing the XML.
Graham Ollis <plicease@cpan.org>
This software is copyright (c) 2020 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.