cpp/io/basic stringbuf/seekoff

Repositions std and/or std, if possible, to the position that corresponds to exactly characters from beginning, end, or current position of the get and/or put area of the buffer.


 * If includes std and this buffer is open for reading (that is, if ), then repositions the read pointer std inside the get area as described below
 * If includes std and this buffer is open for writing (that is, ), then repositions the write pointer std inside the put area as described below
 * If includes both  std and  std and the buffer is open for both reading and writing (that is, ), and  is either std or std, then repositions both read and write pointers as described below.
 * Otherwise, this function fails.

If and/or  is repositioned, it is done as follows: @1@ The new pointer offset of type  is determined
 * @a@ if, then is zero
 * @b@ if, then is the current position of the pointer ( or )
 * @c@ if, then is the length of the entire initialized part of the buffer (if  is used, the high watermark pointer minus the beginning pointer)

@2@ If the pointer to be repositioned is a null pointer and would be non-zero, this function fails. @3@ If (the repositioning would move the pointer to before the beginning of the buffer) or if  would point past the end of the buffer (or past the last initialized character in the buffer if  is used), the function fails. @4@ Otherwise, the pointer is assigned as if by or.

Return value
on success, on failure or if  cannot represent the resulting stream position.