genericopenlibs/cppstdlib/stl/src/gen_dosc.pl
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 16 Apr 2010 16:46:38 +0300
changeset 18 47c74d1534e1
parent 0 e4d67989cc36
child 45 4b03adbd26ca
child 71 28ccaba883f4
permissions -rw-r--r--
Revision: 201011 Kit: 201015

#
# 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);
}