source: branches/UKMO/r6232_tracer_advection/NEMOGCM/EXTERNAL/fcm/lib/Fcm/Keyword/Formatter/Entries.pm @ 9295

Last change on this file since 9295 was 9295, checked in by jcastill, 3 years ago

Remove svn keywords

File size: 1.8 KB
Line 
1# ------------------------------------------------------------------------------
2# (C) Crown copyright Met Office. All rights reserved.
3# For further details please refer to the file COPYRIGHT.txt
4# which you should have received as part of this distribution.
5# ------------------------------------------------------------------------------
6use strict;
7use warnings;
8
9package Fcm::Keyword::Formatter::Entries;
10
11use Fcm::Keyword::Formatter::Entry;
12
13################################################################################
14# Constructor
15sub new {
16    my ($class) = @_;
17    return bless(\do{my $annon_scalar}, $class);
18}
19
20################################################################################
21# Formats a keyword entry
22sub format {
23    my ($self, $entries) = @_;
24    my $formatter = Fcm::Keyword::Formatter::Entry->new();
25    my $return = q{};
26    for my $entry (
27        sort {$a->get_key() cmp $b->get_key()}
28        grep {!$_->can('is_implied') || !$_->is_implied()}
29        $entries->get_all_entries()
30    ) {
31        $return .= $formatter->format($entry);
32    }
33    return $return;
34}
35
361;
37__END__
38
39=head1 NAME
40
41Fcm::Keyword::Formatter::Entries
42
43=head1 SYNOPSIS
44
45    use Fcm::Keyword::Formatter::Entries;
46    $formatter = Fcm::Keyword::Formatter::Entries->new();
47    print($formatter->format($entries));
48
49=head1 DESCRIPTION
50
51An object of this class is used to format a keyword entries object.
52
53=head1 METHODS
54
55=over 4
56
57=item new()
58
59Constructor.
60
61=item format($entries)
62
63Returns a simple string representation of $entries.
64
65=back
66
67=head1 SEE ALSO
68
69L<Fcm::Keyword::Entries|Fcm::Keyword::Entries>,
70L<Fcm::Keyword::Entry|Fcm::Keyword::Entry>,
71L<Fcm::Keyword::Formatter::Entry|Fcm::Keyword::Formatter::Entry>
72
73=head1 COPYRIGHT
74
75E<169> Crown copyright Met Office. All rights reserved.
76
77=cut
Note: See TracBrowser for help on using the repository browser.