Browse Source

+ Subtitle::SSA::Record->parse_format_line()

master
Alex 'AdUser' Z 9 years ago
parent
commit
e74302f560
  1. 18
      lib/Subtitle/SSA/Record.pm

18
lib/Subtitle/SSA/Record.pm

@ -53,6 +53,24 @@ sub set {
return 1;
}
sub parse_format_line {
my ($self, $line) = @_;
return unless $line and $line =~ m{^Format:}oi;
chomp $line;
$line =~ s{^Format:\s+}{}oi;
my @fields;
foreach my $field (split(/,\s*/o, $line)) {
$field = lc($field);
return unless exists $FIELDS{$field};
push @fields, $field;
}
return [ @fields ];
}
# formats:
# s - string, use as is
# d - decimal, no-zero pad

Loading…
Cancel
Save