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.25 2002/10/12 12:10:40 grubba Exp $ + // $Id: Table.pmod,v 1.26 2003/04/07 17:19:41 nilsson Exp $      #pike __REAL_VERSION__   #define TABLE_ERR(msg) error("(Table) "+msg+"\n")      //! 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:368:    //! @param column_names    //! This argument is an array of column names associated with each    //! column in the table. References by column name are case insensitive.    //! The case used in @[column_names] will be used when the table is    //! displayed. A column can also be referred to by its position,    //! starting from zero.    //!    //! @param column_types    //! This is an optional array of mappings. The column type    //! information is only used when displaying the table. Currently, only the -  //! keyword @tt{"type"@} is recognized. The type can be specified as -  //! @tt{"text"@} or @tt{"num"@} (numerical). Text columns are left +  //! keyword @expr{"type"@} is recognized. The type can be specified as +  //! @expr{"text"@} or @expr{"num"@} (numerical). Text columns are left    //! 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,
pike.git/lib/modules/ADT.pmod/Table.pmod:443:   object ASCII = class {   //! @endignore    object decode(string s, void|mapping options)    {    // Yet to be done.    return 0;    }       //! @decl string encode(object table, void|mapping options)    //! -  //! This method returns a table represented in ASCII suitable for human eyes. -  //! @[options] is an optional mapping. If the keyword @tt{"indent"@} is used -  //! with a number, the table will be indented with that number of space -  //! characters. +  //! This method returns a table represented in ASCII suitable for +  //! human eyes. @[options] is an optional mapping. If the keyword +  //! @expr{"indent"@} is used with a number, the table will be +  //! indented with that number of space characters.       string encode(object t, void|mapping options)    {    options = options || ([]);    mapping sizes = ([]);    array fields = indices(t);    string indent = " " * options->indent;       t = t->copy(({ fields }) + values(t));    for(int field = 0; field < sizeof(fields); field++)