Example #1
0
        //流的当前指针回退count个字节。如果退到文件开始之前,failbit将被设置,
        //同时,流的当前指针指向文件开始处。
        ifstream backward(int count)
        {
            long pos = tellg();

            if (pos > count)
            {
                StreamReaderExtensions.SetPosition(this, pos - count);
            }
            else
            {
                StreamReaderExtensions.SetPosition(this, 0);
            }
            return(this);
        }
Example #2
0
 public ifstream seekg(long pos)
 {
     StreamReaderExtensions.SetPosition(this, pos);
     return(this);
 }
Example #3
0
 public long tellg()
 {
     return(StreamReaderExtensions.GetPosition(this));
 }