From d5981392882621b17b3699441b2d9832919173c2 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Sun, 31 May 2009 02:58:21 +0300 Subject: more documentation clarifications --- lib/Asterisk/config.pm | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/lib/Asterisk/config.pm b/lib/Asterisk/config.pm index 2bdd7e8..a1b1b79 100644 --- a/lib/Asterisk/config.pm +++ b/lib/Asterisk/config.pm @@ -749,8 +749,9 @@ Returns the section as a hash of key=>value pairs. $sip_conf->fetch_values_arrayref(section=>[section name|unsection], key=>key name); -return referenced value list, if section name unreachable return -failed. if key name unreachable return failed. +Returns a (reference to a) list of all the values a specific keys have +in a specific section. referenced value list, Returns 0 if section +was not found or key was not found in the section. =head2 reload @@ -790,19 +791,29 @@ replace new data when matched. =head2 assign_append +Used to add extra data to an existing section or to edit it. + $sip_conf->assign_append(point=>['up'|'down'|'foot'], section=>[section name], data=>'key=value'|['key=value','key=value']|{key=>'value',key=>'value'}); -append data around with section name. +This form is used to merely append new data. =over 3 -=item * point -> append data C / C / C with section. +=item point + +Append data C / C / C with section. + +=item section + +Matched section name, expect 'unsection'. If ommited, data will be +placed above first setcion, as in 'unsection', but then you cannot +use C"foot">. -=item * section -> matched section name, expect 'unsection'. +=item data -=item * data -> new replace data in string/array/hash. +New replace data in string/array/hash. =back @@ -811,20 +822,21 @@ append data around with section name. comkey=>[key,value], data=>'key=value'|['key=value','key=value']|{key=>'value',key=>'value'}; -append data around with section name and key/value in same section. +Appends data before, after or instead a given line. The line is +the first line in C
where the key is C and the value +is C (from C. =over 2 -=item * point -> C will overwrite with key/value matched. +=item point -=item * comkey -> match key and value. +C will overwrite with key/value matched. -=back +=item comkey - $sip_conf->assign_append(point=>'up'|'down', - data=>'key=value'|['key=value','key=value']|{key=>'value',key=>'value'}); +Match key and value. -simple append data without any section. +=back =head2 assign_replacesection -- cgit v1.2.3