pike.git / lib / modules / ADT.pmod / Table.pmod

version» Context lines:

pike.git/lib/modules/ADT.pmod/Table.pmod:1:   // Table.pmod by Fredrik Noring, 1998 - // $Id: Table.pmod,v 1.7 1998/06/18 13:21:34 noring Exp $ + // $Id: Table.pmod,v 1.8 1998/06/24 17:02:42 noring Exp $      #define TABLE_ERR(msg) throw(({ "(Table) "+msg+"\n", backtrace() }))      class table {    static private mapping fieldmap;    static private array table, fields, types;       static private array|int remap(array|string|int cs, int|void forgive)    {    array v = ({});
pike.git/lib/modules/ADT.pmod/Table.pmod:305:    object decode(string s, void|mapping options)    {    string rowsep = options->rowsep||"\n";    string colsep = options->colsep||"\t";    array t = Array.map(s/rowsep, `/, colsep);    return table(t[1..], t[0], options->types);    }       mixed encode(object t, void|mapping options)    { +  options = options || ([]);    string rowsep = options->rowsep||"\n";    string colsep = options->colsep||"\t";    return Array.map(({ indices(t) }) + values(t),    lambda(array r, string colsep)    { return Array.map(r, _string)*colsep; }, colsep)*rowsep;    }   }();      object ASCII = class {    object decode(string s, void|mapping options)