|
| | BufferOut () |
| |
| | BufferOut (file::File &destFile, Memory::sizeOption bufferSize=std::nullopt, DataFormat format=DataFormat{}) |
| |
| | BufferOut (Memory &memory, Memory::sizeOption bufferSize=std::nullopt, DataFormat format=DataFormat{}) |
| |
| | BufferOut (Memory &&memory, Memory::sizeOption bufferSize=std::nullopt, DataFormat format=DataFormat{}) |
| |
| | BufferOut (String &destString, Memory::sizeOption bufferSize=std::nullopt, DataFormat format=DataFormat{}) |
| |
| | BufferOut (BufferOut &&source) noexcept |
| |
|
| BufferOut (const BufferOut &source)=delete |
| |
| virtual | ~BufferOut () |
| |
| BufferOut & | operator= (BufferOut &&source) noexcept |
| |
|
BufferOut & | operator= (const BufferOut &)=delete |
| |
| | operator bool () const |
| |
| const BufferOut & | operator<< (char val) const |
| |
| const BufferOut & | operator<< (const String &str) const |
| |
| const BufferOut & | operator<< (int16_t val) const |
| |
| const BufferOut & | operator<< (int32_t val) const |
| |
| const BufferOut & | operator<< (uint32_t val) const |
| |
| const BufferOut & | operator<< (int64_t val) const |
| |
| const BufferOut & | operator<< (uint64_t val) const |
| |
| const BufferOut & | operator<< (double val) const |
| |
| Memory::sizeOption | maxSize () const |
| |
| Memory::sizeOption | getPosition () const |
| |
| DataFormat | format () const |
| |
| TextEncoding | getEncoding () const |
| |
| const BufferOut & | write (const String &toWrite) const |
| |
| const BufferOut & | write (const String &toWrite, DataFormat format) const |
| |
| const BufferOut & | write (const char *toWrite, Memory::size_type length) const |
| |
| const BufferOut & | write (unsigned char toWrite) const |
| |
| template<class T > |
| const BufferOut & | writeBinary (const T &obj) const |
| |
| const BufferOut & | flush () const |
| |
| void | setDestination (file::File *destFile) |
| |
| void | setDestination (Memory *memory) |
| |
| void | setDestination (String *destString) |
| |
| void | setEncoding (TextEncoding encoding) |
| |
| | IOBase () noexcept |
| |
| | IOBase (const IOBase &source) noexcept |
| |
| virtual | ~IOBase () noexcept=default |
| |
| bool | operator! () const noexcept |
| |
| | operator void * () const noexcept |
| |
| virtual bool | good () const noexcept |
| |
| virtual bool | eof () const noexcept |
| |
| virtual bool | fail () const noexcept |
| |
| virtual bool | bad () const noexcept |
| |
| virtual flag_type | state () const noexcept |
| |
| virtual void | clear (flag_type f=std::ios_base::goodbit) |
| |
| virtual void | setState (flag_type f) |
| |
| virtual void | unsetState (flag_type f) |
| |
|
|
using | flag_type = std::ios_base::iostate |
| | The state flag representation type.
|
| |
◆ BufferOut() [1/6]
◆ BufferOut() [2/6]
Constructor
- Parameters
-
| destFile | The destination data file |
| bufferSize | Suggested buffer size (can minimise overheads if a small number is suggested - large values will be ignored) |
| format | The destination data format |
◆ BufferOut() [3/6]
Constructor
- Parameters
-
| memory | The destination memory block |
| bufferSize | Suggested buffer size (can minimise overheads if a small number is suggested - large values will be ignored) |
| format | The destination data format |
◆ BufferOut() [4/6]
Constructor
- Parameters
-
| memory | The destination memory block |
| bufferSize | Suggested buffer size (can minimise overheads if a small number is suggested - large values will be ignored) |
| format | The destination data format |
◆ BufferOut() [5/6]
Constructor
- Parameters
-
| destString | The destination string |
| bufferSize | Suggested buffer size (can minimise overheads if a small number is suggested - large values will be ignored) |
| format | The destination data format |
◆ BufferOut() [6/6]
Move constructor
- Parameters
-
◆ ~BufferOut()
| BufferOut::~BufferOut |
( |
| ) |
|
|
virtual |
◆ confirmBuffer()
| bool BufferOut::confirmBuffer |
( |
| ) |
const |
|
protectedvirtual |
Confirm the buffer is mine and prepared to receive data
- Returns
- True if the buffer is confirmed (false = bad buffer state - writing will be rejected)
Reimplemented in active::utility::StackBufferOut< S >.
◆ flush()
| const BufferOut & active::utility::BufferOut::flush |
( |
| ) |
const |
|
inline |
Flush the buffer to the destination
- Returns
- A reference to this
◆ format()
| DataFormat active::utility::BufferOut::format |
( |
| ) |
const |
|
inline |
Get the destination data format
- Returns
- The data format
◆ getBuffer()
| const Memory & active::utility::BufferOut::getBuffer |
( |
| ) |
const |
|
inlineprotected |
Get the buffer memory
- Returns
- The buffer memory
◆ getEncoding()
| TextEncoding active::utility::BufferOut::getEncoding |
( |
| ) |
const |
|
inline |
Get the source text encoding (NB: for text input functionality only)
- Returns
- The text encoding type
◆ getPosition()
Get the current write position in the destination (not the write position in the buffer)
- Returns
- The write position (e.g. the write position in a destination file, nullopt on error)
◆ isMyBuffer()
| virtual bool active::utility::BufferOut::isMyBuffer |
( |
| ) |
const |
|
inlineprotectedvirtual |
◆ maxSize()
Get the maximum size of the output buffer (when a fixed-sized memory buffer is used)
- Returns
- The maximum number of bytes the buffer can hold (null-opt for any dynamic buffer target)
◆ operator bool()
| active::utility::BufferOut::operator bool |
( |
| ) |
const |
|
inline |
Bool operator
- Returns
- True if the source is not is a failed state
◆ operator<<() [1/8]
| const BufferOut & active::utility::BufferOut::operator<< |
( |
char | val | ) |
const |
|
inline |
Write operator
- Parameters
-
- Returns
- A reference to this
◆ operator<<() [2/8]
| const BufferOut & active::utility::BufferOut::operator<< |
( |
const String & | str | ) |
const |
|
inline |
Write operator
- Parameters
-
- Returns
- A reference to this
◆ operator<<() [3/8]
| const BufferOut & active::utility::BufferOut::operator<< |
( |
double | val | ) |
const |
|
inline |
Write operator
- Parameters
-
| val | A double value to write |
- Returns
- A reference to this
◆ operator<<() [4/8]
| const BufferOut & active::utility::BufferOut::operator<< |
( |
int16_t | val | ) |
const |
|
inline |
Write operator
- Parameters
-
| val | A 16-bit integer to write |
- Returns
- A reference to this
◆ operator<<() [5/8]
| const BufferOut & active::utility::BufferOut::operator<< |
( |
int32_t | val | ) |
const |
|
inline |
Write operator
- Parameters
-
| val | A 32-bit integer to write |
- Returns
- A reference to this
◆ operator<<() [6/8]
| const BufferOut & active::utility::BufferOut::operator<< |
( |
int64_t | val | ) |
const |
|
inline |
Write operator
- Parameters
-
| val | A 64-bit integer to write |
- Returns
- A reference to this
◆ operator<<() [7/8]
| const BufferOut & active::utility::BufferOut::operator<< |
( |
uint32_t | val | ) |
const |
|
inline |
Write operator
- Parameters
-
| val | An unsigned 32-bit integer to write |
- Returns
- A reference to this
◆ operator<<() [8/8]
| const BufferOut & active::utility::BufferOut::operator<< |
( |
uint64_t | val | ) |
const |
|
inline |
Write operator
- Parameters
-
| val | An unsigned 64-bit integer to write |
- Returns
- A reference to this
◆ operator=()
Assignment with move operator
- Parameters
-
- Returns
- A reference to this object
◆ setBuffer()
| void active::utility::BufferOut::setBuffer |
( |
void * | buffer, |
|
|
Memory::size_type | size ) const |
|
inlineprotected |
Set the buffer memory
- Parameters
-
| buffer | The buffer memory |
| size | The buffer size |
◆ setDestination() [1/3]
| void BufferOut::setDestination |
( |
file::File * | destFile | ) |
|
Set the buffer output destination
- Parameters
-
| destFile | The destination data file |
◆ setDestination() [2/3]
| void BufferOut::setDestination |
( |
Memory * | memory | ) |
|
Set the buffer output destination
- Parameters
-
| memory | The destination memory block |
◆ setDestination() [3/3]
| void BufferOut::setDestination |
( |
String * | destString | ) |
|
Set the buffer output destination
- Parameters
-
| destString | The destination string |
◆ setEncoding()
| void active::utility::BufferOut::setEncoding |
( |
TextEncoding | encoding | ) |
|
|
inline |
Set The source text encoding
- Parameters
-
| encoding | The text encoding type |
◆ write() [1/4]
Write a specified memory block (NB: The data is not assumed to be text - simply a stream of bytes. Avoid when buffering to a string)
- Parameters
-
| toWrite | The block address |
| length | The number of bytes to write |
- Returns
- A reference to this
◆ write() [2/4]
| const BufferOut & active::utility::BufferOut::write |
( |
const String & | toWrite | ) |
const |
|
inline |
Write the specified string (using the buffer text encoding)
- Parameters
-
| toWrite | The string to write |
- Returns
- A reference to this
◆ write() [3/4]
Write the specified string (using the specified text encoding)
- Parameters
-
| toWrite | The string to write |
| format | The data format |
- Returns
- A reference to this
◆ write() [4/4]
| const BufferOut & BufferOut::write |
( |
unsigned char | toWrite | ) |
const |
Write a single byte
- Parameters
-
- Returns
- A reference to this
◆ writeBinary()
template<class T >
| const BufferOut & active::utility::BufferOut::writeBinary |
( |
const T & | obj | ) |
const |
|
inline |
Write an object to the buffer as binary data (NB: Avoid when buffering to a string)
- Parameters
-
- Returns
- A reference to this
The documentation for this class was generated from the following files:
- /Users/rwessel/Documents/Development/ActiveLib/Active/Utility/BufferOut.h
- /Users/rwessel/Documents/Development/ActiveLib/Active/Utility/BufferOut.cpp