]> iEval git - io-compress-brotli.git/blobdiff - lib/IO/Compress/Brotli.pm
Migrate 3 functions in the *.pm to *.xs
[io-compress-brotli.git] / lib / IO / Compress / Brotli.pm
index 9117f704d3a571aa8cfd238d0435b8843fb17ccb..a41c09bda19e2a8f7b292e86dead062173c59bac 100644 (file)
@@ -13,27 +13,6 @@ our @EXPORT_OK = @EXPORT;
 
 our $VERSION = '0.001001';
 
-sub create {
-       my ($class) = @_;
-       my $state = BrotliEncoderCreateInstance();
-       bless \$state, $class
-}
-
-sub DESTROY {
-       my ($self) = @_;
-       BrotliEncoderDestroyInstance($$self)
-}
-
-sub quality {
-    my ($self, $quality) = @_;
-    BrotliEncoderSetQuality($$self, $quality)
-}
-
-sub window {
-    my ($self, $window) = @_;
-    BrotliEncoderSetWindow($$self, $window)
-}
-
 my %BROTLI_ENCODER_MODE = ( generic => 0, text => 1, font => 2 );
 sub mode {
     my ($self, $mode) = @_;
@@ -41,34 +20,9 @@ sub mode {
     die "Invalid encoder mode"
         unless $BROTLI_ENCODER_MODE{$mode};
 
-    BrotliEncoderSetMode($$self, $mode)
+    _mode($$self, $mode)
 }
 
-use constant {
-    BROTLI_OPERATION_PROCESS => 0,
-    BROTLI_OPERATION_FLUSH   => 1,
-    BROTLI_OPERATION_FINISH  => 2
-};
-sub compress {
-       my ($self, $data) = @_;
-       BrotliEncoderCompressStream($$self, $data, BROTLI_OPERATION_PROCESS )
-}
-
-sub flush {
-       my ($self) = @_;
-       BrotliEncoderCompressStream($$self, '', BROTLI_OPERATION_FLUSH )
-}
-
-sub finish {
-       my ($self) = @_;
-       BrotliEncoderCompressStream($$self, '', BROTLI_OPERATION_FINISH )
-}
-
-# Untested, probably not working
-sub set_dictionary {
-       my ($self, $dict) = @_;
-       BrotliEncoderSetCustomDictionary($$self, $dict)
-}
 
 1;
 __END__
@@ -77,7 +31,7 @@ __END__
 
 =head1 NAME
 
-IO::Compress::Brotli - [Not yet implemented] Write Brotli buffers/streams
+IO::Compress::Brotli - Write Brotli buffers/streams
 
 =head1 SYNOPSIS
 
This page took 0.023229 seconds and 4 git commands to generate.