#!/bin/perl # -*- perl -*- use Getopt::Long; use SelfLoader; @includes = (); sub Init { my %options; GetOptions(\%options,"help|h","pod","I=s@","H=s"); if ($options{'help'}) { help_msg(); exit; } if ($options{'pod'}) { pod_msg(); exit; } } ## MAIN ## Init(); __DATA__ sub help_msg() { print $0 . <<__end_help; [-I include] [-H hpath] class.m.emb generate an objc class from a partial definition options: I - add a path to the include path list H - specify where to put the .h file help - this message pod - man page __end_help } sub pod_msg() { my $more; if ($ENV{'PAGER'}) { $more = $ENV{'PAGER'}; } else { $more = 'more'; } system("pod2text $0 | $more"); } __END__ =head1 NAME B - Generate a complete Objective C class from only a partial definition. =head1 SYNOPSIS =over 4 emb-genclass [B<-I> I] [B<-H> I<.h dir>] I =back =head1 DESCRIPTION =over 4 B accepts a class.m.emb file and outputs a class.m and class.h file as a result. Its operation involves deriving the over all class structure from a partial .m file (with certain additional information provided there) and generating well-formed Objective-C classes. It generates accessors for all variables that do not have defined accessors. It creates the .h file based on a list of variables in the header of the .emb file and the methods defined there, in addition to the automated methods derived from the variable list. =back =head1 OPTIONS =over 4 =item B<-I> Add an include directory to the include dir list. This is used to derive the #include in the resulting class file. =item B<-H> Tell genclass the directory where the resulting .h file is to reside for output (defualt is currect directory). =back =head1 AUTHOR =over 4 B, which is based on an older script called genclass.pl, was written by Nick Rusnov . =back =cut