Commit 5c27dd6f authored by Adrien Dorsaz's avatar Adrien Dorsaz

Add a subroutine to find ical parameters in content lines.

parent ea7d1ac5
......@@ -199,6 +199,30 @@ sub repeatWeekFlagFromDayOfWeek {
return $repeatweekflags;
# Find a parameter in a certain content line
sub getIcalParameter{
my ($content, $param) = @_;
my $result;
if(ref(\$content) eq 'SCALAR'){ #single value (need to check by caller)
}elsif(ref($content) eq 'HASH'){ #impossible
}elsif(ref($content) eq 'ARRAY'){
for my $cont (@$content){
if(ref($cont) eq 'HASH' && defined($cont->{$param})){
}elsif(ref(\$cont) eq 'SCALAR' && $cont=~/$param/){
debug("Found parameter $param with value :$result");
return $result;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment