# NOTE: Derived from web_diary_dir/lib/TDS/Collection.pm.
# Changes made here will be lost when autosplit again.
# See AutoSplit.pm.
package TDS::Collection;

#line 420 "web_diary_dir/lib/TDS/Collection.pm (autosplit into web_diary_dir/lib/auto/TDS/Collection/parse_file.al)"
################################################################
# ファイルをパースする
sub parse_file ($$$)
{
#    my ($self, $filename, $year, $month, $day) = @_;
    my ($self, $filename, $parser) = @_;

    # check
    die "BUG: TDS::Collection::parse_file: not TDS::Tdf::Parser object"
	unless ref $parser eq 'TDS::Tdf::Parser';

    open(F, "$filename") || die $filename;
    sub conv;
    *conv = mkjconv($TdfJcode, $TDS::System::InternalJcode);
    while (<F>){
	my $tmp = $_;
	$tmp .= "\n" unless $tmp =~ /\n$/;        # thanks to Mr.Takei
	conv(\$tmp);

	# send to parser
	$parser->Parse($tmp);
    }
    close F;
    return $parser;
}

# end of TDS::Collection::parse_file
1;
