DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦137306d0c⟧ TextFile

    Length: 3051 (0xbeb)
    Types: TextFile
    Names: »B«

Derivation

└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Message_Interchange;
with String_Utilities;
with Unchecked_Deallocation;


package body Parameter is

    use Bs;

    package Mi renames Message_Interchange;
    function Sup (S : String) return String renames String_Utilities.Upper_Case;


    function Create (Name : String; Class : String; Value : String)
                    return Parameter.Object is
    begin  
        return Object'(Name => Bs.Value (Sup (Name)),
                       Class => Bs.Value (Sup (Class)),
                       Value => Bs.Value (Sup (Value)));
    end Create;


    function Image (Of_Parameter : Parameter.Object) return String is
        P : Parameter.Object renames Of_Parameter;
    begin
        return Bs.Image (P.Name) & Mi.Separator & Bs.Image (P.Class) &
                  Mi.Separator & Bs.Image (P.Value);
    end Image;


    function Value (Of_String : String) return Parameter.Object is
        First : constant Positive := Of_String'First;
        Last : constant Positive := Of_String'Last;
        S1 : Positive := First;
        S2 : Positive;  
    begin
        loop
            exit when Of_String (S1) = Mi.Separator;
            S1 := S1 + 1;
        end loop;
        S2 := S1 + 1; -- to point jbst after the separator

        loop
            exit when Of_String (S2) = Mi.Separator;
            S2 := S2 + 1;
        end loop;

        return Object'(Name => Bs.Value (Sup (Of_String (First .. S1 - 1))),
                       Class => Bs.Value (Sup (Of_String (S1 + 1 .. S2 - 1))),
                       Value => Bs.Value (Sup (Of_String (S2 + 1 .. Last))));

    end Value;


    function Is_Valued (Parameter : Standard.Parameter.Object) return Boolean is
    begin
        return Bs.Image (Parameter.Value) /= Void;
    end Is_Valued;


    function Is_Null (Parameter : Standard.Parameter.Object) return Boolean is
    begin
        return Bs.Image (Parameter.Name) = Void;
        -- right now the criteria is based only on the name
        -- this is to allow untyped parameters
    end Is_Null;
    function Is_Equal (Left, Right : Parameter.Object) return Boolean is
    begin
        return Left.Name = Right.Name and Left.Class = Right.Class and
                  Left.Value = Right.Value;
    end Is_Equal;


    function Is_Compatible (Left, Right : Parameter.Object) return Boolean is
    begin
        return Left.Name = Right.Name and Left.Class = Right.Class;
    end Is_Compatible;


    function Get_Name (Parameter : Standard.Parameter.Object) return String is
    begin
        return Bs.Image (Parameter.Name);
    end Get_Name;


    function Get_Class (Parameter : Standard.Parameter.Object) return String is
    begin
        return Bs.Image (Parameter.Class);
    end Get_Class;


    function Get_Value (Parameter : Standard.Parameter.Object) return String is
    begin
        return Bs.Image (Parameter.Value);
    end Get_Value;

    procedure Strip_Value (Parameter : in out Standard.Parameter.Object) is
    begin
        Parameter.Value := Bs.Value (Void);
    end Strip_Value;
end Parameter;