[streambuf.protected]

# 31 Input/output library [[input.output]](./#input.output)

## 31.6 Stream buffers [[stream.buffers]](stream.buffers#streambuf.protected)

### 31.6.3 Class template basic_streambuf [[streambuf]](streambuf#protected)

#### 31.6.3.4 Protected member functions [streambuf.protected]

#### [31.6.3.4.1](#streambuf.assign) Assignment [[streambuf.assign]](streambuf.assign)

[ð](#lib:operator=,basic_streambuf)

`basic_streambuf& operator=(const basic_streambuf& rhs);
`

[1](#streambuf.assign-1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L3426)

*Postconditions*: 

- [(1.1)](#streambuf.assign-1.1)

eback() == rhs.eback()

- [(1.2)](#streambuf.assign-1.2)

gptr() == rhs.gptr()

- [(1.3)](#streambuf.assign-1.3)

egptr() == rhs.egptr()

- [(1.4)](#streambuf.assign-1.4)

pbase() == rhs.pbase()

- [(1.5)](#streambuf.assign-1.5)

pptr() == rhs.pptr()

- [(1.6)](#streambuf.assign-1.6)

epptr() == rhs.epptr()

- [(1.7)](#streambuf.assign-1.7)

getloc() == rhs.getloc()

[2](#streambuf.assign-2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L3438)

*Returns*: *this[.](#streambuf.assign-2.sentence-1)

[ð](#lib:swap,basic_streambuf)

`void swap(basic_streambuf& rhs);
`

[3](#streambuf.assign-3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L3449)

*Effects*: Swaps the data members of rhs and *this[.](#streambuf.assign-3.sentence-1)

#### [31.6.3.4.2](#streambuf.get.area) Get area access [[streambuf.get.area]](streambuf.get.area)

[ð](#lib:eback,basic_streambuf)

`char_type* eback() const;
`

[1](#streambuf.get.area-1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L3463)

*Returns*: The beginning pointer for the input sequence[.](#streambuf.get.area-1.sentence-1)

[ð](#lib:gptr,basic_streambuf)

`char_type* gptr() const;
`

[2](#streambuf.get.area-2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L3474)

*Returns*: The next pointer for the input sequence[.](#streambuf.get.area-2.sentence-1)

[ð](#lib:egptr,basic_streambuf)

`char_type* egptr() const;
`

[3](#streambuf.get.area-3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L3485)

*Returns*: The end pointer for the input sequence[.](#streambuf.get.area-3.sentence-1)

[ð](#lib:gbump,basic_streambuf)

`void gbump(int n);
`

[4](#streambuf.get.area-4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L3496)

*Effects*: Adds n to the next pointer for the input sequence[.](#streambuf.get.area-4.sentence-1)

[ð](#lib:setg,basic_streambuf)

`void setg(char_type* gbeg, char_type* gnext, char_type* gend);
`

[5](#streambuf.get.area-5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L3507)

*Preconditions*: [gbeg, gnext), [gbeg, gend), and [gnext, gend)
are all valid ranges[.](#streambuf.get.area-5.sentence-1)

[6](#streambuf.get.area-6)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L3512)

*Postconditions*: gbeg == eback(),gnext == gptr(),
andgend == egptr() are all true[.](#streambuf.get.area-6.sentence-1)

#### [31.6.3.4.3](#streambuf.put.area) Put area access [[streambuf.put.area]](streambuf.put.area)

[ð](#lib:pbase,basic_streambuf)

`char_type* pbase() const;
`

[1](#streambuf.put.area-1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L3528)

*Returns*: The beginning pointer for the output sequence[.](#streambuf.put.area-1.sentence-1)

[ð](#lib:pptr,basic_streambuf)

`char_type* pptr() const;
`

[2](#streambuf.put.area-2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L3539)

*Returns*: The next pointer for the output sequence[.](#streambuf.put.area-2.sentence-1)

[ð](#lib:epptr,basic_streambuf)

`char_type* epptr() const;
`

[3](#streambuf.put.area-3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L3550)

*Returns*: The end pointer for the output sequence[.](#streambuf.put.area-3.sentence-1)

[ð](#lib:pbump,basic_streambuf)

`void pbump(int n);
`

[4](#streambuf.put.area-4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L3561)

*Effects*: Adds n to the next pointer for the output sequence[.](#streambuf.put.area-4.sentence-1)

[ð](#lib:setp,basic_streambuf)

`void setp(char_type* pbeg, char_type* pend);
`

[5](#streambuf.put.area-5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L3572)

*Preconditions*: [pbeg, pend) is a valid range[.](#streambuf.put.area-5.sentence-1)

[6](#streambuf.put.area-6)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L3576)

*Postconditions*: pbeg == pbase(),pbeg == pptr(),
andpend == epptr() are all true[.](#streambuf.put.area-6.sentence-1)
