ePages 6.17.15 - DE_EPAGES/Presentation/Scripts/Sprites/SpriteUtil.pm

Package DE_EPAGES::Presentation::Scripts::Sprites::SpriteUtil

Utility class for Sprite Composer

@EXPORT_OK
ReadConfigFile
MergeOptions
ReplaceMarkers

Functions

MergeOptions
ReadConfigFile
ReplaceMarkers

MergeOptions

Merges options from command line with options from configuration file

Syntax
my $hResult = MergeOptions($hCommandLineOptions, $hConfigFileOptions);
Example
my $hMergedOptions = MergeOptions(\%CommandLineOptions, $hConfigFileOptions);
Input
$hCommandLineOptions (ref to hash)
command line options
$hConfigFileOptions (ref to hash)
options from config file
Return
\%Result (ref to hash)
merged options

ReadConfigFile

Reads config parameters from given file

Syntax
my $hConfigValues = ReadConfigFile($FileName);
Example
my $hConfigFileOptions = $class->ReadConfigFile(__FILE__);
Input
$FileName (string)
name of the config file
Return
$hConfigValues (ref to hash)
hash with the configuration values

ReplaceMarkers

Replace the markers with ENV variable values or the given option values.

Syntax
$Text = ReplaceMarkers($Text, $hOptions);
Example
$TargetFileName = ReplaceMarkers(
  $self->{'csstargetdirectoryrelative'}.CorrectPathSlashes('/').$TargetFileName,
  {'cartridge' => $CartridgeName}
);
Input
$Text (string)
string containing markers
$hOptions (ref to hash)
optional parameters with marker name-value pairs
Return
$Text (string)
updated string