From 18f3d8f960baa30b67b73768f11e9217b58a6309 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Wed, 6 Jul 2016 17:32:26 +1000 Subject: [PATCH] * Subtitle::SSA::* : add get_format_line() helper --- lib/Subtitle/SSA/Record.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/Subtitle/SSA/Record.pm b/lib/Subtitle/SSA/Record.pm index 8eaae29..a333e0d 100644 --- a/lib/Subtitle/SSA/Record.pm +++ b/lib/Subtitle/SSA/Record.pm @@ -121,4 +121,15 @@ sub to_string { return $string; } +sub get_format_line { + my ($self) = @_; + + my @keys = @{ $self->{_format} }; + my @names = map { $FIELDS{$_}->{name} } @keys; + + my $line = 'Format: ' . join(', ' => @names); + + return $line; +} + 1;