pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:2937:    optflags OPT_EXTERNAL_DEPEND;   {    low_backtrace(& Pike_interpreter);   }      /*! @module String    */      /*! @class Buffer    *! A buffer, used for building strings. It's -  *! conceptually similar to a string, but you can only @[add] -  *! strings to it, and you can only @[get] the value from it once. +  *! conceptually similar to a string, but speed-optimised for growing +  *! strings.    *! -  *! There is a reason for those seemingly rather odd limitations, -  *! it makes it possible to do some optimizations that really speed -  *! things up. -  *! +     *! You do not need to use this class unless you add very many    *! strings together, or very large strings.    *!    *! @example    *! For the fastest possible operation, write your code like this:    *!    *! @code    *! String.Buffer b = String.Buffer( );    *!    *! function add = b->add;
pike.git/src/builtin.cmod:3178:    PIKEFUN object `+=( string|Buffer what )    rawtype tFunc(tOr(tString, tObjIs_BUFFER), tObjIs_BUFFER);    {    f_Buffer_add( 1 );    REF_RETURN Pike_fp->current_object;    }       /*! @decl int addat(int(0..) pos, string|String.Buffer ... data)    *!    *! Adds @[data] to the buffer, starting at position @[pos]. +  *! It overwrites existing content at that offset, never truncates the +  *! buffer, possibly extends the buffer if the new content does not fit.    *!    *! @returns    *! Returns the size of the buffer.    *!    *! @note -  *! If the buffer isn't of the required size, it will be padded -  *! with NUL-characters. +  *! If the starting position @[pos] extends beyond the end of the current +  *! buffer content, the gap will be filled with NUL-characters.    *! -  *! @note -  *! Pike 7.8 and earlier did not support adding @[String.Buffer]s -  *! directly. -  *! +     *! @seealso    *! @[add()]    */    PIKEFUN int addat(int(0..) pos, string ... arg1 )    rawtype tFuncV(tIntPos, tOr(tString, tObjIs_BUFFER), tIntPos);    {    struct Buffer_struct *str = THIS;       if (pos < 0)    SIMPLE_BAD_ARG_ERROR("addat", 1, "int(0..)");
pike.git/src/builtin.cmod:3275:    RETURN str->str.s ? str->str.s->len : 0;    }       /*! @decl int add(string|String.Buffer ... data)    *!    *! Adds @[data] to the buffer.    *!    *! @returns    *! Returns the size of the buffer.    *! -  *! @note -  *! Pike 7.8 and earlier did not support adding @[String.Buffer]s -  *! directly. -  *! +     *! @seealso    *! @[addat()]    */    PIKEFUN int add( string|Buffer ... arg1 )    rawtype tFuncV(tNone, tOr(tString, tObjIs_BUFFER), tIntPos);    {    struct Buffer_struct *str = THIS;    push_int(str->str.s ? str->str.s->len : 0);    stack_revroll(++args);    f_Buffer_addat(args);