pike.git / lib / modules / Val.pmod

version» Context lines:

pike.git/lib/modules/Val.pmod:1:   #pike __REAL_VERSION__ + #pragma strict_types      //! This module contains special values used by various modules, e.g.   //! a null value used both by @[Sql] and @[Standards.JSON].   //!   //! In many ways these values should be considered constant, but it is   //! possible for a program to replace them with extended versions,   //! provided they don't break the behavior of the base classes defined   //! here. Since there is no good mechanism to handle such extending in   //! several steps, pike libraries should preferably ensure that the   //! base classes defined here provide required functionality directly.
pike.git/lib/modules/Val.pmod:38:    constant is_val_true = 1;    //! Nonzero recognition constant.       string encode_json() {return "true";}       // The following shouldn't be necessary if there's only one    // instance, but that might not always be the case.    protected int __hash()    {return 34123;}    protected int `== (mixed other) -  {return objectp (other) && other->is_val_true;} +  {return objectp (other) && [int]([object]other)->is_val_true;}       protected mixed cast (string type)    {    switch (type) {    case "int": return 1;    case "string": return "1";    default: error ("Cannot cast %O to %s.\n", this, type);    }    }   
pike.git/lib/modules/Val.pmod:71:    constant is_val_false = 1;    //! Nonzero recognition constant.       protected int `!() {return 1;}       string encode_json() {return "false";}       protected int __hash()    {return 54634;}    protected int `== (mixed other) -  {return objectp (other) && other->is_val_false;} +  {return objectp (other) && [int]([object]other)->is_val_false;}       protected mixed cast (string type)    {    switch (type) {    case "int": return 0;    case "string": return "0";    default: error ("Cannot cast %O to %s.\n", this, type);    }    }   
pike.git/lib/modules/Val.pmod:180:   //! if (objectp(something) && something->is_val_null) ...   //! @endcode   //!   //! That way it's possible for other code to replace it with an   //! extended class, or create their own variants which needs to behave   //! like @[Val.null].   //!   //! @fixme   //! The Oracle glue currently uses static null objects which won't be   //! affected if this object is replaced. +  + //! + constant Timestamp = __builtin.Timestamp; +  + //! + constant Time = __builtin.Time; +  + //! + constant TimeTZ = __builtin.TimeTZ; +  + //! + constant Date = __builtin.Date; +  + //! + constant Interval = __builtin.Interval; +  + //! + constant Range = __builtin.Range; +  + //! + constant Inet = __builtin.Inet;