imgtools/buildrom/tools/CONVERT.PL
changeset 629 541af5ee3ed9
parent 590 360bd6b35136
equal deleted inserted replaced
628:7c4a911dc066 629:541af5ee3ed9
       
     1 #!/usr/bin/perl
     1 #
     2 #
     2 # Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 # Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 # All rights reserved.
     4 # All rights reserved.
     4 # This component and the accompanying materials are made available
     5 # This component and the accompanying materials are made available
     5 # under the terms of the License "Eclipse Public License v1.0"
     6 # under the terms of the License "Eclipse Public License v1.0"
    16 # parameter %2 is the command to execute
    17 # parameter %2 is the command to execute
    17 # parameters %3 onwards are the parameters to %2
    18 # parameters %3 onwards are the parameters to %2
    18 # example:
    19 # example:
    19 # perl -w CONVERT.PL # echo the language code for french is #french#
    20 # perl -w CONVERT.PL # echo the language code for french is #french#
    20 
    21 
       
    22 use romutl;
       
    23 
       
    24 my $include_path=&get_epocroot."epoc32\/include\/";
    21 $conversionDelimiter=shift;
    25 $conversionDelimiter=shift;
    22 open(E32STD_H, "< \\epoc32\\include\\E32STD.H") or die "\\epoc32\\include\\E32STD.H could not be opened";
    26 
       
    27 open(E32STD_H, "< ${include_path}E32STD.H") or die "${include_path}E32STD.H could not be opened";
    23 while ($line=<E32STD_H>)
    28 while ($line=<E32STD_H>)
    24 	{
    29 	{
    25 	if ($line=~/\benum\s+TLanguage\b(.*)$/)
    30 	if ($line=~/\benum\s+TLanguage\b(.*)$/)
    26 		{
    31 		{
    27 		$line=$1;
    32 		$line=$1;
    70 	if ($ARGV[$i]=~/^(.*?)$conversionDelimiter(.*?)$conversionDelimiter(.*)$/)
    75 	if ($ARGV[$i]=~/^(.*?)$conversionDelimiter(.*?)$conversionDelimiter(.*)$/)
    71 		{
    76 		{
    72 		$bitBefore=$1;
    77 		$bitBefore=$1;
    73 		$languageNameInLowerCase=lc $2;
    78 		$languageNameInLowerCase=lc $2;
    74 		$bitAfter=$3;
    79 		$bitAfter=$3;
    75 		defined $languageData{$languageNameInLowerCase} or die "The language \"$languageNameInLowerCase\" is not defined in \\epoc32\\include\\E32STD.H";
    80 		defined $languageData{$languageNameInLowerCase} or die "The language \"$languageNameInLowerCase\" is not defined in \/epoc32\/include\/E32STD.H";
    76 		$ARGV[$i]=sprintf("$bitBefore%02d$bitAfter", $languageData{$languageNameInLowerCase});
    81 		$ARGV[$i]=sprintf("$bitBefore%02d$bitAfter", $languageData{$languageNameInLowerCase});
    77 		}
    82 		}
    78 	}
    83 	}
    79 system("@ARGV");
    84 system("@ARGV");
    80 
    85