Panda3D

Loading...
Searching...
No Matches
Public Member Functions | List of all members
StringStreamBuf Class Reference

Used by StringStream to implement an stream that reads from and/or writes to a memory buffer, whose contents can be appended to or extracted at any time by application code. More...

`#include "stringStreamBuf.h"`

Inheritance diagram for StringStreamBuf:

## Public Member Functions
void | clear ()
| Empties the buffer.
const vector_uchar & | get_data () const
| Returns a reference to the contents of the internal buffer, without any of the iostream buffer.
size_t | read_chars (char *start, size_t length)
| Attempts to extract the indicated number of characters from the current file position.
void | swap_data (vector_uchar &data)
| Swaps the indicated buffer for the contents of the internal buffer.
void | write_chars (const char *start, size_t length)
| Appends the indicated stream of characters to the current file position.

## Detailed Description

Used by StringStream to implement an stream that reads from and/or writes to a memory buffer, whose contents can be appended to or extracted at any time by application code.

Definition at line 25 of file stringStreamBuf.h.

## Constructor & Destructor Documentation

## ◆ StringStreamBuf()

StringStreamBuf::StringStreamBuf | ( |  | ) |

Definition at line 25 of file stringStreamBuf.cxx.

## ◆ ~StringStreamBuf()

StringStreamBuf::~StringStreamBuf | ( |  | ) |
| virtual

Definition at line 52 of file stringStreamBuf.cxx.

## Member Function Documentation

## ◆ clear()

void StringStreamBuf::clear | ( |  | ) |

Empties the buffer.

Definition at line 62 of file stringStreamBuf.cxx.

## ◆ get_data()

const vector_uchar & StringStreamBuf::get_data | ( |  | ) | const
| inline

Returns a reference to the contents of the internal buffer, without any of the iostream buffer.

Definition at line 27 of file stringStreamBuf.I.

## ◆ read_chars()

size_t StringStreamBuf::read_chars | ( | char * | start,
|  | size_t | length )

Attempts to extract the indicated number of characters from the current file position.

Returns the number of characters extracted.

Definition at line 76 of file stringStreamBuf.cxx.

## ◆ swap_data()

void StringStreamBuf::swap_data | ( | vector_uchar & | data | ) |
| inline

Swaps the indicated buffer for the contents of the internal buffer.

Does not affect the ppos or gpos, or the iostream buffer.

Definition at line 18 of file stringStreamBuf.I.

## ◆ write_chars()

void StringStreamBuf::write_chars | ( | const char * | start,
|  | size_t | length )

Appends the indicated stream of characters to the current file position.

Definition at line 98 of file stringStreamBuf.cxx.

The documentation for this class was generated from the following files:

- panda/src/downloader/stringStreamBuf.h
- panda/src/downloader/stringStreamBuf.cxx
- panda/src/downloader/stringStreamBuf.I