libbmq b6028b29b733bc7541593d2905a5f79a9f0192fc
Loading...
Searching...
No Matches
BloombergLP::bmqt::CompressionAlgorithmType Struct Reference

This struct defines various types of compression algorithms.

#include <bmqt_compressionalgorithmtype.h>

Public Types

enum  Enum { e_UNKNOWN = -1 , e_NONE = 0 , e_ZLIB = 1 }
 

Static Public Member Functions

static bsl::ostream & print (bsl::ostream &stream, CompressionAlgorithmType::Enum value, int level=0, int spacesPerLevel=4)
 
static const char * toAscii (CompressionAlgorithmType::Enum value)
 
static bool fromAscii (CompressionAlgorithmType::Enum *out, const bsl::string &str)
 
static bool isValid (const bsl::string *str, bsl::ostream &stream)
 

Static Public Attributes

static const int k_LOWEST_SUPPORTED_TYPE = e_NONE
 
static const int k_HIGHEST_SUPPORTED_TYPE = e_ZLIB
 

Member Enumeration Documentation

◆ Enum

Enumerator
e_UNKNOWN 
e_NONE 
e_ZLIB 

Member Function Documentation

◆ print()

static bsl::ostream & BloombergLP::bmqt::CompressionAlgorithmType::print ( bsl::ostream &  stream,
CompressionAlgorithmType::Enum  value,
int  level = 0,
int  spacesPerLevel = 4 
)
static

Write the string representation of the specified enumeration value to the specified output stream, and return a reference to stream. Optionally specify an initial indentation level, whose absolute value is incremented recursively for nested objects. If level is specified, optionally specify spacesPerLevel, whose absolute value indicates the number of spaces per indentation level for this and all of its nested objects. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level). See toAscii for what constitutes the string representation of a CompressionAlgorithmType::Enum value.

Referenced by BloombergLP::bmqt::operator<<().

◆ toAscii()

static const char * BloombergLP::bmqt::CompressionAlgorithmType::toAscii ( CompressionAlgorithmType::Enum  value)
static

Return the non-modifiable string representation corresponding to the specified enumeration value, if it exists, and a unique (error) string otherwise. The string representation of value matches its corresponding enumerator name with the "e_" prefix eluded. For example:

static const char * toAscii(CompressionAlgorithmType::Enum value)
@ e_NONE
Definition bmqt_compressionalgorithmtype.h:46

will print the following on standard output:

NONE

Note that specifying a value that does not match any of the enumerators will result in a string representation that is distinct from any of those corresponding to the enumerators, but is otherwise unspecified.

◆ fromAscii()

static bool BloombergLP::bmqt::CompressionAlgorithmType::fromAscii ( CompressionAlgorithmType::Enum out,
const bsl::string &  str 
)
static

Update the specified out with correct enum corresponding to the specified string str, if it exists, and return true. Otherwise in case of an error or unidentified string, return false. The expected str is the enumerator name with the "e_" prefix excluded. For example:

static bool fromAscii(CompressionAlgorithmType::Enum *out, const bsl::string &str)

will return true and the value of out will be:

bmqt::CompresssionAlgorithmType::e_NONE

Note that specifying a str that does not match any of the enumerators excluding "e_" prefix will result in the function returning false and the specified out will not be touched.

◆ isValid()

static bool BloombergLP::bmqt::CompressionAlgorithmType::isValid ( const bsl::string *  str,
bsl::ostream &  stream 
)
static

Return true incase of valid specified str i.e. a enumerator name with the "e_" prefix excluded. Otherwise in case of invalid str return false and populate the specified stream with error message.

Member Data Documentation

◆ k_LOWEST_SUPPORTED_TYPE

const int BloombergLP::bmqt::CompressionAlgorithmType::k_LOWEST_SUPPORTED_TYPE = e_NONE
static

NOTE: This value must always be equal to the lowest type in the enum because it is being used as a lower bound to verify that a header's CompressionAlgorithmType field is a supported type.

◆ k_HIGHEST_SUPPORTED_TYPE

const int BloombergLP::bmqt::CompressionAlgorithmType::k_HIGHEST_SUPPORTED_TYPE = e_ZLIB
static

NOTE: This value must always be equal to the highest type in the enum because it is being used as an upper bound to verify that a header's CompressionAlgorithmType field is a supported type.


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