summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-11 13:46:43 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-11 13:46:43 +0100
commiteee020b64190189e8f5484ab913e3314686e8bcb (patch)
tree215245504d99ef6ccb0a9a1290f0d9b77134550c /misc
parentf274393cd7e9ed81084661ccefa1a2e53c49b50a (diff)
parent7b9f4ef95ba384fac5915be168f97b9e47411906 (diff)
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'misc')
-rw-r--r--misc/freeswitch/scripts/common/str.lua31
1 files changed, 0 insertions, 31 deletions
diff --git a/misc/freeswitch/scripts/common/str.lua b/misc/freeswitch/scripts/common/str.lua
index 541199f..0673421 100644
--- a/misc/freeswitch/scripts/common/str.lua
+++ b/misc/freeswitch/scripts/common/str.lua
@@ -4,37 +4,6 @@
module(...,package.seeall)
-function try(array, arguments)
- if type(arguments) ~= 'string' or type(array) ~= 'table' then
- return nil;
- end
-
- local result = array;
-
- arguments:gsub('([^%.]+)', function(entry)
- local success, result = pcall(function() result = (result[tonumber(entry) or entry]); end);
- end);
-
- return result;
-end
-
-
-function set(array, arguments, value)
- local nop, arguments_count = arguments:gsub('%.', '');
- local structure = array;
- arguments:gsub('([^%.]+)', function(entry)
- if arguments_count <= 0 then
- structure[entry] = value;
- elseif type(structure[entry]) == 'table' then
- structure = structure[entry];
- else
- structure[entry] = {};
- structure = structure[entry];
- end
- arguments_count = arguments_count - 1;
- end);
-end
-
-- to number
function to_n(value)
value = tostring(value):gsub('[^%d%.%+%-]', '');