package Opals::Message;

require Exporter;
@ISA       = qw(Exporter);
# Symbols to be exported by default
#@EXPORT    = qw(
#    opl_
#);
# Symbols to be exported on request
@EXPORT_OK = qw(
    msg_buildMsg
);
# Version number
$VERSION   = 0.01;


#use utf8;
use strict;

#use Opals::_Some_Module_;


########################################################################################
sub msg_buildMsg {
    my ($inputStr, $valMap) = @_;
    my $retMsg;
   
    if($inputStr eq '' || scalar($valMap) == 0) return;
    
    my $repStr='';
    while ($inputStr =~ m/#\{([a-zA-Z_]\w+)\}/ ){
        $repStr =$1;
        $inputStr  =~ s/("#{" + $repStr + "}"/$valMap[$repStr]/g; 
    }
    $retMsg = $inputStr;
    return $retMsg;
}



1;
