Panda3D
|
This class can be used to write a series of datagrams into a memory buffer. More...
#include <pandadoc.hpp>
Public Member Functions | |
__init__ () | |
Initializes an empty datagram buffer. | |
__init__ (VectorUchar data) | |
Initializes the buffer with the given data. | |
clear () | |
Clears the internal buffer. | |
![]() | |
bool | copyDatagram (SubfileInfo result, const Filename filename) |
Copies the file data from the entire indicated file (via the vfs) as the next datagram. | |
bool | copyDatagram (SubfileInfo result, const SubfileInfo source) |
Copies the file data from the range of the indicated file (outside of the vfs) as the next datagram. | |
flush () | |
const FileReference | getFile () |
Returns the FileReference that provides the target for these datagrams, if any, or NULL if the datagrams do not written to a file on disk. | |
const Filename | getFilename () |
Returns the filename that provides the target for these datagrams, if any, or empty string if the datagrams do not get written to a file on disk. | |
Streamoff | getFilePos () |
Returns the current file position within the data stream, if any, or 0 if the file position is not meaningful or cannot be determined. | |
bool | isError () |
bool | putDatagram (const Datagram data) |
![]() | |
bool | getDatagram (Datagram data) |
const FileReference | getFile () |
Returns the FileReference that provides the source for these datagrams, if any, or NULL if the datagrams do not originate from a file on disk. | |
const Filename | getFilename () |
Returns the filename that provides the source for these datagrams, if any, or empty string if the datagrams do not originate from a file on disk. | |
Streamoff | getFilePos () |
Returns the current file position within the data stream, if any, or 0 if the file position is not meaningful or cannot be determined. | |
time_t | getTimestamp () |
Returns the on-disk timestamp of the file that was read, at the time it was opened, if that is available, or 0 if it is not. | |
VirtualFile | getVfile () |
Returns the VirtualFile that provides the source for these datagrams, if any, or NULL if the datagrams do not originate from a VirtualFile. | |
bool | isEof () |
bool | isError () |
bool | saveDatagram (SubfileInfo info) |
Skips over the next datagram without extracting it, but saves the relevant file information in the SubfileInfo object so that its data may be read later. | |
Public Attributes | |
const VectorUchar | data |
Returns the internal buffer. | |
![]() | |
const FileReference | file |
Returns the FileReference that provides the target for these datagrams, if any, or NULL if the datagrams do not written to a file on disk. | |
Streamoff | file_pos |
Returns the current file position within the data stream, if any, or 0 if the file position is not meaningful or cannot be determined. | |
const Filename | filename |
Returns the filename that provides the target for these datagrams, if any, or empty string if the datagrams do not get written to a file on disk. | |
This class can be used to write a series of datagrams into a memory buffer.
It acts as both a datagram sink and generator; you can fill it up with datagrams and then read as many datagrams from it.
This uses the same format as DatagramInputFile and DatagramOutputFile, meaning that Datagram sizes are always stored little-endian.
__init__ | ( | ) |
Initializes an empty datagram buffer.
__init__ | ( | VectorUchar | data | ) |
Initializes the buffer with the given data.
clear | ( | ) |
Clears the internal buffer.
const VectorUchar data |
Returns the internal buffer.