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.15 2001/01/05 15:19:04 grubba Exp $ + // $Id: Table.pmod,v 1.16 2001/01/05 19:42:20 grubba Exp $      #pike __REAL_VERSION__   #define TABLE_ERR(msg) throw(({ "(Table) "+msg+"\n", backtrace() }))      //! ADT.Table is a generic module for manipulating tables.   //!   //! Each table contains one or several columns.   //! Each column is associated with a name, the column name.   //! Optionally, one can provide a column type. The Table module can do a number   //! of operations on a given table, like computing the sum of a column,
pike.git/lib/modules/ADT.pmod/Table.pmod:377:    //! adjusted, whereas numerical columns are right adjusted. If a mapping    //! in the array is 0 (zero), it will be assumed to be a text column.    //! If @[column_types] is omitted, all columns will displayed as text.    //!    //! See @[ADT.Table.ASCII.encode()] on how to display a table.    //!    //! @seealso    //! @[ADT.Table.ASCII.encode()]    //!    void create(array(array) table, array(string) column_names, -  array(mapping(string:string)|void column_types) +  array(mapping(string:string))|void column_types)    {    if(!arrayp(table))    TABLE_ERR("Table not array");    if(!arrayp(column_names))    TABLE_ERR("Fields not array");    if(sizeof(table) && sizeof(table[0]) != sizeof(column_names))    TABLE_ERR("Table and field sizes differ");    foreach(column_names, string s)    if(!stringp(s))    TABLE_ERR("Field name not string");