BDE 4.14.0 Production release
Loading...
Searching...
No Matches
balcl::Constraint Struct Reference

#include <balcl_constraint.h>

Public Types

typedef bsl::function< bool(const char *, bsl::ostream &)> CharConstraint
 
typedef bsl::function< bool(const int *, bsl::ostream &)> IntConstraint
 
typedef bsl::function< bool(const bsls::Types::Int64 *, bsl::ostream &)> Int64Constraint
 
typedef bsl::function< bool(const double *, bsl::ostream &)> DoubleConstraint
 
typedef bsl::function< bool(const bsl::string *, bsl::ostream &)> StringConstraint
 
typedef bsl::function< bool(const bdlt::Datetime *, bsl::ostream &)> DatetimeConstraint
 
typedef bsl::function< bool(const bdlt::Date *, bsl::ostream &)> DateConstraint
 
typedef bsl::function< bool(const bdlt::Time *, bsl::ostream &)> TimeConstraint
 

Detailed Description

This struct provides a namespace that defines the types used to impose user-defined constraints on values associated with command-line options. One type is defined for each scalar type defined in balcl::OptionType except for bool.

Member Typedef Documentation

◆ CharConstraint

typedef bsl::function<bool(const char *, bsl::ostream& )> balcl::Constraint::CharConstraint

◆ DateConstraint

typedef bsl::function<bool(const bdlt::Date *, bsl::ostream& )> balcl::Constraint::DateConstraint

◆ DatetimeConstraint

typedef bsl::function<bool(const bdlt::Datetime *, bsl::ostream& )> balcl::Constraint::DatetimeConstraint

◆ DoubleConstraint

typedef bsl::function<bool(const double *, bsl::ostream& )> balcl::Constraint::DoubleConstraint

◆ Int64Constraint

◆ IntConstraint

typedef bsl::function<bool(const int *, bsl::ostream& )> balcl::Constraint::IntConstraint

◆ StringConstraint

typedef bsl::function<bool(const bsl::string *, bsl::ostream& )> balcl::Constraint::StringConstraint

◆ TimeConstraint

typedef bsl::function<bool(const bdlt::Time *, bsl::ostream& )> balcl::Constraint::TimeConstraint

These types are aliases for function objects (functors) used to express user-defined constraints on option values. Such objects should return true if the supplied value (first argument) are deemed valid, and false otherwise. Descriptive error messages may be written to the supplied stream (second argument).


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