NS_IMETHODIMP BasicStringImpl::Seek(PRInt32 whence, PRInt32 offset)
NS_IMETHODIMP BasicStringImpl::Seek(PRSeekWhence whence, PRInt32 offset)
NS_IMETHODIMP BasicStringImpl::Seek(PRInt32 whence, PRInt32 offset)//----------------------------------------------------------------------------------------{    mLastResult = NS_OK; // reset on a seek.    mEOF = PR_FALSE; // reset on a seek.    PRInt32 fileSize = length();    PRInt32 newPosition=-1;    switch (whence)    {        case PR_SEEK_CUR: newPosition = mOffset + offset; break;        case PR_SEEK_SET: newPosition = offset; break;        case PR_SEEK_END: newPosition = fileSize + offset; break;    }    if (newPosition < 0)    {        newPosition = 0;        mLastResult = NS_FILE_RESULT(PR_FILE_SEEK_ERROR);    }    if (newPosition >= fileSize)    {        newPosition = fileSize;        mEOF = PR_TRUE;    }    mOffset = newPosition;    return NS_OK;} // StringImpl::Seek