BDE 4.14.0 Production release
Loading...
Searching...
No Matches
balber::BerUtil_StreambufUtil Struct Reference

#include <balber_berutil.h>

Static Public Member Functions

static int peekChar (char *value, bsl::streambuf *streamBuf)
 
static int getChars (char *buffer, bsl::streambuf *streamBuf, int bufferLength)
 
static int putChars (bsl::streambuf *streamBuf, const char *buffer, int bufferLength)
 

Detailed Description

This component-private utility struct provides a namespace for a suite of functions used by BerUtil to perform input and output operations on bsl::streambuf objects. Note that these functions are intended to adapt the standard stream-buffer operations to a BDE-style interface.

Member Function Documentation

◆ getChars()

int balber::BerUtil_StreambufUtil::getChars ( char *  buffer,
bsl::streambuf *  streamBuf,
int  bufferLength 
)
inlinestatic

Read the specified bufferLength number of bytes from the input sequence of the specified streamBuf, as if by a call to streamBuf->sgetn(buffer, bufferLength), and load the bytes into successive elements of the specified buffer, starting at the first element. Return 0 on success, and a non-zero value otherwise. The operation succeeds if length bytes are successfully read from the input sequence of the streamBuf without the read position becoming unavailable. If less than bufferLength bytes are read, the number of bytes loaded into buffer is not specified. The behavior is undefined unless 0 <= bufferLength and buffer is the address of a sequence of at least bufferLength bytes.

◆ peekChar()

int balber::BerUtil_StreambufUtil::peekChar ( char *  value,
bsl::streambuf *  streamBuf 
)
inlinestatic

Read the next byte from the specified streamBuf without advancing the read position and load that byte into the specified value. Return 0 on success, and a non-zero value otherwise. If this operation is not successful, the value of *value is unchanged. This operation fails if the input sequence of streamBuf is at its end.

◆ putChars()

int balber::BerUtil_StreambufUtil::putChars ( bsl::streambuf *  streamBuf,
const char *  buffer,
int  bufferLength 
)
inlinestatic

Write the first specified bufferLength number of bytes from the specified buffer to the specified streamBuf, as if by a call to streamBuf->sputn(buffer, bufferLength). Return 0 on success, and a non-zero value otherwise.


The documentation for this struct was generated from the following file: