genericopenlibs/cppstdlib/stl/src/gen_dosc.pl
author William Roberts <williamr@symbian.org>
Tue, 22 Jun 2010 22:03:38 +0100
branchGCC_SURGE
changeset 39 4393da0c39b5
parent 18 47c74d1534e1
child 45 4b03adbd26ca
child 71 28ccaba883f4
permissions -rw-r--r--
Fix IMPORT_C/EXPORT_C mismatches in bsul and openenvcore/backend - Bug 2971

#
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved.
# This component and the accompanying materials are made available
# under the terms of "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
#
# Initial Contributors:
# Nokia Corporation - initial contribution.
#
# Contributors:
#
# Description: 
#
#!C:\Perl\bin

&do_c_header;
#&do_cpp_header;



#end of sub calls


sub do_c_header
{
$l1="/**   \
\@file   FILENAME	\
\@internalComponent \
*/";

	$infile = "ls.txt";
	#$logfile = "sample.dosc";
	$cmd = "ls *.h > ls.txt";
	$cmd2 = "rm ls.txt";

	#open(LOGFILE, ">$logfile");	

	# take dir list
	system $cmd;

	#open ls.txt and read lines
	open(INFILE, $infile);	
	@lines=<INFILE>;

	foreach $filename (@lines)	#$filename = @lines[1];
	{
		#print LOGFILE "$filename\n";
		$l2 = "$l1";
		#print LOGFILE "-----------\n";
		#print LOGFILE "$l2\n";
		#print LOGFILE "----\n";
		$l2 =~ s/FILENAME/$filename/; 			#replace FILENAME with header file name
		#print LOGFILE "$l2\n";
		#print LOGFILE "-----------\n";
		$filename =~ s/\.h/.dosc/; 				#rename .h to .dosc
		#print LOGFILE $filename;
		
		open (OUTFILE, ">$filename");	
		print OUTFILE $l2;
		close (OUTFILE);
	}


	#clean the ls.txt file
	close (INFILE);
	system $cmd2;

	#print LOGFILE "$l1";
	#print LOGFILE @lines;
	#close (LOGFILE);
}

sub do_cpp_header
{
$l1="/**   \
\@file   FILENAME	\
\@internalComponent \
*/";

	$infile = "ls.txt";
	#$logfile = "sample.dosc";
	$cmd = "ls | grep -v \\. > ls.txt";
	$cmd2 = "rm ls.txt";

	#open(LOGFILE, ">$logfile");	

	# take dir list
	system $cmd;

	#open ls.txt and read lines
	open(INFILE, $infile);	
	@lines=<INFILE>;

	foreach $filename (@lines)	#$filename = @lines[1];
	{
		#print "$filename\n";  
		$l2 = "$l1";
		$l2 =~ s/FILENAME/$filename/; 			#replace FILENAME with header file name
		#print LOGFILE "-----------\n";
		#print "$l2\n";
		#print LOGFILE "----\n";
		
		#print LOGFILE "$l2\n";
		#print LOGFILE "-----------\n";
		#print LOGFILE $filename;
		$filename =~ s/\n/\.dosc/;
		#print "$filename\n";
		
		open (OUTFILE, ">$filename");	
		print OUTFILE $l2;
		close (OUTFILE);
	}

	#clean the ls.txt file
	close (INFILE);
#	system $cmd2;

	#print LOGFILE "$l1";
	#print LOGFILE @lines;
	#close (LOGFILE);
}