[#BloombergLP-balcl-TypeInfoUtil-parseAndValidate] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balcl.adoc[balcl]::xref:BloombergLP/balcl/TypeInfoUtil.adoc[TypeInfoUtil]::parseAndValidate :relfileprefix: ../../../ :mrdocs: 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. Optionally specify `inputSource` indicating the source of the option text being parsed. If `inputSource` is not provided, `input` is treated as if it came from the command line. `inputSource` is used in handling boolean options. Boolean options supplied by command line should not have associated text, where as boolean options supplied by the environment should have the values "0", "1", "true", or "false". The behavior is undefined unless `element‐>type() == typeInfo.type()`. == Synopsis Declared in `<balcl_typeinfo.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static bool parseAndValidate( xref:BloombergLP/balcl/OptionValue.adoc[OptionValue]* element, std::string_view const& input, xref:BloombergLP/balcl/TypeInfo.adoc[TypeInfo] const& typeInfo, std::ostream& stream, xref:BloombergLP/balcl/TypeInfo/ParseInputSource.adoc[TypeInfo::ParseInputSource] inputSource = TypeInfo::e_COMMAND_LINE); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#