|Git::Raw::Filter(3pm)||User Contributed Perl Documentation||Git::Raw::Filter(3pm)|
NAME¶Git::Raw::Filter - Git filter class
DESCRIPTION¶A Git::Raw::Filter represents a Git filter.
WARNING: The API of this module is unstable and may change without warning (any change will be appropriately documented in the changelog).
create( $name, $attributes)¶Create a filter. $name is a name by which the filter can be referenced. $attributes is a whitespace-separated list of attribute names to check for this filter (e.g. "eol crlf text"). If the attribute name is bare, it will be simply loaded and passed to the "check" callback. If it has a value (i.e. "name=value"), the attribute must match that value for the filter to be applied.
callbacks( \%callbacks )¶Set the callbacks for the filter. %callbacks may specificy the following callbacks.
Optional callback to be invoked before a filter is first used. It will be called once at most.
Optional callback to be invoked when the filter is unregistered or when the library is shutting down. It will be called once at most. This may be called even if "initialize" has never been called.
Optional callback that checks if filtering is needed for a given source. The callback receives the following parameters: The filter source, a Git::Raw::Filter::Source object.
If the filter should be applied, "Git::Raw::Error->OK" should be returned. If the filter should be skipped, "Git::Raw::Error->PASSTHROUGH" should be returned.
Callback that actually filters data.
The callback receives the following parameters: The filter source, a Git::Raw::Filter::Source object, $from the source data and $to, a scalar reference where the output should be written to.
If the filter successfully writes the output, "Git::Raw::Error->OK" should be returned. If the filter failed, "Git::Raw::Error->ERROR" should be returned. If the filter does not want to run, "Git::Raw::Error->PASSTHROUGH" should be returned.
Optional callback to clean up after filtering has been applied.
register( $priority )¶Register the filter with priority $priority.
unregister( )¶Remove the filter.
AUTHOR¶Alessandro Ghedini <email@example.com>
Jacques Germishuys <firstname.lastname@example.org>
LICENSE AND COPYRIGHT¶Copyright 2014 Alessandro Ghedini.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.