]> Dogcows Code - chaz/p5-File-KDBX/blob - lib/File/KDBX/Loader/Raw.pm
Version 0.800
[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 File::KDBX::Util qw(:class);
8 use namespace::clean;
9
10 extends 'File::KDBX::Loader';
11
12 our $VERSION = '0.800'; # VERSION
13
14 sub _read {
15 my $self = shift;
16 my $fh = shift;
17
18 $self->_read_body($fh);
19 }
20
21 sub _read_body {
22 my $self = shift;
23 my $fh = shift;
24
25 $self->_read_inner_body($fh);
26 }
27
28 sub _read_inner_body {
29 my $self = shift;
30 my $fh = shift;
31
32 my $content = do { local $/; <$fh> };
33 $self->kdbx->raw($content);
34 }
35
36 1;
37
38 __END__
39
40 =pod
41
42 =encoding UTF-8
43
44 =head1 NAME
45
46 File::KDBX::Loader::Raw - A no-op loader that doesn't do any parsing
47
48 =head1 VERSION
49
50 version 0.800
51
52 =head1 SYNOPSIS
53
54 use File::KDBX::Loader;
55
56 my $kdbx = File::KDBX::Loader->load_file('file.kdbx', $key, inner_format => 'Raw');
57 print $kdbx->raw;
58
59 =head1 DESCRIPTION
60
61 A typical KDBX file is made up of an outer section (with headers) and an inner section (with the body). The
62 inner section is usually loaded using L<File::KDBX::Loader::XML>, but you can use the
63 B<File::KDBX::Loader::Raw> loader to not parse the body at all and just get the raw body content. This can be
64 useful for debugging or creating KDBX files with arbitrary content (see L<File::KDBX::Dumper::Raw>).
65
66 =head1 BUGS
67
68 Please report any bugs or feature requests on the bugtracker website
69 L<https://github.com/chazmcgarvey/File-KDBX/issues>
70
71 When submitting a bug or request, please include a test-file or a
72 patch to an existing test-file that illustrates the bug or desired
73 feature.
74
75 =head1 AUTHOR
76
77 Charles McGarvey <ccm@cpan.org>
78
79 =head1 COPYRIGHT AND LICENSE
80
81 This software is copyright (c) 2022 by Charles McGarvey.
82
83 This is free software; you can redistribute it and/or modify it under
84 the same terms as the Perl 5 programming language system itself.
85
86 =cut
This page took 0.036467 seconds and 4 git commands to generate.