=head1 NAME

CFX5::Files::CCLText - module for handling def files

=head1 DESCRIPTION

The CFX5::Files::CCLText class provides ccl-text-file-specific code
for CFX5::AnyFile.

=cut

package CFX5::Files::CCLText;

use strict;

use CFX5::PkgLoader qw(cfx5_require);

use CFX5::Files::Any;
use vars qw(@ISA);
push @ISA, qw(CFX5::Files::Any);

use CFX5::Output qw(:all);

sub init {
  my $self=shift;

  $self->SUPER::init(@_)
    or return '';

  1;
}

sub description {
  "ANSYS CFX Command Language File";
}

=head2 CCL STUFF

=head3 extract_ccl

=cut

sub extract_ccl {
  my $self=shift;

  cfx5_require('CFX5::FileOps');
  my $ccl=CFX5::FileOps::get_file_contents($self->file());
  if (not defined $ccl) {
    _error("Error reading", $self->description(), $self->file() . ": $!");
    return ();
  }
  return split(/\r?\n\r?/, $ccl);
}


1;
