X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-File-KDBX;a=blobdiff_plain;f=lib%2FFile%2FKDBX%2FLoader.pm;h=628fe98814e8aad3d03c9e59fce792835c09e2c7;hp=9f513218949255a234b2438d4c4a6e5276708246;hb=63d73bf382edfb0089b36a45193fc2835cb58b6d;hpb=cfe6ddf632ec8f9ce9569fbf4c7e759160ba3419 diff --git a/lib/File/KDBX/Loader.pm b/lib/File/KDBX/Loader.pm index 9f51321..628fe98 100644 --- a/lib/File/KDBX/Loader.pm +++ b/lib/File/KDBX/Loader.pm @@ -6,7 +6,7 @@ use strict; use File::KDBX::Constants qw(:magic :header :version); use File::KDBX::Error; -use File::KDBX::Util qw(:io); +use File::KDBX::Util qw(:class :io); use File::KDBX; use IO::Handle; use Module::Load (); @@ -105,7 +105,7 @@ sub reset { Load a KDBX file. -The C<$key> is either a L or a primitive that can be converted to a Key object. +The C<$key> is either a L or a primitive that can be cast to a Key object. =cut @@ -212,25 +212,30 @@ sub kdbx { =attr format -TODO +Get the file format used for reading the database. Normally the format is auto-detected from the data stream. +This auto-detection works well, so there's not really a good reason to explicitly specify the format. +Possible formats: -=cut - -sub format { $_[0]->{format} } -sub inner_format { $_[0]->{inner_format} // 'XML' } +=for :list +* C +* C +* C +* C +* C -=attr min_version +=attr inner_format - $min_version = File::KDBX::Loader->min_version; +Get the format of the data inside the KDBX envelope. This only applies to C and C formats. Possible +formats: -Get the minimum KDBX file version supported, which is 3.0 or C<0x00030000> as -it is encoded. - -To read older KDBX files unsupported by this module, try L. +=for :list +* C - Read the database groups and entries as XML (default) +* C - Read and store the result in L without parsing =cut -sub min_version { KDBX_VERSION_OLDEST } +has format => undef, is => 'ro'; +has inner_format => 'XML', is => 'ro'; =method read_magic_numbers @@ -346,3 +351,9 @@ sub _read_inner_body { } 1; +__END__ + +=head1 DESCRIPTION + + +=cut