]> Dogcows Code - chaz/p5-File-KDBX/blob - lib/File/KDBX/Loader/Raw.pm
58e920dd7f6129245b01090e11dac37cc588fb8e
[chaz/p5-File-KDBX] / lib / File / KDBX / Loader / Raw.pm
1 package File::KDBX::Loader::Raw;
2 # ABSTRACT: A no-op loader that doesn't do any parsing
3
4 use warnings;
5 use strict;
6
7 use parent 'File::KDBX::Loader';
8
9 our $VERSION = '999.999'; # VERSION
10
11 sub _read {
12 my $self = shift;
13 my $fh = shift;
14
15 $self->_read_body($fh);
16 }
17
18 sub _read_body {
19 my $self = shift;
20 my $fh = shift;
21
22 $self->_read_inner_body($fh);
23 }
24
25 sub _read_inner_body {
26 my $self = shift;
27 my $fh = shift;
28
29 my $content = do { local $/; <$fh> };
30 $self->kdbx->raw($content);
31 }
32
33 1;
34 __END__
35
36 =head1 SYNOPSIS
37
38 use File::KDBX::Loader;
39
40 my $kdbx = File::KDBX::Loader->load_file('file.kdbx', $key, inner_format => 'Raw');
41 print $kdbx->raw;
42
43 =head1 DESCRIPTION
44
45 A typical KDBX file is made up of an outer section (with headers) and an inner section (with the body). The
46 inner section is usually loaded using L<File::KDBX::Loader::XML>, but you can use the
47 B<File::KDBX::Loader::Raw> loader to not parse the body at all and just get the raw body content. This can be
48 useful for debugging or creating KDBX files with arbitrary content (see L<File::KDBX::Dumper::Raw>).
49
50 =cut
This page took 0.030441 seconds and 3 git commands to generate.