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

#include <balber_berutil.h>

Public Types

typedef BerUtil_LengthImpUtil LengthUtil
 

Static Public Member Functions

static int putRawStringValue (bsl::streambuf *streamBuf, const char *string, int stringLength)
 
static int putChars (bsl::streambuf *streamBuf, char value, int numChars)
 
static int getStringValue (bsl::string *value, bsl::streambuf *streamBuf, int length, const BerDecoderOptions &options)
 
static int putStringValue (bsl::streambuf *streamBuf, const bsl::string &value)
 
static int putStringViewValue (bsl::streambuf *streamBuf, const bsl::string_view &value)
 
static int putStringRefValue (bsl::streambuf *streamBuf, const bslstl::StringRef &value)
 

Detailed Description

This component-private utility struct provides a namespace for a suite of functions used by BerUtil to implement BER encoding and decoding operations for string values. Within the definition of this struct:

: the specification: : Refers to the August 2015 revision of the ITU-T Recommendation X.690.

Member Typedef Documentation

◆ LengthUtil

LengthUtil is an alias to a namespace for a suite of functions used to implement BER encoding and decoding operations for length quantities.

Member Function Documentation

◆ getStringValue()

static int balber::BerUtil_StringImpUtil::getStringValue ( bsl::string value,
bsl::streambuf *  streamBuf,
int  length,
const BerDecoderOptions options 
)
static

Read the specified length number of bytes from the input sequence of the specified streamBuf and load to the specified value the interpretation of those bytes as the value of the contents octets of a BER-encoded character string (more specifically, an unrestricted character string) according to the specification, unless an alternate value is indicated by the specified options, in which case, the alternate value is loaded. If the DefaultEmptyStrings attribute of the options is true and the witnessed BER-encoded character string represents the empty string value, the alternate value is the current *value, otherwise there is no alternate value. Return 0 if successful, 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, and the bytes read contain a valid representation of the contents octets of a character string value according to the specification.

◆ putChars()

static int balber::BerUtil_StringImpUtil::putChars ( bsl::streambuf *  streamBuf,
char  value,
int  numChars 
)
static

Write the specified numChars number of bytes having the specified value to the output sequence of the specified streamBuf. Return 0 if successful, and a non-zero value otherwise. The operation succeeds if all numChars bytes are written to the streamBuf without the write position becoming unavailable.

◆ putRawStringValue()

int balber::BerUtil_StringImpUtil::putRawStringValue ( bsl::streambuf *  streamBuf,
const char *  string,
int  stringLength 
)
inlinestatic

Write the length and contents octets of the BER encoding of the specified byte string having the specified stringLength (as defined in the specification) to the output sequence of the specified streamBuf. Return 0 if successful, and a non-zero value otherwise. The operation succeeds if all bytes corresponding to the length and contents octets are written to the streamBuf without the write position becoming unavailable.

◆ putStringRefValue()

int balber::BerUtil_StringImpUtil::putStringRefValue ( bsl::streambuf *  streamBuf,
const bslstl::StringRef value 
)
inlinestatic

Write the length and contents octets of the BER encoding of the specified character string value (as defined in the specification) to the output sequence of the specified streamBuf. Return 0 if successful, and a non-zero value otherwise. The operation succeeds if all bytes corresponding to the length and contents octets are written to the streamBuf without the write position becoming unavailable.

◆ putStringValue()

int balber::BerUtil_StringImpUtil::putStringValue ( bsl::streambuf *  streamBuf,
const bsl::string value 
)
inlinestatic

Write the length and contents octets of the BER encoding of the specified character string value (as defined in the specification) to the output sequence of the specified streamBuf. Return 0 if successful, and a non-zero value otherwise. The operation succeeds if all bytes corresponding to the length and contents octets are written to the streamBuf without the write position becoming unavailable.

◆ putStringViewValue()

int balber::BerUtil_StringImpUtil::putStringViewValue ( bsl::streambuf *  streamBuf,
const bsl::string_view value 
)
inlinestatic

Write the length and contents octets of the BER encoding of the specified character string value (as defined in the specification) to the output sequence of the specified streamBuf. Return 0 if successful, and a non-zero value otherwise. The operation succeeds if all bytes corresponding to the length and contents octets are written to the streamBuf without the write position becoming unavailable.


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