Index

Package: Values

Description

package Values is

Classes

Value (abstract)

type Value is abstract new Object with private;

Ancestors:

Immediate Children:

Values.Val_Bool
Values.Val_Int
Values.Val_String

Primitive operations:

Object_Input
Object_Read (overriding Objects.Object_Read)
Object_Write (overriding Objects.Object_Write)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.To_String (Inherited)
A Value represents a generic value of type boolean, integer or string. The value can be converted to other types in certain cases. Values can also be copied and written to a stream.

Types

A_Value

type A_Value is access all Value'Class;

Constants & Global variables

VALUE_NOT_FOUND

VALUE_NOT_FOUND,
    INVALID_CONVERSION : exception;

INVALID_CONVERSION

INVALID_CONVERSION : exception;

Subprograms & Entries

Create_Value

function Create_Value
( val: Boolean ) return A_Value;
Creates a new boolean Value.

Create_Value

function Create_Value
( val: Integer ) return A_Value;
Creates a new integer Value.

Create_Value

function Create_Value
( val: String ) return A_Value;
Creates a new string Value.

As_Boolean

function As_Boolean
( this: access Value ) return Boolean;
Returns the Value as a boolean. Raises INVALID_CONVERSION if the value can't be converted to a boolean.

As_Integer

function As_Integer
( this: access Value ) return Integer;
Returns the Value as a boolean. Raises INVALID_CONVERSION if the value can't be converted to an integer.

As_String

function As_String
( this: access Value ) return String;
Returns the Value as a boolean. Raises INVALID_CONVERSION if the value can't be converted to a string.

Object_Input (abstract)

function Object_Input
( stream: access Root_Stream_Type'Class ) return Value is abstract;

Copy

function Copy
( src: A_Value ) return A_Value;
Returns a copy of 'src'.

Delete

procedure Delete
( this: in out A_Value );
Deletes the Value.