BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlat::EnumUtil Struct Reference

#include <bdlat_enumutil.h>

Static Public Member Functions

template<class TYPE >
static int fromIntOrFallbackIfEnabled (TYPE *result, int number)
 
template<class TYPE >
static int fromStringOrFallbackIfEnabled (TYPE *result, const char *string, int stringLength)
 

Detailed Description

This struct provides a namespace for functions that decode bdlat "enumerations" from integral and string representations, possibly to the "fallback" value (if one exists).

Member Function Documentation

◆ fromIntOrFallbackIfEnabled()

template<class TYPE >
int bdlat::EnumUtil::fromIntOrFallbackIfEnabled ( TYPE *  result,
int  number 
)
static

Load into the specified result the enumerator matching the specified number and return 0 if such an enumerator exists. Otherwise, if result supports a fallback enumerator, load into result the fallback enumerator value and return 0. Otherwise, return a non-zero value with no effect on result. The behavior is undefined unless TYPE is a bdlat enumeration type.

◆ fromStringOrFallbackIfEnabled()

template<class TYPE >
int bdlat::EnumUtil::fromStringOrFallbackIfEnabled ( TYPE *  result,
const char *  string,
int  stringLength 
)
static

Load into the specified result the enumerator matching the specified string of the specified stringLength and return 0 if such an enumerator exists. Otherwise, if result supports a fallback enumerator, load into result the fallback enumerator value and return 0. Otherwise, return a non-zero value with no effect on result. The behavior is undefined unless TYPE is a bdlat enumeration type.


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