17 Dec 2009 07:27:04 UTC
- Development release
- Distribution: KinoSearch
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (5)
- Testers (41 / 0 / 8)
- KwaliteeBus factor: 0
- License: perl_5
- Activity24 month
- Download (810.65KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionCREAMYG Marvin Humphreyand 1 contributors
- Marvin Humphrey <marvin at rectangular dot com>
- COPYRIGHT AND LICENSE
Boilerplater::File - Structured representation of the contents of a Boilerplater source file.
An abstraction representing a file which contains Boilerplater code.
my $file_obj = Boilerplater::File->new( blocks => \@blocks, # required source_class => 'Dog::Dalmation', # required parcel => 'Dog', # default: special );
blocks - An arrayref. Each element must be either a Boilerplater::Class, a Boilerplater::Parcel, or a Boilerplater::CBlock.
source_class - The class name associated with the source file, regardless of how what classes are defined in the source file. Example: If source_class is "Foo::Bar", that implies that the source file could be found at 'Foo/Bar.bp' within the source directory and that the output C header file should be 'Foo/Bar.h' within the target include directory.
parcel - A Boilerplater::Parcel or parcel name.
my @blocks = $file->blocks;
Return all blocks as a list.
my @classes = $file->classes;
Return all Boilerplater::Class blocks from the file as a list.
Accessors for the file's "modified" property, which is initially false.
# '/path/to/Source/Class.c', etc. my $c_path = $file->c_path('/path/to'); my $h_path = $file->h_path('/path/to'); my $bp_path = $file->bp_path('/path/to');
Given a base directory, return a path name derived from the File's source_class with the specified extension.
# e.g. "H_DOG_DALMATION" my $guard_name = $file->guard_name
Return a string used for an include guard in a C header, unique per file.
Return a string opening the include guard.
Return a string closing the include guard. Other classes count on being able to match this string.
Copyright 2008-2009 Marvin Humphrey
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.