X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-File-KDBX;a=blobdiff_plain;f=lib%2FFile%2FKDBX%2FDumper.pm;h=7e2741c9353fb1212b03e168bec57110a946c403;hp=8be64be930cbda8f003d445c45a06be96e535fd0;hb=37b09e0f2832514b33de4499a83f22d5ffe7c0a3;hpb=8a37f035ef35682b764c34e7b3c61ce03318b1c7 diff --git a/lib/File/KDBX/Dumper.pm b/lib/File/KDBX/Dumper.pm index 8be64be..7e2741c 100644 --- a/lib/File/KDBX/Dumper.pm +++ b/lib/File/KDBX/Dumper.pm @@ -7,6 +7,7 @@ use strict; use Crypt::Digest qw(digest_data); use File::KDBX::Constants qw(:magic :header :version :random_stream); use File::KDBX::Error; +use File::KDBX::Util qw(:class); use File::KDBX; use IO::Handle; use Module::Load; @@ -254,10 +255,6 @@ The most common reason to explicitly specify the file format is to save a databa $kdbx->dump_file('database.xml', format => 'XML'); -=cut - -sub format { $_[0]->{format} } - =attr inner_format Get the format of the data inside the KDBX envelope. This only applies to C and C formats. Possible @@ -267,23 +264,6 @@ formats: * C - Write the database groups and entries as XML (default) * C - Write L instead of the actual database contents -=cut - -sub inner_format { $_[0]->{inner_format} // 'XML' } - -=attr min_version - - $min_version = File::KDBX::Dumper->min_version; - -Get the minimum KDBX file version supported, which is 3.0 or C<0x00030000> as -it is encoded. - -To generate older KDBX files unsupported by this module, try L. - -=cut - -sub min_version { KDBX_VERSION_OLDEST } - =attr allow_upgrade $bool = $dumper->allow_upgrade; @@ -294,10 +274,6 @@ too low to support new features being used. The default is to allow upgrading. -=cut - -sub allow_upgrade { $_[0]->{allow_upgrade} // 1 } - =attr randomize_seeds $bool = $dumper->randomize_seeds; @@ -308,7 +284,23 @@ they are. =cut -sub randomize_seeds { $_[0]->{randomize_seeds} // 1 } +has 'format', is => 'ro'; +has 'inner_format', is => 'ro', default => 'XML'; +has 'allow_upgrade', is => 'ro', default => 1; +has 'randomize_seeds', is => 'ro', default => 1; + +=method min_version + + $min_version = File::KDBX::Dumper->min_version; + +Get the minimum KDBX file version supported, which is 3.0 or C<0x00030000> as +it is encoded. + +To generate older KDBX files unsupported by this module, try L. + +=cut + +sub min_version { KDBX_VERSION_OLDEST } sub _fh { $_[0]->{fh} or throw 'IO handle not set' }