Slackware::Slackget::Network::Backend::Bzip2 - Bzip2 backend for slack-get network protocol


Slackware-Slackget documentation Contained in the Slackware-Slackget distribution.

Index


Code Index:

NAME

Top

Slackware::Slackget::Network::Backend::Bzip2 - Bzip2 backend for slack-get network protocol

VERSION

Top

Version 0.8.0

SYNOPSIS

Top

Still to do

CONSTRUCTOR

Top

new

Still to do

FUNCTIONS

Top

All methods return a Slackware::Slackget::Network::Message (Slackware::Slackget::Network::Message) object, and if the remote slack-getd return some data they are accessibles via the data() accessor of the Slackware::Slackget::Network::Message object.

backend_decode

backend_encode

AUTHOR

Top

DUPUIS Arnaud, <a.dupuis@infinityperl.org>

BUGS

Top

Please report any bugs or feature requests to bug-Slackware-Slackget@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Slackware-Slackget. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Slackware::Slackget




You can also look for information at:

* Infinity Perl website

http://www.infinityperl.org/category/slack-get

* slack-get specific website

http://slackget.infinityperl.org

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Slackware-Slackget

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Slackware-Slackget

* CPAN Ratings

http://cpanratings.perl.org/d/Slackware-Slackget

* Search CPAN

http://search.cpan.org/dist/Slackware-Slackget

ACKNOWLEDGEMENTS

Top

Thanks to Bertrand Dupuis (yes my brother) for his contribution to the documentation.

SEE ALSO

Top

Slackware::Slackget::Network::Message, Slackware::Slackget::Status, Slackware::Slackget::Network::Connection

COPYRIGHT & LICENSE

Top


Slackware-Slackget documentation Contained in the Slackware-Slackget distribution.
package Slackware::Slackget::Network::Backend::Bzip2;

use warnings;
use strict;
require Slackware::Slackget::Network::Message ;
use Compress::Bzip2 ;

our $VERSION = '0.8.0';

sub new
{
	my ($class,%args) = @_ ;
	my $self = {%args};
	bless($self,$class);
	return $self;
}

sub backend_decode {
	my $self = shift;
	my $Bzip2_msg = shift;
	print "[Slackware::Slackget::Network::Backend::Bzip2] call backend_decode($Bzip2_msg).\n" if($ENV{SG_DAEMON_DEBUG}) ;
	my $raw = $Bzip2_msg->data ;
	my $data = memBunzip( $raw );
	print "[Slackware::Slackget::Network::Backend::Bzip2] decoded data are :\n".$data."\n" if($ENV{SG_DAEMON_DEBUG}) ;
	return Slackware::Slackget::Network::Message->new(raw_data => $data);
}

sub backend_encode {
	my $self = shift;
	my $message = shift ;
	print "[Slackware::Slackget::Network::Backend::Bzip2] call backend_encode($message).\n" if($ENV{SG_DAEMON_DEBUG}) ;
	my $raw = $message->data();
	my $Bzip2 = memBzip($raw);
	print "[Slackware::Slackget::Network::Backend::Bzip2] encoded Bzip2:\n$Bzip2\n" if($ENV{SG_DAEMON_DEBUG});
	return Slackware::Slackget::Network::Message->new(
		action => $message->action,
		action_id => $message->{action_id},
		raw_data => $Bzip2,
	);
}



1; # End of Slackware::Slackget::Network::Backend::Bzip2