diff -r 000000000000 -r e6b17d312c8b brandingserver/tools/xml/xml2h.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/brandingserver/tools/xml/xml2h.pl Thu Dec 17 08:54:49 2009 +0200 @@ -0,0 +1,111 @@ +# +# Copyright (c) 2006-2006 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: Writes a header file based on brand xml file +# + +#------------------------------------------------------------------------------ +# Prints usage information +#------------------------------------------------------------------------------ +# +sub UsageInformation +{ + print < ); + close(INPUT); + + # remove all comments + $xmlcontent =~ s///g; + + # find elements id's + $_ = $xmlcontent; + my @elements = /<.*element[. ]* id="([\w\d_]+)".*>/g; + + #debug print +# foreach $item (@elements) print "$item\n"; + return @elements; +} + +#------------------------------------------------------------------------------ +# Write Header file +#------------------------------------------------------------------------------ +# +sub WriteHeaderFile +{ + my @ids = @_; + open( OUTPUT, ">$ARGV[1]" ) || die "Can't open file: '$ARGV[1]'"; + + # Write header + print OUTPUT <