NAME
Thrift::IDL - Parser and OO representation of a Thrift interface definintion language (IDL)
SYNOPSIS
my
$idl
= Thrift::IDL->parse_thrift_file(
'tutorial.thrift'
);
foreach
my
$service
(
$idl
->services) {
printf
"Offers service '%s':\n"
,
$service
->name;
}
DESCRIPTION
The Thrift interface definition language (IDL) file is a structured file describing all the data types, services, methods, etc. of a Thrift interface. This is necessary if you need an in-memory representation of the Thrift schema.
METHODS
parse_thrift_file ($input_filename, $debug)
my
$document
= Thrift::IDL->parse_thrift_file(
'tutorial.thrift'
);
Given a filename of a Thrift IDL file and an optional boolean for debug output, parse the input file into a Thrift::IDL::Document object and return it. The debug flag will cause verbose output on STDERR.
parse_thrift ($data, $debug)
my
$document
= Thrift::IDL->parse_thrift(...);
Given a scalar of a Thrift IDL file and an optional boolean for debug output, parse the input into a Thrift::IDL::Document object and return it. The debug flag will cause verbose output on STDERR.
NOTE: If the thrift references other documents via an include statement, you'll need to use absolute paths