2 -- Copyright (C) 2008 Matthew Wild
3 -- Copyright (C) 2008 Waqas Hussain
5 -- This project is MIT/X11 licensed. Please see the
6 -- COPYING file in the source package for more information.
11 local select = select;
12 local t_insert = table.insert;
18 local function get(self, ...)
20 for n = 1,select('#', ...) do
21 t = t[select(n, ...)];
22 if not t then break; end
27 local function add(self, ...)
29 local count = select('#', ...);
31 local key = select(n, ...);
33 if not tab then tab = {}; t[key] = tab; end
36 t_insert(t, (select(count, ...)));
39 local function set(self, ...)
41 local count = select('#', ...);
43 local key = select(n, ...);
45 if not tab then tab = {}; t[key] = tab; end
48 t[(select(count-1, ...))] = (select(count, ...));
51 local function r(t, n, _end, ...)
52 if t == nil then return; end
53 local k = select(n, ...);
67 for _,b in pairs(t) do
76 local function remove(self, ...)
77 local _end = select('#', ...);
79 if select(n, ...) then _end = n; break; end
81 r(self.data, 1, _end, ...);