8#ifndef INCLUDED_BDLAT_ENUMFUNCTIONS
9#define INCLUDED_BDLAT_ENUMFUNCTIONS
367#include <bdlscm_version.h>
381#include <bsl_string.h>
399 template <
class TYPE>
403 bslalg::HasTrait<TYPE, bdlat_TypeTraitBasicEnumeration>::value> {
412 template <
class TYPE>
416 bslalg::HasTrait<TYPE, bdlat_TypeTraitHasFallbackEnumerator>::value> {
424 template <
class TYPE>
431 template <
class TYPE>
432 int fromString(TYPE *result,
const char *
string,
int stringLength);
437 template <
class TYPE>
444 template <
class TYPE>
449 template <
class TYPE>
454 template <
class TYPE>
455 void toInt(
int *result,
const TYPE& value);
459 template <
class TYPE>
479 template <
class TYPE>
481 template <
class TYPE>
484 template <
class TYPE>
486 template <
class TYPE>
489 template <
class TYPE>
491 template <
class TYPE>
524 template <
class TYPE>
527 template <
class TYPE>
540 template <
class TYPE>
544 template <
class TYPE>
547 template <
class TYPE>
557 template <
class TYPE>
567 template <
class TYPE>
585 return bdlat_enumFromInt(result, number);
645#if !defined(BSLS_PLATFORM_CMP_SUN)
649 return bdlat_enumMakeFallback(result);
655 static_cast<void>(result);
663#if !defined(BSLS_PLATFORM_CMP_SUN)
667 return bdlat_enumHasFallback(value);
674 static_cast<void>(value);
682#if !defined(BSLS_PLATFORM_CMP_SUN)
686 return bdlat_enumIsFallback(value);
693 static_cast<void>(value);
708 return Wrapper::fromInt(result, number);
721 return Wrapper::fromString(result,
string, stringLength);
728#if !defined(BSLS_PLATFORM_CMP_SUN)
736 return Wrapper::makeFallback(result);
747 *result =
static_cast<int>(value);
759 *result = Wrapper::toString(value);
766#if !defined(BSLS_PLATFORM_CMP_SUN)
774 return Wrapper::hasFallback(value);
781#if !defined(BSLS_PLATFORM_CMP_SUN)
789 return Wrapper::isFallback(value);
Definition bslstl_string.h:1281
static bool hasFallback(const TYPE &value, bsl::true_type)
Definition bdlat_enumfunctions.h:660
static int makeFallback(TYPE *result, bsl::true_type)
Definition bdlat_enumfunctions.h:643
static bool isFallback(const TYPE &value, bsl::true_type)
Definition bdlat_enumfunctions.h:679
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:229
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlat_enumfunctions.h:389
void bdlat_enumToString(bsl::string *result, const TYPE &value)
void toInt(int *result, const TYPE &value)
int fromString(TYPE *result, const char *string, int stringLength)
int bdlat_enumFromInt(TYPE *result, int number)
bool bdlat_enumHasFallback(const TYPE &value)
bool bdlat_enumIsFallback(const TYPE &value)
int fromInt(TYPE *result, int number)
void toString(bsl::string *result, const TYPE &value)
int bdlat_enumFromString(TYPE *result, const char *string, int stringLength)
void bdlat_enumToInt(int *result, const TYPE &value)
int bdlat_enumMakeFallback(TYPE *result)
int makeFallback(TYPE *result)
bool hasFallback(const TYPE &value)
bool isFallback(const TYPE &value)
Definition bdlat_typetraits.h:146
Definition bdlat_enumfunctions.h:416
Definition bdlat_enumfunctions.h:403
Definition bdlat_enumfunctions.h:476
This trait may be declared for "enumeration" types.
Definition bdlat_typetraits.h:121
Definition bslmf_integralconstant.h:244
Definition bslalg_hastrait.h:117