Subtype attributes 'Image
and 'Value
will take, respectively, a scalar value and a string and they return, respectively, a string and a scalar value. The result of 'Image
can be input to 'Value
to get the original value. The converse is also true.
The __Scalar_Object__'Image
attribute can be used directly on objects (since Ada 2012-TC-1).
Note that 'Image
can incur implementation defined results (RM 3.5), namely when some graphic characters needed for the String
result are not defined in Character
. Consider the larger repertoires of 'Wide_Image
and 'Wide_Wide_Image
.
The permission to use the attribute __Scalar_Object__'Image
directly on an object was added in Ada 2012-TC-1 (April 2016).