|
Momentum
A library for solving nonlinear optimization problems related to human body kinematics
|
Stream buffer based on a span. More...
#include <stream_utils.h>
Public Member Functions | |
| spanstreambuf (std::span< const std::byte > buffer={}) | |
| Construct a spanstreambuf with an optional buffer. | |
| ~spanstreambuf () override | |
| Destructor. | |
| spanstreambuf (const spanstreambuf &)=delete | |
| spanstreambuf & | operator= (const spanstreambuf &)=delete |
| spanstreambuf (spanstreambuf &&)=delete | |
| spanstreambuf & | operator= (spanstreambuf &&)=delete |
Protected Member Functions | |
| std::streamsize | xsputn (const char_type *s, std::streamsize n) override |
| Write a sequence of characters to the output buffer. | |
| pos_type | seekoff (off_type off, std::ios_base::seekdir way, std::ios_base::openmode which=std::ios_base::in) override |
| Seek to an offset relative to way (begin/cur/end). | |
| pos_type | seekpos (pos_type pos, std::ios_base::openmode which=std::ios_base::in) override |
| Seek to an absolute position from the start of the buffer. | |
Stream buffer based on a span.
Used to avoid copying the span when creating a std::istream: spanstreambuf sbuf(str); std::istream inputStream(&sbuf);
Definition at line 22 of file stream_utils.h.
| momentum::spanstreambuf::spanstreambuf | ( | std::span< const std::byte > | buffer = {} | ) |
Construct a spanstreambuf with an optional buffer.
| buffer | A std::span of const std::byte (default: empty span). |
Definition at line 14 of file stream_utils.cpp.
Referenced by operator=(), operator=(), spanstreambuf(), and spanstreambuf().
|
overridedefault |
Destructor.
|
delete |
References spanstreambuf().
|
delete |
References spanstreambuf().
|
delete |
References spanstreambuf().
|
delete |
References spanstreambuf().
|
overrideprotected |
Seek to an offset relative to way (begin/cur/end).
Required for callers that need random access (e.g., binary parsers like ezc3d that use seekg/tellg).
Definition at line 34 of file stream_utils.cpp.
Referenced by seekpos().
|
overrideprotected |
Seek to an absolute position from the start of the buffer.
Definition at line 70 of file stream_utils.cpp.
References seekoff().
|
overrideprotected |
Write a sequence of characters to the output buffer.
| s | A pointer to the character sequence to be written. |
| n | The number of characters to write. |
Definition at line 27 of file stream_utils.cpp.
References MT_THROW.