Quick Links:

bal | bbl | bdl | bsl

Static Public Member Functions

balcl::TypeInfoUtil Struct Reference

#include <balcl_typeinfo.h>

List of all members.

Static Public Member Functions

static bool satisfiesConstraint (const OptionValue &element, const TypeInfo &typeInfo)
static bool satisfiesConstraint (const OptionValue &element, const TypeInfo &typeInfo, bsl::ostream &stream)
static bool satisfiesConstraint (const void *variable, const TypeInfo &typeInfo)
static bool satisfiesConstraint (const void *variable, const TypeInfo &typeInfo, bsl::ostream &stream)
static bool parseAndValidate (OptionValue *element, const bsl::string &input, const TypeInfo &typeInfo, bsl::ostream &stream)

Detailed Description

This utility struct provides a namespace for functions that perform non-primitive operations using TypeInfo objects.

See Component balcl_typeinfo


Member Function Documentation

static bool balcl::TypeInfoUtil::satisfiesConstraint ( const OptionValue element,
const TypeInfo typeInfo 
) [static]
static bool balcl::TypeInfoUtil::satisfiesConstraint ( const OptionValue element,
const TypeInfo typeInfo,
bsl::ostream &  stream 
) [static]

Return true if the specified element satisfies the constraint of the specified typeInfo object (if any), and false otherwise. Optionally specify a stream; if stream is specified and validation fails, a descriptive error message indicating the reason for the failure is written to stream. If typeInfo holds no constraint, this method returns true. The behavior is undefined unless element.type() == typeInfo.type().

static bool balcl::TypeInfoUtil::satisfiesConstraint ( const void *  variable,
const TypeInfo typeInfo 
) [static]
static bool balcl::TypeInfoUtil::satisfiesConstraint ( const void *  variable,
const TypeInfo typeInfo,
bsl::ostream &  stream 
) [static]

Return true if the value at the specified variable satisfies the constraint of the specified typeInfo object (if any), and false otherwise. Optionally specify a stream; if stream is specified and validation fails, a descriptive error message indicating the reason for the failure is written to stream. If typeInfo holds no constraint, this method returns true. The behavior is undefined unless variable can be (validly) cast to OptionType<ENUM>EnumToType::type * where ENUM matches typeInfo.type().

static bool balcl::TypeInfoUtil::parseAndValidate ( OptionValue element,
const bsl::string input,
const TypeInfo typeInfo,
bsl::ostream &  stream 
) [static]

Load into the specified element the result of parsing the specified input as a value of the element->type(). Return true if input is parsed without error and the value satisfies the constraint of the specified typeInfo object (if any), and false with no effect on element otherwise. If the operation fails a descriptive error message indicating the reason for the failure is written to the specified stream. If 'typeInfo holds no constraint that validation is considered true; nevertheless, the parse might still fail due to problems with the input format. The behavior is undefined unless element->type() == typeInfo.type().


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